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() { if (m_pVec3) VectorCopy(m_ptClip, *m_pVec3); };
44 void SetPointPtr(vec3_t* p) { m_pVec3 = p; };
45 vec3_t m_ptClip; // the 3d point
46 vec3_t* m_pVec3; // optional ptr for 3rd party updates
47 int m_ptScreenX, m_ptScreenY; // the onscreen xy point (for mousability)
49 operator vec3_t&() {return m_ptClip;};
50 operator vec3_t*() {return &m_ptClip;};
52 /*! Draw clip/path point with rasterized number label */
53 void Draw(float fScale, int num);
54 /*! Draw clip/path point with rasterized string label */
55 void Draw(float fScale, const char *label);
58 class XYWnd : public GLWindow
66 vec3_t& RotateOrigin();
75 void Redraw(unsigned int nBits);
76 void VectorCopyXY(vec3_t in, vec3_t out);
82 void SetOrigin(vec3_t org); // PGM
87 void DrawRotateIcon();
88 void DrawCameraIcon();
89 void XY_DrawBlockGrid();
91 void XY_MouseMoved (int x, int y, int buttons);
92 // TTimo: FIXME: was experimental stuff to track possible endless loop issues
93 // void XY_MouseMovedRec (int x, int y, int buttons);
94 void NewBrushDrag (int x, int y);
95 qboolean DragDelta (int x, int y, vec3_t move);
96 void XY_MouseUp(int x, int y, int buttons);
97 void XY_MouseDown (int x, int y, int buttons);
98 void XY_ToGridPoint (int x, int y, vec3_t point);
99 void XY_ToPoint (int x, int y, vec3_t point);
100 void SnapToPoint (int x, int y, vec3_t point);
101 void SetActive(bool b) {m_bActive = b;};
102 bool Active() {return m_bActive;};
104 void DropClipPoint(guint32 nFlags, int pointx, int pointy);
105 bool RogueClipMode();
107 void SetClipMode(bool bMode);
108 void RetainClipMode(bool bMode);
111 bool SetRotateMode(bool bMode);
113 void SetScaleMode(bool bMode);
116 void DropPathPoint(guint32 nFlags, int pointx, int pointy);
118 // void AddPointPoint(guint32 nFlags, vec3_t* pVec);
119 void SetPointMode(bool b);
121 void SetViewType(int n);
135 int m_ptCursorX, m_ptCursorY;
141 vec3_t m_vPressdelta;
142 bool m_bPress_selection;
147 // this is unique for all views
148 static GtkWidget* m_mnuDrop;
153 int m_ptDragX, m_ptDragY;
154 int m_ptDragAdjX, m_ptDragAdjY;
155 int m_ptDragTotalX, m_ptDragTotalY;
157 void OriginalButtonUp(guint32 nFlags, int point, int pointy);
158 void OriginalButtonDown(guint32 nFlags, int point, int pointy);
159 // void ProduceSplits(brush_t** pFront, brush_t** pBack);
160 void PlanePointsFromClipPoints(vec3_t planepts[3], brush_t *pBrush);
161 void ProduceSplitLists();
163 void PaintSizeInfo(int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds);
165 int m_ptDownX, m_ptDownY;
168 void OnEntityCreate(const char* item);
169 int GetViewType() {return m_nViewType; }
170 void SetScale(float f) {m_fScale = f;}
171 float Scale() {return m_fScale;}
172 int Width() {return m_nWidth;}
173 int Height() {return m_nHeight;}
179 void OnLButtonDown(guint32 flags, int pointx, int pointy);
180 void OnRButtonDown(guint32 flags, int pointx, int pointy);
181 void OnMButtonDown(guint32 flags, int pointx, int pointy);
182 void OnLButtonUp(guint32 flags, int pointx, int pointy);
183 void OnRButtonUp(guint32 flags, int pointx, int pointy);
184 void OnMButtonUp(guint32 flags, int pointx, int pointy);
185 void OnMouseMove(guint32 nFlags, int pointx, int pointy);
186 void OnMouseWheel(bool bUp);
187 void OnSize (int cx, int cy);
191 XORRectangle m_XORRectangle;
194 #endif // _XYWINDOW_H_