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
33 : x(0), y(0), w(0), h(0)
35 rectangle_t(float _x, float _y, float _w, float _h)
36 : x(_x), y(_y), w(_w), h(_h)
47 XORRectangle(GtkWidget* widget)
48 : m_widget(widget), m_gc(NULL)
55 void set(rectangle_t rectangle)
59 m_rectangle = rectangle;
63 bool initialised() const
71 m_gc = gdk_gc_new(m_widget->window);
73 GdkColor color = { 0, 0xffff, 0xffff, 0xffff, };
74 GdkColormap* colormap = gdk_window_get_colormap(m_widget->window);
75 gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE);
76 gdk_gc_copy(m_gc, m_widget->style->white_gc);
77 gdk_gc_set_foreground(m_gc, &color);
78 gdk_gc_set_background(m_gc, &color);
80 gdk_gc_set_function(m_gc, GDK_XOR);
85 const int x = (int)m_rectangle.x;
86 const int y = (int)m_rectangle.y;
87 const int w = (int)m_rectangle.w;
88 const int h = (int)m_rectangle.h;
89 gdk_draw_rectangle(m_widget->window, m_gc, TRUE, x, -(h) - (y - m_widget->allocation.height), w, h);
92 rectangle_t m_rectangle;
98 class CamWnd : public GLWindow
101 void MatchViewAxes(const vec3_t P, const vec3_t vec, int &axis, float &sgn);
106 camera_t *Camera(){return &m_Camera;};
107 void Cam_MouseControl(float dtime);
108 void Cam_ChangeFloor(qboolean up);
109 void ToggleFreeMove();
114 void Cam_BuildMatrix();
115 void Cam_PositionDrag();
116 void Cam_KeyControl(float dtime);
117 void Cam_MouseDown(int x, int y, int buttons);
118 void Cam_MouseUp (int x, int y, int buttons);
119 void Cam_MouseMoved (int x, int y, int buttons);
121 qboolean CullBrush (brush_t *b);
123 void Cam_DrawStuff();
124 void Cam_DrawBrushes(int mode);
125 void Cam_DrawBrush(brush_t *b, int mode);
127 brush_t* m_TransBrushes[MAX_MAP_BRUSHES];
128 int m_nNumTransBrushes;
130 int m_nCambuttonstate;
134 int m_ptLastCamCursorX;
138 int m_ptLastCamCursorY;
139 face_t* m_pSide_select;
145 guint m_FocusOutHandler_id;
149 void OnLButtonDown (guint32 flags, int x, int y);
150 void OnRButtonDown (guint32 flags, int x, int y);
151 void OnMButtonDown (guint32 flags, int x, int y);
152 void OnLButtonUp (guint32 flags, int pointx, int pointy);
153 void OnRButtonUp (guint32 flags, int pointx, int pointy);
154 void OnMButtonUp (guint32 flags, int pointx, int pointy);
155 void OnMouseMove (guint32 flags, int pointx, int pointy);
156 void OnMouseWheel(bool bUp);
157 void OnSize(int cx, int cy);
160 void OriginalMouseDown (guint32 nFlags, int pointX, int pointY);
161 void OriginalMouseUp (guint32 nFlags, int pointX, int pointY);
164 XORRectangle m_XORRectangle;
166 // project a point in geometric space into camera space
167 void ProjectCamera(const vec3_t A, vec_t B[2]);
171 #endif // _CAMWINDOW_H_