Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 2:14:09 PM (15 years ago)
Author:
bknecht
Message:

(Doxygen) Documentation added for GUIManager and some GameState classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/gui/GUIManager.h

    r2853 r2875  
    2323 *      Reto Grieder
    2424 *   Co-authors:
    25  *      ...
     25 *      Benjamin Knecht
    2626 *
    2727 */
     
    4949{
    5050    /**
     51    @class GUIManager
    5152    @brief
    52         Provides a simple interface to CEGUI with tolua methods and console commands
     53        Provides a simple interface to CEGUI with tolua methods and console commands. It also acts as a key and mouse handler.
     54
     55        The GUIManager is a singleton and can be called anywhere when access on the GUI is needed.
     56        Creation of the GUIManager is therefore not possible and the cunstructor is private.
     57
     58        Since the GUI needs user input, the GUIManager implements the functions needed to act as a key and/or mouse handler.
     59        Those input events are then injected into CEGUI in Lua.
    5360    */
    5461    class _OrxonoxExport GUIManager
     
    5966// tolua_end
    6067    public:
     68        /**
     69        @enum State
     70            The current state of the GUIManager. There should maybe be more (or we can omit this totally).
     71        */
    6172        enum State
    6273        {
    63             Uninitialised,
    64             Ready,
    65             OnDisplay
     74            Uninitialised,  //!< Initial state of the GUIManager
     75            Ready,          //!< State after initialisation if ready
     76            OnDisplay       //!< State if GUI is displayed
    6677        };
    6778
     
    8495
    8596    private:
    86         GUIManager(const GUIManager& instance);
     97        GUIManager(const GUIManager& instance);                 //!< private constructor (this is a singleton class)
    8798
    8899        void loadLuaCode();
    89100
     101        // keyHandler functions
    90102        void keyPressed (const KeyEvent& evt)
    91         { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); }
     103            { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); }
    92104        void keyReleased(const KeyEvent& evt)
    93         { guiSystem_->injectKeyUp(evt.key); }
    94         void keyHeld    (const KeyEvent& evt)
    95         { }
     105            { guiSystem_->injectKeyUp(evt.key); }
     106        void keyHeld    (const KeyEvent& evt) { }
    96107
     108        // mouseHandler functions
    97109        void mouseButtonPressed (MouseButtonCode::ByEnum id);
    98110        void mouseButtonReleased(MouseButtonCode::ByEnum id);
    99         void mouseButtonHeld    (MouseButtonCode::ByEnum id)
    100         { }
     111        void mouseButtonHeld    (MouseButtonCode::ByEnum id) { }
    101112        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    102         { guiSystem_->injectMouseMove(rel.x, rel.y); }
     113            { guiSystem_->injectMouseMove(rel.x, rel.y); }
    103114        void mouseScrolled      (int abs, int rel)
    104         { guiSystem_->injectMouseWheelChange(rel);}
     115            { guiSystem_->injectMouseWheelChange(rel);}
    105116
    106         void updateInput(float dt) { }
    107         void updateKey(float dt) { }
    108         void updateMouse(float dt) { }
    109 
    110         Ogre::RenderWindow*       renderWindow_;
    111         CEGUI::OgreCEGUIRenderer* guiRenderer_;
    112         CEGUI::ResourceProvider*  resourceProvider_;
    113         CEGUI::LuaScriptModule*   scriptModule_;
    114         CEGUI::DefaultLogger*     ceguiLogger_;
    115         CEGUI::System*            guiSystem_;
    116         CEGUI::Imageset*          backgroundImage_;
    117         lua_State*                luaState_;
    118 
    119         State state_;
     117        void updateInput(float dt)  { }
     118        void updateKey  (float dt)  { }
     119        void updateMouse(float dt)  { }
    120120
    121121        static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
    122122
    123         static GUIManager*        singletonRef_s;
     123        Ogre::RenderWindow*         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
     124        CEGUI::OgreCEGUIRenderer*   guiRenderer_;       //!< CEGUI's interface to the Ogre Engine
     125        CEGUI::ResourceProvider*    resourceProvider_;  //!< CEGUI's resource provider
     126        CEGUI::LuaScriptModule*     scriptModule_;      //!< CEGUI's script module to use Lua
     127        CEGUI::DefaultLogger*       ceguiLogger_;       //!< CEGUI's logger to be able to log CEGUI errors in our log
     128        CEGUI::System*              guiSystem_;         //!< CEGUI's main system
     129        lua_State*                  luaState_;          //!< Lua state, access point to the Lua engine
     130
     131        State                       state_;             //!< reflects state of the GUIManager
     132
     133        static GUIManager*          singletonRef_s;     //!< Singleton reference to GUIManager
    124134    }; // tolua_export
    125135} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.