]> git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/textool/StdAfx.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / plugins / textool / StdAfx.h
1 /*\r
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.\r
4 \r
5 This file is part of GtkRadiant.\r
6 \r
7 GtkRadiant is free software; you can redistribute it and/or modify\r
8 it under the terms of the GNU General Public License as published by\r
9 the Free Software Foundation; either version 2 of the License, or\r
10 (at your option) any later version.\r
11 \r
12 GtkRadiant is distributed in the hope that it will be useful,\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 GNU General Public License for more details.\r
16 \r
17 You should have received a copy of the GNU General Public License\r
18 along with GtkRadiant; if not, write to the Free Software\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
20 */\r
21 \r
22 // stdafx.h\r
23 // precompiled headers\r
24 \r
25 // standard headers\r
26 #include <gdk/gdkkeysyms.h>\r
27 #include <gtk/gtk.h>\r
28 #include <stdio.h>\r
29 #include <stdlib.h>\r
30 \r
31 #if defined(__linux__) || defined(__APPLE__)\r
32 \r
33 // Necessary for proper boolean type declaration\r
34 #include "qertypes.h"\r
35 \r
36 typedef void* HMODULE;\r
37 typedef void* LPVOID;\r
38 typedef char* LPCSTR;\r
39 \r
40 #define MB_OK                       0x00000000L\r
41 #define MB_OKCANCEL                 0x00000001L\r
42 #define MB_ABORTRETRYIGNORE         0x00000002L\r
43 #define MB_YESNOCANCEL              0x00000003L\r
44 #define MB_YESNO                    0x00000004L\r
45 #define MB_RETRYCANCEL              0x00000005L\r
46  \r
47  \r
48 #define MB_ICONHAND                 0x00000010L\r
49 #define MB_ICONQUESTION             0x00000020L\r
50 #define MB_ICONEXCLAMATION          0x00000030L\r
51 #define MB_ICONASTERISK             0x00000040L\r
52  \r
53 #define MB_USERICON                 0x00000080L\r
54 #define MB_ICONWARNING              MB_ICONEXCLAMATION\r
55 #define MB_ICONERROR                MB_ICONHAND\r
56 #define MB_ICONINFORMATION          MB_ICONASTERISK\r
57 #define MB_ICONSTOP                 MB_ICONHAND\r
58  \r
59 #define MB_TYPEMASK                 0x0000000FL\r
60 #define MB_ICONMASK                 0x000000F0L\r
61 #define MB_DEFMASK                  0x00000F00L\r
62 #define MB_MODEMASK                 0x00003000L\r
63 #define MB_MISCMASK                 0x0000C000L\r
64  \r
65 #define IDOK                1\r
66 #define IDCANCEL            2\r
67 #define IDABORT             3\r
68 #define IDRETRY             4\r
69 #define IDIGNORE            5\r
70 #define IDYES               6\r
71 #define IDNO                7\r
72 \r
73 typedef struct tagRECT\r
74 {\r
75     long    left;\r
76     long    top;\r
77     long    right;\r
78     long    bottom;\r
79 } RECT, *PRECT, *LPRECT;\r
80 \r
81 #endif // __linux__\r
82 \r
83 // plugin\r
84 // FIXME TTimo: drop this\r
85 extern "C" void Sys_Printf (char *text, ...);\r
86 \r
87 #include "synapse.h"\r
88 #include "iplugin.h"\r
89 #include "qerplugin.h"\r
90 #include "mathlib.h"\r
91 #include "igl.h"\r
92 #include "iselectedface.h"\r
93 #include "isurfaceplugin.h"\r
94 #include "iui.h"\r
95 \r
96 // internals\r
97 // the implementation of a IWindowListener interface to use with the native UI\r
98 // TODO: move in it's own set of files?\r
99 // 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\r
100 class CWindowListener : public IWindowListener\r
101 {\r
102   int refCount;\r
103 public:\r
104   // Increment the number of references to this object\r
105   void IncRef () { refCount++; }\r
106   // Decrement the reference count\r
107   void DecRef () { if ( --refCount <= 0 ) delete this; }\r
108   // IWindowListener ---------------------------------------\r
109   bool OnLButtonDown(guint32 nFlags, double x, double y);\r
110         bool OnMButtonDown(guint32 nFlags, double x, double y) { return false; }\r
111         bool OnRButtonDown(guint32 nFlags, double x, double y);\r
112   bool OnLButtonUp(guint32 nFlags, double x, double y);\r
113         bool OnMButtonUp(guint32 nFlags, double x, double y) { return false; }\r
114         bool OnRButtonUp(guint32 nFlags, double x, double y);\r
115   bool OnMouseMove(guint32 nFlags, double x, double y);\r
116   bool OnKeyPressed(char *s);\r
117   bool Paint();\r
118   void Close();\r
119 };\r
120 \r
121 #include "2DView.h"\r
122 typedef struct\r
123 {\r
124         float   data[MAX_POINTS_ON_WINDING][2];\r
125 } CtrlPts_t;\r
126 #include "ControlPointsManager.h"\r
127 \r
128 extern _QERQglTable                     g_QglTable;\r
129 extern _QERFuncTable_1                  g_FuncTable;\r
130 // prefs globals\r
131 // NOTE: these are used by the CControlPointsManager classes, not very C++ish\r
132 extern bool                                             g_bPrefsUpdateCameraView;\r
133 extern _QERSelectedFaceTable    g_SelectedFaceTable;\r
134 extern _QERFaceData                             g_CancelFaceData;\r
135 \r
136 #define Sys_Printf g_FuncTable.m_pfnSysPrintf\r
137 #define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf\r
138 \r
139 // call to validate the current changes into the editor\r
140 extern void Textool_Validate();\r
141 extern void Textool_Cancel();\r
142 \r
143 class CSynapseClientTexTool : public CSynapseClient\r
144 {\r
145 public:\r
146   // CSynapseClient API\r
147   bool RequestAPI(APIDescriptor_t *pAPI);\r
148   const char* GetInfo();\r
149   \r
150   CSynapseClientTexTool() { }\r
151   virtual ~CSynapseClientTexTool() { }\r
152 };\r
153 \r
154 extern IWindow *g_pToolWnd;\r