libsax documentation

7.2

Introduction

libsax is a X11 configuration library for XOrg version v6.x. Between the SaX GUI and the SaX engine an interface exists to transport the information from the GUI into the engine which is then able to create or modify the X11 configuration. This interface is called ISaX. A complete explanation about how SaX2 is structured can be found within the documentation at /usr/share/doc/packages/sax2. The ISaX interface is the basis for the C++ library explained here. The library is based on the following major topics:

The programmer starts with an init() sequence to be able to access the automatically generated configuration suggestion which is based on the hardware detection. After this it is possible to import,manipulate and export information.

Bindings

A language binding enables the programmer to use libsax in another language than C++. Currently the following language bindings exist:

To give you an overview how simple it is to use libsax in another language have a look at the following perl example which is used to change the default color depth of the current configuration to a value of 24 bit

 #!/usr/bin/perl

 use SaX;

 sub main {
     my %section;
     my @importID = (
         $SaX::SAX_CARD, $SaX::SAX_DESKTOP, $SaX::SAX_PATH
     );
     my $config = new SaX::SaXConfig;
     foreach my $id (@importID) {
         $import = new SaX::SaXImport ( $id );
         $import->setSource ( $SaX::SAX_SYSTEM_CONFIG );
         $import->doImport();
         $config->addImport ( $import );
         $section{$import->getSectionName()} = $import;
     }
     my $mDesktop = new SaX::SaXManipulateDesktop (
         $section{Desktop},$section{Card},$section{Path}
     );
     if ($mDesktop->selectDesktop (0)) {
         $mDesktop->setColorDepth (24);
     }
     $config->setMode ($SaX::SAX_MERGE);
     $config->createConfiguration();
 }

 main();

Generated on Mon Jan 7 17:25:36 2008 for libsax by  doxygen 1.4.6