#include <desktop.h>
Public Member Functions | |
| void | calculateModelines (bool) |
| void | setExtraModelineString (const QString &) |
| void | setExtraModeline (int, int, int, int) |
| void | addExtraModeline (int, int, int, int) |
| void | removeExtraModeline (int, int) |
| void | setResolution (int, int, int) |
| void | addResolution (int, int, int) |
| void | removeResolution (int, int, int) |
| void | setVirtualResolution (int, int, int) |
| void | removeVirtualResolution (int) |
| void | setColorDepth (int) |
| bool | enable3D (void) |
| bool | disable3D (void) |
| void | setDisplaySize (int, int) |
| void | setDisplayRatioAndTraversal (double, int, int) |
| void | setHsyncRange (double, double) |
| void | setVsyncRange (double, double) |
| void | enableDPMS (void) |
| void | disableDPMS (void) |
| void | setMonitorVendor (const QString &) |
| void | setMonitorName (const QString &) |
| void | setCDBMonitor (const QString &) |
| QList< QString > | getCDBMonitorVendorList (void) |
| QList< QString > | getCDBMonitorModelList (const QString &) |
| QDict< QString > | getCDBMonitorData (const QString &, const QString &) |
| QDict< QString > | getCDBMonitorIDData (const QString &) |
| void | setCDBMonitorData (const QString &, const QString &, const QString &, const QString &) |
| QList< QString > | getResolutions (int) |
| QList< QString > | getResolutionsFromFrameBuffer (void) |
| QList< QString > | getResolutionFromServer (void) |
| QList< QString > | getResolutionsFromDDC1 (void) |
| QList< QString > | getResolutionsFromDDC2 (void) |
| QList< QString > | getDisplaySize (void) |
| QList< QString > | getDisplayRatio (void) |
| QString | getDisplayTraversal (void) |
| QList< QString > | getHsyncRange (void) |
| QList< QString > | getVsyncRange (void) |
| bool | is3DEnabled (void) |
| bool | is3DCard (void) |
| bool | isDualHeadCard (void) |
| bool | isXineramaMode (void) |
| bool | DPMSEnabled (void) |
| int | getFBKernelMode (const QString &, int) |
| int | setFBKernelMode (int) |
| int | getColorDepthFromServer (void) |
| QString | getMonitorVendor (void) |
| QString | getMonitorName (void) |
| QString | getColorDepth (void) |
| QString | getVirtualResolution (int) |
| QString | getDualHeadProfile (void) |
| QString | getModelineAlgorithm (void) |
| bool | willCalculateModelines (void) |
| bool | selectDesktop (int) |
| SaXManipulateDesktop (SaXImport *, SaXImport *, SaXImport *, int=0) | |
The desktop manipulator requires three import objects to become created:
Once created the manipulator object is able to get/set desktop related information like resolutions color depth monitor specs or 3D. The following example shows how to use the desktop manipulator for adding a new standard resolution in 24 bit color depth:
#include <sax/sax.h> int main (void) { SaXException().setDebug (true); QDict<SaXImport> section; int importID[] = { SAX_CARD, SAX_DESKTOP, SAX_PATH, }; printf ("Importing data...\n"); SaXConfig* config = new SaXConfig; for (int id=0; id<3; id++) { SaXImport* import = new SaXImport ( importID[id] ); import->setSource ( SAX_SYSTEM_CONFIG ); import->doImport(); config->addImport (import); section.insert ( import->getSectionName(),import ); } printf ("Setting up resolution...\n"); SaXManipulateDesktop mDesktop ( section["Desktop"],section["Card"],section["Path"] ); if (mDesktop.selectDesktop (0)) { mDesktop.addResolution (24,1600,1200); } printf ("Writing configuration\n"); config->setMode (SAX_MERGE); if ( ! config->createConfiguration() ) { printf ("%s\n",config->errorString()); printf ("%s\n",config->getParseErrorValue()); return 1; } return 0; }
Definition at line 182 of file desktop.h.
| SaX::SaXManipulateDesktop::SaXManipulateDesktop | ( | SaXImport * | desktop, | |
| SaXImport * | card, | |||
| SaXImport * | path, | |||
| int | desktopID = 0 | |||
| ) |
An object of this type is used to configure desktop properties like resolution and colors
Definition at line 29 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excCardImportBindFailed(), SaX::SaXException::excDesktopImportBindFailed(), SaX::SaXException::excNullPointerArgument(), SaX::SaXException::excPathImportBindFailed(), and SaX::SaXImport::getSectionID().
| void SaX::SaXManipulateDesktop::calculateModelines | ( | bool | calc | ) | [virtual] |
enable/disable the modeline calculation. This is onyl needed for non VESA modes or modes which are not part of the internal X-Server mode pool
Implements SaX::SaXManipulateDesktopIF.
Definition at line 88 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setExtraModelineString | ( | const QString & | mode | ) | [virtual] |
This method includes one modeline specified by mode without checking if it fits into the current range.
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1546 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setExtraModeline | ( | int | x, | |
| int | y, | |||
| int | refresh, | |||
| int | hsync | |||
| ) | [virtual] |
This method includes one modeline XxY with refresh Hz but without checking if it fits into the current range. This method should be used carefully
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1562 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::addExtraModeline | ( | int | x, | |
| int | y, | |||
| int | refresh, | |||
| int | hsync | |||
| ) | [virtual] |
This method add a modeline XxY with refresh Hz but without checking if it fits into the current range. This method should be used carefully
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1579 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::removeExtraModeline | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
This function removes a modeline XxY from the SpecialModeline value
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1603 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setResolution | ( | int | c, | |
| int | x, | |||
| int | y | |||
| ) | [virtual] |
set resolution (X)x(Y) for colordepth (c). Using this member will overwrite the current resolution setting
Implements SaX::SaXManipulateDesktopIF.
Definition at line 107 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::addResolution | ( | int | c, | |
| int | x, | |||
| int | y | |||
| ) | [virtual] |
add resolution (X)x(Y) for colordepth (c). Using this member will add the resolution to the current setting
Implements SaX::SaXManipulateDesktopIF.
Definition at line 125 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::removeResolution | ( | int | c, | |
| int | x, | |||
| int | y | |||
| ) | [virtual] |
remove the resolution (X)x(Y) for colordepth (c) from the current Modes value
Implements SaX::SaXManipulateDesktopIF.
Definition at line 147 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setVirtualResolution | ( | int | c, | |
| int | x, | |||
| int | y | |||
| ) | [virtual] |
set virtual resolution (X)x(Y) for colordepth (c). This call will overwrite the current setting
Implements SaX::SaXManipulateDesktopIF.
Definition at line 167 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::removeVirtualResolution | ( | int | c | ) | [virtual] |
remove the virtual resolution (X)x(Y) set for colordepth (c).
Implements SaX::SaXManipulateDesktopIF.
Definition at line 185 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setColorDepth | ( | int | c | ) | [virtual] |
set the default color depth. Valid values are 4,8,15,16 and 24
Implements SaX::SaXManipulateDesktopIF.
Definition at line 203 of file desktop.cpp.
Referenced by enable3D().
| bool SaX::SaXManipulateDesktop::enable3D | ( | void | ) | [virtual] |
enable 3D system. This method will include the needed extension module to activate 3D. It is necessary to restart the X-Server after the configuration has been written. The method will take care about the special nvidia setup which requires the nvidia installer to uninstall -> disable or install -> enable the 3D subsystem. NOTE: libsax will not install or uninstall anything but an exception will be throwed if the binary nvidia driver is not installed
Implements SaX::SaXManipulateDesktopIF.
Definition at line 462 of file desktop.cpp.
References SaX::SaXManipulateCard::addCardOption(), SaX::SaXManipulatePath::addLoadableModule(), SaX::SaXException::errorString(), SaX::SaXException::excDriverMismatch(), SaX::SaXException::excEmptyCDBGroup(), SaX::SaXException::excNvidiaDriverMissing(), SaX::SaXManipulateCard::getCardDriver(), getColorDepth(), SaX::SaXStorage::getItem(), SaX::SaXManipulateCard::getOptions(), SaX::SaXFile::readDict(), SaX::SaXManipulatePath::removeLoadableModule(), SaX::SaXManipulateCard::setCardDriver(), and setColorDepth().
| bool SaX::SaXManipulateDesktop::disable3D | ( | void | ) | [virtual] |
remove the needed extension module(s) related to the 3D subsystem. This method will handle the special nvidia case as well. An exception will be throwed if the nvidia driver is installed and needs to get uninstalled to deactivate 3D in this case
Implements SaX::SaXManipulateDesktopIF.
Definition at line 621 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excDriverMismatch(), SaX::SaXException::excEmptyCDBGroup(), SaX::SaXException::excNvidiaDriverInstalled(), SaX::SaXManipulateCard::getCardDriver(), SaX::SaXStorage::getItem(), SaX::SaXManipulateCard::getOptions(), SaX::SaXFile::readDict(), SaX::SaXManipulateCard::removeCardOption(), SaX::SaXManipulatePath::removeLoadableModule(), and SaX::SaXManipulateCard::setCardDriver().
| void SaX::SaXManipulateDesktop::setDisplaySize | ( | int | width, | |
| int | height | |||
| ) | [virtual] |
set the DisplaySize in [mm] for the width and height of the currently selected display
Implements SaX::SaXManipulateDesktopIF.
Definition at line 753 of file desktop.cpp.
Referenced by setDisplayRatioAndTraversal().
| void SaX::SaXManipulateDesktop::setDisplayRatioAndTraversal | ( | double | traversal, | |
| int | aspect, | |||
| int | ratio | |||
| ) | [virtual] |
set the DisplaySize in [mm] for the traversal and ratio of the currently selected display
Implements SaX::SaXManipulateDesktopIF.
Definition at line 769 of file desktop.cpp.
References setDisplaySize().
| void SaX::SaXManipulateDesktop::setHsyncRange | ( | double | hsmin, | |
| double | hsmax | |||
| ) | [virtual] |
set the horizontal sync range in [Khz] of the currently selected display.
Implements SaX::SaXManipulateDesktopIF.
Definition at line 791 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setVsyncRange | ( | double | vsmin, | |
| double | vsmax | |||
| ) | [virtual] |
set the vertical sync range in [Hz] of the currently selected display.
Implements SaX::SaXManipulateDesktopIF.
Definition at line 807 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::enableDPMS | ( | void | ) | [virtual] |
enable monitor option DPMS, currently there is only one monitor option so we will set the value and overwrite the current setting
Implements SaX::SaXManipulateDesktopIF.
Definition at line 823 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::disableDPMS | ( | void | ) | [virtual] |
disable monitor option DPMS by removing the complete entry. This works because there is only one option available
Implements SaX::SaXManipulateDesktopIF.
Definition at line 838 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setMonitorVendor | ( | const QString & | vendor | ) | [virtual] |
set monitor vendor name. This method will only set the vendor string to identify the monitor
Implements SaX::SaXManipulateDesktopIF.
Definition at line 852 of file desktop.cpp.
Referenced by setCDBMonitor().
| void SaX::SaXManipulateDesktop::setMonitorName | ( | const QString & | name | ) | [virtual] |
set the monitor model name. This method will only set the model string to identify the monitor
Implements SaX::SaXManipulateDesktopIF.
Definition at line 866 of file desktop.cpp.
Referenced by setCDBMonitor().
| void SaX::SaXManipulateDesktop::setCDBMonitor | ( | const QString & | group | ) | [virtual] |
set all monitor data associated with the given group name to the current desktop data. The group name consists of the vendor and model name separated by a colon
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1358 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excCDBRecordNotFound(), setMonitorName(), and setMonitorVendor().
| QList< QString > SaX::SaXManipulateDesktop::getCDBMonitorVendorList | ( | void | ) | [virtual] |
retrieve a list of supported monitor vendors. Each item contains the vendor name as it is stored in the CDB
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1386 of file desktop.cpp.
| QList< QString > SaX::SaXManipulateDesktop::getCDBMonitorModelList | ( | const QString & | vendor | ) | [virtual] |
retrieve a list of supported monitor models. Each item contains the vendor name as it is stored in the CDB
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1419 of file desktop.cpp.
| QDict< QString > SaX::SaXManipulateDesktop::getCDBMonitorData | ( | const QString & | vendor, | |
| const QString & | name | |||
| ) | [virtual] |
return the monitor data dictionary associated with the given vendor and model name.
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1447 of file desktop.cpp.
| QDict< QString > SaX::SaXManipulateDesktop::getCDBMonitorIDData | ( | const QString & | id | ) | [virtual] |
return the monitor data dictionary associated with the given DDC id.
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1474 of file desktop.cpp.
| void SaX::SaXManipulateDesktop::setCDBMonitorData | ( | const QString & | vendor, | |
| const QString & | name, | |||
| const QString & | key, | |||
| const QString & | value | |||
| ) | [virtual] |
add a CDB group to the current CDB monitor table of this manipulator instance. Note the information is not part of the CDB directly it is only stored temporarly as long as the object instance exists
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1505 of file desktop.cpp.
| QList< QString > SaX::SaXManipulateDesktop::getResolutions | ( | int | color | ) | [virtual] |
return a list of resolutions refering to the given color depth. If there is no resolution defined for the given color an empty list is returned
Implements SaX::SaXManipulateDesktopIF.
Definition at line 915 of file desktop.cpp.
| QList< QString > SaX::SaXManipulateDesktop::getResolutionFromServer | ( | void | ) | [virtual] |
return the resolution the currently running server is using This call will only work if there is a server which can be asked for the resolution. The xquery -r call is used to obtain the resolution
Implements SaX::SaXManipulateDesktopIF.
Definition at line 942 of file desktop.cpp.
References SaX::SaXProcessCall::readStdout().
| QList< QString > SaX::SaXManipulateDesktop::getDisplaySize | ( | void | ) | [virtual] |
get the values for the display size wheras the first entry in the list refers to the X value in mm and the second value refers to the Y value in mm. If there is no display size defined an empty list is returned
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1100 of file desktop.cpp.
Referenced by getDisplayRatio(), and getDisplayTraversal().
| QList< QString > SaX::SaXManipulateDesktop::getDisplayRatio | ( | void | ) | [virtual] |
get the aspect ratio x/y values according to the information from the getDisplaySize() method
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1152 of file desktop.cpp.
References getDisplaySize().
| QString SaX::SaXManipulateDesktop::getDisplayTraversal | ( | void | ) | [virtual] |
get the traversal length according to the information from the getDisplaySize() method
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1129 of file desktop.cpp.
References getDisplaySize().
| QList< QString > SaX::SaXManipulateDesktop::getHsyncRange | ( | void | ) | [virtual] |
get the values for the horizontal sync range in Khz the first entry specify the start value and the second value specify the end of the range
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1188 of file desktop.cpp.
| QList< QString > SaX::SaXManipulateDesktop::getVsyncRange | ( | void | ) | [virtual] |
get the values for the vertical sync range in Khz the first entry specify the start value and the second value specify the end of the range
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1215 of file desktop.cpp.
| bool SaX::SaXManipulateDesktop::is3DEnabled | ( | void | ) | [virtual] |
check if 3D is enabled. first we will have a look at the driver used. In case of nvidia 3D is always enabled in any other case the dri module must be used to enable the 3D subsystem
Implements SaX::SaXManipulateDesktopIF.
Definition at line 880 of file desktop.cpp.
References SaX::SaXManipulatePath::getModules().
| bool SaX::SaXManipulateDesktop::is3DCard | ( | void | ) | [virtual] |
check if the card can be used with 3D hardware acceleration according to the CDB information
Implements SaX::SaXManipulateDesktopIF.
Definition at line 219 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excEmptyCDBGroup(), and SaX::SaXStorage::getItem().
| bool SaX::SaXManipulateDesktop::isDualHeadCard | ( | void | ) | [virtual] |
check if the card is a dual head card The check is based on a profile check. If the card is bound to a DualHead profile the method will return true
Implements SaX::SaXManipulateDesktopIF.
Definition at line 376 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excEmptyCDBGroup(), SaX::SaXException::excProcessFailed(), SaX::SaXProcessCall::exitStatus(), and SaX::SaXStorage::getItem().
| bool SaX::SaXManipulateDesktop::DPMSEnabled | ( | void | ) | [virtual] |
check if DPMS is enabled by checking the value for MonitorOptions. Currently there is only one monitor option available so the check is rather simple
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1242 of file desktop.cpp.
| QString SaX::SaXManipulateDesktop::getMonitorVendor | ( | void | ) | [virtual] |
get the name of the monitor vendor for the currently selected desktop
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1261 of file desktop.cpp.
| QString SaX::SaXManipulateDesktop::getMonitorName | ( | void | ) | [virtual] |
get the name of the monitor model for the currently selected desktop
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1275 of file desktop.cpp.
| QString SaX::SaXManipulateDesktop::getColorDepth | ( | void | ) | [virtual] |
get the currently set default color depth for the active desktop
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1289 of file desktop.cpp.
Referenced by enable3D().
| QString SaX::SaXManipulateDesktop::getVirtualResolution | ( | int | color | ) | [virtual] |
get the virtual resolution if defined for the given color depth. If there is no virtual resolution a (null) string is returned
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1334 of file desktop.cpp.
| QString SaX::SaXManipulateDesktop::getDualHeadProfile | ( | void | ) | [virtual] |
return the full qualified profile file name used to set the driver options for a dual head configuration. if the card is not a dual head card or the assigned profile is not a DualHead_DriverOptions profile the method will return an empty QString
Implements SaX::SaXManipulateDesktopIF.
Definition at line 278 of file desktop.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excEmptyCDBGroup(), SaX::SaXStorage::getItem(), and SaX::SaXManipulateCard::isNoteBook().
| QString SaX::SaXManipulateDesktop::getModelineAlgorithm | ( | void | ) | [virtual] |
get the currently used modeline algorithm method
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1303 of file desktop.cpp.
| bool SaX::SaXManipulateDesktop::willCalculateModelines | ( | void | ) | [virtual] |
check if the modeline calculation is enabled or not The method will return true if enabled otherwise false
Implements SaX::SaXManipulateDesktopIF.
Definition at line 1316 of file desktop.cpp.
| bool SaX::SaXManipulateDesktop::selectDesktop | ( | int | desktop | ) | [virtual] |
select the desktop device the changes should be applied to if the device does not exist (false) is returned
Implements SaX::SaXManipulateDesktopIF.
Definition at line 70 of file desktop.cpp.
References SaX::SaXStorage::setID().
1.5.3