]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/xywindow.h
Merge commit 'dd7f4f1689e8ede7580bdfa8e08d0b78d08f5253' into garux-merge
[xonotic/netradiant.git] / radiant / xywindow.h
index cbf37b430f1a0bdfb496f79faa279f8582e928a4..966f374996a95f6b738eaf2b3bf16855b651c49b 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;
 }
 
@@ -121,17 +119,31 @@ void Move_End();
 bool m_move_started;
 guint m_move_focusOut;
 
-void Zoom_Begin();
+void Zoom_Begin( int x, int y );
 void Zoom_End();
 bool m_zoom_started;
 guint m_zoom_focusOut;
 
+void ZoomIn();
+void ZoomOut();
+void ZoomInWithMouse( int pointx, int pointy );
+
+void RenderActive();
 void SetActive( bool b ){
        m_bActive = b;
+       RenderActive();
 };
 bool Active(){
        return m_bActive;
 };
+struct camera_icon_t
+{
+       float x, y, fov, box;
+       double a;
+};
+camera_icon_t Cam;
+void UpdateCameraIcon();
+
 
 void Clipper_OnLButtonDown( int x, int y );
 void Clipper_OnLButtonUp( int x, int y );
@@ -139,10 +151,12 @@ void Clipper_OnMouseMoved( int x, int y );
 void Clipper_Crosshair_OnMouseMoved( int x, int y );
 void DropClipPoint( int pointx, int pointy );
 
+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;
@@ -196,10 +210,12 @@ bool m_entityCreate;
 
 public:
 void ButtonState_onMouseDown( unsigned int buttons ){
-       m_buttonstate |= buttons;
+       //m_buttonstate |= buttons;
+       m_buttonstate = buttons;
 }
 void ButtonState_onMouseUp( unsigned int buttons ){
-       m_buttonstate &= ~buttons;
+       //m_buttonstate &= ~buttons;
+       m_buttonstate = 0;
 }
 unsigned int getButtonState() const {
        return m_buttonstate;
@@ -226,7 +242,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 ){
@@ -245,33 +261,31 @@ 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;
 
-       bool m_bRightClick;
+//     bool m_bRightClick;
        bool m_bNoStipple;
+       bool m_bZoomInToPointer;
 
        xywindow_globals_t() :
-               color_gridback( 1.f, 1.f, 1.f ),
-               color_gridminor( 0.75f, 0.75f, 0.75f ),
-               color_gridmajor( 0.5f, 0.5f, 0.5f ),
-               color_gridblock( 0.f, 0.f, 1.f ),
+               color_gridback( 0.77f, 0.77f, 0.77f ),
+               color_gridminor( 0.83f, 0.83f, 0.83f ),
+               color_gridmajor( 0.89f, 0.89f, 0.89f ),
+               color_gridblock( 1.0f, 1.0f, 1.0f ),
                color_gridtext( 0.f, 0.f, 0.f ),
                color_brushes( 0.f, 0.f, 0.f ),
                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 ),
                AxisColorZ( 0.f, 0.f, 1.f ),
-               m_bRightClick( true ),
-               m_bNoStipple( false ){
+//             m_bRightClick( true ),
+               m_bNoStipple( true ),
+               m_bZoomInToPointer( true ){
        }
 
 };
@@ -281,10 +295,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();