[Orxonox-commit 1649] r6367 - in code/branches/presentation2/src/libraries/core: . input

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Dec 16 22:19:32 CET 2009


Author: rgrieder
Date: 2009-12-16 22:19:32 +0100 (Wed, 16 Dec 2009)
New Revision: 6367

Modified:
   code/branches/presentation2/src/libraries/core/GUIManager.cc
   code/branches/presentation2/src/libraries/core/GUIManager.h
   code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
   code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h
Log:
Moved CEGUI event hack from KeyBinderManager to GUIManager and made the function static.

Modified: code/branches/presentation2/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/GUIManager.cc	2009-12-16 20:44:22 UTC (rev 6366)
+++ code/branches/presentation2/src/libraries/core/GUIManager.cc	2009-12-16 21:19:32 UTC (rev 6367)
@@ -39,6 +39,7 @@
 #include <CEGUIMouseCursor.h>
 #include <CEGUIResourceProvider.h>
 #include <CEGUISystem.h>
+#include <CEGUIWindow.h>
 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
 
 #include "SpecialConfig.h" // Configures the macro below
@@ -346,4 +347,9 @@
             return CEGUI::NoButton;
         }
     }
+
+    void GUIManager::subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function)
+    {
+        window->subscribeScriptedEvent(event, function);
+    }
 }

Modified: code/branches/presentation2/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/presentation2/src/libraries/core/GUIManager.h	2009-12-16 20:44:22 UTC (rev 6366)
+++ code/branches/presentation2/src/libraries/core/GUIManager.h	2009-12-16 21:19:32 UTC (rev 6367)
@@ -83,6 +83,9 @@
         inline PlayerInfo* getPlayer(const std::string& guiname) const
             { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }
 
+        // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work
+        static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export
+
     private:
         GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
 

Modified: code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	2009-12-16 20:44:22 UTC (rev 6366)
+++ code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	2009-12-16 21:19:32 UTC (rev 6367)
@@ -28,8 +28,6 @@
 
 #include "KeyBinderManager.h"
 
-#include <CEGUIWindow.h>
-
 #include "util/Debug.h"
 #include "util/Exception.h"
 #include "core/ConfigValueIncludes.h"
@@ -103,11 +101,6 @@
     {
         this->currentBinder_->setBinding("", binding, true);
     }
-    
-    void KeyBinderManager::subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function)
-    {
-        window->subscribeScriptedEvent(event, function);
-    }
 
     void KeyBinderManager::load(const std::string& filename)
     {

Modified: code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h
===================================================================
--- code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	2009-12-16 20:44:22 UTC (rev 6366)
+++ code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	2009-12-16 21:19:32 UTC (rev 6367)
@@ -34,7 +34,6 @@
 #include <map>
 #include <string>
 #include <boost/shared_ptr.hpp>
-#include <CEGUIForwardRefs.h>
 
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
@@ -81,8 +80,6 @@
         //! Selects the default KeyBinder as current one
         void setToDefault()
             { this->setCurrent(this->defaultFilename_); }
-            
-        void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export
 
         //! Returns a pointer to a KeyBinder (creates it if not yet loaded)
         KeyBinder* get(const std::string& name);




More information about the Orxonox-commit mailing list