]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/textool/StdAfx.h
* fixed a lot of compiler warnings (mostly const char * stuff and use of uninitialize...
[xonotic/netradiant.git] / plugins / textool / StdAfx.h
1 /*
2 Copyright (C) 1999-2007 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 // stdafx.h
23 // precompiled headers
24
25 // standard headers
26 #include <gdk/gdkkeysyms.h>
27 #include <gtk/gtk.h>
28 #include <glib/gi18n.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31
32 #if defined(__linux__) || defined(__APPLE__)
33
34 // Necessary for proper boolean type declaration
35 #include "qertypes.h"
36
37 typedef void* HMODULE;
38 typedef void* LPVOID;
39 typedef char* LPCSTR;
40
41 #define MB_OK                       0x00000000L
42 #define MB_OKCANCEL                 0x00000001L
43 #define MB_ABORTRETRYIGNORE         0x00000002L
44 #define MB_YESNOCANCEL              0x00000003L
45 #define MB_YESNO                    0x00000004L
46 #define MB_RETRYCANCEL              0x00000005L
47
48
49 #define MB_ICONHAND                 0x00000010L
50 #define MB_ICONQUESTION             0x00000020L
51 #define MB_ICONEXCLAMATION          0x00000030L
52 #define MB_ICONASTERISK             0x00000040L
53
54 #define MB_USERICON                 0x00000080L
55 #define MB_ICONWARNING              MB_ICONEXCLAMATION
56 #define MB_ICONERROR                MB_ICONHAND
57 #define MB_ICONINFORMATION          MB_ICONASTERISK
58 #define MB_ICONSTOP                 MB_ICONHAND
59
60 #define MB_TYPEMASK                 0x0000000FL
61 #define MB_ICONMASK                 0x000000F0L
62 #define MB_DEFMASK                  0x00000F00L
63 #define MB_MODEMASK                 0x00003000L
64 #define MB_MISCMASK                 0x0000C000L
65
66 #define IDOK                1
67 #define IDCANCEL            2
68 #define IDABORT             3
69 #define IDRETRY             4
70 #define IDIGNORE            5
71 #define IDYES               6
72 #define IDNO                7
73
74 typedef struct tagRECT
75 {
76     long    left;
77     long    top;
78     long    right;
79     long    bottom;
80 } RECT, *PRECT, *LPRECT;
81
82 #endif // __linux__
83
84 // plugin
85 // FIXME TTimo: drop this
86 extern "C" void Sys_Printf (char *text, ...);
87
88 #include "synapse.h"
89 #include "iplugin.h"
90 #include "qerplugin.h"
91 #include "mathlib.h"
92 #include "igl.h"
93 #include "iselectedface.h"
94 #include "isurfaceplugin.h"
95 #include "iui.h"
96
97 // internals
98 // the implementation of a IWindowListener interface to use with the native UI
99 // TODO: move in it's own set of files?
100 // NOTE: I'm not too sure about the bool flags being any use.. they are supposed to tell if we handle the event or not
101 class CWindowListener : public IWindowListener
102 {
103   int refCount;
104 public:
105   // Increment the number of references to this object
106   void IncRef () { refCount++; }
107   // Decrement the reference count
108   void DecRef () { if ( --refCount <= 0 ) delete this; }
109   // IWindowListener ---------------------------------------
110   bool OnLButtonDown(guint32 nFlags, double x, double y);
111         bool OnMButtonDown(guint32 nFlags, double x, double y) { return false; }
112         bool OnRButtonDown(guint32 nFlags, double x, double y);
113   bool OnLButtonUp(guint32 nFlags, double x, double y);
114         bool OnMButtonUp(guint32 nFlags, double x, double y) { return false; }
115         bool OnRButtonUp(guint32 nFlags, double x, double y);
116   bool OnMouseMove(guint32 nFlags, double x, double y);
117   bool OnKeyPressed(char *s);
118   bool Paint();
119   void Close();
120 };
121
122 #include "2DView.h"
123 typedef struct
124 {
125         float   data[MAX_POINTS_ON_WINDING][2];
126 } CtrlPts_t;
127 #include "ControlPointsManager.h"
128
129 extern _QERQglTable                     g_QglTable;
130 extern _QERFuncTable_1                  g_FuncTable;
131 // prefs globals
132 // NOTE: these are used by the CControlPointsManager classes, not very C++ish
133 extern bool                                             g_bPrefsUpdateCameraView;
134 extern _QERSelectedFaceTable    g_SelectedFaceTable;
135 extern _QERFaceData                             g_CancelFaceData;
136
137 #define Sys_Printf g_FuncTable.m_pfnSysPrintf
138 #define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf
139
140 // call to validate the current changes into the editor
141 extern void Textool_Validate();
142 extern void Textool_Cancel();
143
144 class CSynapseClientTexTool : public CSynapseClient
145 {
146 public:
147   // CSynapseClient API
148   bool RequestAPI(APIDescriptor_t *pAPI);
149   const char* GetInfo();
150
151   CSynapseClientTexTool() { }
152   virtual ~CSynapseClientTexTool() { }
153 };
154
155 extern IWindow *g_pToolWnd;