rag
graphic 2d engine
Event.h
1 #ifndef Rag_Event_h
2 #define Rag_Event_h
3 
4 #include <string>
5 
6 namespace rag
7 {
8  class DisplayObject;
9 }
10 
11 namespace events
12 {
13 
14  static const std::string REMOVED = "Removed";
15  static const std::string ADDED = "Added";
16 
18 
24  class Event
25  {
26 
27  public:
28 
30  Event(std::string type)
31  {
32  this->type = type;
33  captured = false;
34  }
35 
36  std::string type;
37  bool captured;
39 
41  virtual std::string toString() {return "Event " + type;}
42 
43  };
44 }
45 
46 
47 #endif
Base class for event system.
Definition: Event.h:24
Definition: Bitmap.h:8
Event(std::string type)
Creates a new event of the given type.
Definition: Event.h:30
virtual std::string toString()
string representing the event.
Definition: Event.h:41
std::string type
The type of the event. The string should be unique for this event.
Definition: Event.h:36
Core object used to display things in screen.
Definition: DisplayObject.h:23
rag::DisplayObject * target
Usually points to the dispatcher object. 'target' can be assigned to anything for custom events...
Definition: Event.h:38
bool captured
When an event is captured, it won't propagate anymore through the Display List.
Definition: Event.h:37
Definition: Event.h:11