]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/sample/sample.cpp
reformat code! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / plugins / sample / sample.cpp
index df3ba9041162424f197a59575c4797a04cf92221..565a09f40b2acbeec65f8c31b4be00437f23e46a 100644 (file)
 #include "modulesystem/singletonmodule.h"
 #include "typesystem.h"
 
-namespace Sample
-{
-const char* init( void* hApp, void* pMainWidget ){
-       return "";
-}
-const char* getName(){
-       return "Sample Plugin";
-}
-const char* getCommandList(){
-       return "About;Do Something";
-}
-const char* getCommandTitleList(){
-       return "";
-}
-void dispatch( const char* command, float* vMin, float* vMax, bool bSingleBrush ){
-       if ( string_equal( command, "About" ) ) {
-               globalOutputStream() << "Sample Demo Plugin\n";
-       }
-       if ( string_equal( command, "Do Something" ) ) {
-               globalOutputStream() << "Sample Command\n";
-       }
-}
+namespace Sample {
+    const char *init(void *hApp, void *pMainWidget)
+    {
+        return "";
+    }
+
+    const char *getName()
+    {
+        return "Sample Plugin";
+    }
+
+    const char *getCommandList()
+    {
+        return "About;Do Something";
+    }
+
+    const char *getCommandTitleList()
+    {
+        return "";
+    }
+
+    void dispatch(const char *command, float *vMin, float *vMax, bool bSingleBrush)
+    {
+        if (string_equal(command, "About")) {
+            globalOutputStream() << "Sample Demo Plugin\n";
+        }
+        if (string_equal(command, "Do Something")) {
+            globalOutputStream() << "Sample Command\n";
+        }
+    }
 
 } // namespace
 
-class SamplePluginModule : public TypeSystemRef
-{
-_QERPluginTable m_plugin;
+class SamplePluginModule : public TypeSystemRef {
+    _QERPluginTable m_plugin;
 public:
-typedef _QERPluginTable Type;
-STRING_CONSTANT( Name, "sample" );
-
-SamplePluginModule(){
-       m_plugin.m_pfnQERPlug_Init = &Sample::init;
-       m_plugin.m_pfnQERPlug_GetName = &Sample::getName;
-       m_plugin.m_pfnQERPlug_GetCommandList = &Sample::getCommandList;
-       m_plugin.m_pfnQERPlug_GetCommandTitleList = &Sample::getCommandTitleList;
-       m_plugin.m_pfnQERPlug_Dispatch = &Sample::dispatch;
-}
-_QERPluginTable* getTable(){
-       return &m_plugin;
-}
+    typedef _QERPluginTable Type;
+    STRING_CONSTANT( Name,
+    "sample" );
+
+    SamplePluginModule()
+    {
+        m_plugin.m_pfnQERPlug_Init = &Sample::init;
+        m_plugin.m_pfnQERPlug_GetName = &Sample::getName;
+        m_plugin.m_pfnQERPlug_GetCommandList = &Sample::getCommandList;
+        m_plugin.m_pfnQERPlug_GetCommandTitleList = &Sample::getCommandTitleList;
+        m_plugin.m_pfnQERPlug_Dispatch = &Sample::dispatch;
+    }
+
+    _QERPluginTable *getTable()
+    {
+        return &m_plugin;
+    }
 };
 
-typedef SingletonModule<SamplePluginModule> SingletonSamplePluginModule;
+typedef SingletonModule <SamplePluginModule> SingletonSamplePluginModule;
 
 SingletonSamplePluginModule g_SamplePluginModule;
 
 
-extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){
-       initialiseModule( server );
+extern "C" void RADIANT_DLLEXPORT
+Radiant_RegisterModules( ModuleServer
+& server ){
+initialiseModule( server );
+
+g_SamplePluginModule.
+
+selfRegister();
 
-       g_SamplePluginModule.selfRegister();
 }