SaX::SaXManipulateLayout Class Reference

SaX2 - Layout class. More...

#include <layout.h>

Inheritance diagram for SaX::SaXManipulateLayout:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void setXOrgMultiheadMode (int)
bool setXOrgLayout (int, int, int, int, int)
bool setRelative (int, int, int, int)
bool removeRelative (int)
int getMultiheadMode (void)
QList< QString > getXOrgLayout (int)
QList< QString > getInputLayout (void)
void addInputLayout (int)
void removeInputLayout (int)
 SaXManipulateLayout (SaXImport *, SaXImport *)

Detailed Description

SaX2 - Layout class.

The layout manipulator requires two import objects (Layout and Card) to become created. Once created the manipulator object is able to get/set layout related information. The layout specifies the relationship and cooperation between the screens. The following example demonstrate how to check for the multihead mode currently used:

 #include <sax/sax.h>

 int main (void) {
     SaXException().setDebug (true);
     QDict<SaXImport> section;
     int importID[] = {
         SAX_LAYOUT,
         SAX_CARD
     };
     printf ("Importing data...\n");
     SaXConfig* config = new SaXConfig;
     for (int id=0; id<2; id++) {
         SaXImport* import = new SaXImport ( importID[id] );
         import->setSource ( SAX_SYSTEM_CONFIG );
         import->doImport();
         config->addImport (import);
         section.insert (
             import->getSectionName(),import
         );
     }
     printf ("checking multihead mode... ");
     SaXManipulateLayout layout (
         section["Layout"],section["Card"]
     );
     switch (layout.getMultiheadMode()) {
         case SAX_SINGLE_HEAD:
             printf ("single head mode\n");
         break;
         case SAX_XINERAMA:
             printf ("Xorg Xinerama mode\n");
         break;
         case SAX_TRADITIONAL:
             printf ("Xorg traditional multihead\n");
         break;
         case SAX_CLONE:
             printf ("Xorg cloned multihead\n");
         break;
         case SAX_TWINVIEW:
             printf ("Nvidia Twinview mode\n");
         break;
         case SAX_TWINVIEW_CLONE:
             printf ("Nvidia Twinview clone mode\n");
         break;
         default:
             printf ("unknown mode\n");
         break;
     }
     return (0);
 }

Definition at line 132 of file layout.h.


Constructor & Destructor Documentation

SaX::SaXManipulateLayout::SaXManipulateLayout SaXImport layout,
SaXImport card
 

An object of this type is used to configure the server layout. This includes mainly the configuration of the multihead arrangement and the multihead mode

Definition at line 27 of file layout.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excLayoutImportBindFailed(), SaX::SaXException::excNullPointerArgument(), and SaX::SaXImport::getSectionID().

Here is the call graph for this function:


Member Function Documentation

void SaX::SaXManipulateLayout::addInputLayout int  id  )  [virtual]
 

add the given pointer ID to the InputDevice option of the layout section.

Implements SaX::SaXManipulateLayoutIF.

Definition at line 339 of file layout.cpp.

QList< QString > SaX::SaXManipulateLayout::getInputLayout void   )  [virtual]
 

return the layout of the pointer devices. The list contains the Identifier numbers of the activated devices

Implements SaX::SaXManipulateLayoutIF.

Definition at line 308 of file layout.cpp.

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

Here is the call graph for this function:

int SaX::SaXManipulateLayout::getMultiheadMode void   )  [virtual]
 

return an identifier for the currently used multihead mode. Currently there are the following modes: SAX_TWINVIEW,SAX_TRADITIONAL,SAX_SINGLE_HEAD,SAX_CLONE and SAX_XINERAMA. The return of SAX_UNKNOWN_MODE should never happen

Implements SaX::SaXManipulateLayoutIF.

Definition at line 185 of file layout.cpp.

References SaX::SaXStorage::getCount().

Here is the call graph for this function:

QList< QString > SaX::SaXManipulateLayout::getXOrgLayout int  screen  )  [virtual]
 

return the layout for the given screen (screen). The returned list has four elements which defines the (left | right | top | bottom) neighbours of the requested screen

Implements SaX::SaXManipulateLayoutIF.

Definition at line 274 of file layout.cpp.

References SaX::SaXManipulateCard::selectCard().

Here is the call graph for this function:

void SaX::SaXManipulateLayout::removeInputLayout int  id  )  [virtual]
 

remove the given pointer ID from the InputDevice option of the layout section

Implements SaX::SaXManipulateLayoutIF.

Definition at line 357 of file layout.cpp.

bool SaX::SaXManipulateLayout::removeRelative int  screen  )  [virtual]
 

remove the Relative position information from the ServerLayout section if there is such an information

Implements SaX::SaXManipulateLayoutIF.

Definition at line 127 of file layout.cpp.

References SaX::SaXManipulateCard::selectCard().

Here is the call graph for this function:

bool SaX::SaXManipulateLayout::setRelative int  relativeTo,
int  originForScreen,
int  x,
int  y
[virtual]
 

These give the screen's location relative to another screen. When positioning to the right or left, the top edges are aligned. When positioning above or below, the left edges are aligned. The Relative form specifies the offset of the screen's origin (upper left corner) relative to the origin of another screen. Example:

1024 |---------- | | | 640 768 | 0 |-----| | | 1 | 480 |---------- |-----|

To achieve this allignment the origin (upper left corner) of Screen[1] must be set to X=1024 Y=288 RELATIVE to Screen[0] This means the following function call

setRelative ( 0,1,1024,288 )

Implements SaX::SaXManipulateLayoutIF.

Definition at line 86 of file layout.cpp.

References SaX::SaXManipulateCard::selectCard().

Here is the call graph for this function:

bool SaX::SaXManipulateLayout::setXOrgLayout int  screen,
int  left,
int  right,
int  top,
int  bottom
[virtual]
 

set the layout for the given screen (screen). The parameters define the neighbour IDs at the positions left , right , top and bottom. If there is no neighbour at position X a negative value must be set

Implements SaX::SaXManipulateLayoutIF.

Definition at line 145 of file layout.cpp.

References SaX::SaXManipulateCard::selectCard().

Here is the call graph for this function:

void SaX::SaXManipulateLayout::setXOrgMultiheadMode int  mode  )  [virtual]
 

set the multihead mode which can be one of the following settings: SAX_XINERAMA, SAX_TRADITIONAL or SAX_CLONE

Implements SaX::SaXManipulateLayoutIF.

Definition at line 57 of file layout.cpp.

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

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 17:38:27 2008 for libsax by  doxygen 1.4.6