[Scummvm-cvs-logs] SF.net SVN: scummvm:[35544] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Dec 26 00:55:37 CET 2008


Revision: 35544
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35544&view=rev
Author:   fingolfin
Date:     2008-12-25 23:55:36 +0000 (Thu, 25 Dec 2008)

Log Message:
-----------
Renamed NewGui to GuiManager

Modified Paths:
--------------
    scummvm/trunk/base/main.cpp
    scummvm/trunk/engines/scumm/dialogs.cpp
    scummvm/trunk/engines/scumm/input.cpp
    scummvm/trunk/gui/dialog.cpp
    scummvm/trunk/gui/dialog.h
    scummvm/trunk/gui/newgui.cpp
    scummvm/trunk/gui/newgui.h
    scummvm/trunk/gui/widget.cpp

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/base/main.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -74,7 +74,7 @@
 	// a --gui-theme option, to allow that option to be working, we need to initialize
 	// GUI here.
 	// FIXME: Find a nicer way to allow --gui-theme to be working
-	GUI::NewGui::instance();
+	GUI::GuiManager::instance();
 
 	// Discard any command line options. Those that affect the graphics
 	// mode and the others (like bootparam etc.) should not
@@ -341,7 +341,7 @@
 	PluginManager::destroy();
 	Common::ConfigManager::destroy();
 	Common::SearchManager::destroy();
-	GUI::NewGui::destroy();
+	GUI::GuiManager::destroy();
 
 	return 0;
 }

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -22,8 +22,6 @@
  * $Id$
  */
 
-
-
 #include "common/config-manager.h"
 #include "common/savefile.h"
 #include "common/system.h"

Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/engines/scumm/input.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -23,8 +23,6 @@
  *
  */
 
-
-
 #include "common/config-manager.h"
 #include "common/events.h"
 #include "common/system.h"
@@ -471,7 +469,7 @@
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
 
-		scummMenuDialog();		// Display NewGui
+		scummMenuDialog();		// Display GUI
 
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, 0);

Modified: scummvm/trunk/gui/dialog.cpp
===================================================================
--- scummvm/trunk/gui/dialog.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/gui/dialog.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -131,7 +131,7 @@
 	// Update: called on tab drawing, mainly...
 	// we can pass this as open a new dialog or something
 //	g_gui._needRedraw = true;
-	g_gui._redrawStatus = GUI::NewGui::kRedrawTopDialog;
+	g_gui._redrawStatus = GUI::GuiManager::kRedrawTopDialog;
 }
 
 void Dialog::drawDialog() {

Modified: scummvm/trunk/gui/dialog.h
===================================================================
--- scummvm/trunk/gui/dialog.h	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/gui/dialog.h	2008-12-25 23:55:36 UTC (rev 35544)
@@ -33,7 +33,7 @@
 
 namespace GUI {
 
-class NewGui;
+class GuiManager;
 class PopUpWidget;
 
 // Some "common" commands sent to handleCommand()
@@ -42,7 +42,7 @@
 };
 
 class Dialog : public GuiObject {
-	friend class NewGui;
+	friend class GuiManager;
 protected:
 	Widget	*_mouseWidget;
 	Widget  *_focusedWidget;

Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/gui/newgui.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -34,29 +34,17 @@
 
 #include "common/config-manager.h"
 
-DECLARE_SINGLETON(GUI::NewGui);
+DECLARE_SINGLETON(GUI::GuiManager);
 
 namespace GUI {
 
-/*
- * TODO list
- * - add more widgets: edit field, popup, radio buttons, ...
- *
- * Other ideas:
- * - allow multi line (l/c/r aligned) text via StaticTextWidget ?
- * - add "close" widget to all dialogs (with a flag to turn it off) ?
- * - make dialogs "moveable" ?
- * - come up with a new look & feel / theme for the GUI
- * - ...
- */
-
 enum {
 	kDoubleClickDelay = 500, // milliseconds
 	kCursorAnimateDelay = 250
 };
 
 // Constructor
-NewGui::NewGui() : _redrawStatus(kRedrawDisabled),
+GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled),
 	_stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) {
 	_theme = 0;
 	_useStdCursor = false;
@@ -80,11 +68,11 @@
 	_themeChange = false;
 }
 
-NewGui::~NewGui() {
+GuiManager::~GuiManager() {
 	delete _theme;
 }
 
-bool NewGui::loadNewTheme(Common::String filename, ThemeEngine::GraphicsMode gfx) {
+bool GuiManager::loadNewTheme(Common::String filename, ThemeEngine::GraphicsMode gfx) {
 	if (_theme && filename == _theme->getThemeFileName() && gfx == _theme->getGraphicsMode())
 		return true;
 
@@ -117,7 +105,7 @@
 	return true;
 }
 
-void NewGui::redraw() {
+void GuiManager::redraw() {
 	int i;
 
 	if (_redrawStatus == kRedrawDisabled)
@@ -154,13 +142,13 @@
 	_redrawStatus = kRedrawDisabled;
 }
 
-Dialog *NewGui::getTopDialog() const {
+Dialog *GuiManager::getTopDialog() const {
 	if (_dialogStack.empty())
 		return 0;
 	return _dialogStack.top();
 }
 
-void NewGui::runLoop() {
+void GuiManager::runLoop() {
 	Dialog *activeDialog = getTopDialog();
 	bool didSaveState = false;
 	int button;
@@ -294,7 +282,7 @@
 
 #pragma mark -
 
-void NewGui::saveState() {
+void GuiManager::saveState() {
 	// Backup old cursor
 	_lastClick.x = _lastClick.y = 0;
 	_lastClick.time = 0;
@@ -303,7 +291,7 @@
 	_stateIsSaved = true;
 }
 
-void NewGui::restoreState() {
+void GuiManager::restoreState() {
 	if (_useStdCursor) {
 		CursorMan.popCursor();
 		CursorMan.popCursorPalette();
@@ -314,7 +302,7 @@
 	_stateIsSaved = false;
 }
 
-void NewGui::openDialog(Dialog *dialog) {
+void GuiManager::openDialog(Dialog *dialog) {
 	_dialogStack.push(dialog);
 	_redrawStatus = kRedrawOpenDialog;
 
@@ -336,7 +324,7 @@
 	}
 }
 
-void NewGui::closeTopDialog() {
+void GuiManager::closeTopDialog() {
 	// Don't do anything if no dialog is open
 	if (_dialogStack.empty())
 		return;
@@ -346,7 +334,7 @@
 	_redrawStatus = kRedrawCloseDialog;
 }
 
-void NewGui::setupCursor() {
+void GuiManager::setupCursor() {
 	const byte palette[] = {
 		255, 255, 255, 0,
 		255, 255, 255, 0,
@@ -363,7 +351,7 @@
 // SCUMM games, but the code no longer resembles what we have in cursor.cpp
 // very much. We could plug in a different cursor here if we like to.
 
-void NewGui::animateCursor() {
+void GuiManager::animateCursor() {
 	int time = _system->getMillis();
 	if (time > _cursorAnimateTimer + kCursorAnimateDelay) {
 		for (int i = 0; i < 15; i++) {
@@ -380,12 +368,12 @@
 	}
 }
 
-void NewGui::clearDragWidget() {
+void GuiManager::clearDragWidget() {
 	if (!_dialogStack.empty())
 		_dialogStack.top()->_dragWidget = 0;
 }
 
-void NewGui::screenChange() {
+void GuiManager::screenChange() {
 	_lastScreenChangeID = _system->getScreenChangeID();
 
 	// reinit the whole theme

Modified: scummvm/trunk/gui/newgui.h
===================================================================
--- scummvm/trunk/gui/newgui.h	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/gui/newgui.h	2008-12-25 23:55:36 UTC (rev 35544)
@@ -43,7 +43,7 @@
 class Eval;
 class ThemeEval;
 
-#define g_gui	(GUI::NewGui::instance())
+#define g_gui	(GUI::GuiManager::instance())
 
 
 // Height of a single text line
@@ -59,11 +59,11 @@
 /**
  * GUI manager singleton.
  */
-class NewGui : public Common::Singleton<NewGui> {
+class GuiManager : public Common::Singleton<GuiManager> {
 	friend class Dialog;
 	friend class Common::Singleton<SingletonBaseType>;
-	NewGui();
-	~NewGui();
+	GuiManager();
+	~GuiManager();
 public:
 
 	// Main entry for the GUI: this will start an event loop that keeps running

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2008-12-25 20:53:59 UTC (rev 35543)
+++ scummvm/trunk/gui/widget.cpp	2008-12-25 23:55:36 UTC (rev 35544)
@@ -83,8 +83,6 @@
 }
 
 void Widget::draw() {
-	NewGui *gui = &g_gui;
-
 	if (!isVisible() || !_boss->isVisible())
 		return;
 
@@ -96,7 +94,7 @@
 
 	// Draw border
 	if (_flags & WIDGET_BORDER) {
-		gui->theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, ThemeEngine::kWidgetBackgroundBorder);
+		g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, ThemeEngine::kWidgetBackgroundBorder);
 		_x += 4;
 		_y += 4;
 		_w -= 8;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list