00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "desktop.h"
00022 #include <X11/Xcms.h>
00023 #include <X11/extensions/scrnsaver.h>
00024
00025 namespace SaX {
00026
00027
00028
00029 SaXManipulateDesktop::SaXManipulateDesktop (
00030 SaXImport* desktop, SaXImport* card , SaXImport* path, int desktopID
00031 ) {
00032
00035
00036 if ( (! desktop) || (! card) ) {
00037 excNullPointerArgument ();
00038 qError (errorString(),EXC_NULLPOINTERARGUMENT);
00039 return;
00040 }
00041 if ( desktop->getSectionID() != SAX_DESKTOP ) {
00042 excDesktopImportBindFailed ( desktop->getSectionID() );
00043 qError (errorString(),EXC_DESKTOPIMPORTBINDFAILED);
00044 return;
00045 }
00046 if ( card->getSectionID() != SAX_CARD ) {
00047 excCardImportBindFailed ( card->getSectionID() );
00048 qError (errorString(),EXC_CARDIMPORTBINDFAILED);
00049 return;
00050 }
00051 if ( path->getSectionID() != SAX_PATH ) {
00052 excPathImportBindFailed ( path->getSectionID() );
00053 qError (errorString(),EXC_PATHIMPORTBINDFAILED);
00054 return;
00055 }
00056 mDesktopID = desktopID;
00057 mDesktop = desktop;
00058 mCard = card;
00059 mPath = path;
00060 mDesktop -> setID ( mDesktopID );
00061 mCard -> setID ( mDesktopID );
00062 mPath -> setID ( 0 );
00063 mCDBMonitors = 0;
00064 mSyspDesktop = 0;
00065 }
00066
00067
00068
00069
00070 bool SaXManipulateDesktop::selectDesktop (int desktop) {
00071
00074
00075 if ((! mDesktop) || (! mCard) || (! mPath)) {
00076 return false;
00077 }
00078 if ( (mDesktop->setID (desktop)) && (mCard->setID (desktop)) ) {
00079 mDesktopID = desktop;
00080 return true;
00081 }
00082 return false;
00083 }
00084
00085
00086
00087
00088 void SaXManipulateDesktop::calculateModelines (bool calc) {
00089
00093
00094 if ((! mDesktop) || (! mCard) || (! mPath)) {
00095 return;
00096 }
00097 QString val ("no");
00098 if (calc) {
00099 val = "on";
00100 }
00101 mDesktop -> setItem ( "CalcModelines",val );
00102 }
00103
00104
00105
00106
00107 void SaXManipulateDesktop::setResolution (int c,int x,int y) {
00108
00111
00112 if ((! mDesktop) || (! mCard) || (! mPath)) {
00113 return;
00114 }
00115 QString key;
00116 QString val;
00117 key.sprintf ("Modes:%d",c);
00118 val.sprintf ("%dx%d",x,y);
00119 mDesktop -> setItem ( key,val );
00120 }
00121
00122
00123
00124
00125 void SaXManipulateDesktop::addResolution (int c,int x,int y) {
00126
00129
00130 if ((! mDesktop) || (! mCard) || (! mPath)) {
00131 return;
00132 }
00133 QString key;
00134 QString val;
00135 key.sprintf ("Modes:%d",c);
00136 if (! mDesktop -> getItem (key).isEmpty()) {
00137 val = mDesktop -> getItem (key);
00138 }
00139 QTextOStream (&val) << "," << x << "x" << y;
00140 val.replace (QRegExp("^,"),"");
00141 mDesktop -> setItem ( key,val );
00142 }
00143
00144
00145
00146
00147 void SaXManipulateDesktop::removeResolution (int c,int x,int y) {
00148
00151
00152 if ((! mDesktop) || (! mCard) || (! mPath)) {
00153 return;
00154 }
00155 QString key;
00156 QString val;
00157 key.sprintf ("Modes:%d",c);
00158 val.sprintf ("%dx%d",x,y);
00159 if (! mDesktop -> getItem (key).isEmpty()) {
00160 mDesktop -> removeItem (key,val);
00161 }
00162 }
00163
00164
00165
00166
00167 void SaXManipulateDesktop::setVirtualResolution (int c,int x,int y) {
00168
00171
00172 if ((! mDesktop) || (! mCard) || (! mPath)) {
00173 return;
00174 }
00175 QString key;
00176 QString val;
00177 key.sprintf ("Virtual:%d",c);
00178 val.sprintf ("%d %d",x,y);
00179 mDesktop -> setItem ( key,val );
00180 }
00181
00182
00183
00184
00185 void SaXManipulateDesktop::removeVirtualResolution (int c) {
00186
00189
00190 if ((! mDesktop) || (! mCard) || (! mPath)) {
00191 return;
00192 }
00193 QString key;
00194 key.sprintf ("Virtual:%d",c);
00195 if (! mDesktop -> getItem (key).isEmpty()) {
00196 mDesktop -> setItem (key,"");
00197 }
00198 }
00199
00200
00201
00202
00203 void SaXManipulateDesktop::setColorDepth (int c) {
00204
00207
00208 if ((! mDesktop) || (! mCard) || (! mPath)) {
00209 return;
00210 }
00211 QString color;
00212 color.sprintf ("%d",c);
00213 mDesktop -> setItem ( "ColorDepth",color );
00214 }
00215
00216
00217
00218
00219 bool SaXManipulateDesktop::is3DCard (void) {
00220
00223
00224 if ((! mDesktop) || (! mCard) || (! mPath)) {
00225 return false;
00226 }
00227
00228
00229
00230 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00231 pCard -> doImport();
00232 if (! pCard -> setID ( mDesktopID )) {
00233 return false;
00234 }
00235 QString mCardName;
00236 QTextOStream (&mCardName) <<
00237 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00238
00239
00240
00241 SaXProcess* CDBCards = new SaXProcess ();
00242 CDBCards -> start (CDB_CARDS);
00243 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00244 Q3Dict<QString>* cardData = CDBData.find( mCardName );
00245 if ( cardData ) {
00246 QString* flag = cardData -> find ("Flag");
00247 if (flag) {
00248 QString driver = mCard -> getItem ("Driver");
00249 QString* driver3D = cardData -> find ("3DDriver");
00250 if ((driver3D) && (driver == *driver3D)) {
00251
00252
00253
00254 if ( driver == "nvidia") {
00255 QString vendor = getVendorForDriver ( driver );
00256 if (vendor == "NVIDIA Corporation") {
00257 return true;
00258 }
00259 return false;
00260 }
00261 return true;
00262 }
00263 return false;
00264 }
00265 return false;
00266 }
00267
00268
00269
00270 excEmptyCDBGroup ( mCardName.latin1() );
00271 qError (errorString(),EXC_EMPTYCDBGROUP);
00272 return false;
00273 }
00274
00275
00276
00277
00278 QString SaXManipulateDesktop::getDualHeadProfile ( void ) {
00279
00285
00286 if ((! mDesktop) || (! mCard) || (! mPath)) {
00287 QString* nope = new QString;
00288 return *nope;
00289 }
00290
00291
00292
00293 Q3Dict<QString> metaData = getMetaData();
00294 if (metaData["SAX_NO_CDB_CHECK"]) {
00295 QString driver = mCard -> getItem ("Driver");
00296 QString profile = getDriverOptionsDualHeadProfile ( driver );
00297 return profile;
00298 }
00299
00300
00301
00302 QString result;
00303 SaXManipulateCard cardInfo (mCard);
00304 if (cardInfo.isNoteBook()) {
00305 QString driver = mCard -> getItem ("Driver");
00306 result = getDriverOptionsDualHeadProfile ( driver );
00307 return result;
00308 }
00309
00310
00311
00312 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00313 pCard -> doImport();
00314 if (! pCard -> setID ( mDesktopID )) {
00315 QString* nope = new QString;
00316 return *nope;
00317 }
00318 QString mCardName;
00319 QTextOStream (&mCardName) <<
00320 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00321
00322
00323
00324 SaXProcess* CDBCards = new SaXProcess ();
00325 CDBCards -> start (CDB_CARDS);
00326 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00327 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00328 if ( cardData ) {
00329 QString* profile = cardData -> find ("Profile");
00330 if ((profile) && (profile->contains("DualHead_DriverOptions"))) {
00331
00332
00333
00334 QString syspDriver = pCard -> getItem ("Module");
00335 QString* CDB2DDriver = cardData -> find ("Driver");
00336 QString* CDB3DDriver = cardData -> find ("3DDriver");
00337 if (
00338 ((CDB2DDriver) && (syspDriver == *CDB2DDriver)) ||
00339 ((CDB3DDriver) && (syspDriver == *CDB2DDriver))
00340 ) {
00341 QTextOStream (&result) << PROFILE_DIR << profile;
00342 return result;
00343 }
00344
00345
00346
00347 result = getDriverOptionsDualHeadProfile ( syspDriver );
00348 return result;
00349 }
00350 }
00351
00352
00353
00354 excEmptyCDBGroup ( mCardName.latin1() );
00355 qError (errorString(),EXC_EMPTYCDBGROUP);
00356 QString* nope = new QString;
00357 return *nope;
00358 }
00359
00360
00361
00362
00363 bool SaXManipulateDesktop::isXineramaMode (void) {
00364
00365
00366
00367
00368
00369 Q3Dict<QString> metaData = getMetaData();
00370 if (metaData["SAX_NO_DUAL_MODE"]) {
00371 return true;
00372 }
00373 return false;
00374 }
00375
00376
00377
00378
00379 bool SaXManipulateDesktop::isDualHeadCard (void) {
00380
00384
00385 if ((! mDesktop) || (! mCard) || (! mPath)) {
00386 return false;
00387 }
00388
00389
00390
00391 Q3Dict<QString> metaData = getMetaData();
00392 if (metaData["SAX_NO_CDB_CHECK"]) {
00393 QString driver = mCard -> getItem ("Driver");
00394 QString profile = getDriverOptionsDualHeadProfile ( driver );
00395 if (! profile.isEmpty()) {
00396 return true;
00397 }
00398 return false;
00399 }
00400
00401
00402
00403 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00404 pCard -> doImport();
00405 if (! pCard -> setID ( mDesktopID )) {
00406 return false;
00407 }
00408 QString mCardName;
00409 QTextOStream (&mCardName) <<
00410 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00411
00412
00413
00414 SaXProcess* CDBCards = new SaXProcess ();
00415 CDBCards -> start (CDB_CARDS);
00416 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00417 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00418 if ( cardData ) {
00419 QString* profile = cardData -> find ("Profile");
00420 if ((profile) && (profile->contains("DualHead_DriverOptions"))) {
00421
00422
00423
00424 QString syspDriver = pCard -> getItem ("Module");
00425 QString* CDB2DDriver = cardData -> find ("Driver");
00426 QString* CDB3DDriver = cardData -> find ("3DDriver");
00427 if (
00428 ((CDB2DDriver) && (syspDriver != *CDB2DDriver)) &&
00429 ((CDB3DDriver) && (syspDriver != *CDB2DDriver))
00430 ) {
00431 *profile = getDriverOptionsDualHeadProfile ( syspDriver );
00432 }
00433 if (profile->isEmpty()) {
00434 return false;
00435 }
00436
00437
00438
00439 SaXProcessCall* proc = new SaXProcessCall ();
00440 proc -> addArgument ( SAX_PROFILE_CHECK );
00441 proc -> addArgument ( *profile );
00442 if ( ! proc -> start() ) {
00443 excProcessFailed();
00444 qError (errorString(),EXC_PROCESSFAILED);
00445 return false;
00446 }
00447 if (proc->exitStatus() == 0) {
00448 return true;
00449 }
00450 return false;
00451 }
00452 return false;
00453 }
00454
00455
00456
00457 excEmptyCDBGroup ( mCardName.latin1() );
00458 qError (errorString(),EXC_EMPTYCDBGROUP);
00459 return false;
00460 }
00461
00462
00463
00464
00465 bool SaXManipulateDesktop::enable3D (void) {
00466
00475
00476 if ((! mDesktop) || (! mCard) || (! mPath)) {
00477 return false;
00478 }
00479
00480
00481
00482 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00483 pCard -> doImport();
00484 if (! pCard -> setID ( mDesktopID )) {
00485 return false;
00486 }
00487 QString mCardName;
00488 QTextOStream (&mCardName) <<
00489 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00490
00491
00492
00493
00494 SaXProcess* CDBCards = new SaXProcess ();
00495 CDBCards -> start (CDB_CARDS);
00496 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00497
00498
00499
00500
00501 SaXManipulateCard cardInfo (mCard,mDesktopID);
00502 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00503 if ( cardData ) {
00504 QString* driver3D= cardData -> find ("3DDriver");
00505 QString* driver2D= cardData -> find ("Driver");
00506 QString* extends = cardData -> find ("Extension");
00507 QString* flag = cardData -> find ("Flag");
00508
00509
00510
00511 if (! flag) {
00512 return false;
00513 }
00514
00515
00516
00517 if ((driver3D) && (*driver3D == "nvidia")) {
00518 bool foundBinaryNVidiaDriver = false;
00519 if ((getVendorForDriver(*driver3D)) == "NVIDIA Corporation") {
00520 foundBinaryNVidiaDriver = true;
00521 }
00522 if (! foundBinaryNVidiaDriver) {
00523 excNvidiaDriverMissing();
00524 qError (errorString(),EXC_NVIDIADRIVERMISSING);
00525 return false;
00526 }
00527 }
00528
00529
00530
00531 if (extends) {
00532 SaXManipulatePath pathInfo (mPath);
00533 pathInfo.removeDisableModule (*extends);
00534 pathInfo.removeLoadableModule (*extends);
00535 pathInfo.addLoadableModule (*extends);
00536 }
00537
00538
00539
00540 if (driver3D) {
00541 QString currentDriver = cardInfo.getCardDriver();
00542 if ((currentDriver != *driver3D) && (currentDriver != *driver2D)) {
00543 excDriverMismatch (driver3D->ascii(),currentDriver.ascii());
00544 qError (errorString(),EXC_DRIVERMISMATCH);
00545 } else {
00546 cardInfo.setCardDriver (*driver3D);
00547 }
00548 }
00549 }
00550
00551
00552
00553 if (cardData) {
00554 QStringList profiles;
00555 QString* profile3D = cardData -> find ("3DProfile");
00556 QString* driver3D = cardData -> find ("3DDriver");
00557 QString* driver2D = cardData -> find ("Driver");
00558 if ((profile3D) && (! profile3D->contains("DualHead"))) {
00559 profiles += *profile3D;
00560 }
00561 if ((driver3D) && (*driver2D != *driver3D)) {
00562 SaXFile mapHandle (MAP_DIR + QString("Driver.map"));
00563 Q3Dict<QString> driverMap = mapHandle.readDict();
00564 QString driver = cardInfo.getCardDriver();
00565 if ((! driver.isEmpty()) && (driverMap[driver])) {
00566 QStringList items = QStringList::split ( ",", *driverMap[driver] );
00567 profiles += items;
00568 }
00569 }
00570 for (
00571 QStringList::Iterator it=profiles.begin();
00572 it != profiles.end(); ++it
00573 ) {
00574 QString profile (*it);
00575 SaXImportProfile* pProfile = new SaXImportProfile (
00576 PROFILE_DIR + profile
00577 );
00578 pProfile -> doImport();
00579
00580
00581
00582 SaXImport* mImportCard = pProfile -> getImport ( SAX_CARD );
00583 if ( mImportCard ) {
00584 Q3Dict<QString> profileDriverOptions;
00585 SaXManipulateCard saxProfileCard ( mImportCard );
00586 profileDriverOptions = saxProfileCard.getOptions();
00587 Q3DictIterator<QString> it ( profileDriverOptions );
00588 for (; it.current(); ++it) {
00589 QString key = it.currentKey();
00590 QString val = *it.current();
00591 cardInfo.addCardOption (key,val);
00592 }
00593 }
00594
00595
00596
00597 SaXImport* mImportDesktop = pProfile -> getImport ( SAX_DESKTOP );
00598 if ( mImportDesktop ) {
00599 Q3Dict<QString> profileDriverOptions;
00600 SaXManipulateDesktop saxProfileDesktop (
00601 mImportDesktop,mCard,mPath
00602 );
00603
00604
00605
00606 QString color = saxProfileDesktop.getColorDepth();
00607 if (! color.isEmpty()) {
00608 setColorDepth (color.toInt());
00609 }
00610 }
00611 }
00612 return true;
00613 }
00614
00615
00616
00617 excEmptyCDBGroup ( mCardName.latin1() );
00618 qError (errorString(),EXC_EMPTYCDBGROUP);
00619 return false;
00620 }
00621
00622
00623
00624
00625 bool SaXManipulateDesktop::disable3D (void) {
00626
00632
00633 if ((! mDesktop) || (! mCard) || (! mPath)) {
00634 return false;
00635 }
00636
00637
00638
00639 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00640 pCard -> doImport();
00641 if (! pCard -> setID ( mDesktopID )) {
00642 return false;
00643 }
00644 QString mCardName;
00645 QTextOStream (&mCardName) <<
00646 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00647
00648
00649
00650
00651 SaXProcess* CDBCards = new SaXProcess ();
00652 CDBCards -> start (CDB_CARDS);
00653 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00654
00655
00656
00657
00658 SaXManipulateCard cardInfo (mCard);
00659 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00660 if ( cardData ) {
00661 QString* driver3D= cardData -> find ("3DDriver");
00662 QString* driver2D= cardData -> find ("Driver");
00663 QString* extends = cardData -> find ("Extension");
00664 QString* flag = cardData -> find ("Flag");
00665
00666
00667
00668 if (! flag) {
00669 return false;
00670 }
00671
00672
00673
00674 if ((driver3D) && (*driver3D == "nvidia")) {
00675 if ((getVendorForDriver(*driver3D)) == "NVIDIA Corporation") {
00676 excNvidiaDriverInstalled();
00677 qError (errorString(),EXC_NVIDIADRIVERINSTALLED);
00678 return false;
00679 }
00680 }
00681
00682
00683
00684 if (extends) {
00685 SaXManipulatePath pathInfo (mPath);
00686 pathInfo.removeLoadableModule (*extends);
00687 pathInfo.removeDisableModule (*extends);
00688 pathInfo.addDisableModule (*extends);
00689 }
00690
00691
00692
00693 if ((driver2D) && (driver3D)) {
00694 QString currentDriver = cardInfo.getCardDriver();
00695 if ((currentDriver != *driver3D) && (currentDriver != *driver2D)) {
00696 excDriverMismatch (driver2D->ascii(),currentDriver.ascii());
00697 qError (errorString(),EXC_DRIVERMISMATCH);
00698 } else {
00699 cardInfo.setCardDriver (*driver2D);
00700 }
00701 }
00702 }
00703
00704
00705
00706 if (cardData) {
00707 QStringList profiles;
00708 QString* profile3D = cardData -> find ("3DProfile");
00709 QString* driver3D = cardData -> find ("3DDriver");
00710 QString* driver2D = cardData -> find ("Driver");
00711 if ((profile3D) && (! profile3D->contains("DualHead"))) {
00712 profiles += *profile3D;
00713 }
00714 if ((driver3D) && (*driver2D != *driver3D)) {
00715 SaXFile mapHandle (MAP_DIR + QString("Driver.map"));
00716 Q3Dict<QString> driverMap = mapHandle.readDict();
00717 if ((driver3D) && (driverMap[*driver3D])) {
00718 QStringList items = QStringList::split ( ",",*driverMap[*driver3D] );
00719 profiles += items;
00720 }
00721 }
00722 for (
00723 QStringList::Iterator it=profiles.begin();
00724 it != profiles.end(); ++it
00725 ) {
00726 QString profile (*it);
00727 SaXImportProfile* pProfile = new SaXImportProfile (
00728 PROFILE_DIR + profile
00729 );
00730 pProfile -> doImport();
00731
00732
00733
00734 SaXImport* mImportCard = pProfile -> getImport ( SAX_CARD );
00735 if ( mImportCard ) {
00736 Q3Dict<QString> profileDriverOptions;
00737 SaXManipulateCard saxProfileCard ( mImportCard );
00738 profileDriverOptions = saxProfileCard.getOptions();
00739 Q3DictIterator<QString> it ( profileDriverOptions );
00740 for (; it.current(); ++it) {
00741 QString key = it.currentKey();
00742 cardInfo.removeCardOption (key);
00743 }
00744 }
00745 }
00746 return true;
00747 }
00748
00749
00750
00751 excEmptyCDBGroup ( mCardName.latin1() );
00752 qError (errorString(),EXC_EMPTYCDBGROUP);
00753 return false;
00754 }
00755
00756
00757
00758
00759 void SaXManipulateDesktop::setDisplaySize (int width,int height) {
00760
00763
00764 if ((! mDesktop) || (! mCard) || (! mPath)) {
00765 return;
00766 }
00767 QString size;
00768 size.sprintf ("%d %d",width,height);
00769 mDesktop -> setItem ( "DisplaySize",size );
00770 }
00771
00772
00773
00774
00775 void SaXManipulateDesktop::setDisplayRatioAndTraversal (
00776 double traversal,int aspect, int ratio
00777 ) {
00778
00781
00782 if ((! mDesktop) || (! mCard) || (! mPath)) {
00783 return;
00784 }
00785 traversal = traversal * 25.4;
00786 double ar = (double)aspect / (double)ratio;
00787 double y = sqrt ( (traversal * traversal) / (ar * ar + 1.0) );
00788 double x = ar * y;
00789 setDisplaySize (
00790 (int)(round(x)),(int)(round(y))
00791 );
00792 }
00793
00794
00795
00796
00797 void SaXManipulateDesktop::setHsyncRange (double hsmin,double hsmax) {
00798
00801
00802 if ((! mDesktop) || (! mCard) || (! mPath)) {
00803 return;
00804 }
00805 QString range;
00806 range.sprintf ("%.0f-%.0f",hsmin,hsmax);
00807 mDesktop -> setItem ( "HorizSync",range );
00808 }
00809
00810
00811
00812
00813 void SaXManipulateDesktop::setVsyncRange (double vsmin,double vsmax) {
00814
00817
00818 if ((! mDesktop) || (! mCard) || (! mPath)) {
00819 return;
00820 }
00821 QString range;
00822 range.sprintf ("%.0f-%.0f",vsmin,vsmax);
00823 mDesktop -> setItem ( "VertRefresh",range );
00824 }
00825
00826
00827
00828
00829 void SaXManipulateDesktop::setPreferredMode (const QString& mode) {
00830
00833
00834 if ((! mDesktop) || (! mCard) || (! mPath)) {
00835 return;
00836 }
00837 mDesktop -> setItem ( "PreferredMode",mode);
00838 }
00839
00840
00841
00842
00843 void SaXManipulateDesktop::enableDPMS (void) {
00844
00848
00849 if ((! mDesktop) || (! mCard) || (! mPath)) {
00850 return;
00851 }
00852 mDesktop -> setItem ( "MonitorOptions","DPMS" );
00853 }
00854
00855
00856
00857
00858 void SaXManipulateDesktop::disableDPMS (void) {
00859
00862
00863 if ((! mDesktop) || (! mCard) || (! mPath)) {
00864 return;
00865 }
00866 mDesktop -> setItem ( "MonitorOptions","" );
00867 }
00868
00869
00870
00871
00872 void SaXManipulateDesktop::setMonitorVendor (const QString& vendor) {
00873
00876
00877 if ((! mDesktop) || (! mCard) || (! mPath)) {
00878 return;
00879 }
00880 mDesktop -> setItem ( "VendorName",vendor );
00881 }
00882
00883
00884
00885
00886 void SaXManipulateDesktop::setMonitorName (const QString& name) {
00887
00890
00891 if ((! mDesktop) || (! mCard) || (! mPath)) {
00892 return;
00893 }
00894 mDesktop -> setItem ( "ModelName",name );
00895 }
00896
00897
00898
00899
00900 bool SaXManipulateDesktop::is3DEnabled (void) {
00901
00906
00907 if ((! mDesktop) || (! mCard) || (! mPath)) {
00908 return false;
00909 }
00910 if ( mCard -> getCount() > 1 ) {
00911 return false;
00912 }
00913 QString driver = mCard -> getItem ("Driver");
00914 if (driver == "nvidia") {
00915 QString vendor = getVendorForDriver ( driver );
00916 if (vendor == "NVIDIA Corporation") {
00917 return true;
00918 }
00919 return false;
00920 }
00921 SaXManipulatePath pathInfo (mPath);
00922 QList<QString> modules = pathInfo.getModules();
00923 QString it;
00924 foreach (it,modules) {
00925 if (it == "dri") {
00926 return true;
00927 }
00928 }
00929 return false;
00930 }
00931
00932
00933
00934
00935 QList<QString> SaXManipulateDesktop::getResolutions (int color) {
00936
00940
00941 if ((! mDesktop) || (! mCard) || (! mPath)) {
00942 QList<QString>* nope = new QList<QString>;
00943 return *nope;
00944 }
00945 QString modes;
00946 modes.sprintf ("Modes:%d",color);
00947 QString resolutions = mDesktop -> getItem (modes);
00948 if (resolutions.isEmpty()) {
00949 QList<QString>* nope = new QList<QString>;
00950 return *nope;
00951 }
00952 QList<QString> result;
00953 QStringList resList = QStringList::split ( ",", resolutions );
00954 for (QStringList::Iterator it=resList.begin(); it!=resList.end();++ it) {
00955 result.append (*it);
00956 }
00957 return result;
00958 }
00959
00960
00961
00962
00963 QList<QString> SaXManipulateDesktop::getResolutionFromServer ( void ) {
00964
00969
00970 if ((! mDesktop) || (! mCard) || (! mPath)) {
00971 QList<QString>* nope = new QList<QString>;
00972 return *nope;
00973 }
00974 QList<QString> defaultList;
00975 defaultList.append (QString("800x600"));
00976 SaXProcessCall* proc = new SaXProcessCall();
00977 proc -> addArgument ( XQUERY );
00978 proc -> addArgument ( "-r" );
00979 if ( ! proc -> start() ) {
00980 return defaultList;
00981 }
00982 QList<QString> data = proc->readStdout();
00983 QString in;
00984 foreach (in,data) {
00985 QRegExp modeExp ("(\\d+) (.*)");
00986 int rpos = modeExp.search (in,0);
00987 if (rpos >= 0) {
00988 int id = modeExp.cap(1).toInt();
00989 if (id == mDesktopID) {
00990 QList<QString> result;
00991 result.append (QString (modeExp.cap(2)));
00992 return result;
00993 }
00994 }
00995 }
00996 return defaultList;
00997 }
00998
00999
01000
01001
01002 int SaXManipulateDesktop::getColorDepthFromServer (void) {
01003 Display* dpy = XOpenDisplay (0);
01004 return DisplayPlanes( dpy,0 );
01005 }
01006
01007
01008
01009
01010 int SaXManipulateDesktop::getFBKernelMode (const QString& res,int depth) {
01011 if (! mSyspDesktop) {
01012 mSyspDesktop = new SaXImportSysp (SYSP_DESKTOP);
01013 }
01014 mSyspDesktop -> setID ( mDesktopID );
01015 mSyspDesktop -> doImport ();
01016 if ( mSyspDesktop->getItem("FBBoot").isNull()) {
01017 return 0;
01018 }
01019 QString val = mSyspDesktop->getItem("FBBoot");
01020 QStringList items = QStringList::split ( ",", val );
01021 for (
01022 QStringList::Iterator it=items.begin();
01023 it != items.end(); ++it
01024 ) {
01025 QString* resolution = new QString();
01026 QString mode (*it);
01027 QStringList record = QStringList::split ( " ", mode );
01028 QTextOStream (resolution) << record.at(0) << "x" << record.at(1);
01029 QString color = record.at(2);
01030 if ((*resolution == res) && (color.toInt() == depth)) {
01031 QString mode = record.at(3);
01032 return mode.toInt();
01033 }
01034 }
01035 return 0;
01036 }
01037
01038
01039
01040
01041 int SaXManipulateDesktop::setFBKernelMode (int mode) {
01042 QString* modeString = new QString();
01043 QTextOStream (modeString) << mode;
01044 SaXProcessCall* proc = new SaXProcessCall ();
01045 proc -> addArgument ( SAX_GRUB_UPDATE );
01046 proc -> addArgument ( *modeString );
01047 if ( ! proc -> start() ) {
01048 excProcessFailed();
01049 qError (errorString(),EXC_PROCESSFAILED);
01050 return false;
01051 }
01052 if (proc->exitStatus() == 0) {
01053 return true;
01054 }
01055 return false;
01056 }
01057
01058
01059
01060
01061 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC (const QString& key) {
01062 QList<QString> result;
01063 Q3Dict<QString> hashed;
01064 SaXImportSysp* desktop = new SaXImportSysp (SYSP_DESKTOP);
01065 desktop -> setID ( mDesktopID );
01066 desktop -> doImport ();
01067 if ( desktop->getItem(key).isNull()) {
01068 QList<QString>* nope = new QList<QString>;
01069 return *nope;
01070 }
01071 if ((key != "FBBoot") && (desktop->getItem("DDC") == "<undefined>")) {
01072 QList<QString>* nope = new QList<QString>;
01073 return *nope;
01074 }
01075 QString val = desktop->getItem(key);
01076 QStringList items = QStringList::split ( ",", val );
01077 for (
01078 QStringList::Iterator it=items.begin();
01079 it != items.end(); ++it
01080 ) {
01081 QString* data = new QString();
01082 QString mode (*it);
01083 QStringList resolution = QStringList::split (" ", mode);
01084 QTextOStream (data) << resolution.at(0) << "x" << resolution.at(1);
01085 if (! hashed[*data]) {
01086 hashed.insert (*data,data);
01087 }
01088 }
01089 QString* default1 = new QString ("800x600");
01090 QString* default2 = new QString ("1024x768");
01091 hashed.insert (*default1,default1);
01092 hashed.insert (*default2,default2);
01093 Q3DictIterator<QString> ir (hashed);
01094 for (; ir.current(); ++ir) {
01095 result.append (*ir.current());
01096 }
01097 return result;
01098 }
01099
01100
01101
01102
01103 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC1 (void) {
01104 return getResolutionsFromDDC ("Vesa");
01105 }
01106
01107
01108
01109
01110 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC2 (void) {
01111 return getResolutionsFromDDC ("Vesa[2]");
01112 }
01113
01114
01115
01116
01117 QList<QString> SaXManipulateDesktop::getResolutionsFromFrameBuffer (void) {
01118 return getResolutionsFromDDC ("FBBoot");
01119 }
01120
01121
01122
01123
01124 QList<QString> SaXManipulateDesktop::getDisplaySize (void) {
01125
01131
01132 if ((! mDesktop) || (! mCard) || (! mPath)) {
01133 QList<QString>* nope = new QList<QString>;
01134 return *nope;
01135 }
01136 QString size = mDesktop -> getItem ("DisplaySize");
01137 if (size.isEmpty()) {
01138 QList<QString>* nope = new QList<QString>;
01139 return *nope;
01140 }
01141 QList<QString> result;
01142 QStringList sizeList = QStringList::split ( " ", size );
01143 result.append (
01144 QString(sizeList.first())
01145 );
01146 result.append (
01147 QString(sizeList.last())
01148 );
01149 return result;
01150 }
01151
01152
01153
01154
01155 QString SaXManipulateDesktop::getDisplayTraversal (void) {
01156
01159
01160 if ((! mDesktop) || (! mCard) || (! mPath)) {
01161 QString* nope = new QString;
01162 return *nope;
01163 }
01164 QList<QString> size = getDisplaySize();
01165 if (size.isEmpty()) {
01166 QString* nope = new QString;
01167 return *nope;
01168 }
01169 int x = size.at(0).toInt();
01170 int y = size.at(1).toInt();
01171 double traversal = sqrt (x*x + y*y) / 25.4;
01172 QString result;
01173 QTextOStream (&result) << traversal;
01174 return result;
01175 }
01176
01177
01178
01179
01180 QList<QString> SaXManipulateDesktop::getDisplayRatio (void) {
01181
01184
01185 if ((! mDesktop) || (! mCard) || (! mPath)) {
01186 QList<QString>* nope = new QList<QString>;
01187 return *nope;
01188 }
01189 QString* setX = new QString ("4");
01190 QString* setY = new QString ("3");
01191 QList<QString> result;
01192 QList<QString> size = getDisplaySize();
01193 if (size.isEmpty()) {
01194 QList<QString>* nope = new QList<QString>;
01195 return *nope;
01196 }
01197 int x = size.at(0).toInt();
01198 int y = size.at(1).toInt();
01199 double ar = (double)x / (double)y;
01200 if ( ar > 1.4 ) {
01201 *setX = "16";
01202 *setY = "10";
01203 } else if (( ar <= 1.4 ) && ( ar > 1.3 )) {
01204 *setX = "4";
01205 *setY = "3";
01206 } else if ( ar <= 1.3 ) {
01207 *setX = "5";
01208 *setY = "4";
01209 }
01210 result.append (*setX);
01211 result.append (*setY);
01212 return result;
01213 }
01214
01215
01216
01217
01218 QList<QString> SaXManipulateDesktop::getHsyncRange (void) {
01219
01223
01224 if ((! mDesktop) || (! mCard) || (! mPath)) {
01225 QList<QString>* nope = new QList<QString>;
01226 return *nope;
01227 }
01228 QString range = mDesktop -> getItem ("HorizSync");
01229 if (range.isEmpty()) {
01230 QList<QString>* nope = new QList<QString>;
01231 return *nope;
01232 }
01233 QList<QString> result;
01234 QStringList rangeList = QStringList::split ( "-", range );
01235 result.append (
01236 QString(rangeList.first())
01237 );
01238 result.append (
01239 QString(rangeList.last())
01240 );
01241 return result;
01242 }
01243
01244
01245
01246
01247 QList<QString> SaXManipulateDesktop::getVsyncRange (void) {
01248
01252
01253 if ((! mDesktop) || (! mCard) || (! mPath)) {
01254 QList<QString>* nope = new QList<QString>;
01255 return *nope;
01256 }
01257 QString range = mDesktop -> getItem ("VertRefresh");
01258 if (range.isEmpty()) {
01259 QList<QString>* nope = new QList<QString>;
01260 return *nope;
01261 }
01262 QList<QString> result;
01263 QStringList rangeList = QStringList::split ( "-", range );
01264 result.append (
01265 QString(rangeList.first())
01266 );
01267 result.append (
01268 QString(rangeList.last())
01269 );
01270 return result;
01271 }
01272
01273
01274
01275
01276 bool SaXManipulateDesktop::DPMSEnabled (void) {
01277
01281
01282 if ((! mDesktop) || (! mCard) || (! mPath)) {
01283 return false;
01284 }
01285 QString options = mDesktop -> getItem ("MonitorOptions");
01286 if (options == "DPMS") {
01287 return true;
01288 }
01289 return false;
01290 }
01291
01292
01293
01294
01295 QString SaXManipulateDesktop::getMonitorVendor (void) {
01296
01299
01300 if ((! mDesktop) || (! mCard) || (! mPath)) {
01301 QString* nope = new QString;
01302 return *nope;
01303 }
01304 return mDesktop -> getItem ("VendorName");
01305 }
01306
01307
01308
01309
01310 QString SaXManipulateDesktop::getMonitorName (void) {
01311
01314
01315 if ((! mDesktop) || (! mCard) || (! mPath)) {
01316 QString* nope = new QString;
01317 return *nope;
01318 }
01319 return mDesktop -> getItem ("ModelName");
01320 }
01321
01322
01323
01324
01325 QString SaXManipulateDesktop::getColorDepth (void) {
01326
01329
01330 if ((! mDesktop) || (! mCard) || (! mPath)) {
01331 QString* nope = new QString;
01332 return *nope;
01333 }
01334 return mDesktop -> getItem ("ColorDepth");
01335 }
01336
01337
01338
01339
01340 QString SaXManipulateDesktop::getModelineAlgorithm (void) {
01341
01343
01344 if ((! mDesktop) || (! mCard) || (! mPath)) {
01345 QString* nope = new QString;
01346 return *nope;
01347 }
01348 return mDesktop -> getItem ("CalcAlgorithm");
01349 }
01350
01351
01352
01353
01354 bool SaXManipulateDesktop::willCalculateModelines (void) {
01355
01358
01359 if ((! mDesktop) || (! mCard) || (! mPath)) {
01360 return false;
01361 }
01362 QString calculate = mDesktop -> getItem ("CalcModelines");
01363 if ((calculate == "on") || (calculate == "yes")) {
01364 return true;
01365 }
01366 return false;
01367 }
01368
01369
01370
01371
01372 QString SaXManipulateDesktop::getVirtualResolution (int color) {
01373
01377
01378 if ((! mDesktop) || (! mCard) || (! mPath)) {
01379 QString* nope = new QString;
01380 return *nope;
01381 }
01382 QString key;
01383 QString val;
01384 key.sprintf ("Virtual:%d",color);
01385 val = mDesktop -> getItem (key);
01386 if (val.isEmpty()) {
01387 QString* nope = new QString;
01388 return *nope;
01389 }
01390 QStringList resList = QStringList::split ( " ", val );
01391 QString result (resList.join("x"));
01392 return result;
01393 }
01394
01395
01396
01397
01398 void SaXManipulateDesktop::setCDBMonitor ( const QString& group ) {
01399
01403
01404 if ( ! mCDBMonitors ) {
01405 mCDBMonitors = new SaXProcess ();
01406 mCDBMonitors -> start (CDB_MONITORS);
01407 }
01408 Q3PtrList< Q3Dict<QString> > data;
01409 data = mCDBMonitors -> getTablePointerCDB_DATA (group);
01410 if (data.isEmpty()) {
01411 excCDBRecordNotFound (group);
01412 qError (errorString(),EXC_CDBRECORDNOTFOUND);
01413 return;
01414 }
01415 QStringList nameList = QStringList::split ( ":", group );
01416 setMonitorVendor ( nameList.first() );
01417 setMonitorName ( nameList.last() );
01418 mDesktop -> merge ( data );
01419 }
01420
01421
01422
01423
01424 QList<QString> SaXManipulateDesktop::getCDBMonitorVendorList ( void ) {
01425
01428
01429 mCDBMonitorList.clear();
01430 if ( ! mCDBMonitors ) {
01431 mCDBMonitors = new SaXProcess ();
01432 mCDBMonitors -> start (CDB_MONITORS);
01433 }
01434 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01435 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01436 for (; it.current(); ++it) {
01437 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01438 QString* vendorName = new QString (vnlist.first());
01439 int hasVendor = false;
01440 QString io;
01441 foreach(io,mCDBMonitorList) {
01442 if (io == *vendorName ) {
01443 hasVendor = true;
01444 break;
01445 }
01446 }
01447 if (! hasVendor ) {
01448 mCDBMonitorList.append ( *vendorName );
01449 }
01450 }
01451 return mCDBMonitorList;
01452 }
01453
01454
01455
01456
01457 QList<QString> SaXManipulateDesktop::getCDBMonitorModelList (
01458 const QString& vendor
01459 ) {
01460
01463
01464 mCDBMonitorList.clear();
01465 if ( ! mCDBMonitors ) {
01466 mCDBMonitors = new SaXProcess ();
01467 mCDBMonitors -> start (CDB_MONITORS);
01468 }
01469 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01470 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01471 for (; it.current(); ++it) {
01472 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01473 QString vendorName = vnlist.first();
01474 QString* modelName = new QString (vnlist.last());
01475 if ( vendorName == vendor ) {
01476 mCDBMonitorList.append ( *modelName );
01477 }
01478 }
01479 return mCDBMonitorList;
01480 }
01481
01482
01483
01484
01485 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorData (
01486 const QString& vendor, const QString& name
01487 ) {
01488
01491
01492 QString key;
01493 QTextOStream (&key) << vendor << ":" << name;
01494 mCDBMonitorData.clear();
01495 if ( ! mCDBMonitors ) {
01496 mCDBMonitors = new SaXProcess ();
01497 mCDBMonitors -> start (CDB_MONITORS);
01498 }
01499 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01500 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01501 for (; it.current(); ++it) {
01502 if ( it.currentKey() == key ) {
01503 mCDBMonitorData = *it.current();
01504 break;
01505 }
01506 }
01507 return mCDBMonitorData;
01508 }
01509
01510
01511
01512 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorIDData (
01513 const QString& id
01514 ) {
01515
01518
01519 mCDBMonitorData.clear();
01520 if ( ! mCDBMonitors ) {
01521 mCDBMonitors = new SaXProcess ();
01522 mCDBMonitors -> start (CDB_MONITORS);
01523 }
01524 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01525 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01526 bool found = false;
01527 for (; it.current(); ++it) {
01528 mCDBMonitorData = *it.current();
01529 if ((mCDBMonitorData["DDC"]) && (*mCDBMonitorData["DDC"] == id)) {
01530 mCDBMonitorData.insert ("Name",new QString(it.currentKey()));
01531 found = true;
01532 break;
01533 }
01534 }
01535 if (! found) {
01536 mCDBMonitorData.clear();
01537 }
01538 return mCDBMonitorData;
01539 }
01540
01541
01542
01543 void SaXManipulateDesktop::setCDBMonitorData (
01544 const QString& vendor, const QString& name,
01545 const QString& key, const QString& value
01546 ) {
01547
01552
01553 QString group;
01554 QTextOStream (&group) << vendor << ":" << name;
01555 if ( ! mCDBMonitors ) {
01556 mCDBMonitors = new SaXProcess ();
01557 mCDBMonitors -> start (CDB_MONITORS);
01558 }
01559 mCDBMonitors -> addGroup (
01560 group,key,value
01561 );
01562 }
01563
01564
01565
01566 QString SaXManipulateDesktop::getVendorForDriver ( const QString& driver ) {
01567
01570
01571 SaXProcessCall* proc = new SaXProcessCall ();
01572 proc -> addArgument ( SYSP_VENDOR );
01573 proc -> addArgument ( driver );
01574 if ( ! proc -> start() ) {
01575 excProcessFailed();
01576 qError (errorString(),EXC_PROCESSFAILED);
01577 }
01578 QList<QString> data = proc -> readStdout();
01579 return data.first();
01580 }
01581
01582
01583
01584 void SaXManipulateDesktop::setExtraModelineString (
01585 const QString & mode
01586 ) {
01587
01590
01591
01592 if ((! mDesktop) || (! mCard) || (! mPath)) {
01593 return;
01594 }
01595 mDesktop -> setItem ( "SpecialModeline",mode );
01596 }
01597
01598
01599
01600 void SaXManipulateDesktop::setExtraModeline (
01601 int x,int y,int refresh,int hsync
01602 ) {
01603
01607
01608 if ((! mDesktop) || (! mCard) || (! mPath)) {
01609 return;
01610 }
01611 QString mode = calculateModeline ( x,y,refresh,hsync );
01612 mDesktop -> setItem ( "SpecialModeline",mode );
01613 }
01614
01615
01616
01617 void SaXManipulateDesktop::addExtraModeline (
01618 int x,int y,int refresh,int hsync
01619 ) {
01620
01624
01625 if ((! mDesktop) || (! mCard) || (! mPath)) {
01626 return;
01627 }
01628 QString val;
01629 QString key = "SpecialModeline";
01630 QString mode = calculateModeline ( x,y,refresh,hsync );
01631 if (! mDesktop -> getItem (key).isEmpty()) {
01632 val = mDesktop -> getItem (key);
01633 }
01634 QTextOStream (&val) << "," << mode;
01635 val.replace (QRegExp("^,"),"");
01636 mDesktop -> setItem ( key,val );
01637 }
01638
01639
01640
01641 void SaXManipulateDesktop::removeExtraModeline ( int x,int y) {
01642
01645
01646 if ((! mDesktop) || (! mCard) || (! mPath)) {
01647 return;
01648 }
01649 QString val;
01650 QString key = "SpecialModeline";
01651 val.sprintf ("\"%dx%d\"",x,y);
01652 QString current = mDesktop -> getItem (key);
01653 QStringList lines = QStringList::split ( ",", current );
01654 for (
01655 QStringList::Iterator it=lines.begin();
01656 it != lines.end(); ++it
01657 ) {
01658 QString mode (*it);
01659 if (mode.contains (val)) {
01660 mDesktop -> removeItem (key,mode);
01661 }
01662 }
01663 }
01664
01665
01666
01667 QString SaXManipulateDesktop::calculateModeline (
01668 int x,int y,int refresh,int hsync
01669 ) {
01670
01674
01675 QString result;
01676 for (int r=refresh;r >= 50;r--) {
01677 SaXProcessCall* proc = new SaXProcessCall ();
01678 proc -> addArgument ( XMODE );
01679 proc -> addArgument ( "-x" );
01680 proc -> addArgument ( x );
01681 proc -> addArgument ( "-y" );
01682 proc -> addArgument ( y );
01683 proc -> addArgument ( "-r" );
01684 proc -> addArgument ( r + 2 );
01685 if ( ! proc -> start() ) {
01686 excProcessFailed();
01687 qError (errorString(),EXC_PROCESSFAILED);
01688 }
01689 QList<QString> data = proc->readStdout();
01690 int hs = data.at(0).toInt();
01691 result = *data.at(2);
01692 if (hs <= hsync) {
01693 break;
01694 }
01695 }
01696 result.replace (QRegExp("^Modeline "),"");
01697 return result;
01698 }
01699
01700
01701
01702 QString SaXManipulateDesktop::getDriverOptionsDualHeadProfile (
01703 const QString& driver
01704 ) {
01705
01709
01710 QString result;
01711 if ((driver == "i810") || (driver == "i915")) {
01712 QTextOStream (&result)
01713 << PROFILE_DIR << "Intel_DualHead_DriverOptions";
01714 }
01715 if (driver == "intel") {
01716 QTextOStream (&result)
01717 << PROFILE_DIR << "IntelNext_DualHead_DriverOptions";
01718 }
01719 if (driver == "nvidia") {
01720 QTextOStream (&result)
01721 << PROFILE_DIR << "NVidia_DualHead_DriverOptions";
01722 }
01723 if (driver == "radeonhd") {
01724 QTextOStream (&result)
01725 << PROFILE_DIR << "RadeonHD_DualHead_DriverOptions";
01726 }
01727 if (driver == "radeon") {
01728 QTextOStream (&result)
01729 << PROFILE_DIR << "Radeon_DualHead_DriverOptions";
01730 }
01731 if (driver == "fglrx") {
01732 QTextOStream (&result)
01733 << PROFILE_DIR << "FGLRX_DualHead_DriverOptions";
01734 }
01735 if (driver == "mga") {
01736 QTextOStream (&result)
01737 << PROFILE_DIR << "Matrox_DualHead_DriverOptions";
01738 }
01739 if (driver == "sis") {
01740 QTextOStream (&result)
01741 << PROFILE_DIR << "SiS_DualHead_DriverOptions";
01742 }
01743 return result;
01744 }
01745
01746
01747
01748 Q3Dict<QString> SaXManipulateDesktop::getMetaData ( void ) {
01749
01755 QString cardID;
01756 QTextOStream (&cardID) << mDesktopID;
01757 QList<const char*> metaOptions;
01758 metaOptions.append ((const char*) "-c" );
01759 metaOptions.append ( (const char*)cardID.latin1() );
01760 SaXProcess* proc = new SaXProcess ();
01761 proc->start ( metaOptions , SAX_META );
01762 Q3Dict<QString> metaData = proc->getCurrentTable();
01763 return metaData;
01764 }
01765 }