2 Copyright (C) 1999-2006 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
22 #include "pluginapi.h"
24 #include "modulesystem.h"
25 #include "qerplugin.h"
27 #include "generic/callback.h"
28 #include "math/vector.h"
32 #include "camwindow.h"
34 #include "mainframe.h"
38 void QERApp_GetCamera( Vector3& origin, Vector3& angles )
40 CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
41 origin = Camera_getOrigin(camwnd);
42 angles = Camera_getAngles(camwnd);
45 void QERApp_SetCamera( const Vector3& origin, const Vector3& angles )
47 CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
48 Camera_setOrigin(camwnd, origin);
49 Camera_setAngles(camwnd, angles);
52 void QERApp_GetCamWindowExtents( int *x, int *y, int *width, int *height )
55 CamWnd* camwnd = g_pParentWnd->GetCamWnd();
57 gtk_window_get_position(GTK_WINDOW(camwnd->m_window), x, y);
59 *width = camwnd->Camera()->width;
60 *height = camwnd->Camera()->height;
68 _QERCameraTable m_camera;
70 typedef _QERCameraTable Type;
71 STRING_CONSTANT(Name, "*");
75 m_camera.m_pfnGetCamera = &QERApp_GetCamera;
76 m_camera.m_pfnSetCamera = &QERApp_SetCamera;
77 m_camera.m_pfnGetCamWindowExtents = &QERApp_GetCamWindowExtents;
79 _QERCameraTable* getTable()
85 #include "modulesystem/singletonmodule.h"
86 #include "modulesystem/moduleregistry.h"
88 typedef SingletonModule<CameraAPI> CameraModule;
89 typedef Static<CameraModule> StaticCameraModule;
90 StaticRegisterModule staticRegisterCamera(StaticCameraModule::instance());