[Scummvm-cvs-logs] SF.net SVN: scummvm: [33011] scummvm/branches/gsoc2008-gui/gui

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Sat Jul 12 03:59:33 CEST 2008


Revision: 33011
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33011&view=rev
Author:   Tanoku
Date:     2008-07-11 18:59:33 -0700 (Fri, 11 Jul 2008)

Log Message:
-----------
Debug widgets.
Added dialog backgrounds.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp	2008-07-11 20:28:50 UTC (rev 33010)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp	2008-07-12 01:59:33 UTC (rev 33011)
@@ -49,6 +49,10 @@
 	"<drawdata id = 'mainmenu_bg' cache = false>"
 		"<drawstep func = 'fill' fill = 'gradient' gradient_start = '214, 113, 8' gradient_end = '240, 200, 25' />"
 	"</drawdata>"
+	
+	"<drawdata id = 'default_bg' cache = false>"
+	"<drawstep func = 'roundedsq' radius = 12 stroke = 8 fg_color = '0, 0, 0' fill = 'gradient' gradient_start = '255, 231, 140' gradient_end = '255, 243, 206' shadow = 3 size = 'auto' />"
+	"</drawdata>"
 
 	"<drawdata id = 'button_idle' cache = false>"
 		"<text vertical_align = 'center' horizontal_align = 'center' color = '255, 255, 255' />"

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-07-11 20:28:50 UTC (rev 33010)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-07-12 01:59:33 UTC (rev 33011)
@@ -305,7 +305,7 @@
 	drawDDText(dd, r, str);	
 
 	addDirtyRect(r);
-	debugWidgetPosition(r);
+	debugWidgetPosition("BTN", r);
 }
 
 void ThemeRenderer::drawLineSeparator(const Common::Rect &r, WidgetStateInfo state) {
@@ -315,7 +315,7 @@
 	drawDD(kDDSeparator, r);
 	addDirtyRect(r);
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Separator", r);
 }
 
 void ThemeRenderer::drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
@@ -336,7 +336,7 @@
 	drawDDText(checked ? kDDCheckboxEnabled : kDDCheckboxDisabled, r2, str);
 
 	addDirtyRect(r);
-	debugWidgetPosition(r);
+	debugWidgetPosition("Checkbox", r);
 }
 
 void ThemeRenderer::drawSlider(const Common::Rect &r, int width, WidgetStateInfo state) {
@@ -351,68 +351,70 @@
 	drawDD(kDDSliderFull, r2);
 
 	addDirtyRect(r);
-	debugWidgetPosition(r);
+	debugWidgetPosition("Slider", r);
 }
 
 void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState sb_state, WidgetStateInfo state) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("SCB", r);
 }
 
 void ThemeRenderer::drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state) {
 	if (!ready())
 		return;
 		
-	if (hints & THEME_HINT_MAIN_DIALOG)
+	if (hints & THEME_HINT_MAIN_DIALOG) {
 		drawDD(kDDMainDialogBackground, r);
-	else if (hints & THEME_HINT_SPECIAL_COLOR) 
+	} else if (hints & THEME_HINT_SPECIAL_COLOR) { 
 		drawDD(kDDSpecialColorBackground, r);
-	else if (hints & THEME_HINT_PLAIN_COLOR)
+	} else if (hints & THEME_HINT_PLAIN_COLOR) {
 		drawDD(kDDPlainColorBackground, r);	
-	else
+	} else {
 		drawDD(kDDDefaultBackground, r);
+	}
 	
-	debugWidgetPosition(r);
+	debugWidgetPosition("Background", r);
 }
 
 void ThemeRenderer::drawCaret(const Common::Rect &r, bool erase, WidgetStateInfo state) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Caret", r);
 }
 
 void ThemeRenderer::drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, WidgetStateInfo state, TextAlign align) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Popup Widget", r);
 }
 
 void ThemeRenderer::drawSurface(const Common::Rect &r, const Graphics::Surface &surface, WidgetStateInfo state, int alpha, bool themeTrans) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Surface", r);
 }
 
 void ThemeRenderer::drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, WidgetStateInfo state) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Widget Background", r);
 }
 
 void ThemeRenderer::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state) {
 	if (!ready())
 		return;
 
-	debugWidgetPosition(r);
+	debugWidgetPosition("Tab widget", r);
 }
 
-void ThemeRenderer::debugWidgetPosition(const Common::Rect &r) {
+void ThemeRenderer::debugWidgetPosition(const char *name, const Common::Rect &r) {
+	_font->drawString(_screen, name, r.left, r.top, r.width(), 0xFFFF, Graphics::kTextAlignLeft, 0, true);
 	_screen->hLine(r.left, r.top, r.right, 0xFFFF);
 	_screen->hLine(r.left, r.bottom, r.right, 0xFFFF);
 	_screen->vLine(r.left, r.top, r.bottom, 0xFFFF);

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h	2008-07-11 20:28:50 UTC (rev 33010)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h	2008-07-12 01:59:33 UTC (rev 33011)
@@ -239,7 +239,7 @@
 
 	inline void drawDD(DrawData type, const Common::Rect &r);
 	inline void drawDDText(DrawData type, const Common::Rect &r, const Common::String &text);
-	inline void debugWidgetPosition(const Common::Rect &r);
+	inline void debugWidgetPosition(const char *name, const Common::Rect &r);
 
 	// TODO
 	void restoreBackground(Common::Rect r, bool special = false) {}


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