Oxygine  1
2g game engine
Event.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "closure/closure.h"
4 #include "Input.h"
5 #include "EventDispatcher.h"
6 #undef OUT
7 
8 namespace oxygine
9 {
10  class Event
11  {
12  public:
13  enum { COMPLETE = sysEventID('C', 'M', 'P') };
14 
15  enum Phase
16  {
17  phase_capturing = 1,
18  phase_target,
19  phase_bubbling
20  };
21 
22  Event(eventType Type, bool Bubbles = false) : listenerID(0), userData(0), type(Type), phase(phase_target), bubbles(Bubbles), stopsImmediatePropagation(false), stopsPropagation(false) {}
23  virtual ~Event() {}
24 
25  eventType type;
26  Phase phase;
27  bool bubbles;
28  bool stopsImmediatePropagation;
29  bool stopsPropagation;
30 
31  void* userData;
32  spObject userDataObject;
33  int listenerID;
34 
36  spEventDispatcher target;
38  spEventDispatcher currentTarget;
39 
40  void stopPropagation() { stopsPropagation = true; }
41  void stopImmediatePropagation() { stopsPropagation = stopsImmediatePropagation = true; }
42 
51  void removeListener() { currentTarget->removeEventListener(listenerID); }
52  };
53 }
void removeListener()
Definition: Event.h:51
Definition: Event.h:10
spEventDispatcher target
Definition: Event.h:36
–oxgl-end–!
Definition: Actor.h:14
spEventDispatcher currentTarget
Definition: Event.h:38