]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/xywindow.h
refactored plugin api; refactored callback library; added signals library
[xonotic/netradiant.git] / radiant / xywindow.h
index 5891c0380354cedc2d0a81146e422aa7ad001032..317ec591ae0fb7af27f8a1c51c2e0df1f256466d 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define INCLUDED_XYWINDOW_H
 
 #include "math/matrix.h"
+#include "signal/signal.h"
 
 #include "gtkutil/cursor.h"
 #include "gtkutil/window.h"
@@ -30,6 +31,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "view.h"
 #include "map.h"
 
+#include "qerplugin.h"
+
 class Shader;
 class SelectionSystemWindowObserver;
 namespace scene
@@ -46,13 +49,6 @@ void Clip();
 void OnClipMode(bool enabled);
 bool ClipMode();
 
-enum VIEWTYPE
-{
-  YZ = 0,
-  XZ = 1,
-  XY = 2
-};
-
 inline const char* ViewType_getTitle(VIEWTYPE viewtype)
 {
   if(viewtype == XY)
@@ -177,18 +173,6 @@ private:
   int m_ptCursorX, m_ptCursorY;
 
   unsigned int m_buttonstate;
-  void ButtonState_onMouseDown(unsigned int buttons)
-  {
-    m_buttonstate |= buttons;
-  }
-  void ButtonState_onMouseUp(unsigned int buttons)
-  {
-    m_buttonstate &= ~buttons;
-  }
-  unsigned int getButtonState() const
-  {
-    return m_buttonstate;
-  }
 
   int m_nNewBrushPressx;
   int m_nNewBrushPressy;
@@ -209,6 +193,18 @@ private:
   bool m_entityCreate;
 
 public:
+  void ButtonState_onMouseDown(unsigned int buttons)
+  {
+    m_buttonstate |= buttons;
+  }
+  void ButtonState_onMouseUp(unsigned int buttons)
+  {
+    m_buttonstate &= ~buttons;
+  }
+  unsigned int getButtonState() const
+  {
+    return m_buttonstate;
+  }
   void EntityCreate_MouseDown(int x, int y);
   void EntityCreate_MouseMove(int x, int y);
   void EntityCreate_MouseUp(int x, int y);
@@ -231,6 +227,10 @@ public:
   {
     return m_nHeight;
   }
+
+  Signal3<const WindowVector&, ButtonIdentifier, ModifierFlags> onMouseDown;
+  void mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers);
+  typedef Member3<XYWnd, const WindowVector&, ButtonIdentifier, ModifierFlags, void, &XYWnd::mouseDown> MouseDownCaller;
 };
 
 inline void XYWnd_Update(XYWnd& xywnd)