libsax 7.2
Public Member Functions

SaX::SaXManipulateDesktop Class Reference

SaX2 - Desktop manipulator class. More...

#include <desktop.h>

Inheritance diagram for SaX::SaXManipulateDesktop:
Inheritance graph
[legend]

List of all members.

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 setPreferredMode (const QString &)
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 &)
Q3Dict< QString > getCDBMonitorData (const QString &, const QString &)
Q3Dict< 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)
bool getKMSStatus (void)
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)

Detailed Description

SaX2 - Desktop manipulator class.

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 185 of file desktop.h.


Constructor & Destructor Documentation

usr src packages BUILD sax libsax desktop cpp 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 30 of file desktop.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excCardImportBindFailed(), SaX::SaXException::excDesktopImportBindFailed(), SaX::SaXException::excNullPointerArgument(), SaX::SaXException::excPathImportBindFailed(), and SaX::SaXImport::getSectionID().

Here is the call graph for this function:


Member Function Documentation

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 1639 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 126 of file desktop.cpp.

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 89 of file desktop.cpp.

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 626 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 859 of file desktop.cpp.

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 1298 of file desktop.cpp.

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 466 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 844 of file desktop.cpp.

Q3Dict< 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 1507 of file desktop.cpp.

Q3Dict< 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 1534 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 1479 of file desktop.cpp.

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 1446 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 1347 of file desktop.cpp.

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 1199 of file desktop.cpp.

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 1143 of file desktop.cpp.

QString SaX::SaXManipulateDesktop::getDisplayTraversal ( void  ) [virtual]

get the traversal length according to the information from the getDisplaySize() method

Implements SaX::SaXManipulateDesktopIF.

Definition at line 1174 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 279 of file desktop.cpp.

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 1240 of file desktop.cpp.

QString SaX::SaXManipulateDesktop::getModelineAlgorithm ( void  ) [virtual]

get the currently used modeline algorithm method

Implements SaX::SaXManipulateDesktopIF.

Definition at line 1362 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 1332 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 1317 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 964 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 936 of file desktop.cpp.

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 1394 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 1269 of file desktop.cpp.

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 220 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 901 of file desktop.cpp.

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 380 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 1663 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 148 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 186 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 71 of file desktop.cpp.

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 1420 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 1565 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 204 of file desktop.cpp.

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 776 of file desktop.cpp.

References setDisplaySize().

Here is the call graph for this function:

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 760 of file desktop.cpp.

Referenced by setDisplayRatioAndTraversal().

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 1622 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 1606 of file desktop.cpp.

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 798 of file desktop.cpp.

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 887 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 873 of file desktop.cpp.

void SaX::SaXManipulateDesktop::setPreferredMode ( const QString &  mode) [virtual]

set the PreferredMode which is required because randr12 based drivers will ignore any Modes setup, great

Implements SaX::SaXManipulateDesktopIF.

Definition at line 830 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 108 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 168 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 814 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 1376 of file desktop.cpp.


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