[Scummvm-cvs-logs] scummvm master -> beedcaf28ee83411d75fb159703823ab1ebe7925

dreammaster dreammaster at scummvm.org
Sat Jun 20 19:46:55 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
beedcaf28e SHERLOCK: RT: Create WidgetSceneTooltip descendant tooltip class


Commit: beedcaf28ee83411d75fb159703823ab1ebe7925
    https://github.com/scummvm/scummvm/commit/beedcaf28ee83411d75fb159703823ab1ebe7925
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-20T13:46:02-04:00

Commit Message:
SHERLOCK: RT: Create WidgetSceneTooltip descendant tooltip class

Changed paths:
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/tattoo_user_interface.h
    engines/sherlock/tattoo/widget_base.h
    engines/sherlock/tattoo/widget_tooltip.cpp
    engines/sherlock/tattoo/widget_tooltip.h



diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 7c408c8..d7de2de 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -611,7 +611,7 @@ void TattooUserInterface::displayObjectNames() {
 		}
 	}
 
-	_tooltipWidget.execute();
+	_tooltipWidget.handleEvents();
 	_oldArrowZone = _arrowZone;
 }
 
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h
index ae64791..35e1cb8 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.h
+++ b/engines/sherlock/tattoo/tattoo_user_interface.h
@@ -57,7 +57,7 @@ private:
 	int _cAnimFramePause;
 	WidgetInventory _inventoryWidget;
 	WidgetText _textWidget;
-	WidgetTooltip _tooltipWidget;
+	WidgetSceneTooltip _tooltipWidget;
 	WidgetVerbs _verbsWidget;
 	WidgetBase *_widget;
 private:
diff --git a/engines/sherlock/tattoo/widget_base.h b/engines/sherlock/tattoo/widget_base.h
index 5a16ab6..4b7ae2e 100644
--- a/engines/sherlock/tattoo/widget_base.h
+++ b/engines/sherlock/tattoo/widget_base.h
@@ -67,6 +67,11 @@ public:
 	 * Close a currently active menu
 	 */
 	virtual void banishWindow();
+
+	/**
+	 * Handle event processing
+	 */
+	virtual void handleEvents() {}
 };
 
 } // End of namespace Tattoo
diff --git a/engines/sherlock/tattoo/widget_tooltip.cpp b/engines/sherlock/tattoo/widget_tooltip.cpp
index 69bfd14..2e55d4b 100644
--- a/engines/sherlock/tattoo/widget_tooltip.cpp
+++ b/engines/sherlock/tattoo/widget_tooltip.cpp
@@ -117,7 +117,41 @@ void WidgetTooltip::setText(const Common::String &str) {
 	}
 }
 
-void WidgetTooltip::execute() {
+void WidgetTooltip::draw() {
+	Screen &screen = *_vm->_screen;
+
+	if (!_surface.empty())
+		screen._backBuffer1.transBlitFrom(_surface, Common::Point(_bounds.left, _bounds.top));
+}
+
+void WidgetTooltip::erase() {
+	Screen &screen = *_vm->_screen;
+	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+
+	if (_bounds.width() > 0) {
+		screen.slamArea(_oldBounds.left - ui._currentScroll.x, _oldBounds.top, _oldBounds.width(), _oldBounds.height());
+
+		// If there's no text actually being displayed, then reset bounds so we don't keep restoring the area
+		if (_surface.empty()) {
+			_bounds.left = _bounds.top = _bounds.right = _bounds.bottom = 0;
+			_oldBounds.left = _oldBounds.top = _oldBounds.right = _oldBounds.bottom = 0;
+		}
+	}
+
+	if (!_surface.empty())
+		screen.slamArea(_bounds.left - ui._currentScroll.x, _bounds.top, _bounds.width(), _bounds.height());
+}
+
+void WidgetTooltip::erasePrevious() {
+	Screen &screen = *_vm->_screen;
+	if (_oldBounds.width() > 0)
+		screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(_oldBounds.left, _oldBounds.top),
+		_oldBounds);
+}
+
+/*----------------------------------------------------------------*/
+
+void WidgetSceneTooltip::handleEvents() {
 	Events &events = *_vm->_events;
 	People &people = *_vm->_people;
 	Scene &scene = *_vm->_scene;
@@ -168,38 +202,6 @@ void WidgetTooltip::execute() {
 	ui._oldArrowZone = ui._arrowZone;
 }
 
-void WidgetTooltip::draw() {
-	Screen &screen = *_vm->_screen;
-
-	if (!_surface.empty())
-		screen._backBuffer1.transBlitFrom(_surface, Common::Point(_bounds.left, _bounds.top));
-}
-
-void WidgetTooltip::erase() {
-	Screen &screen = *_vm->_screen;
-	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
-
-	if (_bounds.width() > 0) {
-		screen.slamArea(_oldBounds.left - ui._currentScroll.x, _oldBounds.top, _oldBounds.width(), _oldBounds.height());
-
-		// If there's no text actually being displayed, then reset bounds so we don't keep restoring the area
-		if (_surface.empty()) {
-			_bounds.left = _bounds.top = _bounds.right = _bounds.bottom = 0;
-			_oldBounds.left = _oldBounds.top = _oldBounds.right = _oldBounds.bottom = 0;
-		}
-	}
-
-	if (!_surface.empty())
-		screen.slamArea(_bounds.left - ui._currentScroll.x, _bounds.top, _bounds.width(), _bounds.height());
-}
-
-void WidgetTooltip::erasePrevious() {
-	Screen &screen = *_vm->_screen;
-	if (_oldBounds.width() > 0)
-		screen._backBuffer1.blitFrom(screen._backBuffer2, Common::Point(_oldBounds.left, _oldBounds.top),
-		_oldBounds);
-}
-
 } // End of namespace Tattoo
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/widget_tooltip.h b/engines/sherlock/tattoo/widget_tooltip.h
index ff1795d..ae93f15 100644
--- a/engines/sherlock/tattoo/widget_tooltip.h
+++ b/engines/sherlock/tattoo/widget_tooltip.h
@@ -44,11 +44,6 @@ public:
 	void setText(const Common::String &str);
 
 	/**
-	 * Handle updating the tooltip state
-	 */
-	void execute();
-
-	/**
 	 * Draw the tooltip if necessary
 	 */
 	void draw();
@@ -64,6 +59,16 @@ public:
 	void erasePrevious();
 };
 
+class WidgetSceneTooltip : public WidgetTooltip {
+public:
+	WidgetSceneTooltip(SherlockEngine *vm) : WidgetTooltip(vm) {}
+
+	/**
+	 * Handle updating the tooltip state
+	 */
+	virtual void handleEvents();
+};
+
 } // End of namespace Tattoo
 
 } // End of namespace Sherlock






More information about the Scummvm-git-logs mailing list