]> git.xonotic.org Git - xonotic/netradiant.git/blob - radiant/camwindow.h
Q3map2:
[xonotic/netradiant.git] / radiant / camwindow.h
1 /*
2    Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3    For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5    This file is part of GtkRadiant.
6
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.
11
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.
16
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
20  */
21
22 #if !defined( INCLUDED_CAMWINDOW_H )
23 #define INCLUDED_CAMWINDOW_H
24
25 #include "math/vector.h"
26 #include "signal/signalfwd.h"
27
28 typedef struct _GtkWidget GtkWidget;
29 typedef struct _GtkWindow GtkWindow;
30
31 class CamWnd;
32 CamWnd* NewCamWnd();
33 void DeleteCamWnd( CamWnd* camwnd );
34
35 void AddCameraMovedCallback( const SignalHandler& handler );
36
37 void CamWnd_Update( CamWnd& camwnd );
38
39 GtkWidget* CamWnd_getWidget( CamWnd& camwnd );
40 void CamWnd_setParent( CamWnd& camwnd, GtkWindow* parent );
41
42 void GlobalCamera_setCamWnd( CamWnd& camwnd );
43
44 typedef struct _GtkToolbar GtkToolbar;
45 void CamWnd_constructToolbar( GtkToolbar* toolbar );
46 void CamWnd_registerShortcuts();
47
48 void GlobalCamera_Benchmark();
49
50 const Vector3& Camera_getOrigin( CamWnd& camwnd );
51 void Camera_setOrigin( CamWnd& camwnd, const Vector3& origin );
52
53 void GlobalCamera_FocusOnSelected();
54
55 enum
56 {
57         CAMERA_PITCH = 0, // up / down
58         CAMERA_YAW = 1, // left / right
59         CAMERA_ROLL = 2, // fall over
60 };
61
62 const Vector3& Camera_getAngles( CamWnd& camwnd );
63 void Camera_setAngles( CamWnd& camwnd, const Vector3& angles );
64
65
66 struct camwindow_globals_t
67 {
68         Vector3 color_cameraback;
69         Vector3 color_selbrushes3d;
70
71         int m_nCubicScale;
72
73         bool m_bZoomInToPointer;
74
75         camwindow_globals_t() :
76                 color_cameraback( 0.25f, 0.25f, 0.25f ),
77                 color_selbrushes3d( 1.0f, 0.f, 0.f ),
78                 m_nCubicScale( 14 ),
79                 m_bZoomInToPointer( true ){
80         }
81
82 };
83
84 extern camwindow_globals_t g_camwindow_globals;
85
86 void CamWnd_Construct();
87 void CamWnd_Destroy();
88
89 #endif