- Added function to get the active host type as a string.

XMLParser: 
- Added support for ignoring keys while parsing (check documentation). Backwards compatible.
- parserError() has been revamped. Shows all kinds of detailed information regarding the error ala Python

InterfaceManager/ThemeParser:
- DrawData keys and their DrawStep subkeys are now successfully parsed and loaded into structs. That's a win.
- Bug fixes.

svn-id: r32768
This commit is contained in:
Vicent Marti 2008-06-24 19:48:01 +00:00
parent a4b4534a66
commit 8caa7d3f8b
8 changed files with 295 additions and 36 deletions

View file

@ -38,11 +38,44 @@ namespace GUI {
using namespace Graphics;
const char *InterfaceManager::kDrawDataStrings[] = {
"mainmenu_bg",
"special_bg",
"plain_bg",
"default_bg",
"button_idle",
"button_hover",
"surface",
"slider_full",
"slider_empty",
"checkbox_enabled",
"checkbox_disabled",
"tab",
"scrollbar_base",
"scrollbar_top",
"scrollbar_bottom",
"scrollbar_handle",
"popup",
"caret",
"separator"
};
InterfaceManager::InterfaceManager() :
_vectorRenderer(0), _system(0), _graphicsMode(kGfxDisabled),
_screen(0), _bytesPerPixel(0) {
_system = g_system;
for (int i = 0; i < kDrawDataMAX; ++i) {
_widgets[i] = 0;
}
setGraphicsMode(kGfxStandard16bit);
}
@ -78,9 +111,25 @@ void InterfaceManager::setGraphicsMode(Graphics_Mode mode) {
}
void InterfaceManager::addDrawStep(Common::String &drawDataId, Graphics::DrawStep *step) {
_widgets[getDrawDataId(drawDataId)]->_steps.push_back(step);
DrawData id = getDrawDataId(drawDataId);
assert(_widgets[id] != 0);
_widgets[id]->_steps.push_back(step);
}
bool InterfaceManager::addDrawData(DrawData data_id, bool cached) {
assert(data_id >= 0 && data_id < kDrawDataMAX);
if (_widgets[data_id] != 0)
return false;
_widgets[data_id] = new WidgetDrawData;
_widgets[data_id]->_cached = cached;
_widgets[data_id]->_type = data_id;
_widgets[data_id]->_scaled = false;
return true;
}
bool InterfaceManager::init() {
return false;