SaX::SaXManipulateCard Class Reference

SaX2 - Card manipulator class. More...

#include <card.h>

Inheritance diagram for SaX::SaXManipulateCard:
[legend]

List of all members.

Public Member Functions

void setCardDriver (const QString &)
void setCardOption (const QString &, const QString &)
void addCardOption (const QString &, const QString &)
void removeCardOption (const QString &)
void addCardExternal (const QString &)
void addCardExternalOption (const QString &, const QString &)
void setBusID (const QString &)
void setScreenID (int)
void setRotate (int)
QList< QString > getCardDrivers (void)
QDict< QString > getCardOptions (const QString &)
QDict< QString > getOptions (void)
QString getCardDriver (void)
QString getCardName (void)
QString getCardVendor (void)
QString getCardModel (void)
QString getBusID (void)
QString getScreenID (void)
QString getRotationDirection (void)
int getCards (void)
int getHeads (void)
int getDevices (void)
bool isNoteBook (void)
bool selectCard (int)
 SaXManipulateCard (SaXImport *, int=0)

Protected Attributes

SaXImportmImport
SaXProcessmCDBCardModules
QList< QString > mCDBCardDrivers
QDict< QString > mCDBCardOptions
int mCard


Detailed Description

SaX2 - Card manipulator class.

The card manipulator requires one import object (Card) to become created. Once created the manipulator object is able to get/set hardware related information like graphics card driver or options to use with this driver. The following example shows how to use the card manipulator to force setting up the PanelSize on a radeon based NoteBook which reports the wrong size in its DDC record

 #include <sax/sax.h>

 int main (void) {
     SaXException().setDebug (true);
     QDict<SaXImport> section;

     printf ("Importing data...\n");
     SaXConfig* config = new SaXConfig;
     SaXImport* import = new SaXImport ( SAX_CARD );
     import->setSource ( SAX_SYSTEM_CONFIG );
     import->doImport();
     config->addImport (import);
     section.insert (
         import->getSectionName(),import
     );
     printf ("Overwrite PanelSize option...\n");
     SaXManipulateCard mCard (
         section["Card"]
     );
     if (mCard.selectCard (0)) {
         mCard.addCardOption ("PanelSize","1280x1024");
     }
     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 131 of file card.h.


Constructor & Destructor Documentation

SaX::SaXManipulateCard::SaXManipulateCard ( SaXImport in,
int  card = 0 
)

An object of this type is used to manipulate the graphics card settings refering to the X11 Device sections. An import of type SAX_CARD is required with this class

Definition at line 27 of file card.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excCardImportBindFailed(), SaX::SaXException::excNullPointerArgument(), SaX::SaXImport::getSectionID(), mCard, mCDBCardModules, and mImport.

Here is the call graph for this function:


Member Function Documentation

void SaX::SaXManipulateCard::setCardDriver ( const QString &  driver  )  [virtual]

set the card driver to use with the selected device

Implements SaX::SaXManipulateCardIF.

Definition at line 71 of file card.cpp.

References mImport.

Referenced by SaX::SaXManipulateDesktop::disable3D(), and SaX::SaXManipulateDesktop::enable3D().

void SaX::SaXManipulateCard::setCardOption ( const QString &  keyword,
const QString &  value 
) [virtual]

set an option to the graphics card used with the currently selected device

Implements SaX::SaXManipulateCardIF.

Definition at line 131 of file card.cpp.

References mImport, SaX::SaXStorage::setItem(), and SaX::SaXStorage::setRawItem().

Here is the call graph for this function:

void SaX::SaXManipulateCard::addCardOption ( const QString &  keyword,
const QString &  value 
) [virtual]

add an option to the graphics card used with the currently selected device

Implements SaX::SaXManipulateCardIF.

Definition at line 159 of file card.cpp.

References SaX::SaXStorage::addItem(), SaX::SaXStorage::addRawItem(), and mImport.

Referenced by SaX::SaXManipulateVNC::allowMultipleConnections(), SaX::SaXManipulateVNC::disableVNC(), SaX::SaXManipulateDesktop::enable3D(), SaX::SaXManipulateVNC::enableHTTPAccess(), SaX::SaXManipulateVNC::enablePasswordProtection(), and SaX::SaXManipulateVNC::enableVNC().

Here is the call graph for this function:

void SaX::SaXManipulateCard::removeCardOption ( const QString &  value  )  [virtual]

removes an option which has been set to the currently selected device. If the option does not exist nothing will happen

Implements SaX::SaXManipulateCardIF.

Definition at line 187 of file card.cpp.

References SaX::SaXStorage::getItem(), mImport, SaX::SaXStorage::removeItem(), and SaX::SaXStorage::removeRawItem().

Referenced by SaX::SaXManipulateVNC::allowMultipleConnections(), SaX::SaXManipulateDesktop::disable3D(), SaX::SaXManipulateVNC::disableHTTPAccess(), SaX::SaXManipulateVNC::disablePasswordProtection(), SaX::SaXManipulateVNC::disableVNC(), and SaX::SaXManipulateVNC::enableVNC().

Here is the call graph for this function:

void SaX::SaXManipulateCard::addCardExternal ( const QString &  ident  )  [virtual]

add raw option value for SaXExternal which cause the system to add a Monitor section with the given identifier

Implements SaX::SaXManipulateCardIF.

Definition at line 84 of file card.cpp.

References SaX::SaXStorage::addRawItem(), getOptions(), mImport, and SaX::SaXStorage::removeRawItem().

Here is the call graph for this function:

void SaX::SaXManipulateCard::addCardExternalOption ( const QString &  keyword,
const QString &  value 
) [virtual]

add raw option for SaXExternal value. This includes the given key/value pair as option to the appropriate Monitor section

Implements SaX::SaXManipulateCardIF.

Definition at line 106 of file card.cpp.

References SaX::SaXStorage::addRawItem(), getOptions(), mImport, and SaX::SaXStorage::removeRawItem().

Here is the call graph for this function:

void SaX::SaXManipulateCard::setBusID ( const QString &  busid  )  [virtual]

set busID location for the selected graphics device

Implements SaX::SaXManipulateCardIF.

Definition at line 214 of file card.cpp.

References mImport.

void SaX::SaXManipulateCard::setScreenID ( int  screen  )  [virtual]

set screen identification for the selected graphics device this is only useful for multihead cards to separate the heads

Implements SaX::SaXManipulateCardIF.

Definition at line 227 of file card.cpp.

References mImport.

void SaX::SaXManipulateCard::setRotate ( int  direction  )  [virtual]

set rotation direction for the selected graphics device rotation works only for drivers which supports this

Implements SaX::SaXManipulateCardIF.

Definition at line 243 of file card.cpp.

References mImport.

QList< QString > SaX::SaXManipulateCard::getCardDrivers ( void   )  [virtual]

retrieve a list of X11 card driver names. The items if the list can be used to retrieve the coresponding option list using the getCardOptions() method

Implements SaX::SaXManipulateCardIF.

Definition at line 452 of file card.cpp.

References SaX::SaXStorage::getTablePointerCDB(), mCDBCardDrivers, and mCDBCardModules.

Here is the call graph for this function:

QDict< QString > SaX::SaXManipulateCard::getCardOptions ( const QString &  driver  )  [virtual]

retrieve a list of card options for the given driver name (driver). A list of drivers can be obtained using the getCardDrivers() member method

Implements SaX::SaXManipulateCardIF.

Definition at line 474 of file card.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excCDBRecordNotFound(), mCDBCardModules, and mCDBCardOptions.

Here is the call graph for this function:

QDict< QString > SaX::SaXManipulateCard::getOptions ( void   )  [virtual]

retrieve an option list of all options set for the selected card. The storage is a dictionary saving the option name as key and the options value as value for this key. If there is no value set for the option (bool options) the value for the key is the (null) string

Implements SaX::SaXManipulateCardIF.

Definition at line 400 of file card.cpp.

References mImport.

Referenced by addCardExternal(), addCardExternalOption(), SaX::SaXManipulateDesktop::disable3D(), SaX::SaXManipulateDesktop::enable3D(), SaX::SaXManipulateVNC::getHTTPPort(), SaX::SaXManipulateLayout::getMultiheadMode(), SaX::SaXManipulateVNC::isHTTPAccessEnabled(), SaX::SaXManipulateVNC::isMultiConnectEnabled(), SaX::SaXManipulateVNC::isPwdProtectionEnabled(), and SaX::SaXManipulateVNC::isVNCEnabled().

QString SaX::SaXManipulateCard::getCardDriver ( void   )  [virtual]

retrieve the cards driver name from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 357 of file card.cpp.

References mImport.

Referenced by SaX::SaXManipulateDesktop::disable3D(), and SaX::SaXManipulateDesktop::enable3D().

QString SaX::SaXManipulateCard::getCardName ( void   )  [virtual]

retrieve the card vendor and name as one string separated by a colon from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 262 of file card.cpp.

References SaX::SaXStorage::getItem(), mCard, and mImport.

Here is the call graph for this function:

QString SaX::SaXManipulateCard::getCardVendor ( void   )  [virtual]

retrieve the card vendor from the SYSP_CARD interface

Implements SaX::SaXManipulateCardIF.

Definition at line 293 of file card.cpp.

References SaX::SaXStorage::getItem(), mCard, and mImport.

Here is the call graph for this function:

QString SaX::SaXManipulateCard::getCardModel ( void   )  [virtual]

retrieve the card model from the SYSP_CARD interface

Implements SaX::SaXManipulateCardIF.

Definition at line 318 of file card.cpp.

References SaX::SaXStorage::getItem(), mCard, and mImport.

Here is the call graph for this function:

QString SaX::SaXManipulateCard::getBusID ( void   )  [virtual]

retrieve the cards busID location from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 343 of file card.cpp.

References mImport.

QString SaX::SaXManipulateCard::getScreenID ( void   )  [virtual]

retrieve the card screen identification from the currently selected card. This value is always 0 for non multihead cards

Implements SaX::SaXManipulateCardIF.

Definition at line 371 of file card.cpp.

References mImport.

QString SaX::SaXManipulateCard::getRotationDirection ( void   )  [virtual]

retrieve the current value of the Rotate option if defined. If there is no rotate option given an empty QString is returned

Implements SaX::SaXManipulateCardIF.

Definition at line 385 of file card.cpp.

References mImport.

int SaX::SaXManipulateCard::getCards ( void   )  [virtual]

returns the number of installed graphics cards. This refers to the real value of different graphics devices located on the BUS

Implements SaX::SaXManipulateCardIF.

Definition at line 544 of file card.cpp.

References SaX::SaXStorage::getItem(), and mImport.

Referenced by getHeads().

Here is the call graph for this function:

int SaX::SaXManipulateCard::getHeads ( void   )  [virtual]

returns the number of configurable VGA heads This value may differ from the getCards() return value because there are possibly more than one head available on one card

Implements SaX::SaXManipulateCardIF.

Definition at line 581 of file card.cpp.

References getCards(), SaX::SaXStorage::getItem(), isNoteBook(), mCard, mImport, and selectCard().

Here is the call graph for this function:

int SaX::SaXManipulateCard::getDevices ( void   )  [virtual]

returns the number of configured device sections the result should be always the same as calling getHeads(), but getHeads will refer to the CDB data whereas getDevices is counting the included X11 Device sections.

Implements SaX::SaXManipulateCardIF.

Definition at line 564 of file card.cpp.

References SaX::SaXStorage::getCount(), and mImport.

Here is the call graph for this function:

bool SaX::SaXManipulateCard::isNoteBook ( void   )  [virtual]

check if the graphics card is working in a NoteBook. The check is based on the battery count in /proc/acpi/battery/ if there is a battery we will asumme a NoteBook

Implements SaX::SaXManipulateCardIF.

Definition at line 511 of file card.cpp.

Referenced by SaX::SaXManipulateDesktop::getDualHeadProfile(), and getHeads().

bool SaX::SaXManipulateCard::selectCard ( int  card  )  [virtual]

select the card device the changes should be applied to if the device does not exist (false) is returned

Implements SaX::SaXManipulateCardIF.

Definition at line 53 of file card.cpp.

References mCard, and mImport.

Referenced by getHeads(), SaX::SaXManipulateLayout::getMultiheadMode(), SaX::SaXManipulateLayout::getXOrgLayout(), SaX::SaXManipulateLayout::removeRelative(), SaX::SaXManipulateLayout::setRelative(), and SaX::SaXManipulateLayout::setXOrgLayout().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 20:18:17 2007 for libsax by  doxygen 1.5.3