2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "camwindow.h"
29 const int SCALE_X = 0x01;
30 const int SCALE_Y = 0x02;
31 const int SCALE_Z = 0x04;
33 typedef void ( PFNPathCallback )( bool, int );
34 // as i didn't really encapsulate anything this
35 // should really be a struct..
39 ClipPoint(){ Reset(); };
40 void Reset(){ m_ptClip[0] = m_ptClip[1] = m_ptClip[2] = 0.0; m_bSet = false; m_pVec3 = NULL; };
41 bool Set(){ return m_bSet; };
42 void Set( bool b ) { m_bSet = b; };
43 void UpdatePointPtr() {
45 VectorCopy( m_ptClip, *m_pVec3 );
48 void SetPointPtr( vec3_t* p ) { m_pVec3 = p; };
49 vec3_t m_ptClip; // the 3d point
50 vec3_t* m_pVec3; // optional ptr for 3rd party updates
51 int m_ptScreenX, m_ptScreenY; // the onscreen xy point (for mousability)
60 /*! Draw clip/path point with rasterized number label */
61 void Draw( float fScale, int num );
62 /*! Draw clip/path point with rasterized string label */
63 void Draw( float fScale, const char *label );
66 class XYWnd : public GLWindow
74 vec3_t& RotateOrigin();
83 void Redraw( unsigned int nBits );
84 void VectorCopyXY( vec3_t in, vec3_t out );
90 void SetOrigin( vec3_t org ); // PGM
95 void DrawRotateIcon();
96 void DrawCameraIcon();
97 void XY_DrawBlockGrid();
99 void XY_MouseMoved( int x, int y, int buttons );
100 // TTimo: FIXME: was experimental stuff to track possible endless loop issues
101 // void XY_MouseMovedRec (int x, int y, int buttons);
102 void NewBrushDrag( int x, int y );
103 qboolean DragDelta( int x, int y, vec3_t move );
104 void XY_MouseUp( int x, int y, int buttons );
105 void XY_MouseDown( int x, int y, int buttons );
106 void XY_ToGridPoint( int x, int y, vec3_t point );
107 void XY_ToPoint( int x, int y, vec3_t point );
108 void SnapToPoint( int x, int y, vec3_t point );
109 void SetActive( bool b ) {m_bActive = b; };
110 bool Active() {return m_bActive; };
112 void DropClipPoint( guint32 nFlags, int pointx, int pointy );
113 bool RogueClipMode();
115 void SetClipMode( bool bMode );
116 void RetainClipMode( bool bMode );
119 bool SetRotateMode( bool bMode );
121 void SetScaleMode( bool bMode );
124 void DropPathPoint( guint32 nFlags, int pointx, int pointy );
126 // void AddPointPoint(guint32 nFlags, vec3_t* pVec);
127 void SetPointMode( bool b );
129 void SetViewType( int n );
143 int m_ptCursorX, m_ptCursorY;
149 vec3_t m_vPressdelta;
150 bool m_bPress_selection;
155 // this is unique for all views
156 static GtkWidget* m_mnuDrop;
161 int m_ptDragX, m_ptDragY;
162 int m_ptDragAdjX, m_ptDragAdjY;
163 int m_ptDragTotalX, m_ptDragTotalY;
165 void OriginalButtonUp( guint32 nFlags, int point, int pointy );
166 void OriginalButtonDown( guint32 nFlags, int point, int pointy );
167 // void ProduceSplits(brush_t** pFront, brush_t** pBack);
168 void PlanePointsFromClipPoints( vec3_t planepts[3], brush_t * pBrush );
169 void ProduceSplitLists();
171 void PaintSizeInfo( int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds );
173 int m_ptDownX, m_ptDownY;
176 void OnEntityCreate( const char* item );
177 int GetViewType() {return m_nViewType; }
178 void SetScale( float f ) {m_fScale = f; }
179 float Scale() {return m_fScale; }
180 int Width() {return m_nWidth; }
181 int Height() {return m_nHeight; }
187 void OnLButtonDown( guint32 flags, int pointx, int pointy );
188 void OnRButtonDown( guint32 flags, int pointx, int pointy );
189 void OnMButtonDown( guint32 flags, int pointx, int pointy );
190 void OnLButtonUp( guint32 flags, int pointx, int pointy );
191 void OnRButtonUp( guint32 flags, int pointx, int pointy );
192 void OnMButtonUp( guint32 flags, int pointx, int pointy );
193 void OnMouseMove( guint32 nFlags, int pointx, int pointy );
194 void OnMouseWheel( bool bUp );
195 void OnSize( int cx, int cy );
199 XORRectangle m_XORRectangle;
202 #endif // _XYWINDOW_H_