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.7) {
01201 *setX = "16";
01202 *setY = "9";
01203 } else if (( ar <= 1.7 ) && ( ar > 1.4 )) {
01204 *setX = "16";
01205 *setY = "10";
01206 } else if (( ar <= 1.4 ) && ( ar > 1.3 )) {
01207 *setX = "4";
01208 *setY = "3";
01209 } else if ( ar <= 1.3 ) {
01210 *setX = "5";
01211 *setY = "4";
01212 }
01213 result.append (*setX);
01214 result.append (*setY);
01215 return result;
01216 }
01217
01218
01219
01220
01221 QList<QString> SaXManipulateDesktop::getHsyncRange (void) {
01222
01226
01227 if ((! mDesktop) || (! mCard) || (! mPath)) {
01228 QList<QString>* nope = new QList<QString>;
01229 return *nope;
01230 }
01231 QString range = mDesktop -> getItem ("HorizSync");
01232 if (range.isEmpty()) {
01233 QList<QString>* nope = new QList<QString>;
01234 return *nope;
01235 }
01236 QList<QString> result;
01237 QStringList rangeList = QStringList::split ( "-", range );
01238 result.append (
01239 QString(rangeList.first())
01240 );
01241 result.append (
01242 QString(rangeList.last())
01243 );
01244 return result;
01245 }
01246
01247
01248
01249
01250 QList<QString> SaXManipulateDesktop::getVsyncRange (void) {
01251
01255
01256 if ((! mDesktop) || (! mCard) || (! mPath)) {
01257 QList<QString>* nope = new QList<QString>;
01258 return *nope;
01259 }
01260 QString range = mDesktop -> getItem ("VertRefresh");
01261 if (range.isEmpty()) {
01262 QList<QString>* nope = new QList<QString>;
01263 return *nope;
01264 }
01265 QList<QString> result;
01266 QStringList rangeList = QStringList::split ( "-", range );
01267 result.append (
01268 QString(rangeList.first())
01269 );
01270 result.append (
01271 QString(rangeList.last())
01272 );
01273 return result;
01274 }
01275
01276
01277
01278
01279 bool SaXManipulateDesktop::DPMSEnabled (void) {
01280
01284
01285 if ((! mDesktop) || (! mCard) || (! mPath)) {
01286 return false;
01287 }
01288 QString options = mDesktop -> getItem ("MonitorOptions");
01289 if (options == "DPMS") {
01290 return true;
01291 }
01292 return false;
01293 }
01294
01295
01296
01297
01298 QString SaXManipulateDesktop::getMonitorVendor (void) {
01299
01302
01303 if ((! mDesktop) || (! mCard) || (! mPath)) {
01304 QString* nope = new QString;
01305 return *nope;
01306 }
01307 return mDesktop -> getItem ("VendorName");
01308 }
01309
01310
01311
01312
01313 QString SaXManipulateDesktop::getMonitorName (void) {
01314
01317
01318 if ((! mDesktop) || (! mCard) || (! mPath)) {
01319 QString* nope = new QString;
01320 return *nope;
01321 }
01322 return mDesktop -> getItem ("ModelName");
01323 }
01324
01325
01326
01327
01328 QString SaXManipulateDesktop::getColorDepth (void) {
01329
01332
01333 if ((! mDesktop) || (! mCard) || (! mPath)) {
01334 QString* nope = new QString;
01335 return *nope;
01336 }
01337 return mDesktop -> getItem ("ColorDepth");
01338 }
01339
01340
01341
01342
01343 QString SaXManipulateDesktop::getModelineAlgorithm (void) {
01344
01346
01347 if ((! mDesktop) || (! mCard) || (! mPath)) {
01348 QString* nope = new QString;
01349 return *nope;
01350 }
01351 return mDesktop -> getItem ("CalcAlgorithm");
01352 }
01353
01354
01355
01356
01357 bool SaXManipulateDesktop::willCalculateModelines (void) {
01358
01361
01362 if ((! mDesktop) || (! mCard) || (! mPath)) {
01363 return false;
01364 }
01365 QString calculate = mDesktop -> getItem ("CalcModelines");
01366 if ((calculate == "on") || (calculate == "yes")) {
01367 return true;
01368 }
01369 return false;
01370 }
01371
01372
01373
01374
01375 QString SaXManipulateDesktop::getVirtualResolution (int color) {
01376
01380
01381 if ((! mDesktop) || (! mCard) || (! mPath)) {
01382 QString* nope = new QString;
01383 return *nope;
01384 }
01385 QString key;
01386 QString val;
01387 key.sprintf ("Virtual:%d",color);
01388 val = mDesktop -> getItem (key);
01389 if (val.isEmpty()) {
01390 QString* nope = new QString;
01391 return *nope;
01392 }
01393 QStringList resList = QStringList::split ( " ", val );
01394 QString result (resList.join("x"));
01395 return result;
01396 }
01397
01398
01399
01400
01401 void SaXManipulateDesktop::setCDBMonitor ( const QString& group ) {
01402
01406
01407 if ( ! mCDBMonitors ) {
01408 mCDBMonitors = new SaXProcess ();
01409 mCDBMonitors -> start (CDB_MONITORS);
01410 }
01411 Q3PtrList< Q3Dict<QString> > data;
01412 data = mCDBMonitors -> getTablePointerCDB_DATA (group);
01413 if (data.isEmpty()) {
01414 excCDBRecordNotFound (group);
01415 qError (errorString(),EXC_CDBRECORDNOTFOUND);
01416 return;
01417 }
01418 QStringList nameList = QStringList::split ( ":", group );
01419 setMonitorVendor ( nameList.first() );
01420 setMonitorName ( nameList.last() );
01421 mDesktop -> merge ( data );
01422 }
01423
01424
01425
01426
01427 QList<QString> SaXManipulateDesktop::getCDBMonitorVendorList ( void ) {
01428
01431
01432 mCDBMonitorList.clear();
01433 if ( ! mCDBMonitors ) {
01434 mCDBMonitors = new SaXProcess ();
01435 mCDBMonitors -> start (CDB_MONITORS);
01436 }
01437 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01438 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01439 for (; it.current(); ++it) {
01440 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01441 QString* vendorName = new QString (vnlist.first());
01442 int hasVendor = false;
01443 QString io;
01444 foreach(io,mCDBMonitorList) {
01445 if (io == *vendorName ) {
01446 hasVendor = true;
01447 break;
01448 }
01449 }
01450 if (! hasVendor ) {
01451 mCDBMonitorList.append ( *vendorName );
01452 }
01453 }
01454 return mCDBMonitorList;
01455 }
01456
01457
01458
01459
01460 QList<QString> SaXManipulateDesktop::getCDBMonitorModelList (
01461 const QString& vendor
01462 ) {
01463
01466
01467 mCDBMonitorList.clear();
01468 if ( ! mCDBMonitors ) {
01469 mCDBMonitors = new SaXProcess ();
01470 mCDBMonitors -> start (CDB_MONITORS);
01471 }
01472 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01473 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01474 for (; it.current(); ++it) {
01475 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01476 QString vendorName = vnlist.first();
01477 QString* modelName = new QString (vnlist.last());
01478 if ( vendorName == vendor ) {
01479 mCDBMonitorList.append ( *modelName );
01480 }
01481 }
01482 return mCDBMonitorList;
01483 }
01484
01485
01486
01487
01488 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorData (
01489 const QString& vendor, const QString& name
01490 ) {
01491
01494
01495 QString key;
01496 QTextOStream (&key) << vendor << ":" << name;
01497 mCDBMonitorData.clear();
01498 if ( ! mCDBMonitors ) {
01499 mCDBMonitors = new SaXProcess ();
01500 mCDBMonitors -> start (CDB_MONITORS);
01501 }
01502 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01503 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01504 for (; it.current(); ++it) {
01505 if ( it.currentKey() == key ) {
01506 mCDBMonitorData = *it.current();
01507 break;
01508 }
01509 }
01510 return mCDBMonitorData;
01511 }
01512
01513
01514
01515 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorIDData (
01516 const QString& id
01517 ) {
01518
01521
01522 mCDBMonitorData.clear();
01523 if ( ! mCDBMonitors ) {
01524 mCDBMonitors = new SaXProcess ();
01525 mCDBMonitors -> start (CDB_MONITORS);
01526 }
01527 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01528 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01529 bool found = false;
01530 for (; it.current(); ++it) {
01531 mCDBMonitorData = *it.current();
01532 if ((mCDBMonitorData["DDC"]) && (*mCDBMonitorData["DDC"] == id)) {
01533 mCDBMonitorData.insert ("Name",new QString(it.currentKey()));
01534 found = true;
01535 break;
01536 }
01537 }
01538 if (! found) {
01539 mCDBMonitorData.clear();
01540 }
01541 return mCDBMonitorData;
01542 }
01543
01544
01545
01546 void SaXManipulateDesktop::setCDBMonitorData (
01547 const QString& vendor, const QString& name,
01548 const QString& key, const QString& value
01549 ) {
01550
01555
01556 QString group;
01557 QTextOStream (&group) << vendor << ":" << name;
01558 if ( ! mCDBMonitors ) {
01559 mCDBMonitors = new SaXProcess ();
01560 mCDBMonitors -> start (CDB_MONITORS);
01561 }
01562 mCDBMonitors -> addGroup (
01563 group,key,value
01564 );
01565 }
01566
01567
01568
01569 QString SaXManipulateDesktop::getVendorForDriver ( const QString& driver ) {
01570
01573
01574 SaXProcessCall* proc = new SaXProcessCall ();
01575 proc -> addArgument ( SYSP_VENDOR );
01576 proc -> addArgument ( driver );
01577 if ( ! proc -> start() ) {
01578 excProcessFailed();
01579 qError (errorString(),EXC_PROCESSFAILED);
01580 }
01581 QList<QString> data = proc -> readStdout();
01582 return data.first();
01583 }
01584
01585
01586
01587 void SaXManipulateDesktop::setExtraModelineString (
01588 const QString & mode
01589 ) {
01590
01593
01594
01595 if ((! mDesktop) || (! mCard) || (! mPath)) {
01596 return;
01597 }
01598 mDesktop -> setItem ( "SpecialModeline",mode );
01599 }
01600
01601
01602
01603 void SaXManipulateDesktop::setExtraModeline (
01604 int x,int y,int refresh,int hsync
01605 ) {
01606
01610
01611 if ((! mDesktop) || (! mCard) || (! mPath)) {
01612 return;
01613 }
01614 QString mode = calculateModeline ( x,y,refresh,hsync );
01615 mDesktop -> setItem ( "SpecialModeline",mode );
01616 }
01617
01618
01619
01620 void SaXManipulateDesktop::addExtraModeline (
01621 int x,int y,int refresh,int hsync
01622 ) {
01623
01627
01628 if ((! mDesktop) || (! mCard) || (! mPath)) {
01629 return;
01630 }
01631 QString val;
01632 QString key = "SpecialModeline";
01633 QString mode = calculateModeline ( x,y,refresh,hsync );
01634 if (! mDesktop -> getItem (key).isEmpty()) {
01635 val = mDesktop -> getItem (key);
01636 }
01637 QTextOStream (&val) << "," << mode;
01638 val.replace (QRegExp("^,"),"");
01639 mDesktop -> setItem ( key,val );
01640 }
01641
01642
01643
01644 void SaXManipulateDesktop::removeExtraModeline ( int x,int y) {
01645
01648
01649 if ((! mDesktop) || (! mCard) || (! mPath)) {
01650 return;
01651 }
01652 QString val;
01653 QString key = "SpecialModeline";
01654 val.sprintf ("\"%dx%d\"",x,y);
01655 QString current = mDesktop -> getItem (key);
01656 QStringList lines = QStringList::split ( ",", current );
01657 for (
01658 QStringList::Iterator it=lines.begin();
01659 it != lines.end(); ++it
01660 ) {
01661 QString mode (*it);
01662 if (mode.contains (val)) {
01663 mDesktop -> removeItem (key,mode);
01664 }
01665 }
01666 }
01667
01668
01669
01670 QString SaXManipulateDesktop::calculateModeline (
01671 int x,int y,int refresh,int hsync
01672 ) {
01673
01677
01678 QString result;
01679 for (int r=refresh;r >= 50;r--) {
01680 SaXProcessCall* proc = new SaXProcessCall ();
01681 proc -> addArgument ( XMODE );
01682 proc -> addArgument ( "-x" );
01683 proc -> addArgument ( x );
01684 proc -> addArgument ( "-y" );
01685 proc -> addArgument ( y );
01686 proc -> addArgument ( "-r" );
01687 proc -> addArgument ( r + 2 );
01688 if ( ! proc -> start() ) {
01689 excProcessFailed();
01690 qError (errorString(),EXC_PROCESSFAILED);
01691 }
01692 QList<QString> data = proc->readStdout();
01693 int hs = data.at(0).toInt();
01694 result = *data.at(2);
01695 if (hs <= hsync) {
01696 break;
01697 }
01698 }
01699 result.replace (QRegExp("^Modeline "),"");
01700 return result;
01701 }
01702
01703
01704
01705 QString SaXManipulateDesktop::getDriverOptionsDualHeadProfile (
01706 const QString& driver
01707 ) {
01708
01712
01713 QString result;
01714 if ((driver == "i810") || (driver == "i915")) {
01715 QTextOStream (&result)
01716 << PROFILE_DIR << "Intel_DualHead_DriverOptions";
01717 }
01718 if (driver == "intel") {
01719 QTextOStream (&result)
01720 << PROFILE_DIR << "IntelNext_DualHead_DriverOptions";
01721 }
01722 if (driver == "nvidia") {
01723 QTextOStream (&result)
01724 << PROFILE_DIR << "NVidia_DualHead_DriverOptions";
01725 }
01726 if (driver == "radeonhd") {
01727 QTextOStream (&result)
01728 << PROFILE_DIR << "RadeonHD_DualHead_DriverOptions";
01729 }
01730 if (driver == "radeon") {
01731 QTextOStream (&result)
01732 << PROFILE_DIR << "Radeon_DualHead_DriverOptions";
01733 }
01734 if (driver == "fglrx") {
01735 QTextOStream (&result)
01736 << PROFILE_DIR << "FGLRX_DualHead_DriverOptions";
01737 }
01738 if (driver == "mga") {
01739 QTextOStream (&result)
01740 << PROFILE_DIR << "Matrox_DualHead_DriverOptions";
01741 }
01742 if (driver == "sis") {
01743 QTextOStream (&result)
01744 << PROFILE_DIR << "SiS_DualHead_DriverOptions";
01745 }
01746 return result;
01747 }
01748
01749
01750
01751 Q3Dict<QString> SaXManipulateDesktop::getMetaData ( void ) {
01752
01758 QString cardID;
01759 QTextOStream (&cardID) << mDesktopID;
01760 QList<const char*> metaOptions;
01761 metaOptions.append ((const char*) "-c" );
01762 metaOptions.append ( (const char*)cardID.latin1() );
01763 SaXProcess* proc = new SaXProcess ();
01764 proc->start ( metaOptions , SAX_META );
01765 Q3Dict<QString> metaData = proc->getCurrentTable();
01766 return metaData;
01767 }
01768 }