libsax 7.2
Public Member Functions | Protected Attributes

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 addCardExternal (const QString &)
void addCardExternalOption (const QString &, const QString &)
void setBusID (const QString &)
void setScreenID (int)
void setRotate (int)
QList< QString > getCardDrivers (void)
Q3Dict< QString > getCardOptions (const QString &)
Q3Dict< 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
Q3Dict< 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

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

References SaX::SaXException::errorString(), and SaX::SaXException::excNullPointerArgument().

Here is the call graph for this function:


Member Function Documentation

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

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

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

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

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

Referenced by SaX::SaXManipulateVNC::allowMultipleConnections().

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

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

retrieve the cards driver name from the currently selected card

Implements SaX::SaXManipulateCardIF.

Definition at line 362 of file card.cpp.

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

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

retrieve the card model from the SYSP_CARD interface

Implements SaX::SaXManipulateCardIF.

Definition at line 321 of file card.cpp.

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

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

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

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

retrieve the card vendor from the SYSP_CARD interface

Implements SaX::SaXManipulateCardIF.

Definition at line 295 of file card.cpp.

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

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

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

Referenced by addCardExternalOption(), and SaX::SaXManipulateLayout::getMultiheadMode().

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

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

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

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

Referenced by SaX::SaXManipulateVNC::allowMultipleConnections().

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

Referenced by SaX::SaXManipulateLayout::getMultiheadMode(), 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 215 of file card.cpp.

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

set the card driver to use with the selected device

Implements SaX::SaXManipulateCardIF.

Definition at line 72 of file card.cpp.

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

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

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


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