Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

GUI::Theme Class Reference

#include <theme.h>

Inherited by GUI::ThemeClassic, and GUI::ThemeModern.

List of all members.

Detailed Description

Our theme renderer class.

It is used to draw the different widgets and getting the layout of the widgets for different resolutions.

Definition at line 83 of file theme.h.

Public Types

enum  FontStyle {
  kFontStyleBold = 0, kFontStyleNormal = 1, kFontStyleItalic = 2, kFontStyleFixedNormal = 3,
  kFontStyleFixedBold = 4, kFontStyleFixedItalic = 5, kFontStyleMax
 Font style selector. More...
enum  kThemeImages { kImageLogo = 0 }
 Special image ids for images used in the GUI.
enum  ScrollbarState {
  kScrollbarStateNo, kScrollbarStateUp, kScrollbarStateDown, kScrollbarStateSlider,
enum  ShadingStyle { kShadingNone, kShadingDim, kShadingLuminance }
 Function used to process areas other than the current dialog. More...
enum  State { kStateDisabled, kStateEnabled, kStateHighlight }
 State of the widget to be drawn. More...
enum  TextAlign { kTextAlignLeft, kTextAlignCenter, kTextAlignRight }
 Defined the align of the text. More...
enum  WidgetBackground {
  kWidgetBackgroundNo, kWidgetBackgroundPlain, kWidgetBackgroundBorder, kWidgetBackgroundBorderSmall,
  kWidgetBackgroundEditText, kWidgetBackgroundSlider
 Widget background type. More...
typedef State WidgetStateInfo

Public Member Functions

virtual bool addDirtyRect (Common::Rect r, bool save=false, bool special=false)=0
virtual void clearAll ()=0
virtual void closeAllDialogs ()=0
TextAlign convertAligment (Graphics::TextAlignment align) const
Graphics::TextAlignment convertAligment (TextAlign align) const
virtual void deinit ()=0
virtual void disable ()=0
virtual void drawButton (const Common::Rect &r, const Common::String &str, WidgetStateInfo state=kStateEnabled, uint16 hints=0)=0
virtual void drawCaret (const Common::Rect &r, bool erase, WidgetStateInfo state=kStateEnabled)=0
virtual void drawChar (const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state=kStateEnabled)=0
virtual void drawCheckbox (const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state=kStateEnabled)=0
virtual void drawDialogBackground (const Common::Rect &r, uint16 hints, WidgetStateInfo state=kStateEnabled)=0
virtual void drawLineSeparator (const Common::Rect &r, WidgetStateInfo state=kStateEnabled)=0
virtual void drawPopUpWidget (const Common::Rect &r, const Common::String &sel, int deltax, WidgetStateInfo state=kStateEnabled, TextAlign align=kTextAlignLeft)=0
virtual void drawScrollbar (const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, WidgetStateInfo state=kStateEnabled)=0
virtual void drawSlider (const Common::Rect &r, int width, WidgetStateInfo state=kStateEnabled)=0
virtual void drawSurface (const Common::Rect &r, const Graphics::Surface &surface, WidgetStateInfo state=kStateEnabled, int alpha=256, bool themeTrans=false)=0
virtual void drawTab (const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array< Common::String > &tabs, int active, uint16 hints, int titleVPad, WidgetStateInfo state=kStateEnabled)=0
virtual void drawText (const Common::Rect &r, const Common::String &str, WidgetStateInfo state=kStateEnabled, TextAlign align=kTextAlignCenter, bool inverted=false, int deltax=0, bool useEllipsis=true, FontStyle font=kFontStyleBold)=0
virtual void drawWidgetBackground (const Common::Rect &r, uint16 hints, WidgetBackground background=kWidgetBackgroundPlain, WidgetStateInfo state=kStateEnabled)=0
virtual void enable ()=0
virtual int getCharWidth (byte c, FontStyle font=kFontStyleBold) const =0
virtual const Common::ConfigFilegetConfigFile () const
virtual const Graphics::FontgetFont (FontStyle font=kFontStyleBold) const =0
virtual int getFontHeight (FontStyle font=kFontStyleBold) const =0
virtual const Graphics::SurfacegetImageSurface (const kThemeImages n) const
virtual int getStringWidth (const Common::String &str, FontStyle font=kFontStyleBold) const =0
const Common::StringgetStylefileName () const
virtual int getTabPadding () const =0
virtual int getTabSpacing () const =0
const Common::StringgetThemeName () const
virtual bool init ()=0
bool isThemeLoadingRequired ()
void loadTheme (Common::ConfigFile &config, bool reset, bool doBackendSpecificPostProcessing)
void loadTheme (Common::ConfigFile &config, bool reset=true)
bool needThemeReload ()
virtual void openDialog (bool topDialog)=0
virtual bool ownCursor () const
void processResSection (Common::ConfigFile &config, const Common::String &name, bool skipDefs=false, const Common::String &prefix="")
void processSingleLine (const Common::String &section, const Common::String &prefix, const Common::String &name, const Common::String &str)
virtual void refresh ()=0
virtual void resetDrawArea ()=0
virtual void restoreBackground (Common::Rect r, bool special=false)=0
bool sectionIsSkipped (Common::ConfigFile &config, const char *name, int w, int h)
virtual void setDrawArea (const Common::Rect &r)
void setSpecialAlias (const Common::String &alias, const Common::String &name)
virtual bool supportsImages () const
virtual void updateScreen ()=0

Static Public Member Functions

static bool themeConfigUseable (const Common::String &file, const Common::String &style="", Common::String *cStyle=0, Common::ConfigFile *cfg=0)

Public Attributes

Eval * _evaluator

Protected Member Functions

Common::String genCacheFilename (const char *filename)
void getColorFromConfig (const Common::String &value, uint8 &r, uint8 &g, uint8 &b)
void getColorFromConfig (const Common::String &name, OverlayColor &col)
bool loadConfigFile (const Common::String &file)
const Graphics::FontloadFont (const char *filename)

Protected Attributes

Common::ConfigFile _configFile
Common::ConfigFile _defaultConfig
Common::Rect _drawArea
Common::String _stylefile
Common::String _stylename

Private Attributes

int _loadedThemeX
int _loadedThemeY

Static Private Attributes

static const char * _defaultConfigINI

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index