#include <config.h>
Inheritance diagram for SaX::SaXConfig:
Public Member Functions | |
void | setParseErrorValue (char *) |
void | setParseError (char *) |
void | addImport (SaXImport *) |
void | setMode (int) |
QString | getParseErrorValue (void) |
QString | getParseError (void) |
bool | createConfiguration (void) |
void | commitConfiguration (void) |
int | testConfiguration (void) |
bool | isChecksumOK (void) |
SaXConfig (int=SAX_MERGE) |
A SaXConfig object is mainly used as a container for SaXImport objects. Different import objects describing a complete configuration or only parts of it can be added using the addImport() method. A complete new configuration requires the following import ID's to be added:
If not all of these are provided it is necessary to set the config mode to SAX_MERGE using the setMode() method otherwise the configuration will be broken. If merging is used you may recognize problems while trying to remove complete devices. For example you want to remove one mouse out of two but your changes do not have any effect. This is because while merging the currently existing information is still there. As result of that you need to write a complete new configuration using the SAX_NEW mode to prevent existing sections from beeing imported again.
Calling createConfiguration() will create a preliminary configuration file named /var/lib/sax/xorg.conf. libsax will automatically check the syntax of the new created file and the programmer is able to get possible syntax errors using the getParseError* methods
#include <sax/sax.h> int importID[7] = { SAX_CARD, SAX_DESKTOP, SAX_POINTERS, SAX_KEYBOARD, SAX_LAYOUT, SAX_PATH, SAX_EXTENSIONS }; SaXConfig* config = new SaXConfig; for (int id=0; id < 7; id++) { SaXImport* import = new SaXImport ( importID[id] ); import->doImport(); config->addImport (import); } config->setMode (SAX_NEW); if ( ! config->createConfiguration() ) { printf ("%s\n",config->getParseErrorValue().ascii()); }
Definition at line 141 of file config.h.
|
An object of this type is used to create and verify the basic X11 configuration file /etc/X11/xorg.conf Definition at line 32 of file config.cpp. References SaX::SaXException::setLock(), and SaX::SaXException::unsetLock(). Here is the call graph for this function: ![]() |
|
add previously imported data using a SaXImport reference multiple addImport() calls are possible to add all needed sections Implements SaX::SaXConfigIF. Definition at line 67 of file config.cpp. References SaX::SaXException::errorString(), SaX::SaXException::excImportAlreadyAdded(), SaX::SaXException::excUnknownImport(), and SaX::SaXImport::getSectionID(). Here is the call graph for this function: ![]() |
|
install the configuration file as /etc/X11/xorg.conf installing the file should only be done when createConfiguration() returned succesfully Implements SaX::SaXConfigIF. Definition at line 245 of file config.cpp. |
|
create the preliminary configuration file and verify the syntax of the file. If everything is ok the method will return true otherwise false Implements SaX::SaXConfigIF. Definition at line 179 of file config.cpp. References SaX::SaXExport::doExport(), SaX::SaXException::setLock(), and SaX::SaXException::unsetLock(). Referenced by testConfiguration(). Here is the call graph for this function: ![]() |
|
obtain parse error if there is any. If no error occured an empty string is returned Implements SaX::SaXConfigIF. Definition at line 490 of file config.cpp. |
|
obtain parse error value if there is any. If no error occured an empty string is returned Implements SaX::SaXConfigIF. Definition at line 476 of file config.cpp. |
|
check if the installed configuration has a valid checksum which means there are no manual made changes. if there is no installed config file or the checksum doesn't exist the function will return true. Otherwise the result of the checksum test determines the return value Implements SaX::SaXConfigIF. Definition at line 403 of file config.cpp. |
|
set the ISAX mode for creating the configuration file. Possible modes are: SAX_NEW or SAX_MERGE (default). If SAX_NEW is specified a complete set of imports must be added to create a valid configuration file. Implements SaX::SaXConfigIF. Definition at line 166 of file config.cpp. |
|
private member which stores the parse error for later acces in getParseError() Implements SaX::SaXConfigIF. Definition at line 464 of file config.cpp. |
|
private member which stores the parse error value for later acces in getParseErrorValue() Implements SaX::SaXConfigIF. Definition at line 453 of file config.cpp. |
|
test the configuration by starting a new X-Server using the preliminary configuration file. Implements SaX::SaXConfigIF. Definition at line 349 of file config.cpp. References createConfiguration(), SaX::SaXException::errorString(), and SaX::SaXException::excProcessFailed(). Here is the call graph for this function: ![]() |