]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/xywindow.h
contrib: fix bobToolz loading
[xonotic/netradiant.git] / radiant / xywindow.h
index 822045a5726c30c4524a6ccd86a9e6f7fafdb1ce..41fb89f89b9b053d6ce663a4687ce9fb3e722156 100644 (file)
@@ -40,8 +40,6 @@ namespace scene
 {
 class Node;
 }
-typedef struct _GtkWindow GtkWindow;
-typedef struct _GtkMenu GtkMenu;
 
 
 void FlipClip();
@@ -65,21 +63,21 @@ inline const char* ViewType_getTitle( VIEWTYPE viewtype ){
 
 class XYWnd
 {
-GtkWidget* m_gl_widget;
+ui::GLArea m_gl_widget;
 guint m_sizeHandler;
 guint m_exposeHandler;
 
 DeferredDraw m_deferredDraw;
 DeferredMotion m_deferred_motion;
 public:
-GtkWindow* m_parent;
+ui::Window m_parent;
 XYWnd();
 ~XYWnd();
 
 void queueDraw(){
        m_deferredDraw.draw();
 }
-GtkWidget* GetWidget(){
+ui::GLArea GetWidget(){
        return m_gl_widget;
 }
 
@@ -130,7 +128,10 @@ void ZoomIn();
 void ZoomOut();
 void ZoomInWithMouse( int pointx, int pointy );
 
+void Redraw();
+
 void RenderActive();
+
 void SetActive( bool b ){
        m_bActive = b;
        RenderActive();
@@ -158,7 +159,7 @@ void SetCustomPivotOrigin( int pointx, int pointy );
 void SetViewType( VIEWTYPE n );
 bool m_bActive;
 
-static GtkMenu* m_mnuDrop;
+static ui::Menu m_mnuDrop;
 
 int m_chasemouse_current_x, m_chasemouse_current_y;
 int m_chasemouse_delta_x, m_chasemouse_delta_y;
@@ -168,8 +169,8 @@ guint m_chasemouse_handler;
 void ChaseMouse();
 bool chaseMouseMotion( int pointx, int pointy );
 
-void updateModelview();
-void updateProjection();
+void updateModelview(bool reconstruct = true);
+void updateProjection(bool reconstruct = true);
 Matrix4 m_projection;
 Matrix4 m_modelview;
 
@@ -244,7 +245,7 @@ int Height(){
 Signal0 onDestroyed;
 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;
+typedef Member<XYWnd, void(const WindowVector&, ButtonIdentifier, ModifierFlags), &XYWnd::mouseDown> MouseDownCaller;
 };
 
 inline void XYWnd_Update( XYWnd& xywnd ){
@@ -263,6 +264,8 @@ struct xywindow_globals_t
        Vector3 color_selbrushes;
        Vector3 color_clipper;
        Vector3 color_viewname;
+       Vector3 color_gridminor_alt;
+       Vector3 color_gridmajor_alt;
        Vector3 AxisColorX;
        Vector3 AxisColorY;
        Vector3 AxisColorZ;
@@ -281,6 +284,8 @@ struct xywindow_globals_t
                color_selbrushes( 1.f, 0.f, 0.f ),
                color_clipper( 0.f, 0.f, 1.f ),
                color_viewname( 0.5f, 0.f, 0.75f ),
+               color_gridminor_alt( 0.f, 0.f, 0.f ),
+               color_gridmajor_alt( 0.f, 0.f, 0.f ),
 
                AxisColorX( 1.f, 0.f, 0.f ),
                AxisColorY( 0.f, 1.f, 0.f ),
@@ -297,10 +302,9 @@ extern xywindow_globals_t g_xywindow_globals;
 
 VIEWTYPE GlobalXYWnd_getCurrentViewType();
 
-typedef struct _GtkWindow GtkWindow;
-void XY_Top_Shown_Construct( GtkWindow* parent );
-void YZ_Side_Shown_Construct( GtkWindow* parent );
-void XZ_Front_Shown_Construct( GtkWindow* parent );
+void XY_Top_Shown_Construct( ui::Window parent );
+void YZ_Side_Shown_Construct( ui::Window parent );
+void XZ_Front_Shown_Construct( ui::Window parent );
 
 void XYWindow_Construct();
 void XYWindow_Destroy();