[Orxonox-commit 611] r3143 - branches/pch/src/orxonox/gui

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Jun 10 22:54:43 CEST 2009


Author: rgrieder
Date: 2009-06-10 22:54:43 +0200 (Wed, 10 Jun 2009)
New Revision: 3143

Modified:
   branches/pch/src/orxonox/gui/GUIManager.cc
   branches/pch/src/orxonox/gui/GUIManager.h
Log:
Dependency reductions in the GUIManager.

Modified: branches/pch/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/pch/src/orxonox/gui/GUIManager.cc	2009-06-10 20:49:04 UTC (rev 3142)
+++ branches/pch/src/orxonox/gui/GUIManager.cc	2009-06-10 20:54:43 UTC (rev 3143)
@@ -23,23 +23,28 @@
  *      Reto Grieder
  *      Benjamin Knecht
  *   Co-authors:
+ *      ...
  *
- *
  */
 
 /**
-    @file
-    @brief
-        Implementation of the GUIManager class.
+ at file
+ at brief
+    Implementation of the GUIManager class.
 */
 
 #include "GUIManager.h"
 
-#include <boost/filesystem/path.hpp>
-#include <OgreRenderWindow.h>
-#include <CEGUI.h>
+extern "C" {
+#include <lua.h>
+}
 #include <CEGUIDefaultLogger.h>
+#include <CEGUIExceptions.h>
+#include <CEGUIInputEvent.h>
+#include <CEGUIResourceProvider.h>
+#include <CEGUISystem.h>
 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
+
 #include "SpecialConfig.h" // Configures the macro below
 #ifdef CEGUILUA_USE_INTERNAL_LIBRARY
 #   include <ceguilua/CEGUILua.h>
@@ -48,19 +53,15 @@
 #endif
 
 #include "util/Exception.h"
-#include "core/ConsoleCommand.h"
 #include "core/Core.h"
 #include "core/Clock.h"
 #include "ToluaBindCore.h"
 #include "ToluaBindOrxonox.h"
 #include "core/Loader.h"
 
-extern "C" {
-#include <lua.h>
-}
-
 namespace orxonox
 {
+    static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
     GUIManager* GUIManager::singletonRef_s = 0;
 
     GUIManager::GUIManager()
@@ -138,9 +139,8 @@
                 this->luaState_ = this->scriptModule_->getLuaState();
 
                 // Create our own logger to specify the filepath
-                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
                 this->ceguiLogger_ = new DefaultLogger();
-                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
+                this->ceguiLogger_->setLogFilename(Core::getLogPathString() + "cegui.log");
                 // set the log level according to ours (translate by subtracting 1)
                 this->ceguiLogger_->setLoggingLevel(
                     (LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
@@ -339,6 +339,15 @@
         }
     }
 
+    void GUIManager::keyPressed(const KeyEvent& evt)
+    {
+        guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text);
+    }
+    void GUIManager::keyReleased(const KeyEvent& evt)
+    {
+        guiSystem_->injectKeyUp(evt.key);
+    }
+
     /**
     @brief
         Function receiving a mouse button pressed event.
@@ -383,6 +392,15 @@
         }
     }
 
+    void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
+    {
+        guiSystem_->injectMouseMove(rel.x, rel.y);
+    }
+    void GUIManager::mouseScrolled(int abs, int rel)
+    {
+        guiSystem_->injectMouseWheelChange(rel);
+    }
+
     /**
     @brief
         converts mouse event code to CEGUI event code
@@ -393,7 +411,7 @@
 
         Simple convertion from mouse event code in Orxonox to the one used in CEGUI.
      */
-    inline CEGUI::MouseButton GUIManager::convertButton(MouseButtonCode::ByEnum button)
+    static inline CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button)
     {
         switch (button)
         {

Modified: branches/pch/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/pch/src/orxonox/gui/GUIManager.h	2009-06-10 20:49:04 UTC (rev 3142)
+++ branches/pch/src/orxonox/gui/GUIManager.h	2009-06-10 20:54:43 UTC (rev 3143)
@@ -21,27 +21,29 @@
  *
  *   Author:
  *      Reto Grieder
- *   Co-authors:
  *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
  *
  */
 
 /**
-    @file
-    @brief Declaration of the GUIManager class.
+ at file
+ at brief
+    Declaration of the GUIManager class.
 */
 
 #ifndef _GUIManager_H__
 #define _GUIManager_H__
 
 #include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <string>
 #include <OgrePrerequisites.h>
 #include <CEGUIForwardRefs.h>
-#include <CEGUIInputEvent.h>
-#include <CEGUISystem.h>
+
 #include "core/input/InputInterfaces.h"
-#include <map>
-#include "overlays/GUIOverlay.h"
 
 // Forward declaration
 namespace CEGUI { class DefaultLogger; }
@@ -104,27 +106,21 @@
         void loadLuaCode();
 
         // keyHandler functions
-        void keyPressed (const KeyEvent& evt)
-            { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); }
-        void keyReleased(const KeyEvent& evt)
-            { guiSystem_->injectKeyUp(evt.key); }
+        void keyPressed (const KeyEvent& evt);
+        void keyReleased(const KeyEvent& evt);
         void keyHeld    (const KeyEvent& evt) { }
 
         // mouseHandler functions
         void mouseButtonPressed (MouseButtonCode::ByEnum id);
         void mouseButtonReleased(MouseButtonCode::ByEnum id);
         void mouseButtonHeld    (MouseButtonCode::ByEnum id) { }
-        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
-            { guiSystem_->injectMouseMove(rel.x, rel.y); }
-        void mouseScrolled      (int abs, int rel)
-            { guiSystem_->injectMouseWheelChange(rel);}
+        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
+        void mouseScrolled      (int abs, int rel);
 
         void updateInput(float dt)  { }
         void updateKey  (float dt)  { }
         void updateMouse(float dt)  { }
 
-        static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
-
         Ogre::RenderWindow*         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
         CEGUI::OgreCEGUIRenderer*   guiRenderer_;       //!< CEGUI's interface to the Ogre Engine
         CEGUI::ResourceProvider*    resourceProvider_;  //!< CEGUI's resource provider




More information about the Orxonox-commit mailing list