00001 /* 00002 * GUI manager header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_GUI_MANAGER_H__ 00009 #define __SP_GUI_MANAGER_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #ifdef SP_COMPILE_WITH_GUI 00015 00016 00017 #include "RenderSystem/spRenderSystem.hpp" 00018 #include "GUI/spGUIWindow.hpp" 00019 00020 00021 namespace sp 00022 { 00023 namespace gui 00024 { 00025 00026 00031 class SP_EXPORT GUIManager 00032 { 00033 00034 public: 00035 00036 GUIManager(); 00037 ~GUIManager(); 00038 00040 io::stringc getVersion() const; 00041 00043 void update(); 00044 00045 GUIWindow* addWindow(const dim::point2di &Position, const dim::size2di &Size, const io::stringc &Title, s32 Flags = 0); 00046 void removeWindow(GUIWindow* Window); 00047 00048 /* Inline functions */ 00049 00050 inline void setEventCallback(const GUIEventCallback &Callback) 00051 { 00052 EventCallback_ = Callback; 00053 } 00054 00056 inline video::Texture* getInterfaceTexture() const 00057 { 00058 return TexInterface_; 00059 } 00060 00061 private: 00062 00063 friend class GUIBaseObject; 00064 friend class GUIController; 00065 friend class GUIWindow; 00066 friend class GUIMenuItem; 00067 friend class GUIScrollbarGadget; 00068 friend class GUIStringGadget; 00069 friend class GUITrackbarGadget; 00070 friend class GUITreeGadget; 00071 friend class GUIListGadget; 00072 friend class GUIWebGadget; 00073 00074 /* === Functions === */ 00075 00076 void createHatchedFace(); 00077 void createArrowTex(); 00078 00079 void addController(GUIController* Controller, bool isParent); 00080 void removeController(GUIController* Controller, bool isParent); 00081 void removeParentController(GUIController* Controller); 00082 00083 /* === Members === */ 00084 00085 std::list<GUIController*> ControllerList_, ParentControllerList_; 00086 00087 video::Texture* TexInterface_; 00088 GUIEventCallback EventCallback_; 00089 00090 GUIController* FocusedController_; 00091 bool FocusUsing_; 00092 00093 dim::point2di CursorPos_, CursorSpeed_; 00094 s32 MouseWheel_; 00095 u64 Time_; 00096 io::stringc InputStr_; 00097 00098 video::Texture* HatchedFace_; 00099 video::Texture* ArrowTex_; 00100 00101 }; 00102 00103 00104 } // /namespace gui 00105 00106 } // /namespace sp 00107 00108 00109 #endif 00110 00111 #endif 00112 00113 00114 00115 // ================================================================================