#include <xmlapp.h>
Inheritance diagram for XmlApp:
Public Member Functions | |
DECLSPEC | XmlApp (int argc, char *argv[], const char *xmlfile=NULL) |
DECLSPEC int | init (const char *fn=NULL) |
virtual DECLSPEC void | destroy () |
Call destroy to quit the application. | |
virtual DECLSPEC long | mainLoop () |
Never returns, but exits the application. | |
TiXmlHandle | getXmlHandle () |
TiXmlHandle | getXmlHandleUser () |
Static Public Member Functions | |
static void | quitApplication (void *, BasicObject *, void *) |
Protected Member Functions | |
virtual DECLSPEC void | onInit () |
The class XmlApp makes it possible to change the look of your app in a xml-file. You do not need to recompile the application, when changing XML-data.
XmlApp::XmlApp | ( | int | argc, | |
char * | argv[], | |||
const char * | xmlfile = NULL | |||
) |
Constructor.
xmlfile | the path to the XML file to be used for initialisation The followin events can be specified in the xml root element: DoBeforeInit, DoAfterCreation, DoAfterInit; further attributes can be: UserXML (path to user's xml-file), UserdataPath (path to user's data directory), CanGrabInput (bool), Caption (string), WaitOnStart (ulong). |
int XmlApp::init | ( | const char * | fn = NULL |
) |
Initializes the application. After loading the specified XML file, BasicApp::init() is called with the loaded data's root element as param.
fn | filename of the XML file to use for initialisation, if NULL the filename specified on creation is used |
TiXmlHandle XmlApp::getXmlHandle | ( | ) | [inline] |
TiXmlHandle XmlApp::getXmlHandleUser | ( | ) | [inline] |
void XmlApp::onInit | ( | ) | [protected, virtual] |
Initializes the object's variables by reading data from the XML element. If there were no XML data used for creation, nothing is done. This function calls onInit() of its children recursively (after it has inited itself). It is highly recommended to call BasicObject::onInit(), usually at the end of the onInit() method, when overwriting it in a derived class.
Reimplemented from BasicApp.