ScummVM API documentation
GUI::ThemeParser Class Reference
Inheritance diagram for GUI::ThemeParser:
Common::XMLParser

Classes

struct  PaletteColor
 

Public Member Functions

 ThemeParser (ThemeEngine *parent)
 
void setBaseResolution (int w, int h, float s)
 
bool getPaletteColor (const Common::String &name, int &r, int &g, int &b)
 
- Public Member Functions inherited from Common::XMLParser
 XMLParser ()
 
ParserNodeallocNode ()
 
void freeNode (ParserNode *node)
 
bool loadFile (const Path &filename)
 
bool loadFile (const FSNode &node)
 
bool loadBuffer (const byte *buffer, uint32 size, DisposeAfterUse::Flag disposable=DisposeAfterUse::NO)
 
bool loadStream (SeekableReadStream *stream)
 
void close ()
 
bool parse ()
 
ParserNodegetActiveNode ()
 
ParserNodegetParentNode (ParserNode *child)
 
void setAllowText ()
 

Protected Member Functions

 CUSTOM_XML_PARSER (ThemeParser)
 
 PARSER_END () bool parserCallback_render_info(ParserNode *node)
 
bool parserCallback_defaults (ParserNode *node)
 
bool parserCallback_font (ParserNode *node)
 
bool parserCallback_text_color (ParserNode *node)
 
bool parserCallback_fonts (ParserNode *node)
 
bool parserCallback_language (ParserNode *node)
 
bool parserCallback_text (ParserNode *node)
 
bool parserCallback_palette (ParserNode *node)
 
bool parserCallback_color (ParserNode *node)
 
bool parserCallback_drawstep (ParserNode *node)
 
bool parserCallback_drawdata (ParserNode *node)
 
bool parserCallback_bitmaps (ParserNode *node)
 
bool parserCallback_bitmap (ParserNode *node)
 
bool parserCallback_cursor (ParserNode *node)
 
bool parserCallback_layout_info (ParserNode *node)
 
bool parserCallback_globals (ParserNode *node)
 
bool parserCallback_def (ParserNode *node)
 
bool parserCallback_widget (ParserNode *node)
 
bool parserCallback_dialog (ParserNode *node)
 
bool parserCallback_layout (ParserNode *node)
 
bool parserCallback_space (ParserNode *node)
 
bool parserCallback_import (ParserNode *node)
 
bool closedKeyCallback (ParserNode *node) override
 
bool resolutionCheck (const Common::String &resolution)
 
void cleanup () override
 
Graphics::DrawStepnewDrawStep ()
 
Graphics::DrawStepdefaultDrawStep ()
 
bool parseDrawStep (ParserNode *stepNode, Graphics::DrawStep *drawstep, bool functionSpecific)
 
bool parseCommonLayoutProps (ParserNode *node, const Common::String &var)
 
bool parseList (const char *key, int count,...)
 
bool parseList (const Common::String &keyStr, int count,...)
 
bool vparseList (const char *key, int count, va_list args)
 
- Protected Member Functions inherited from Common::XMLParser
virtual void buildLayout ()=0
 
virtual bool keyCallback (ParserNode *node)=0
 
virtual bool textCallback (const String &val)
 
bool closeKey ()
 
bool parseKeyValue (String keyName)
 
bool parseActiveKey (bool closed)
 
bool parserError (const String &errStr)
 
bool skipSpaces ()
 
bool skipComments ()
 
virtual bool isValidNameChar (char c)
 
bool parseToken ()
 
bool parseIntegerKey (const char *key, int count,...)
 
bool parseIntegerKey (const String &keyStr, int count,...)
 
bool vparseIntegerKey (const char *key, int count, va_list args)
 
bool parseXMLHeader (ParserNode *node)
 
virtual bool handleUnknownKey (ParserNode *node)
 

Protected Attributes

ThemeEngine_theme
 
Graphics::DrawStep_defaultStepGlobal
 
Graphics::DrawStep_defaultStepLocal
 
int16 _baseWidth
 
int16 _baseHeight
 
float _scaleFactor
 
Common::HashMap< Common::String, PaletteColor, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo_palette
 
- Protected Attributes inherited from Common::XMLParser
List< XMLKeyLayout * > _layoutList
 

Additional Inherited Members

- Public Types inherited from Common::XMLParser
enum  ParserState {
  kParserNeedHeader, kParserNeedKey, kParserNeedKeyName, kParserNeedPropertyName,
  kParserNeedPropertyOperator, kParserNeedPropertyValue, kParserError
}
 
typedef HashMap< String, XMLParser::XMLKeyLayout *, IgnoreCase_Hash, IgnoreCase_EqualToChildMap
 
- Public Attributes inherited from Common::XMLParser
XMLKeyLayout_XMLkeys
 
ObjectPool< ParserNode, 8 > _nodePool
 

Member Function Documentation

◆ PARSER_END()

GUI::ThemeParser::PARSER_END ( )
protected

Render info callbacks

◆ parserCallback_layout_info()

bool GUI::ThemeParser::parserCallback_layout_info ( ParserNode node)
protected

Layout info callbacks

◆ closedKeyCallback()

bool GUI::ThemeParser::closedKeyCallback ( ParserNode node)
overrideprotectedvirtual

The closed key callback function MAY be overloaded by inheriting classes to implement parser-specific functions.

The closedKeyCallback is issued once a key has been finished parsing, to let the parser verify that all the required subkeys, etc, were included.

Unlike the keyCallbacks(), there's just a closedKeyCallback() for all keys. Use "node->name" to distinguish between each key type.

Returns true if the key was properly closed, false otherwise. By default, all keys are properly closed.

Reimplemented from Common::XMLParser.

◆ cleanup()

void GUI::ThemeParser::cleanup ( )
overrideprotectedvirtual

Overload if your parser needs to support parsing the same file several times, so you can clean up the internal state of the parser before each parse.

Reimplemented from Common::XMLParser.


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