diff options
author | Max Horn | 2003-11-02 02:18:16 +0000 |
---|---|---|
committer | Max Horn | 2003-11-02 02:18:16 +0000 |
commit | b27a871f870df854a6db0f4530d4596483927bb1 (patch) | |
tree | f6c75300cd5dcd22b67044256e36a01f985a054d /gui/newgui.h | |
parent | f2c4bbbdbfb06b5296eb3fcdcb7235292e6ac039 (diff) | |
download | scummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.tar.gz scummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.tar.bz2 scummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.zip |
turned NewGui into a singleton, and made OSystem a pseudo-singleton; added Widget::findWidget (preparing to add support for nested widgets, for the tab widget)
svn-id: r11045
Diffstat (limited to 'gui/newgui.h')
-rw-r--r-- | gui/newgui.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gui/newgui.h b/gui/newgui.h index b610825b3d..7cec44d567 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -22,14 +22,18 @@ #define NEWGUI_H #include "common/scummsys.h" -#include "common/system.h" // For events +#include "common/singleton.h" #include "common/str.h" +#include "common/system.h" // For events class Dialog; #define hLine(x, y, x2, color) line(x, y, x2, y, color); #define vLine(x, y, y2, color) line(x, y, x, y2, color); +#define g_gui (NewGui::instance()) + + // Height of a single text line enum { kLineHeight = 11 @@ -60,9 +64,11 @@ public: }; // This class hopefully will replace the old Gui class completly one day -class NewGui { - friend class Dialog; +class NewGui : public Common::Singleton<NewGui> { typedef Common::String String; + friend class Dialog; + friend class Common::Singleton<NewGui>; + NewGui(); public: // Main entry for the GUI: this will start an event loop that keeps running @@ -71,8 +77,6 @@ public: bool isActive() { return ! _dialogStack.empty(); } - NewGui(OSystem *system); - protected: OSystem *_system; NewGuiColor *_screen; @@ -122,9 +126,6 @@ public: NewGuiColor _textcolor; NewGuiColor _textcolorhi; - // Misc util - uint32 get_time() const { return _system->get_msecs(); } - // Drawing primitives NewGuiColor *getBasePtr(int x, int y); void box(int x, int y, int width, int height, bool inverted = false); |