interface.cpp

00001 /**************
00002 FILE          : interface.cpp
00003 ***************
00004 PROJECT       : SaX2 - library interface
00005               :
00006 AUTHOR        : Marcus Schäfer <ms@suse.de>
00007               :
00008 BELONGS TO    : SaX2 - SuSE advanced X11 configuration 
00009               : 
00010               :
00011 DESCRIPTION   : native C++ class library to access SaX2
00012               : functionality. Easy to use interface for
00013               : //.../
00014               : - importing/exporting X11 configurations
00015               : - modifying/creating X11 configurations 
00016               : ---
00017               :
00018               :
00019 STATUS        : Status: Development
00020 **************/
00021 #include "interface.h"
00022 
00023 //====================================
00024 // EntryPoint
00025 //------------------------------------
00026 EntryPoint entrypoint = {
00027         name: "LML::libsax",
00028         version: SAX_VERSION,
00029         factory: (Factory) LML::SaXPluglib::factory
00030 };
00031 
00032 namespace LML {
00033 //====================================
00034 // Constructor
00035 //------------------------------------
00036 SaXPluglib::SaXPluglib (void) {
00037         // ...
00038 }
00039 
00040 //====================================
00041 // factory for dynamic loader
00042 //------------------------------------
00043 SaXPluglib* SaXPluglib::factory (void) {
00044         return new SaXPluglib();
00045 }
00046 
00047 //====================================
00048 // Constructor saxInit...
00049 //------------------------------------
00050 SaXInit* SaXPluglib::saxInit ( void ) {
00051         return new SaXInit ();
00052 }
00053 
00054 //====================================
00055 // Constructor saxConfig...
00056 //------------------------------------
00057 SaXConfig* SaXPluglib::saxConfig ( int source ) {
00058         return new SaXConfig (source);
00059 }
00060 
00061 //====================================
00062 // Constructor saxImport...
00063 //------------------------------------
00064 SaXImport* SaXPluglib::saxImport ( int id ) {
00065         return new SaXImport (id);
00066 }
00067 
00068 //====================================
00069 // Constructor saxImportSysp...
00070 //------------------------------------
00071 SaXImportSysp* SaXPluglib::saxImportSysp ( int id ) {
00072         return new SaXImportSysp (id);
00073 }
00074 
00075 //====================================
00076 // Constructor saxImportCDB...
00077 //------------------------------------
00078 SaXImportCDB* SaXPluglib::saxImportCDB  ( int id ) {
00079         return new SaXImportCDB (id);
00080 }
00081 
00082 //====================================
00083 // Constructor saxImportProfile...
00084 //------------------------------------
00085 SaXImportProfile* SaXPluglib::saxImportProfile ( const char* file ) {
00086         return new SaXImportProfile (file);
00087 }
00088 
00089 //====================================
00090 // Constructor saxManipulateDesktop...
00091 //------------------------------------
00092 SaXManipulateDesktop* SaXPluglib::saxManipulateDesktop (
00093         SaXImport* desktop, SaXImport* card , SaXImport* path, int desktopID
00094 ) {
00095         return new SaXManipulateDesktop (desktop,card,path,desktopID);
00096 }
00097 
00098 //====================================
00099 // Constructor saxManipulateCard...
00100 //------------------------------------
00101 SaXManipulateCard* SaXPluglib::saxManipulateCard (
00102         SaXImport* in, int card
00103 ) {
00104         return new SaXManipulateCard (in,card);
00105 }
00106 
00107 //====================================
00108 // Construct saxManipulateKeyboard...
00109 //------------------------------------
00110 SaXManipulateKeyboard* SaXPluglib::saxManipulateKeyboard (
00111         SaXImport* in, int kbd
00112 ) {
00113         return new SaXManipulateKeyboard (in,kbd);
00114 }
00115 
00116 //====================================
00117 // Constructor saxManipulateDevices...
00118 //------------------------------------
00119 SaXManipulateDevices* SaXPluglib::saxManipulateDevices (
00120         SaXImport* desktop ,SaXImport* card ,SaXImport* layout
00121 ) {
00122         return new SaXManipulateDevices (desktop,card,layout);
00123 }
00124 
00125 //====================================
00126 // Constructor saxManipulateDevices...
00127 //------------------------------------
00128 SaXManipulateDevices* SaXPluglib::saxManipulateDevices (
00129         SaXImport* input, SaXImport* layout
00130 ) {
00131         return new SaXManipulateDevices (input,layout);
00132 }
00133 
00134 //====================================
00135 // Constructor saxManipulateLayout...
00136 //------------------------------------
00137 SaXManipulateLayout* SaXPluglib::saxManipulateLayout (
00138         SaXImport* layout,SaXImport* card
00139 ) {
00140         return new SaXManipulateLayout (layout,card);
00141 }
00142 
00143 //====================================
00144 // Constructor saxManipulatePath...
00145 //------------------------------------
00146 SaXManipulatePath* SaXPluglib::saxManipulatePath (
00147         SaXImport* in, int path
00148 ) {
00149         return new SaXManipulatePath (in,path);
00150 }
00151 
00152 //====================================
00153 // Constructor saxManipulateMice...
00154 //------------------------------------
00155 SaXManipulateMice* SaXPluglib::saxManipulateMice (
00156         SaXImport* in, int ptr
00157 ) {
00158         return new SaXManipulateMice (in,ptr);
00159 }
00160 
00161 //====================================
00162 // Constructor saxManipulateTablets...
00163 //------------------------------------
00164 SaXManipulateTablets* SaXPluglib::saxManipulateTablets (
00165         SaXImport* pointer, SaXImport* layout, int id
00166 ) {
00167         return new SaXManipulateTablets (pointer,layout,id);
00168 }
00169 
00170 //====================================
00171 // Constructor saxManipulateVNC...
00172 //------------------------------------
00173 SaXManipulateVNC* SaXPluglib::saxManipulateVNC (
00174         SaXImport* card,SaXImport* pointer,SaXImport* kbd,
00175         SaXImport* layout,SaXImport* path,int id
00176 ) {
00177         return new SaXManipulateVNC (card,pointer,kbd,layout,path,id);
00178 }
00179 
00180 //====================================
00181 // Construct saxManipulateTouchscreens
00182 //------------------------------------
00183 SaXManipulateTouchscreens* SaXPluglib::saxManipulateTouchscreens (
00184         SaXImport* in, int ptr
00185 ) {
00186         return new SaXManipulateTouchscreens (in,ptr);
00187 }
00188 
00189 //====================================
00190 // Construct ManipulateExtensions...
00191 //------------------------------------
00192 SaXManipulateExtensions* SaXPluglib::saxManipulateExtensions (
00193         SaXImport* in
00194 ) {
00195         return new SaXManipulateExtensions (in);
00196 }
00197 
00198 //====================================
00199 // Enable debugging...
00200 //------------------------------------
00201 void SaXPluglib::setDebug ( bool enable ) {
00202         SaXException exception;
00203         exception.setDebug (enable); 
00204 }
00205 
00206 //====================================
00207 // translate QString to std::string
00208 //------------------------------------
00209 std::string SaXPluglib::STLstring (const QString& qstr) {
00210         return std::string (qstr.data());
00211 }
00212 
00213 //====================================
00214 // translate QList to std::deque
00215 //------------------------------------
00216 std::deque<std::string> SaXPluglib::STLdeque (const QList<QString>& qlist) {
00217         std::deque<std::string> list;
00218         QListIterator<QString> it (qlist);
00219         for (; it.current(); ++it) {
00220                 list.push_back (STLstring(*it.current()));
00221         }
00222         return list;
00223 }
00224 
00225 //====================================
00226 // translate QDict to std::map
00227 //------------------------------------
00228 std::map<std::string,std::string> SaXPluglib::STLmap (
00229         const QDict<QString>& qdict
00230 ) {
00231         std::map<std::string,std::string> dict;
00232         QDictIterator<QString> it (qdict);
00233         for (; it.current(); ++it) {
00234                 dict.insert ( std::make_pair (
00235                         STLstring(it.currentKey()),STLstring(*it.current())
00236                 ));
00237         }
00238         return dict;
00239 }
00240 } // end namespace

Generated on Mon Jun 19 12:42:49 2006 for libsax by  doxygen 1.4.6