]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/textool/StdAfx.h
Merge remote-tracking branch 'ttimo/master'
[xonotic/netradiant.git] / plugins / textool / StdAfx.h
index 2a2da9c37aca67583e3b5f8ba84666ce0968faac..a31c0a6d8842bdcc9c80cf1b18c68332d720ccba 100644 (file)
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-// stdafx.h\r
-// precompiled headers\r
-\r
-// standard headers\r
-#include <gdk/gdkkeysyms.h>\r
-#include <gtk/gtk.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#if defined(__linux__) || defined(__APPLE__)\r
-\r
-// Necessary for proper boolean type declaration\r
-#include "qertypes.h"\r
-\r
-typedef void* HMODULE;\r
-typedef void* LPVOID;\r
-typedef char* LPCSTR;\r
-\r
-#define MB_OK                       0x00000000L\r
-#define MB_OKCANCEL                 0x00000001L\r
-#define MB_ABORTRETRYIGNORE         0x00000002L\r
-#define MB_YESNOCANCEL              0x00000003L\r
-#define MB_YESNO                    0x00000004L\r
-#define MB_RETRYCANCEL              0x00000005L\r
\r
\r
-#define MB_ICONHAND                 0x00000010L\r
-#define MB_ICONQUESTION             0x00000020L\r
-#define MB_ICONEXCLAMATION          0x00000030L\r
-#define MB_ICONASTERISK             0x00000040L\r
\r
-#define MB_USERICON                 0x00000080L\r
-#define MB_ICONWARNING              MB_ICONEXCLAMATION\r
-#define MB_ICONERROR                MB_ICONHAND\r
-#define MB_ICONINFORMATION          MB_ICONASTERISK\r
-#define MB_ICONSTOP                 MB_ICONHAND\r
\r
-#define MB_TYPEMASK                 0x0000000FL\r
-#define MB_ICONMASK                 0x000000F0L\r
-#define MB_DEFMASK                  0x00000F00L\r
-#define MB_MODEMASK                 0x00003000L\r
-#define MB_MISCMASK                 0x0000C000L\r
\r
-#define IDOK                1\r
-#define IDCANCEL            2\r
-#define IDABORT             3\r
-#define IDRETRY             4\r
-#define IDIGNORE            5\r
-#define IDYES               6\r
-#define IDNO                7\r
-\r
-typedef struct tagRECT\r
-{\r
-    long    left;\r
-    long    top;\r
-    long    right;\r
-    long    bottom;\r
-} RECT, *PRECT, *LPRECT;\r
-\r
-#endif // __linux__\r
-\r
-// plugin\r
-// FIXME TTimo: drop this\r
-extern "C" void Sys_Printf (char *text, ...);\r
-\r
-#include "synapse.h"\r
-#include "iplugin.h"\r
-#include "qerplugin.h"\r
-#include "mathlib.h"\r
-#include "igl.h"\r
-#include "iselectedface.h"\r
-#include "isurfaceplugin.h"\r
-#include "iui.h"\r
-\r
-// internals\r
-// the implementation of a IWindowListener interface to use with the native UI\r
-// TODO: move in it's own set of files?\r
-// 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
-class CWindowListener : public IWindowListener\r
-{\r
-  int refCount;\r
-public:\r
-  // Increment the number of references to this object\r
-  void IncRef () { refCount++; }\r
-  // Decrement the reference count\r
-  void DecRef () { if ( --refCount <= 0 ) delete this; }\r
-  // IWindowListener ---------------------------------------\r
-  bool OnLButtonDown(guint32 nFlags, double x, double y);\r
-       bool OnMButtonDown(guint32 nFlags, double x, double y) { return false; }\r
-       bool OnRButtonDown(guint32 nFlags, double x, double y);\r
-  bool OnLButtonUp(guint32 nFlags, double x, double y);\r
-       bool OnMButtonUp(guint32 nFlags, double x, double y) { return false; }\r
-       bool OnRButtonUp(guint32 nFlags, double x, double y);\r
-  bool OnMouseMove(guint32 nFlags, double x, double y);\r
-  bool OnKeyPressed(char *s);\r
-  bool Paint();\r
-  void Close();\r
-};\r
-\r
-#include "2DView.h"\r
-typedef struct\r
-{\r
-       float   data[MAX_POINTS_ON_WINDING][2];\r
-} CtrlPts_t;\r
-#include "ControlPointsManager.h"\r
-\r
-extern _QERQglTable                    g_QglTable;\r
-extern _QERFuncTable_1                 g_FuncTable;\r
-// prefs globals\r
-// NOTE: these are used by the CControlPointsManager classes, not very C++ish\r
-extern bool                                            g_bPrefsUpdateCameraView;\r
-extern _QERSelectedFaceTable   g_SelectedFaceTable;\r
-extern _QERFaceData                            g_CancelFaceData;\r
-\r
-#define Sys_Printf g_FuncTable.m_pfnSysPrintf\r
-#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf\r
-\r
-// call to validate the current changes into the editor\r
-extern void Textool_Validate();\r
-extern void Textool_Cancel();\r
-\r
-class CSynapseClientTexTool : public CSynapseClient\r
-{\r
-public:\r
-  // CSynapseClient API\r
-  bool RequestAPI(APIDescriptor_t *pAPI);\r
-  const char* GetInfo();\r
-  \r
-  CSynapseClientTexTool() { }\r
-  virtual ~CSynapseClientTexTool() { }\r
-};\r
-\r
-extern IWindow *g_pToolWnd;\r
+/*
+   Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+   This file is part of GtkRadiant.
+
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+// stdafx.h
+// precompiled headers
+
+// standard headers
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if !defined( WIN32 )
+
+// Necessary for proper boolean type declaration
+#include "qertypes.h"
+
+typedef void* HMODULE;
+typedef void* LPVOID;
+typedef char* LPCSTR;
+
+#define MB_OK                       0x00000000L
+#define MB_OKCANCEL                 0x00000001L
+#define MB_ABORTRETRYIGNORE         0x00000002L
+#define MB_YESNOCANCEL              0x00000003L
+#define MB_YESNO                    0x00000004L
+#define MB_RETRYCANCEL              0x00000005L
+
+
+#define MB_ICONHAND                 0x00000010L
+#define MB_ICONQUESTION             0x00000020L
+#define MB_ICONEXCLAMATION          0x00000030L
+#define MB_ICONASTERISK             0x00000040L
+
+#define MB_USERICON                 0x00000080L
+#define MB_ICONWARNING              MB_ICONEXCLAMATION
+#define MB_ICONERROR                MB_ICONHAND
+#define MB_ICONINFORMATION          MB_ICONASTERISK
+#define MB_ICONSTOP                 MB_ICONHAND
+
+#define MB_TYPEMASK                 0x0000000FL
+#define MB_ICONMASK                 0x000000F0L
+#define MB_DEFMASK                  0x00000F00L
+#define MB_MODEMASK                 0x00003000L
+#define MB_MISCMASK                 0x0000C000L
+
+#define IDOK                1
+#define IDCANCEL            2
+#define IDABORT             3
+#define IDRETRY             4
+#define IDIGNORE            5
+#define IDYES               6
+#define IDNO                7
+
+typedef struct tagRECT
+{
+       long left;
+       long top;
+       long right;
+       long bottom;
+} RECT, *PRECT, *LPRECT;
+
+#endif // __linux__
+
+// plugin
+// FIXME TTimo: drop this
+extern "C" void Sys_Printf( char *text, ... );
+
+#include "synapse.h"
+#include "iplugin.h"
+#include "qerplugin.h"
+#include "mathlib.h"
+#include "igl.h"
+#include "iselectedface.h"
+#include "isurfaceplugin.h"
+#include "iui.h"
+
+// internals
+// the implementation of a IWindowListener interface to use with the native UI
+// TODO: move in it's own set of files?
+// 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
+class CWindowListener : public IWindowListener
+{
+int refCount;
+public:
+// Increment the number of references to this object
+void IncRef() { refCount++; }
+// Decrement the reference count
+void DecRef() {
+       if ( --refCount <= 0 ) {
+               delete this;
+       }
+}
+// IWindowListener ---------------------------------------
+bool OnLButtonDown( guint32 nFlags, double x, double y );
+bool OnMButtonDown( guint32 nFlags, double x, double y ) { return false; }
+bool OnRButtonDown( guint32 nFlags, double x, double y );
+bool OnLButtonUp( guint32 nFlags, double x, double y );
+bool OnMButtonUp( guint32 nFlags, double x, double y ) { return false; }
+bool OnRButtonUp( guint32 nFlags, double x, double y );
+bool OnMouseMove( guint32 nFlags, double x, double y );
+bool OnKeyPressed( char *s );
+bool Paint();
+void Close();
+};
+
+#include "2DView.h"
+typedef struct
+{
+       float data[MAX_POINTS_ON_WINDING][2];
+} CtrlPts_t;
+#include "ControlPointsManager.h"
+
+extern OpenGLBinding g_QglTable;
+extern _QERFuncTable_1 g_FuncTable;
+// prefs globals
+// NOTE: these are used by the CControlPointsManager classes, not very C++ish
+extern bool g_bPrefsUpdateCameraView;
+extern _QERSelectedFaceTable g_SelectedFaceTable;
+extern _QERFaceData g_CancelFaceData;
+
+#define Sys_Printf g_FuncTable.m_pfnSysPrintf
+#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf
+
+// call to validate the current changes into the editor
+extern void Textool_Validate();
+extern void Textool_Cancel();
+
+class CSynapseClientTexTool : public CSynapseClient
+{
+public:
+// CSynapseClient API
+bool RequestAPI( APIDescriptor_t *pAPI );
+const char* GetInfo();
+
+CSynapseClientTexTool() { }
+virtual ~CSynapseClientTexTool() { }
+};
+
+extern IWindow *g_pToolWnd;