SaX::SaXManipulateCard Class Reference

SaX2 - Card manipulator class. More...

#include <card.h>

Inheritance diagram for SaX::SaXManipulateCard:

Inheritance graph
[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 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 129 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(), and mImport.

Here is the call graph for this function:


Member Function Documentation

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 112 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:

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

retrieve the cards busID location from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 296 of file card.cpp.

References mImport.

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

retrieve the cards driver name from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 310 of file card.cpp.

References mImport.

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

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 405 of file card.cpp.

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

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 271 of file card.cpp.

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

Here is the call graph for this function:

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 215 of file card.cpp.

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

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 427 of file card.cpp.

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

Here is the call graph for this function:

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 487 of file card.cpp.

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

Referenced by getHeads().

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 246 of file card.cpp.

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

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 507 of file card.cpp.

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

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 524 of file card.cpp.

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

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 353 of file card.cpp.

References mImport.

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

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 338 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 324 of file card.cpp.

References mImport.

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 454 of file card.cpp.

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

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 140 of file card.cpp.

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

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:

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::getXOrgLayout(), SaX::SaXManipulateLayout::removeRelative(), SaX::SaXManipulateLayout::setRelative(), and SaX::SaXManipulateLayout::setXOrgLayout().

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

set busID location for the selected graphics device

Implements SaX::SaXManipulateCardIF.

Definition at line 167 of file card.cpp.

References mImport.

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 84 of file card.cpp.

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

Here is the call graph for this function:

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 196 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 180 of file card.cpp.

References mImport.


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 12:42:53 2006 for libsax by  doxygen 1.4.6