[Scummvm-cvs-logs] SF.net SVN: scummvm:[34951] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Nov 9 13:38:31 CET 2008
Revision: 34951
http://scummvm.svn.sourceforge.net/scummvm/?rev=34951&view=rev
Author: fingolfin
Date: 2008-11-09 12:38:30 +0000 (Sun, 09 Nov 2008)
Log Message:
-----------
Partially merge classes Theme and ThemeEngine (saves another couple KB), somebody (Tanoku?) should do a proper merge
Modified Paths:
--------------
scummvm/trunk/gui/ThemeEngine.h
scummvm/trunk/gui/newgui.h
scummvm/trunk/gui/theme.cpp
scummvm/trunk/gui/theme.h
Modified: scummvm/trunk/gui/ThemeEngine.h
===================================================================
--- scummvm/trunk/gui/ThemeEngine.h 2008-11-09 12:37:19 UTC (rev 34950)
+++ scummvm/trunk/gui/ThemeEngine.h 2008-11-09 12:38:30 UTC (rev 34951)
@@ -559,6 +559,10 @@
void debugWidgetPosition(const char *name, const Common::Rect &r);
+ const Graphics::Font *loadFont(const Common::String &filename);
+ const Graphics::Font *loadFontFromArchive(const Common::String &filename);
+ Common::String genCacheFilename(const char *filename);
+
public:
/**
* Default values from GUI::Theme
Modified: scummvm/trunk/gui/newgui.h
===================================================================
--- scummvm/trunk/gui/newgui.h 2008-11-09 12:37:19 UTC (rev 34950)
+++ scummvm/trunk/gui/newgui.h 2008-11-09 12:38:30 UTC (rev 34951)
@@ -79,7 +79,7 @@
bool isActive() const { return ! _dialogStack.empty(); }
bool loadNewTheme(Common::String file, ThemeEngine::GraphicsMode gfx = ThemeEngine::kGfxDisabled);
- Theme *theme() { return _theme; }
+ ThemeEngine *theme() { return _theme; }
ThemeEval *xmlEval() { return _theme->getEvaluator(); }
@@ -105,7 +105,7 @@
protected:
OSystem *_system;
- Theme *_theme;
+ ThemeEngine *_theme;
// bool _needRedraw;
RedrawStatus _redrawStatus;
Modified: scummvm/trunk/gui/theme.cpp
===================================================================
--- scummvm/trunk/gui/theme.cpp 2008-11-09 12:37:19 UTC (rev 34950)
+++ scummvm/trunk/gui/theme.cpp 2008-11-09 12:38:30 UTC (rev 34951)
@@ -27,13 +27,15 @@
#include "common/archive.h"
#include "common/unzip.h"
+#include "gui/ThemeEngine.h"
+
namespace GUI {
Theme::Theme() : _loadedThemeX(0), _loadedThemeY(0) {}
Theme::~Theme() {}
-const Graphics::Font *Theme::loadFontFromArchive(const Common::String &filename) {
+const Graphics::Font *ThemeEngine::loadFontFromArchive(const Common::String &filename) {
Common::Archive *arch = 0;
const Graphics::NewFont *font = 0;
@@ -65,7 +67,7 @@
return font;
}
-const Graphics::Font *Theme::loadFont(const Common::String &filename) {
+const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename) {
const Graphics::Font *font = 0;
Common::String cacheFilename = genCacheFilename(filename.c_str());
Common::File fontFile;
@@ -101,7 +103,7 @@
return font;
}
-Common::String Theme::genCacheFilename(const char *filename) {
+Common::String ThemeEngine::genCacheFilename(const char *filename) {
Common::String cacheName(filename);
for (int i = cacheName.size() - 1; i >= 0; --i) {
if (cacheName[i] == '.') {
Modified: scummvm/trunk/gui/theme.h
===================================================================
--- scummvm/trunk/gui/theme.h 2008-11-09 12:37:19 UTC (rev 34950)
+++ scummvm/trunk/gui/theme.h 2008-11-09 12:38:30 UTC (rev 34951)
@@ -133,25 +133,25 @@
*
* @see deinit
*/
- virtual bool init() = 0;
+// virtual bool init() = 0;
/**
* Unloads all data used by the theme renderer.
*/
- virtual void deinit() = 0;
+// virtual void deinit() = 0;
/**
* Updates the renderer to changes to resolution,
* bit depth and other video related configuration.
*/
- virtual void refresh() = 0;
+// virtual void refresh() = 0;
/**
* Checks if the theme supplies its own cursor.
*
* @return true if using an own cursor
*/
- virtual bool ownCursor() const { return false; }
+// virtual bool ownCursor() const { return false; }
/**
* Enables the theme renderer for use.
@@ -171,7 +171,7 @@
* @see disable
* @see init
*/
- virtual void enable() = 0;
+// virtual void enable() = 0;
/**
* Disables the theme renderer.
@@ -186,7 +186,7 @@
* @see enable
* @see uninit
*/
- virtual void disable() = 0;
+// virtual void disable() = 0;
/**
* Tells the theme renderer that a new dialog is opened.
@@ -205,14 +205,14 @@
*
* @see closeAllDialogs
*/
- virtual void openDialog(bool topDialog, ShadingStyle shading = kShadingNone) = 0;
+// virtual void openDialog(bool topDialog, ShadingStyle shading = kShadingNone) = 0;
/**
* This indicates that all dialogs have been closed.
*
* @see openDialog
*/
- virtual void closeAllDialogs() = 0;
+// virtual void closeAllDialogs() = 0;
/**
* Closes the topmost dialog, and redraws the screen
@@ -226,13 +226,13 @@
* the dialog, we return false, which means we need to redraw
* the dialog stack from scratch.
*/
- virtual void startBuffering() = 0;
- virtual void finishBuffering() = 0;
+// virtual void startBuffering() = 0;
+// virtual void finishBuffering() = 0;
/**
* Clear the complete GUI screen.
*/
- virtual void clearAll() = 0;
+// virtual void clearAll() = 0;
/**
* Update the GUI screen aka overlay.
@@ -240,8 +240,9 @@
* This does NOT call OSystem::updateScreen,
* it just copies all (changed) data to the overlay.
*/
- virtual void updateScreen() = 0;
+// virtual void updateScreen() = 0;
+/*
virtual const Graphics::Font *getFont(FontStyle font = kFontStyleBold) const = 0;
virtual int getFontHeight(FontStyle font = kFontStyleBold) const = 0;
virtual int getStringWidth(const Common::String &str, FontStyle font = kFontStyleBold) const = 0;
@@ -268,7 +269,7 @@
virtual int getTabSpacing() const = 0;
virtual int getTabPadding() const = 0;
-
+*/
Graphics::TextAlignment convertAligment(TextAlign align) const {
switch (align) {
case kTextAlignLeft:
@@ -303,14 +304,14 @@
bool isThemeLoadingRequired();
- virtual ThemeEval *getEvaluator() = 0;
+// virtual ThemeEval *getEvaluator() = 0;
static bool themeConfigUseable(const Common::FSNode &node, Common::String &themeName);
static bool themeConfigParseHeader(Common::String header, Common::String &themeName);
- virtual const Common::String &getThemeFileName() const = 0;
- virtual const Common::String &getThemeName() const = 0;
- virtual int getGraphicsMode() const = 0;
+// virtual const Common::String &getThemeFileName() const = 0;
+// virtual const Common::String &getThemeName() const = 0;
+// virtual int getGraphicsMode() const = 0;
/**
* Checks if the theme renderer supports drawing of images.
@@ -335,11 +336,6 @@
*/
virtual const Graphics::Surface *getImageSurface(const kThemeImages n) const { return 0; }
-protected:
- const Graphics::Font *loadFont(const Common::String &filename);
- const Graphics::Font *loadFontFromArchive(const Common::String &filename);
- Common::String genCacheFilename(const char *filename);
-
public:
bool needThemeReload() { return ((_loadedThemeX != g_system->getOverlayWidth()) ||
(_loadedThemeY != g_system->getOverlayHeight())); }
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