]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/MouseEvent.hxx
First working version of DOM like Canvas event handling
[simgear.git] / simgear / canvas / MouseEvent.hxx
index b5d014f2d02d21c80eb7810f20ac17e693a9ac75..3193f27819e49cb7fa74374d77c1d05cfbc0e14b 100644 (file)
@@ -27,24 +27,31 @@ namespace simgear
 namespace canvas
 {
 
-  struct MouseEvent:
+  class MouseEvent:
     public Event
   {
-    MouseEvent():
-      button(-1),
-      state(-1),
-      mod(-1)
-    {}
-
-    osg::Vec2f getPos() const { return pos; }
-    osg::Vec3f getPos3() const { return osg::Vec3f(pos, 0); }
-    osg::Vec2f getDelta() const { return delta; }
-
-    osg::Vec2f  pos,
-                delta;
-    int         button, //<! Button for this event
-                state,  //<! Current button state
-                mod;    //<! Keyboard modifier state
+    public:
+      MouseEvent():
+        button(-1),
+        state(-1),
+        mod(-1)
+      {}
+
+      osg::Vec2f getPos() const { return pos; }
+      osg::Vec3f getPos3() const { return osg::Vec3f(pos, 0); }
+      osg::Vec2f getDelta() const { return delta; }
+
+      float getPosX() const { return pos.x(); }
+      float getPosY() const { return pos.y(); }
+
+      float getDeltaX() const { return delta.x(); }
+      float getDeltaY() const { return delta.y(); }
+
+      osg::Vec2f  pos,
+                  delta;
+      int         button, //<! Button for this event
+                  state,  //<! Current button state
+                  mod;    //<! Keyboard modifier state
   };
 
 } // namespace canvas