]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/CanvasEvent.hxx
First working version of DOM like Canvas event handling
[simgear.git] / simgear / canvas / CanvasEvent.hxx
index b8babfb54682423d1c335acdca8e218882e38068..9ac9d475675b98fe156d427fa8ae4f1d9ced56d6 100644 (file)
@@ -1,4 +1,4 @@
-// Canvas Event for event model similar to DOM Level 2 Event Model
+// Canvas Event for event model similar to DOM Level 3 Event Model
 //
 // Copyright (C) 2012  Thomas Geymayer <tomgey@gmail.com>
 //
@@ -42,11 +42,21 @@ namespace canvas
 
       Type              type;
       ElementWeakPtr    target;
+      bool              propagation_stopped;
 
       Event();
+
+      // We need a vtable to allow nasal::Ghost to determine the dynamic type
+      // of the actual event instances.
+      virtual ~Event();
+
       Type getType() const;
       std::string getTypeString() const;
+
       ElementWeakPtr getTarget() const;
+      void stopPropagation();
+
+      static Type strToType(const std::string& str);
 
   };