2 Copyright (C) 2006, Thomas Nitschke.
\r
5 This file is part of GtkRadiant.
\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
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
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
23 #include "iplugin.h"
\r
24 #include "qerplugin.h"
\r
26 #include <gtk/gtk.h>
\r
27 #include <gtk/gtktreeview.h>
\r
29 #include "debugging/debugging.h"
\r
30 #include "string/string.h"
\r
31 #include "modulesystem/singletonmodule.h"
\r
32 #include "stream/textfilestream.h"
\r
33 #include "stream/stringstream.h"
\r
34 #include "gtkutil/messagebox.h"
\r
35 #include "gtkutil/filechooser.h"
\r
38 #include "iscenegraph.h"
\r
39 #include "iselection.h"
\r
40 #include "ifilesystem.h"
\r
41 #include "ifiletypes.h"
\r
43 #include "support.h"
\r
45 #include "typesystem.h"
\r
47 void CreateWindow (void);
\r
48 void DestroyWindow(void);
\r
49 bool IsWindowOpen(void);
\r
51 namespace BrushExport
\r
53 GtkWindow* g_mainwnd;
\r
55 const char* init(void* hApp, void* pMainWidget)
\r
57 g_mainwnd = (GtkWindow*)pMainWidget;
\r
58 ASSERT_NOTNULL(g_mainwnd);
\r
61 const char* getName()
\r
63 return "Brush export Plugin";
\r
65 const char* getCommandList()
\r
67 return "Export selected as Wavefront Object;About";
\r
69 const char* getCommandTitleList()
\r
74 void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush)
\r
76 if(string_equal(command, "About"))
\r
78 GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_mainwnd), "Brushexport plugin v 2.0 by namespace (www.codecreator.net)\n"
\r
79 "Enjoy!\n\nSend feedback to spam@codecreator.net", "About me...",
\r
83 else if(string_equal(command, "Export selected as Wavefront Object"))
\r
92 class BrushExportDependencies :
\r
93 public GlobalRadiantModuleRef,
\r
94 public GlobalFiletypesModuleRef,
\r
95 public GlobalBrushModuleRef,
\r
96 public GlobalFileSystemModuleRef,
\r
97 public GlobalSceneGraphModuleRef,
\r
98 public GlobalSelectionModuleRef
\r
101 BrushExportDependencies(void)
\r
102 : GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes"))
\r
106 class BrushExportModule : public TypeSystemRef
\r
108 _QERPluginTable m_plugin;
\r
110 typedef _QERPluginTable Type;
\r
111 STRING_CONSTANT(Name, "brushexport2");
\r
113 BrushExportModule()
\r
115 m_plugin.m_pfnQERPlug_Init = &BrushExport::init;
\r
116 m_plugin.m_pfnQERPlug_GetName = &BrushExport::getName;
\r
117 m_plugin.m_pfnQERPlug_GetCommandList = &BrushExport::getCommandList;
\r
118 m_plugin.m_pfnQERPlug_GetCommandTitleList = &BrushExport::getCommandTitleList;
\r
119 m_plugin.m_pfnQERPlug_Dispatch = &BrushExport::dispatch;
\r
121 _QERPluginTable* getTable()
\r
127 typedef SingletonModule<BrushExportModule, BrushExportDependencies> SingletonBrushExportModule;
\r
128 SingletonBrushExportModule g_BrushExportModule;
\r
130 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
\r
132 initialiseModule(server);
\r
133 g_BrushExportModule.selfRegister();
\r