- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- Location:
- trunk/src
- Files:
-
- 29 added
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/3rdparty/zlib/zlib.h
r7 r8 40 40 #define ZLIB_VERSION "1.1.4" 41 41 42 #ifdef Q_OS_WIN 42 43 #ifdef QT_MAKEDLL 43 44 #define Q_ZEXPORT __declspec(dllexport) … … 48 49 #define Q_ZEXPORT ZEXPORT 49 50 #endif 51 #endif 52 #else 53 #define Q_ZEXPORT ZEXPORT 50 54 #endif 51 55 #ifdef Q_OS_TEMP -
trunk/src/codecs/qtextcodec.cpp
r7 r8 562 562 563 563 564 #if def Q_OS_WIN32564 #if defined(Q_OS_WIN32) 565 565 class QWindowsLocalCodec: public QTextCodec 566 566 { … … 621 621 622 622 int QWindowsLocalCodec::heuristicContentMatch(const char* chars, int len) const 623 { 624 // ### Not a bad default implementation? 625 QString t = toUnicode(chars,len); 626 int l = t.length(); 627 QCString mb = fromUnicode(t,l); 628 int i=0; 629 while ( i < len ) { 630 if ( chars[i] == mb[i] ) 631 i++; 632 else 633 break; 634 } 635 return i; 636 } 637 638 #elif defined(Q_OS_OS2) 639 640 class QOS2LocalCodec: public QTextCodec 641 { 642 public: 643 QOS2LocalCodec(); 644 ~QOS2LocalCodec(); 645 646 QString toUnicode(const char* chars, int len) const; 647 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 648 649 const char* name() const; 650 int mibEnum() const; 651 652 int heuristicContentMatch(const char* chars, int len) const; 653 }; 654 655 QOS2LocalCodec::QOS2LocalCodec() 656 { 657 } 658 659 QOS2LocalCodec::~QOS2LocalCodec() 660 { 661 } 662 663 664 QString QOS2LocalCodec::toUnicode(const char* chars, int len) const 665 { 666 return qt_os2MB2QString( chars, len ); 667 } 668 669 QCString QOS2LocalCodec::fromUnicode(const QString& uc, int& lenInOut ) const 670 { 671 QCString r = qt_os2QString2MB( uc, lenInOut ); 672 lenInOut = r.length(); 673 return r; 674 } 675 676 677 const char* QOS2LocalCodec::name() const 678 { 679 return "System"; 680 } 681 682 int QOS2LocalCodec::mibEnum() const 683 { 684 return 0; 685 } 686 687 688 int QOS2LocalCodec::heuristicContentMatch(const char* chars, int len) const 623 689 { 624 690 // ### Not a bad default implementation? … … 2692 2758 static void setupLocaleMapper() 2693 2759 { 2694 #if def Q_OS_WIN322760 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 2695 2761 localeMapper = QTextCodec::codecForName( "System" ); 2696 2762 #else … … 2855 2921 #endif // Q_OS_WIN32 2856 2922 2923 #ifdef Q_OS_OS2 2924 (void) new QOS2LocalCodec; 2925 #endif // Q_OS_OS2 2926 2857 2927 if ( !localeMapper ) 2858 2928 setupLocaleMapper(); -
trunk/src/dialogs/qfiledialog.cpp
r7 r8 991 991 return 1; 992 992 993 #if defined(Q_OS_WIN32) 993 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 994 994 if ( sortFilesBy == QDir::Name ) { 995 995 QString name1 = i1->name().lower(); … … 3693 3693 if ( !nameEdit->text().contains( "/" ) && 3694 3694 !nameEdit->text().contains( "\\" ) 3695 #if defined(Q_OS_WIN32) 3695 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 3696 3696 && nameEdit->text()[ 1 ] != ':' 3697 3697 #endif … … 3700 3700 else if ( nameEdit->text()[ 0 ] == '/' || 3701 3701 nameEdit->text()[ 0 ] == '\\' 3702 #if defined(Q_OS_WIN32) 3702 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 3703 3703 || nameEdit->text()[ 1 ] == ':' 3704 3704 #endif … … 4597 4597 void QFileDialog::done( int i ) 4598 4598 { 4599 // stop any pending operations 4600 d->url.stop(); 4601 4599 4602 if ( i == QDialog::Accepted && (d->mode == ExistingFile || d->mode == ExistingFiles) ) { 4600 4603 QStringList selection = selectedFiles(); … … 5339 5342 if ( ( nameEdit->cursorPosition() == (int)nameEdit->text().length() || nameEdit->hasSelectedText() ) && 5340 5343 isprint(((QKeyEvent *)e)->ascii()) ) { 5341 #if defined(Q_WS_WIN) 5344 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 5342 5345 QString nt( nameEdit->text().lower() ); 5343 5346 #else … … 5347 5350 nt += (char)(((QKeyEvent *)e)->ascii()); 5348 5351 QListViewItem * i = files->firstChild(); 5349 #if defined(Q_WS_WIN) 5352 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 5350 5353 while( i && i->text( 0 ).left(nt.length()).lower() != nt ) 5351 5354 #else … … 5643 5646 if ( u.path() == "/" ) 5644 5647 return TRUE; 5645 #elif defined(Q_OS_WIN32) 5648 #elif defined(Q_OS_WIN32) || defined(Q_OS_OS2) 5646 5649 QString p = u.path(); 5647 5650 if ( p.length() == 3 && … … 5702 5705 bool found = FALSE; 5703 5706 for ( int i = 0; i < d->paths->count(); ++i ) { 5704 #if defined(Q_WS_WIN) 5707 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 5705 5708 if ( d->paths->text( i ).lower() == s.lower() ) { 5706 5709 #else … … 5769 5772 if ( !d->hadDotDot && !isRoot( d->url ) ) { 5770 5773 bool ok = TRUE; 5771 #if defined(Q_WS_WIN) 5774 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 5772 5775 if ( d->url.path().left( 2 ) == "//" ) 5773 5776 ok = FALSE; … … 5857 5860 if ( isRoot( d->url ) ) 5858 5861 continue; 5859 #if defined(Q_WS_WIN) 5862 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 5860 5863 if ( d->url.path().left( 2 ) == "//" ) 5861 5864 continue; … … 5885 5888 } 5886 5889 } 5890 #elif defined(Q_OS_OS2) 5891 if ( !bShowHiddenFiles ) { 5892 if ( d->url.isLocalFile() ) { 5893 QString file = d->url.path(); 5894 if ( !file.endsWith( "/" ) ) 5895 file.append( "/" ); 5896 file += inf.name(); 5897 if ( QFileInfo( file ).isHidden() ) 5898 continue; 5899 } else { 5900 if ( inf.name() != ".." && inf.name()[0] == QChar('.') ) 5901 continue; 5902 } 5903 } 5887 5904 #else 5888 5905 if ( !bShowHiddenFiles && inf.name() != ".." ) { -
trunk/src/dialogs/qmessagebox.cpp
r7 r8 53 53 #include "qnc_win.h" 54 54 #endif 55 55 #if defined(Q_WS_PM) 56 //@@TODO (dmik): this is necessary for WinAlarm() which will be 57 // probably removed from here later. 58 #include "qt_os2.h" 59 #endif 56 60 57 61 // Internal class - don't touch … … 592 596 "<p>Qt provides single-source " 593 597 "portability across MS Windows, Mac OS X, " 598 "IBM OS/2 Warp and eComStation, " 594 599 "Linux, and all major commercial Unix variants." 595 600 "<br>Qt is also available for embedded devices.</p>" … … 1034 1039 #if defined(QT_ACCESSIBILITY_SUPPORT) 1035 1040 QAccessible::updateAccessibility( this, 0, QAccessible::Alert ); 1041 #else 1042 #if defined(Q_WS_PM) 1043 //@@TODO (dmik): currently, the accessibility support is not implemented 1044 // on OS/2, but we still need to play a sound when QMessageBox is opened. 1045 ULONG alarmStyle; 1046 bool playAlarm = TRUE; 1047 switch ( icon() ) { 1048 case Warning: 1049 alarmStyle = WA_WARNING; 1050 break; 1051 case Critical: 1052 alarmStyle = WA_ERROR; 1053 break; 1054 case Information: 1055 alarmStyle = WA_NOTE; 1056 break; 1057 default: 1058 playAlarm = FALSE; 1059 break; 1060 } 1061 if ( playAlarm ) 1062 WinAlarm( HWND_DESKTOP, alarmStyle ); 1063 #endif 1036 1064 #endif 1037 1065 QDialog::showEvent( e ); -
trunk/src/kernel/qapplication.cpp
r7 r8 739 739 If \a GUIenabled is FALSE, the application does not connect to the 740 740 X-server. 741 On Windows and Macintosh, currently the window system is always741 On Windows, OS/2 and Macintosh, currently the window system is always 742 742 initialized, regardless of the value of GUIenabled. This may change in 743 743 future versions of Qt. … … 1232 1232 else 1233 1233 style = "Windows"; // default styles for Windows 1234 #elif defined(Q_WS_PM) 1235 /// @todo (dmik) temporary, until the native style is done 1236 style = "Windows"; // default style for OS/2 1234 1237 #elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS) 1235 1238 style = "CDE"; // default style for X11 on Solaris … … 1541 1544 } 1542 1545 1543 #if def Q_WS_WIN1546 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1544 1547 extern const char *qAppFileName(); 1545 1548 #endif 1546 1549 1547 1550 #ifndef QT_NO_DIR 1548 #if ndef Q_WS_WIN1551 #if !defined(Q_WS_WIN) && !(defined Q_WS_PM) 1549 1552 static QString resolveSymlinks( const QString& path, int depth = 0 ) 1550 1553 { … … 1590 1593 } 1591 1594 } 1592 #endif // Q_WS_WIN1595 #endif // !Q_WS_WIN && !Q_WS_PM 1593 1596 1594 1597 /*! … … 1627 1630 QString QApplication::applicationFilePath() 1628 1631 { 1629 #if def Q_WS_WIN1632 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1630 1633 return QDir::cleanDirPath( QFile::decodeName( qAppFileName() ) ); 1631 1634 #else … … 1706 1709 QString installPathPlugins = QString::fromLocal8Bit(qInstallPathPlugins()); 1707 1710 if ( QFile::exists(installPathPlugins) ) { 1708 #if def Q_WS_WIN1711 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1709 1712 installPathPlugins.replace('\\', '/'); 1710 1713 #endif … … 1715 1718 if (qApp) 1716 1719 app_location = qApp->applicationFilePath(); 1717 #if def Q_WS_WIN1720 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1718 1721 else { 1719 1722 app_location = QString(qAppFileName()); -
trunk/src/kernel/qclipboard.cpp
r7 r8 155 155 } 156 156 157 #if ndef Q_WS_WIN32157 #if !defined(Q_WS_WIN32) && !defined(Q_WS_PM) 158 158 /*! 159 159 \internal … … 173 173 174 174 This signal is emitted when the clipboard data is changed. 175 176 \note On OS/2, this signal is guaranteed to be emitted only if no other 177 non-Qt applications (for example, the standard Clipboard Viewer shipped 178 with OS/2) register themselves as clipboard viewers -- this is the 179 limitation of the Presentation Manager, not Qt. Reconnecting this signal 180 to a slot will restore its functionality (until another non-Qt application 181 will again register itself as the clipboard viewer). 175 182 */ 176 183 -
trunk/src/kernel/qcolor.cpp
r7 r8 162 162 #define COLOR0_PIX 0x00ffffff 163 163 #define COLOR1_PIX 0 164 #elif defined(Q_WS_PM) 165 #define COLOR0_PIX (uint)CLR_FALSE 166 #define COLOR1_PIX (uint)CLR_TRUE 164 167 #else 165 168 #define COLOR0_PIX 0 … … 871 874 return ((QColor*)this)->alloc(); 872 875 else if ( colormodel == d8 ) 873 #if def Q_WS_WIN876 #if defined(Q_WS_WIN) 874 877 // since d.d8.pix is uchar we have to use the PALETTEINDEX 875 878 // macro to get the respective palette entry index. 876 879 return (0x01000000 | (int)(short)(d.d8.pix)); 880 #elif defined(Q_WS_PM) 881 // the code below allows us to use negative color values (such as 882 // CLR_WHITE) in range from -1 to -128 as direct pixel colors (i.e. 883 // set using setPixel()) keeping their special meening. 884 if ( d.d8.direct ) 885 return (int) ((char) d.d8.pix); 886 else 887 return d.d8.pix; 877 888 #else 878 889 return d.d8.pix; -
trunk/src/kernel/qdragobject.cpp
r7 r8 838 838 return r; 839 839 QString text( d->txt ); 840 #if defined(Q_WS_WIN) 840 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 841 841 int index = text.find( QString::fromLatin1("\r\n"), 0 ); 842 842 while ( index != -1 ) { … … 1493 1493 return QCString(); 1494 1494 1495 #if def Q_WS_WIN1495 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1496 1496 1497 1497 … … 1603 1603 file.insert(0,'/'); 1604 1604 } 1605 #if def Q_WS_WIN1605 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1606 1606 if ( file.length() > 2 && file[0] == '/' && file[2] == '|' ) { 1607 1607 file[2] = ':'; … … 1613 1613 #endif 1614 1614 } 1615 #if def Q_WS_WIN1615 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1616 1616 else { 1617 1617 file = uriToUnicodeUri(uri); -
trunk/src/kernel/qeventloop_p.h
r7 r8 60 60 #endif 61 61 62 #if defined(Q_OS_UNIX) || defined (Q_WS_WIN)62 #if defined(Q_OS_UNIX) || defined(Q_WS_WIN) || defined(Q_WS_PM) 63 63 #include "qptrlist.h" 64 #endif // Q_OS_UNIX || Q_WS_WIN 64 #endif // Q_OS_UNIX || Q_WS_WIN || Q_WS_PM 65 65 66 #if defined(Q_OS_UNIX) 66 #if defined(Q_OS_UNIX) || defined(Q_WS_PM) 67 67 struct QSockNot 68 68 { … … 86 86 #endif // Q_OS_UNIX 87 87 88 #if defined(Q_WS_WIN) 88 #if defined(Q_WS_WIN) 89 89 struct QSockNot { 90 90 QSocketNotifier *obj; … … 124 124 #endif // Q_WS_X11 125 125 126 #if defined(Q_OS_UNIX) 126 #if defined(Q_OS_UNIX) 127 127 int thread_pipe[2]; 128 128 #endif 129 #if defined(Q_OS_UNIX) || defined(Q_WS_PM) 129 130 // pending socket notifiers list 130 131 QPtrList<QSockNot> sn_pending_list; … … 135 136 #endif 136 137 137 #if def Q_WS_WIN138 #if defined(Q_WS_WIN) 138 139 // pending socket notifiers list 139 140 QPtrList<QSockNot> sn_pending_list; 140 141 #endif // Q_WS_WIN 141 142 143 #if defined(Q_WS_PM) 144 HAB hab; 145 HMQ hmq; 146 #endif 147 142 148 }; 143 149 -
trunk/src/kernel/qfont.cpp
r7 r8 1394 1394 "courier", "Courier New", 1395 1395 "helvetica", "Arial", 1396 #elif defined(Q_WS_PM) 1397 "times", "Times New Roman", 1396 1398 #endif 1397 1398 1399 0, 0 1399 1400 }; … … 3100 3101 } 3101 3102 3102 #if defined(Q_WS_WIN 3103 #if defined(Q_WS_WIN) || defined(Q_WS_PM) || defined (Q_WS_QWS) 3103 3104 void QFontCache::cleanupPrinterFonts() 3104 3105 { -
trunk/src/kernel/qfontdata_p.h
r7 r8 101 101 if ( family != other.family ) return family < other.family; 102 102 103 #if def Q_WS_X11103 #if defined(Q_WS_X11) 104 104 if ( addStyle != other.addStyle ) return addStyle < other.addStyle; 105 #endif // Q_WS_X11 106 105 #elif defined(Q_WS_PM) 106 if ( pointSize != other.pointSize ) return pointSize < other.pointSize; 107 #endif 107 108 return FALSE; 108 109 } … … 242 243 void insertEngine( const Key &key, QFontEngine *engine ); 243 244 244 #if defined(Q_WS_WIN) || defined(Q_WS_ QWS)245 #if defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_WS_QWS) 245 246 void cleanupPrinterFonts(); 246 247 #endif -
trunk/src/kernel/qfontdatabase.cpp
r7 r8 71 71 #endif 72 72 73 #define SMOOTH_SCALABLE 0xffff 74 73 75 static int ucstricmp( const QString &as, const QString &bs ) 74 76 { … … 138 140 unsigned short pixelSize; 139 141 142 #ifdef Q_WS_PM 143 unsigned short pointSize; // in deca-points 144 LONG lMatch; 145 #endif 140 146 #ifdef Q_WS_X11 141 147 int count; … … 206 212 fakeOblique( FALSE ), count( 0 ), pixelSizes( 0 ) 207 213 { 208 #if defined(Q_WS_X11) 214 #if defined(Q_WS_PM) 215 szFacename[0] = 0; 216 #elif defined(Q_WS_X11) 209 217 weightName = setwidthName = 0; 210 #endif // Q_WS_X11218 #endif 211 219 } 212 220 … … 228 236 QtFontSize *pixelSizes; 229 237 238 #ifdef Q_WS_PM 239 CHAR szFacename [FACESIZE]; 240 #endif 230 241 #ifdef Q_WS_X11 231 242 const char *weightName; … … 233 244 #endif // Q_WS_X11 234 245 246 #ifdef Q_WS_PM 247 QtFontSize *pixelSize( 248 unsigned short size, bool = FALSE, unsigned short pointSize = 0 ); 249 #else 235 250 QtFontSize *pixelSize( unsigned short size, bool = FALSE ); 251 #endif 236 252 }; 237 253 … … 247 263 } 248 264 265 #ifdef Q_WS_PM 266 QtFontSize *QtFontStyle::pixelSize( 267 unsigned short size, bool add, unsigned short pointSize ) 268 #else 249 269 QtFontSize *QtFontStyle::pixelSize( unsigned short size, bool add ) 270 #endif 250 271 { 251 272 for ( int i = 0; i < count; i++ ) { 273 #ifdef Q_WS_PM 274 if ( 275 pixelSizes[i].pixelSize == size && 276 ( 277 size == SMOOTH_SCALABLE || 278 !pointSize || 279 pixelSizes[i].pointSize == pointSize 280 ) 281 ) 282 #else 252 283 if ( pixelSizes[i].pixelSize == size ) 284 #endif 253 285 return pixelSizes + i; 254 286 } … … 261 293 (((count+8) >> 3 ) << 3) * sizeof(QtFontSize) ); 262 294 pixelSizes[count].pixelSize = size; 295 #ifdef Q_WS_PM 296 pixelSizes[count].pointSize = pointSize; 297 pixelSizes[count].lMatch = 0; 298 #endif 263 299 #ifdef Q_WS_X11 264 300 pixelSizes[count].count = 0; … … 336 372 name( n ), count( 0 ), foundries( 0 ) { 337 373 memset( scripts, 0, sizeof( scripts ) ); 374 #ifdef Q_WS_PM 375 //@@TODO (dmik): temporary solution to let QFontDialog work: 376 // at least UnknownScript is supported. 377 scripts[QFont::UnknownScript] = Supported; 378 #endif 338 379 } 339 380 ~QtFontFamily() { … … 357 398 bool fullyLoaded : 1; 358 399 QString name; 400 #ifndef Q_WS_X11 359 401 QString rawName; 402 #endif 360 403 #ifdef Q_WS_X11 361 404 QCString fontFilename; … … 393 436 class QFontDatabasePrivate { 394 437 public: 395 QFontDatabasePrivate() : count( 0 ), families( 0 ) { } 438 QFontDatabasePrivate() : 439 count( 0 ), families( 0 ) { } 396 440 ~QFontDatabasePrivate() { 441 #ifdef Q_WS_PM 442 cleanup(); 443 #else 397 444 while ( count-- ) 398 445 delete families[count]; 399 446 free( families ); 447 #endif 400 448 } 401 449 QtFontFamily *family( const QString &f, bool = FALSE ); … … 403 451 int count; 404 452 QtFontFamily **families; 453 454 #ifdef Q_WS_PM 455 static QFontDatabasePrivate* instance(); 456 private: 457 void cleanup() { 458 while ( count ) 459 delete families[--count]; 460 free( families ); 461 families = 0; 462 } 463 void reload(); 464 #endif 405 465 }; 406 466 … … 627 687 628 688 static QSingleCleanupHandler<QFontDatabasePrivate> qfontdatabase_cleanup; 689 #ifdef Q_WS_PM 690 QFontDatabasePrivate* QFontDatabasePrivate::instance() 691 { 692 static QFontDatabasePrivate *db = 0; 693 if ( !db ) { 694 db = new QFontDatabasePrivate; 695 qfontdatabase_cleanup.set(&db); 696 db->reload(); 697 } 698 return db; 699 } 700 #else 629 701 static QFontDatabasePrivate *db=0; 630 # define SMOOTH_SCALABLE 0xffff702 #endif 631 703 632 704 #if defined( Q_WS_X11 ) … … 636 708 #elif defined( Q_WS_WIN ) 637 709 # include "qfontdatabase_win.cpp" 710 #elif defined( Q_WS_PM ) 711 # include "qfontdatabase_pm.cpp" 638 712 #elif defined( Q_WS_QWS ) 639 713 # include "qfontdatabase_qws.cpp" … … 643 717 644 718 645 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 719 #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_PM) 646 720 static 647 721 unsigned int bestFoundry( QFont::Script script, unsigned int score, int styleStrategy, … … 650 724 QtFontFoundry **best_foundry, QtFontStyle **best_style, 651 725 QtFontSize **best_size 652 #if def Q_WS_X11726 #if defined(Q_WS_X11) 653 727 , QtFontEncoding **best_encoding, int force_encoding_id 728 #elif defined(Q_WS_PM) 729 , int pointSize 654 730 #endif 655 731 ) … … 711 787 // 1. see if we have an exact matching size 712 788 if (! (styleStrategy & QFont::ForceOutline)) { 789 #if defined(Q_WS_PM) 790 size = style->pixelSize(pixelSize, FALSE, pointSize); 791 #else 713 792 size = style->pixelSize(pixelSize); 793 #endif 714 794 if (size) px = size->pixelSize; 715 795 } … … 843 923 #endif 844 924 925 #ifdef Q_WS_PM 926 QFontDatabasePrivate *db = QFontDatabasePrivate::instance(); 927 #else 845 928 if ( !db ) 846 929 initializeDb(); 930 #endif 847 931 848 932 QFontEngine *fe = 0; 849 933 if ( fp ) { 934 #ifndef Q_WS_PM 850 935 if ( fp->rawMode ) { 851 936 fe = loadEngine( script, fp, request, 0, 0, 0 … … 859 944 return fe; 860 945 } 946 #endif // !Q_WS_PM 861 947 862 948 QFontCache::Key key( request, script, 863 #if def Q_WS_WIN949 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 864 950 (int)fp->paintdevice 865 951 #else … … 880 966 parseFontName( request.family, foundry_name, family_name ); 881 967 968 #ifdef Q_WS_PM 969 // the "System VIO" PM font is broken in such way that its real pixel 970 // sizes do not correspond to their nominal point sizes specified in the 971 // font header (i.e. pixelSize is not equal to (pointSize * dpi) / 720). 972 // therefore we use the special table to convert pointSize to pixelSize 973 // in order to let bestFoundry() select the proper font with its nominal 974 // point size corresponding to the requested one. 975 // NOTE: this will produce incorrect results if "System VIO" is NOT 976 // an OS/2 standatd supplied bitmap font. 977 if( !ucstricmp( family_name, "System VIO") ) { 978 // possible sizes of the "System VIO" font ("pixel, point" pairs), 979 // sorted by point size 980 static const short SystemVIO_sz[] = { 981 12, 20, 16, 30, 982 8, 40, 13, 50, 983 15, 60, 24, 70, 984 8, 80, 10, 90, 985 12, 100, 14, 110, 986 16, 120, 18, 130, 987 16, 140, 12, 150, 988 20, 160, 21, 170, 989 29, 180, 990 }; 991 const int SystemVIO_sz_len = sizeof(SystemVIO_sz) / sizeof(SystemVIO_sz[0]); 992 int pt = request.pointSize; 993 pt = QMAX( pt, SystemVIO_sz [1] ); // min limit 994 pt = QMIN( pt, SystemVIO_sz [SystemVIO_sz_len - 1] ); // max limit 995 int i = 1; 996 while ( SystemVIO_sz[i] < pt ) i += 2; 997 if ( SystemVIO_sz[i] > pt ) { 998 int prev = SystemVIO_sz[i-2]; 999 int mid = prev + (SystemVIO_sz[i] - prev + 1) / 2; 1000 if ( pt < mid ) i -= 2; 1001 } 1002 ((QFontDef&)request).pixelSize = SystemVIO_sz[i-1]; 1003 ((QFontDef&)request).pointSize = SystemVIO_sz[i]; 1004 } 1005 #endif 1006 882 1007 #ifdef Q_WS_X11 883 1008 if (family_name.isEmpty() && script == QFont::Han) { … … 905 1030 " stretch: %d\n" 906 1031 " pixelSize: %d\n" 1032 " pointSize: %d\n" 907 1033 " pitch: %c", 908 1034 family_name.isEmpty() ? "-- first in script --" : family_name.latin1(), 909 1035 foundry_name.isEmpty() ? "-- any --" : foundry_name.latin1(), 910 1036 script, scriptName( script ).latin1(), 911 request.weight, request.italic, request.stretch, request.pixelSize, pitch ); 1037 request.weight, request.italic, request.stretch, 1038 request.pixelSize, request.pointSize, 1039 pitch ); 912 1040 913 1041 #ifdef QT_XFT2 … … 944 1072 uint score_adjust = 0; 945 1073 QFont::Script override_script = script; 1074 #ifndef Q_WS_PM 946 1075 if ( ! ( try_family->scripts[script] & QtFontFamily::Supported ) 947 1076 && script != QFont::Unicode) { … … 978 1107 } 979 1108 } 1109 #endif // !Q_WS_PM 980 1110 981 1111 QtFontFoundry *try_foundry = 0; … … 992 1122 try_family, foundry_name, styleKey, request.pixelSize, pitch, 993 1123 &try_foundry, &try_style, &try_size 994 #if def Q_WS_X111124 #if defined(Q_WS_X11) 995 1125 , &try_encoding, force_encoding_id 1126 #elif defined(Q_WS_PM) 1127 , request.pointSize 996 1128 #endif 997 1129 ); … … 1002 1134 QString::null, styleKey, request.pixelSize, 1003 1135 pitch, &try_foundry, &try_style, &try_size 1004 #if def Q_WS_X111136 #if defined(Q_WS_X11) 1005 1137 , &try_encoding, force_encoding_id 1138 #elif defined(Q_WS_PM) 1139 , request.pointSize 1006 1140 #endif 1007 1141 ); … … 1047 1181 1048 1182 fe = loadEngine( script, fp, request, best_family, best_foundry, best_style 1049 #ifdef Q_WS_X11 1183 #if defined(Q_WS_PM) 1184 , best_size 1185 #elif defined(Q_WS_X11) 1050 1186 , best_size, best_encoding, ( force_encoding_id >= 0 ) 1051 1187 #endif … … 1060 1196 } 1061 1197 1198 #ifdef Q_WS_PM 1199 // On OS/2, fontDef.pixelSize and fontDef.pointSize are filled 1200 // by QFontEnginePM constructor 1201 #else 1062 1202 if ( best_style->smoothScalable ) 1063 1203 fe->fontDef.pixelSize = request.pixelSize; … … 1082 1222 fe->fontDef.pointSize = request.pointSize; 1083 1223 } 1224 #endif 1084 1225 fe->fontDef.styleHint = request.styleHint; 1085 1226 fe->fontDef.styleStrategy = request.styleStrategy; … … 1094 1235 1095 1236 if ( fe ) { 1237 #ifdef Q_WS_PM 1238 ///@@TODO (dmik): should do something here? 1239 #else 1096 1240 if ( script != QFont::Unicode && !canRender( fe, script ) ) { 1097 1241 FM_DEBUG( " WARN: font loaded cannot render sample 0x%04x", … … 1117 1261 return fe; 1118 1262 } 1263 #endif // !Q_WS_PM 1119 1264 1120 1265 if ( fp ) { 1121 1266 QFontCache::Key key( request, script, 1122 #if def Q_WS_WIN1267 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1123 1268 (int)fp->paintdevice 1124 1269 #else … … 1128 1273 QFontCache::instance->insertEngine( key, fe ); 1129 1274 1275 #ifndef Q_WS_PM 1130 1276 for ( int i = 0; i < QFont::NScripts; ++i ) { 1131 1277 if ( i == script ) continue; … … 1137 1283 QFontCache::instance->insertEngine( key, fe ); 1138 1284 } 1285 #endif // !Q_WS_PM 1139 1286 } 1140 1287 } else { 1141 1288 if ( request.family.isEmpty() ) { 1289 #ifdef Q_WS_PM 1290 //@@TODO (dmik): what to return in such case? 1291 qFatal( "QFontDatabase::findFont: request.family is empty and nothing is found, should it ever happen?" ); 1292 #else 1142 1293 FM_DEBUG( "returning box engine" ); 1143 1294 … … 1146 1297 if ( fp ) { 1147 1298 QFontCache::Key key( request, script, 1148 #if def Q_WS_WIN1299 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1149 1300 (int)fp->paintdevice 1150 1301 #else … … 1154 1305 QFontCache::instance->insertEngine( key, fe ); 1155 1306 } 1307 #endif // Q_WS_PM 1156 1308 } 1157 1309 } … … 1159 1311 return fe; 1160 1312 } 1161 #endif // Q_WS_X11 || Q_WS_WIN 1313 #endif // Q_WS_X11 || Q_WS_WIN || Q_WS_PM 1162 1314 1163 1315 … … 1355 1507 QFontDatabase::QFontDatabase() 1356 1508 { 1509 #ifdef Q_WS_PM 1510 d = QFontDatabasePrivate::instance(); 1511 #else 1357 1512 createDatabase(); 1358 1513 1359 1514 d = db; 1515 #endif 1360 1516 } 1361 1517 … … 1635 1791 1636 1792 if (size->pixelSize != 0 && size->pixelSize != USHRT_MAX) { 1637 #if def Q_WS_X111793 #if defined(Q_WS_X11) 1638 1794 const uint pointSize = qRound(qt_pointSize(size->pixelSize, 0, -1)); 1795 #elif defined(Q_WS_PM) 1796 //@@TODO (dmik): some bitmap fonts (i.e. System VIO) have point sizes 1797 // that do not really correlate with their actual pixel sizes (i.e. 1798 // their pointsize != pixelsizde * DPI / 72), What to return in that case? 1799 const uint pointSize = size->pointSize / 10; 1639 1800 #else 1640 1801 const uint pointSize = size->pixelSize; // embedded uses 72dpi … … 1740 1901 1741 1902 if ( size->pixelSize != 0 && size->pixelSize != USHRT_MAX ) { 1742 #if def Q_WS_X111903 #if defined(Q_WS_X11) 1743 1904 const uint pointSize = qRound(qt_pointSize(size->pixelSize, 0, -1)); 1905 #elif defined(Q_WS_PM) 1906 //@@TODO (dmik): some bitmap fonts (i.e. System VIO) have point sizes 1907 // that do not really correlate with their actual pixel sizes (i.e. 1908 // their pointsize != pixelsizde * DPI / 72), What to return in that case? 1909 const uint pointSize = size->pointSize / 10; 1744 1910 #else 1745 1911 const uint pointSize = size->pixelSize; // embedded uses 72dpi -
trunk/src/kernel/qfontengine_p.h
r7 r8 40 40 #endif 41 41 42 #ifdef Q_WS_PM 43 #include "qt_os2.h" 44 #endif 45 42 46 #include "qtextengine_p.h" 43 47 44 48 class QPaintDevice; 45 49 46 struct glyph_metrics_t; 47 class QChar; 48 typedef unsigned short glyph_t; 49 struct qoffset_t; 50 typedef int advance_t; 51 class QOpenType; 50 //@@TODO (dmik): these all are defined in the included "qtextengine_p.h", 51 // what do we need it here for? 52 //struct glyph_metrics_t; 53 //class QChar; 54 //typedef unsigned short glyph_t; 55 //struct qoffset_t; 56 //typedef int advance_t; 57 //class QOpenType; 52 58 struct TransformedFont; 53 59 54 #if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_ MAC )60 #if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_PM) || defined( Q_WS_MAC ) 55 61 class QFontEngine : public QShared 56 62 { … … 71 77 Win, 72 78 Uniscribe, 79 80 // OS/2 types 81 PM, 73 82 74 83 // Apple MacOS types … … 151 160 short rbearing; 152 161 #endif // Q_WS_WIN 162 #ifdef Q_WS_PM 163 HPS ps() const; 164 void selectTo( HPS ps ) const; 165 166 HPS hps; 167 FATTRS fa; 168 PFONTMETRICS pfm; 169 #endif 153 170 #ifdef Q_WS_X11 154 171 TransformedFont *transformed_fonts; … … 605 622 #endif 606 623 607 #endif // Q_WS_WIN 608 609 #endif 624 #elif defined( Q_WS_PM ) 625 626 class QFontEnginePM : public QFontEngine 627 { 628 public: 629 QFontEnginePM( HPS ps, PFATTRS pfa, int pixelSize, int pointSize ); 630 virtual ~QFontEnginePM() { delete[] widthCache; } 631 632 Error stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const; 633 634 void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags ); 635 636 glyph_metrics_t boundingBox( const glyph_t *glyphs, 637 const advance_t *advances, const qoffset_t *offsets, int numGlyphs ); 638 glyph_metrics_t boundingBox( glyph_t glyph ); 639 640 int ascent() const; 641 int descent() const; 642 int leading() const; 643 int maxCharWidth() const; 644 int minLeftBearing() const; 645 int minRightBearing() const; 646 647 //@@TODO (dmik): need other implementation? 648 const char *name() const { return 0; } 649 650 bool canRender( const QChar *string, int len ); 651 652 Type type() const; 653 654 //@@TODO (dmik): the current implementation of font-related code does not 655 // support true unicode (chars and strings are converted using 656 // QString::local8bit), so 256 is enough. It will be changed later (when, 657 // for example, ft2lib will be used). See also stringToCMap() implementation. 658 enum { widthCacheSize = 256 }; 659 unsigned char *widthCache; 660 }; 661 662 #endif 663 664 #endif -
trunk/src/kernel/qiconset.cpp
r7 r8 827 827 pixmap->fill( dis.background() ); 828 828 829 if ( !normalMask.mask() ) 830 normalMask.setMask( normalMask ); 831 829 832 QPainter painter; 830 833 painter.begin( pixmap ); 831 painter.setPen( dis. base() );834 painter.setPen( dis.light() ); 832 835 painter.drawPixmap( 1, 1, normalMask ); 833 painter.setPen( dis. foreground() );836 painter.setPen( dis.dark() ); 834 837 painter.drawPixmap( 0, 0, normalMask ); 835 838 painter.end(); 836 837 if ( !normalMask.mask() )838 normalMask.setMask( normalMask );839 839 840 840 QBitmap mask( pixmap->size() ); -
trunk/src/kernel/qlocalfs.cpp
r7 r8 155 155 fi->size(), fi->lastModified(), fi->lastRead(), fi->isDir(), fi->isFile(), 156 156 fi->isSymLink(), fi->isWritable(), fi->isReadable(), fi->isExecutable() ); 157 // ### Block signals to initiate a hack in QNetworkOperation that will 158 // prevent the op from being deleted during the qApp->processEvents() call 159 op->blockSignals( TRUE ); 160 qApp->processEvents(); 161 op->blockSignals( FALSE ); 162 if ( op->state() == StStopped ) { 163 op->free(); 164 return; 165 } 157 166 } 158 167 emit newChildren( infos, op ); -
trunk/src/kernel/qmime.cpp
r7 r8 356 356 QStringList::Iterator it; 357 357 if ( abs_name[0] == '/' 358 #if def Q_WS_WIN358 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 359 359 || ( abs_name[0] && abs_name[1] == ':' ) || abs_name.startsWith("\\\\") 360 360 #endif … … 456 456 if ( context.isNull() || 457 457 !(context[0] == '/' 458 #if def Q_WS_WIN458 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 459 459 || ( context[0] && context[1] == ':') 460 460 #endif -
trunk/src/kernel/qnetworkprotocol.cpp
r7 r8 84 84 oldOps.removeFirst(); 85 85 } 86 delete opStartTimer;87 86 } 88 87 … … 430 429 QNetworkProtocol::~QNetworkProtocol() 431 430 { 431 QNetworkOperation *op = d->opInProgress; 432 if ( op ) { 433 op->setState( StStopped ); 434 op->setProtocolDetail( tr( "Operation stopped by the user" ) ); 435 emit finished( op ); 436 // op->free() will be called by QNetworkOperationPrivate dtor below 437 } 432 438 delete d; 433 439 } … … 1257 1263 void QNetworkOperation::deleteMe() 1258 1264 { 1259 delete this; 1265 // ### A hackish workaround to prevent this op from being deleted during 1266 // the qApp->processEvents() call in QLocalFs::operationListChildren(). 1267 // The proper way is to add something like QNetworkOperation::cancelFree() 1268 // to stop deleteTimer and make it a documented method. 1269 if ( !signalsBlocked() ) 1270 delete this; 1260 1271 } 1261 1272 -
trunk/src/kernel/qobject.cpp
r7 r8 214 214 215 215 216 // Event functions, implemented in q application_xxx.cpp216 // Event functions, implemented in qeventloop_xxx.cpp 217 217 218 218 int qStartTimer( int interval, QObject *obj ); -
trunk/src/kernel/qpainter.cpp
r7 r8 1635 1635 } else { 1636 1636 txop = TxScale; 1637 #if defined(Q_WS_WIN) 1637 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1638 1638 setf(DirtyFont); 1639 1639 #endif … … 1641 1641 } else { 1642 1642 txop = TxRotShear; 1643 #if defined(Q_WS_WIN) 1643 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1644 1644 setf(DirtyFont); 1645 1645 #endif … … 2345 2345 if ( !pdev->cmd( QPaintDevice::PdcDrawPixmap, this, param ) || !hdc ) 2346 2346 return; 2347 #elif defined(Q_WS_PM) 2348 if ( !pdev->cmd( QPaintDevice::PdcDrawPixmap, this, param ) || !hps ) 2349 return; 2347 2350 #elif defined(Q_WS_QWS) 2348 2351 pdev->cmd( QPaintDevice::PdcDrawPixmap, this, param ); … … 2493 2496 if ( !pdev->cmd( QPaintDevice::PdcDrawImage, this, param ) || !hdc ) 2494 2497 return; 2498 #elif defined(Q_WS_PM) 2499 if ( !pdev->cmd( QPaintDevice::PdcDrawImage, this, param ) || !hps ) 2500 return; 2495 2501 #elif defined (Q_WS_QWS) 2496 2502 pdev->cmd( QPaintDevice::PdcDrawImage, this, param ); … … 2551 2557 #if defined(Q_WS_WIN) 2552 2558 if ( !pdev->cmd( QPaintDevice::PdcDrawImage, this, param ) || !hdc ) 2559 return; 2560 #elif defined(Q_WS_PM) 2561 if ( !pdev->cmd( QPaintDevice::PdcDrawImage, this, param ) || !hps ) 2553 2562 return; 2554 2563 #elif defined(Q_WS_QWS) … … 2793 2802 !hdc ) 2794 2803 return; // QPrinter wants PdcDrawText2 2804 #elif defined(Q_WS_PM) 2805 if ( !pdev->cmd( QPaintDevice::PdcDrawText2Formatted, 2806 this, param) || 2807 !hps ) 2808 return; 2795 2809 #elif defined(Q_WS_QWS) 2796 2810 pdev->cmd( QPaintDevice::PdcDrawText2Formatted, this, param); -
trunk/src/kernel/qpixmap.cpp
r7 r8 367 367 #if defined(Q_WS_WIN) 368 368 hdc = pixmap.hdc; // copy Windows device context 369 #elif defined(Q_WS_PM) 370 hps = pixmap.hps; // copy OS/2 PM presentation space 369 371 #elif defined(Q_WS_X11) 370 372 hd = pixmap.hd; // copy X11 drawable … … 475 477 #if defined(Q_WS_WIN) 476 478 hdc = pixmap.hdc; 479 #elif defined(Q_WS_PM) 480 hps = pixmap.hps; 477 481 #elif defined(Q_WS_X11) 478 482 hd = pixmap.hd; // copy QPaintDevice drawable … … 735 739 delete data->mask; 736 740 data->mask = 0; 741 #if defined (Q_WS_PM) 742 if ( data->maskedHbm ) { 743 GpiDeleteBitmap( data->maskedHbm ); 744 data->maskedHbm = 0; 745 } 746 #endif 737 747 } 738 748 return; … … 754 764 data->alphapm = 0; 755 765 #endif // Q_WS_X11 && !QT_NO_XFTFREETYPE 766 767 #if defined (Q_WS_PM) 768 if ( data->maskedHbm ) { 769 GpiDeleteBitmap( data->maskedHbm ); 770 data->maskedHbm = 0; 771 } 772 #endif 756 773 757 774 delete data->mask; -
trunk/src/kernel/qrichtext.cpp
r7 r8 76 76 #endif 77 77 78 #ifdef Q_WS_PM 79 #include "qt_os2.h" 80 #endif 81 78 82 #define QChar_linesep QChar(0x2028U) 79 83 … … 98 102 value = value * metrics.logicalDpiY() / gdc; 99 103 ReleaseDC( 0, hdc ); 104 #elif defined (Q_WS_PM) 105 LONG dpi; 106 DevQueryCaps( GpiQueryDevice( qt_display_ps() ), 107 CAPS_VERTICAL_FONT_RES, 1, &dpi ); 108 value = value * metrics.logicalDpiY() / dpi; 100 109 #elif defined (Q_WS_MAC) 101 110 value = value * metrics.logicalDpiY() / 75; // ##### FIXME … … 517 526 bool justInsert = TRUE; 518 527 QString s( str ); 519 #if defined(Q_WS_WIN) 528 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 520 529 if ( checkNewLine ) { 521 530 int i = 0; -
trunk/src/kernel/qscriptengine.cpp
r7 r8 1041 1041 #elif defined( Q_WS_WIN ) 1042 1042 # include "qscriptengine_win.cpp" 1043 #elif defined( Q_WS_PM ) 1044 # include "qscriptengine_pm.cpp" 1043 1045 #elif defined( Q_WS_MAC ) 1044 1046 # include "qscriptengine_mac.cpp" -
trunk/src/kernel/qsizegrip.cpp
r7 r8 50 50 #include "qobjectlist.h" 51 51 #include "qt_windows.h" 52 #elif defined (Q_WS_PM) 53 #include "qobjectlist.h" 54 #include "qt_os2.h" 52 55 #elif defined(Q_WS_MAC) 53 56 bool qt_mac_update_sizer(QWidget *, int); //qwidget_mac.cpp … … 236 239 tlw->resize( w, h ); 237 240 } 238 #if def Q_WS_WIN241 #if defined (Q_WS_WIN) 239 242 MSG msg; 240 243 while( PeekMessage( &msg, winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE ) ) 244 ; 245 #elif defined (Q_WS_PM) 246 //@@TODO (dmik): is the code below really necessary? 247 QMSG qmsg; 248 while( WinPeekMsg( 0, &qmsg, winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE ) ) 241 249 ; 242 250 #endif -
trunk/src/kernel/qt_gfx.pri
r7 r8 7 7 system-mng { 8 8 win32:LIBS += libmng.lib 9 os2:LIBS += libmng.lib 9 10 unix:LIBS += -lmng 10 11 } else { … … 46 47 unix:LIBS += -ljpeg 47 48 win32:LIBS += libjpeg.lib 49 os2:LIBS += libjpeg.lib 48 50 } else { 49 51 INCLUDEPATH += 3rdparty/libjpeg … … 105 107 unix:LIBS += -lpng 106 108 win32:LIBS += libpng.lib 109 os2:LIBS += png.lib 107 110 } else { 108 111 INCLUDEPATH += 3rdparty/libpng … … 147 150 unix:LIBS += -lz 148 151 win32:LIBS += libz.lib 152 os2:LIBS += z.lib 149 153 } 150 154 -
trunk/src/kernel/qt_kernel.pri
r7 r8 122 122 $$KERNEL_CPP/qfontengine_win.cpp 123 123 124 os2:SOURCES += \ 125 $$KERNEL_CPP/qapplication_pm.cpp \ 126 $$KERNEL_CPP/qclipboard_pm.cpp \ 127 $$KERNEL_CPP/qcolor_pm.cpp \ 128 $$KERNEL_CPP/qcursor_pm.cpp \ 129 $$KERNEL_CPP/qdesktopwidget_pm.cpp \ 130 $$KERNEL_CPP/qeventloop_pm.cpp \ 131 $$KERNEL_CPP/qfont_pm.cpp \ 132 $$KERNEL_CPP/qmime_pm.cpp \ 133 $$KERNEL_CPP/qpixmap_pm.cpp \ 134 $$KERNEL_CPP/qpaintdevice_pm.cpp \ 135 $$KERNEL_CPP/qpainter_pm.cpp \ 136 $$KERNEL_CPP/qregion_pm.cpp \ 137 $$KERNEL_CPP/qthread_pm.cpp \ 138 $$KERNEL_CPP/qwidget_pm.cpp \ 139 $$KERNEL_CPP/qfontengine_pm.cpp 140 124 141 unix:x11 { 125 142 SOURCES += $$KERNEL_CPP/qapplication_x11.cpp \ … … 260 277 } 261 278 } 279 280 #@@TODO(dmik): headers and sources below are substracted until implemented 281 os2 { 282 HEADERS -= \ 283 $$KERNEL_P/qinputcontext_p.h \ 284 $$KERNEL_H/qpolygonscanner.h \ 285 $$KERNEL_H/qprinter.h \ 286 $$KERNEL_H/qprocess.h \ 287 $$KERNEL_H/qsessionmanager.h \ 288 $$KERNEL_H/qsound.h 289 290 SOURCES -= \ 291 $$KERNEL_CPP/qpolygonscanner.cpp \ 292 $$KERNEL_CPP/qprinter.cpp \ 293 $$KERNEL_CPP/qprocess.cpp \ 294 $$KERNEL_CPP/qsound.cpp 295 } -
trunk/src/kernel/qtextengine.cpp
r7 r8 826 826 #elif defined( Q_WS_WIN ) 827 827 # include "qtextengine_win.cpp" 828 #elif defined( Q_WS_PM ) 829 # include "qtextengine_pm.cpp" 828 830 #elif defined( Q_WS_MAC ) 829 831 # include "qtextengine_mac.cpp" -
trunk/src/kernel/qtextengine_p.h
r7 r8 167 167 unsigned short reserved :1; 168 168 unsigned short engineReserved :2; 169 }; 170 171 inline bool operator == ( const QScriptAnalysis &sa1, const QScriptAnalysis &sa2 ) 172 { 173 return 174 sa1.script == sa2.script && 175 sa1.bidiLevel == sa2.bidiLevel; 176 // ### 177 // && override == other.override; 178 } 179 180 #elif defined( Q_WS_PM ) 181 182 //@@TODO (dmik): the definitions below is almost unchecked (no true unicode 183 // support yet) 184 185 //@@TODO (dmik): curretnly glyphs are just 8 bit chars (see 186 // QFontEnginePM::stringToCMap()), so glyph_t is temporarily defined as 187 // unsigned char. it should be changed later. 188 typedef unsigned char glyph_t; 189 //typedef unsigned short glyph_t; 190 191 struct qoffset_t { 192 int x; 193 int y; 194 }; 195 196 typedef int advance_t; 197 198 //@@TODO (dmik): it's a dummy version... 199 struct QScriptAnalysis { 200 unsigned short script :10; 201 unsigned short bidiLevel :5; 202 unsigned short override :1; 203 unsigned short reserved :1; 169 204 }; 170 205 -
trunk/src/kernel/qthread.cpp
r7 r8 41 41 #include <private/qthreadinstance_p.h> 42 42 43 #ifndef QT_NO_COMPAT 43 44 #ifndef QT_H 44 45 # include "qapplication.h" 45 46 #endif // QT_H 47 #endif // QT_NO_COMPAT 46 48 47 49 #if QT_VERSION >= 0x040000 -
trunk/src/kernel/qtranslator.cpp
r7 r8 406 406 407 407 if ( filename[0] == '/' 408 #if def Q_WS_WIN408 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 409 409 || (filename[0] && filename[1] == ':') || filename[0] == '\\' 410 410 #endif -
trunk/src/kernel/qurl.cpp
r7 r8 834 834 d->host.remove( (uint)0, 1 ); 835 835 836 #if defined(Q_OS_WIN32) 836 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 837 837 // hack for windows file://machine/path syntax 838 838 if ( d->protocol == "file" ) { … … 1028 1028 d->cleanPath = d->path; 1029 1029 } else if ( isLocalFile() ) { 1030 #if defined(Q_OS_WIN32) 1030 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 1031 1031 // hack for stuff like \\machine\path and //machine/path on windows 1032 1032 if ( ( d->path.left( 1 ) == "/" || d->path.left( 1 ) == "\\" ) && … … 1101 1101 { 1102 1102 if ( d->path.isEmpty() || d->path.endsWith( "/" ) 1103 #if def Q_WS_WIN1103 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 1104 1104 || d->path.endsWith( "\\" ) 1105 1105 #endif -
trunk/src/kernel/qwidget.cpp
r7 r8 61 61 #include "qinputcontext_p.h" 62 62 #endif 63 #if defined(Q_WS_PM) 64 #include "qt_os2.h" 65 #endif 63 66 #if defined(Q_WS_QWS) 64 67 #include "qwsmanager_qws.h" … … 513 516 QWidget utility functions 514 517 *****************************************************************************/ 515 516 518 static QFont qt_naturalWidgetFont( QWidget* w ) { 517 519 QFont naturalfont = QApplication::font( w ); … … 3259 3261 #if defined(Q_WS_WIN) 3260 3262 && GetFocus() == winId() 3263 #elif defined(Q_WS_PM) 3264 //@@TODO (dmik): currently we don't use WinSetFocus(). what for? Qt seems 3265 // to completely handle focus traversal itself. 3266 // && WinQueryFocus( HWND_DESKTOP ) == winId() 3261 3267 #endif 3262 3268 ) … … 3294 3300 SetFocus( winId() ); 3295 3301 else { 3302 #elif defined(Q_WS_PM) 3303 //@@TODO (dmik): currently we don't use WinSetFocus(). what for? Qt seems 3304 // to completely handle focus traversal itself. 3305 // if ( !topLevelWidget()->isPopup() ) 3306 // WinSetFocus( HWND_DESKTOP, winId() ); 3307 // else { 3296 3308 #endif 3297 3309 #if defined(QT_ACCESSIBILITY_SUPPORT) 3298 3310 QAccessible::updateAccessibility( this, 0, QAccessible::Focus ); 3299 3311 #endif 3300 #if defined(Q_WS_WIN) 3312 #if defined(Q_WS_WIN) // || defined(Q_WS_PM) 3301 3313 } 3302 3314 #endif … … 3345 3357 SetFocus( 0 ); 3346 3358 else { 3359 #elif defined(Q_WS_PM) 3360 //@@TODO (dmik): currently we don't use WinSetFocus(). what for? Qt seems 3361 // to completely handle focus traversal itself. 3362 // if ( !isPopup() && WinQueryFocus( HWND_DESKTOP ) == winId() ) 3363 // WinSetFocus( HWND_DESKTOP, topLevelWidget()->winId() ); 3364 // else { 3347 3365 #endif 3348 3366 #if defined(QT_ACCESSIBILITY_SUPPORT) 3349 3367 QAccessible::updateAccessibility( this, 0, QAccessible::Focus ); 3350 3368 #endif 3351 #if defined(Q_WS_WIN) 3369 #if defined(Q_WS_WIN) // || defined(Q_WS_PM) 3352 3370 } 3353 3371 #endif … … 3567 3585 } 3568 3586 #endif 3587 //@@TODO (dmik): I think we don't need the same as above in OS/2, 3588 // because if the window is active (in Qt terminology) 3589 // qApp->activeWindow() will be equal to toplevelWidget() which is 3590 // checked at the beginnig. 3569 3591 3570 3592 return FALSE; … … 3985 4007 // On Windows, show the popup now so that our own focus handling 3986 4008 // stores the correct old focus widget even if it's stolen in the showevent 4009 //@@TODO (dmik): need the same in OS/2? guess not. 3987 4010 #if defined(Q_WS_WIN) 3988 4011 if ( testWFlags(WType_Popup) ) … … 4006 4029 showWindow(); 4007 4030 4008 #if !defined(Q_WS_WIN) 4031 //@@TODO (dmik): need the same in OS/2? guess not. 4032 #if !defined(Q_WS_WIN) 4009 4033 if ( testWFlags(WType_Popup) ) 4010 4034 qApp->openPopup( this ); … … 4048 4072 qt_leave_modal( this ); 4049 4073 4050 #if defined(Q_WS_WIN) 4074 //@@TODO (dmik): is it correct for OS/2? 4075 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 4051 4076 if ( isTopLevel() && !isPopup() && parentWidget() && isActiveWindow() ) 4052 4077 parentWidget()->setActiveWindow(); // Activate parent … … 4927 4952 } 4928 4953 4954 #ifndef Q_WS_PM 4955 // We disable this on OS/2 since we send these events from qt_sendBlocked() 4956 // which does it more accurately compared to the code below -- only those 4957 // widgets that have actually been blocked/unblocked (not less and not 4958 // more) will receive these events. 4929 4959 case QEvent::WindowBlocked: 4930 4960 case QEvent::WindowUnblocked: … … 4938 4968 } 4939 4969 break; 4970 #endif 4940 4971 4941 4972 default: … … 5527 5558 */ 5528 5559 bool QWidget::winEvent( MSG * ) 5560 { 5561 return FALSE; 5562 } 5563 5564 #endif 5565 #if defined(Q_WS_PM) 5566 5567 /*! 5568 This special event handler can be reimplemented in a subclass to 5569 receive native OS/2 PM events. 5570 5571 In your reimplementation of this function, if you want to stop the 5572 event being handled by Qt, return TRUE. If you return FALSE, this 5573 native event is passed back to Qt, which translates the event into 5574 a Qt event and sends it to the widget. 5575 5576 \warning This function is not portable. 5577 5578 \sa QApplication::pmEventFilter() 5579 */ 5580 bool QWidget::pmEvent( QMSG * ) 5529 5581 { 5530 5582 return FALSE; -
trunk/src/moc/moc.pro
r7 r8 6 6 QT_NO_STL QT_NO_COMPRESS 7 7 win32:DEFINES += QT_NODLL 8 os2:DEFINES += QT_NODLL 8 9 DESTDIR = ../../bin 9 10 … … 48 49 unix:SOURCES += ../tools/qfile_unix.cpp ../tools/qdir_unix.cpp ../tools/qfileinfo_unix.cpp 49 50 win32:SOURCES += ../tools/qfile_win.cpp ../tools/qdir_win.cpp ../tools/qfileinfo_win.cpp 51 os2:SOURCES += ../tools/qfile_pm.cpp ../tools/qdir_pm.cpp ../tools/qfileinfo_pm.cpp 50 52 macx:LIBS += -framework Carbon 51 53 -
trunk/src/network/qdns.cpp
r7 r8 79 79 #include <dlfcn.h> 80 80 #endif 81 #if defined(Q_OS_OS2) 82 //@@TODO (dmik): currently these headers are not used 83 // (see comments to QDns::doSynchronousLookup()) 84 //#include <netinet/in.h> 85 //#include <resolv.h> 86 #endif 81 87 82 88 //#define QDNS_DEBUG … … 105 111 static bool ipv6support = FALSE; 106 112 113 #if defined(Q_OS_OS2) 114 //@@TODO (dmik): currently qdns_res_init() is not used 115 // (see comments to QDns::doSynchronousLookup()) 116 #else 107 117 static int qdns_res_init() 108 118 { … … 116 126 else 117 127 return -1; 118 #elif defined(Q_OS_UNIX) 128 #elif defined(Q_OS_UNIX) || defined(Q_OS_OS2) 119 129 return res_init(); 120 130 #else … … 122 132 #endif 123 133 } 134 #endif 124 135 125 136 … … 129 140 { 130 141 #if defined(Q_DNS_SYNCHRONOUS) 131 #if defined(Q_OS_UNIX) 142 #if defined(Q_OS_UNIX) || defined(Q_OS_OS2) 132 143 noEventLoop = qApp==0 || qApp->loopLevel()==0; 133 144 #else … … 881 892 { 882 893 if ( !globalManager ) { 894 new QDnsManager(); 883 895 qAddPostRoutine(cleanupDns); 884 new QDnsManager();885 896 } 886 897 return globalManager; … … 2443 2454 } 2444 2455 2445 #elif defined(Q_OS_UNIX) 2456 #elif defined(Q_OS_UNIX) || defined(Q_OS_OS2) 2446 2457 2447 2458 #if defined(Q_DNS_SYNCHRONOUS) 2448 2459 void QDns::doSynchronousLookup() 2449 2460 { 2461 #if defined(Q_OS_OS2) 2462 //@@TODO (dmik): we can use the code below on OS/2 also but this will 2463 // require linking against the additional library containing res_* 2464 // functions and global data, which is normally not used anywhere else 2465 // (because QDns implementation does lookups diretcly to achieve 2466 // asynchronous behavior) and will just waste some system resources. 2467 // Anyhow, is synchronous behavior really necessary? Do nothing for now. 2468 #else 2450 2469 if ( t!=None && !l.isEmpty() ) { 2451 2470 QValueListIterator<QString> it = n.begin(); … … 2499 2518 emit resultsReady(); 2500 2519 } 2520 #endif 2501 2521 } 2502 2522 #endif … … 2517 2537 2518 2538 // read resolv.conf manually. 2539 #if defined(Q_OS_OS2) 2540 char *etc = getenv( "ETC" ); 2541 if ( !etc ) { 2542 etc = "x:\\MPTN\\ETC"; 2543 ULONG boot = 0; 2544 DosQuerySysInfo( QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, (PVOID)boot, sizeof(boot) ); 2545 *etc = (char)(boot + 'A' - 1); 2546 } 2547 // currently, resolv takes precedence over resolv2 assuming that resolv 2548 // is created for PPP connections and therefore should override resolv2 2549 // which is created for permanent LAN connections. 2550 QFile resolvConf( QString( etc ) + "\\resolv" ); 2551 if ( !resolvConf.exists() ) 2552 resolvConf.setName( QString( etc ) + "\\resolv2" ); 2553 #else 2519 2554 QFile resolvConf("/etc/resolv.conf"); 2555 #endif 2520 2556 if (resolvConf.open(IO_ReadOnly)) { 2521 2557 QTextStream stream( &resolvConf ); … … 2529 2565 if ( type == "nameserver" ) { 2530 2566 QHostAddress *address = new QHostAddress(); 2531 if ( address->setAddress( QString(line[1])) ) {2567 if ( address->setAddress( list[1] ) ) { 2532 2568 // only add ipv6 addresses from resolv.conf if 2533 2569 // this host supports ipv6. … … 2548 2584 } 2549 2585 2586 #if defined(Q_OS_OS2) 2587 //@@TODO (dmik): currently the code below is not used 2588 // (see comments to QDns::doSynchronousLookup()) 2589 #else 2550 2590 if (ns->isEmpty()) { 2551 2591 #if defined(Q_MODERN_RES_API) … … 2594 2634 } 2595 2635 } 2596 2636 #endif 2637 2638 #if defined(Q_OS_OS2) 2639 QFile hosts( QString( etc ) + "\\hosts" ); 2640 #else 2597 2641 QFile hosts( QString::fromLatin1( "/etc/hosts" ) ); 2642 #endif 2598 2643 if ( hosts.open( IO_ReadOnly ) ) { 2599 2644 // read the /etc/hosts file, creating long-life A and PTR RRs -
trunk/src/network/qt_network.pri
r7 r8 20 20 unix:NETWORK_SOURCES += $$NETWORK_CPP/qsocketdevice_unix.cpp 21 21 win32:NETWORK_SOURCES += $$NETWORK_CPP/qsocketdevice_win.cpp 22 os2:NETWORK_SOURCES += $$NETWORK_CPP/qsocketdevice_pm.cpp 22 23 SOURCES += $$NETWORK_SOURCES 23 24 } -
trunk/src/qt.pro
r7 r8 11 11 12 12 win32:!shared:CONFIG += staticlib 13 os2:!shared:CONFIG += staticlib 13 14 14 15 win32-borland { … … 86 87 win32-borland:INCLUDEPATH += kernel 87 88 89 os2 { 90 OS2_ALL_H = ../include 91 SQL_H = $$OS2_ALL_H 92 KERNEL_H = $$OS2_ALL_H 93 WIDGETS_H = $$OS2_ALL_H 94 TABLE_H = $$OS2_ALL_H 95 DIALOGS_H = $$OS2_ALL_H 96 ICONVIEW_H = $$OS2_ALL_H 97 NETWORK_H = $$OS2_ALL_H 98 OPENGL_H = $$OS2_ALL_H 99 TOOLS_H = $$OS2_ALL_H 100 CODECS_H = $$OS2_ALL_H 101 WORKSPACE_H = $$OS2_ALL_H 102 XML_H = $$OS2_ALL_H 103 CANVAS_H = $$OS2_ALL_H 104 STYLES_H = $$OS2_ALL_H 105 CONFIG -= incremental 106 107 CONFIG += zlib 108 INCLUDEPATH += tmp 109 !staticlib { 110 DEFINES += QT_MAKEDLL 111 exists(qt.rc):RC_FILE = qt.rc 112 exists(qt.def.tpl.$$QMAKESPEC):DEF_FILE_TEMPLATE = qt.def.tpl.$$QMAKESPEC 113 exists(qt.def.map.$$QMAKESPEC):DEF_FILE_MAP = qt.def.map.$$QMAKESPEC 114 } 115 } 116 88 117 unix { 89 118 CANVAS_H = $$CANVAS_CPP … … 143 172 144 173 #modules 145 include($$KERNEL_CPP/qt_kernel.pri) 146 include($$WIDGETS_CPP/qt_widgets.pri) 147 include($$DIALOGS_CPP/qt_dialogs.pri) 148 include($$ICONVIEW_CPP/qt_iconview.pri) 149 include($$WORKSPACE_CPP/qt_workspace.pri) 150 include($$NETWORK_CPP/qt_network.pri) 151 include($$CANVAS_CPP/qt_canvas.pri) 152 include($$TABLE_CPP/qt_table.pri) 153 include($$XML_CPP/qt_xml.pri) 154 include($$OPENGL_CPP/qt_opengl.pri) 155 include($$SQL_CPP/qt_sql.pri) 156 include($$KERNEL_CPP/qt_gfx.pri) 157 include($$TOOLS_CPP/qt_tools.pri) 158 include($$CODECS_CPP/qt_codecs.pri) 159 include($$STYLES_CPP/qt_styles.pri) 174 os2 { 175 # this section should be removed one day 176 # when an OS/2 version of every module is ready 177 include($$KERNEL_CPP/qt_kernel.pri) 178 include($$WIDGETS_CPP/qt_widgets.pri) 179 include($$DIALOGS_CPP/qt_dialogs.pri) 180 include($$WORKSPACE_CPP/qt_workspace.pri) 181 include($$NETWORK_CPP/qt_network.pri) 182 include($$XML_CPP/qt_xml.pri) 183 include($$KERNEL_CPP/qt_gfx.pri) 184 include($$TOOLS_CPP/qt_tools.pri) 185 include($$CODECS_CPP/qt_codecs.pri) 186 include($$STYLES_CPP/qt_styles.pri) 187 } else { 188 include($$KERNEL_CPP/qt_kernel.pri) 189 include($$WIDGETS_CPP/qt_widgets.pri) 190 include($$DIALOGS_CPP/qt_dialogs.pri) 191 include($$ICONVIEW_CPP/qt_iconview.pri) 192 include($$WORKSPACE_CPP/qt_workspace.pri) 193 include($$NETWORK_CPP/qt_network.pri) 194 include($$CANVAS_CPP/qt_canvas.pri) 195 include($$TABLE_CPP/qt_table.pri) 196 include($$XML_CPP/qt_xml.pri) 197 include($$OPENGL_CPP/qt_opengl.pri) 198 include($$SQL_CPP/qt_sql.pri) 199 include($$KERNEL_CPP/qt_gfx.pri) 200 include($$TOOLS_CPP/qt_tools.pri) 201 include($$CODECS_CPP/qt_codecs.pri) 202 include($$STYLES_CPP/qt_styles.pri) 203 } 160 204 embedded:include($$EMBEDDED_CPP/qt_embedded.pri) 161 205 … … 166 210 167 211 #install directives 168 include(qt_install.pri) 212 #@@todo(dmik): need this on OS/2? 213 !os2:include(qt_install.pri) 169 214 !staticlib:PRL_EXPORT_DEFINES += QT_SHARED 170 215 … … 190 235 $$STYLES_CPP/qstyleplugin.cpp \ 191 236 $$CODECS_CPP/qtextcodecplugin.cpp \ 192 $$WIDGETS_CPP/qwidgetplugin.cpp 193 } 237 $$WIDGETS_CPP/qwidgetplugin.cpp 238 } 239 240 os2 { 241 # targets and commands to sync private headers 242 private_headers.target = ..\.private_headers 243 private_headers.depends = do_private_headers 244 do_private_headers.target = do_private_headers 245 do_private_headers.commands = cd .. && $(MAKE) private_headers 246 QMAKE_EXTRA_TARGETS += do_private_headers private_headers 247 PRE_TARGETDEPS += $$do_private_headers.target 248 QMAKE_INTERNAL_INCLUDED_FILES += $$private_headers.target 249 } -
trunk/src/styles/qcommonstyle.cpp
r7 r8 146 146 #ifndef QT_NO_LISTVIEW 147 147 case PE_CheckListController: { 148 p->drawPixmap(r, QPixmap((const char **)check_list_controller_xpm)); 148 QRect pr( r ); 149 QPixmap px( (const char **)check_list_controller_xpm ); 150 // center pixmap if smaller, otherwise it will be scaled to fit 151 int d = pr.width() - px.width(); 152 if ( d > 0 ) { 153 pr.setX( pr.x() + d / 2 ); 154 pr.setWidth( px.width() ); 155 } 156 d = pr.height() - px.height(); 157 if ( d > 0 ) { 158 pr.setY( pr.y() + d / 2 ); 159 pr.setHeight( px.height() ); 160 } 161 p->drawPixmap( pr, px ); 149 162 break; } 150 163 case PE_CheckListExclusiveIndicator: { -
trunk/src/styles/qcompactstyle.cpp
r7 r8 152 152 const QPopupMenu *popupmenu = (const QPopupMenu *) widget; 153 153 QMenuItem *mi = opt.menuItem(); 154 155 // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we 156 // must erase areas not covered by menu items (this is requested by 157 // QPopupMenu using 0 as the menu item argument). 158 // [Win32 version feels ok without this, because it doesn't actually 159 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 160 // erases the background before WM_PAINT and after every resize]. 161 #if !defined (Q_WS_PM) 154 162 if ( !mi ) 155 163 break; 164 #endif 156 165 157 166 int tab = opt.tabWidth(); -
trunk/src/styles/qmotifplusstyle.cpp
r7 r8 757 757 QPopupMenu *popupmenu = (QPopupMenu *) widget; 758 758 QMenuItem *mi = opt.menuItem(); 759 760 // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we 761 // must erase areas not covered by menu items (this is requested by 762 // QPopupMenu using 0 as the menu item argument). 763 // [Win32 version feels ok without this, because it doesn't actually 764 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 765 // erases the background before WM_PAINT and after every resize]. 766 #if !defined (Q_WS_PM) 759 767 if ( !mi ) 760 768 break; 769 #endif 761 770 762 771 int tab = opt.tabWidth(); -
trunk/src/styles/qmotifstyle.cpp
r7 r8 1004 1004 const QPopupMenu *popupmenu = (const QPopupMenu *) widget; 1005 1005 QMenuItem *mi = opt.menuItem(); 1006 1007 // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we 1008 // must erase areas not covered by menu items (this is requested by 1009 // QPopupMenu using 0 as the menu item argument). 1010 // [Win32 version feels ok without this, because it doesn't actually 1011 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 1012 // erases the background before WM_PAINT and after every resize]. 1013 #if !defined (Q_WS_PM) 1006 1014 if ( !mi ) 1007 1015 break; 1016 #endif 1008 1017 1009 1018 int tab = opt.tabWidth(); -
trunk/src/styles/qsgistyle.cpp
r7 r8 946 946 break; 947 947 QMenuItem *mi = opt.menuItem(); 948 949 // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we 950 // must erase areas not covered by menu items (this is requested by 951 // QPopupMenu using 0 as the menu item argument). 952 // [Win32 version feels ok without this, because it doesn't actually 953 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 954 // erases the background before WM_PAINT and after every resize]. 955 #if !defined (Q_WS_PM) 948 956 if ( !mi ) 949 957 break; 958 #endif 950 959 const QPopupMenu *popupmenu = (const QPopupMenu *) widget; 951 960 int tab = opt.tabWidth(); -
trunk/src/styles/qwindowsstyle.cpp
r7 r8 85 85 enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; 86 86 87 #ifndef QT_NO_MENUDATA 87 88 // A friendly class providing access to QMenuData's protected member. 88 89 class FriendlyMenuData : public QMenuData … … 90 91 friend class QWindowsStyle; 91 92 }; 93 #endif 92 94 93 95 // Private class … … 158 160 break; 159 161 case QEvent::KeyRelease: 162 #ifndef QT_NO_MENUDATA 160 163 if (((QKeyEvent*)e)->key() == Key_Alt) { 161 164 widget = widget->topLevelWidget(); … … 172 175 } 173 176 } 177 #endif 174 178 break; 175 179 case QEvent::FocusIn: 176 180 case QEvent::FocusOut: 181 #ifndef QT_NO_MENUBAR 177 182 { 178 183 // Menubars toggle based on focus … … 181 186 menuBarTimer = menuBar->startTimer(0); 182 187 } 188 #endif 183 189 break; 184 190 case QEvent::Close: … … 188 194 break; 189 195 case QEvent::Timer: 196 #ifndef QT_NO_MENUBAR 190 197 { 191 198 QMenuBar *menuBar = ::qt_cast<QMenuBar*>(o); … … 198 205 } 199 206 } 207 #endif 200 208 break; 201 209 default: … … 841 849 const QPopupMenu *popupmenu = (const QPopupMenu *) widget; 842 850 QMenuItem *mi = opt.menuItem(); 851 852 // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we 853 // must erase areas not covered by menu items (this is requested by 854 // QPopupMenu using 0 as the menu item argument). 855 // [Win32 version feels ok without this, because it doesn't actually 856 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 857 // erases the background before WM_PAINT and after every resize]. 858 #if !defined (Q_WS_PM) 843 859 if ( !mi ) 844 860 break; 845 861 #endif 862 846 863 int tab = opt.tabWidth(); 847 864 int maxpmw = opt.maxIconWidth(); -
trunk/src/tools/qconfig.cpp
r7 r8 2 2 3 3 /* Install paths from configure */ 4 static const char QT_INSTALL_PREFIX [267] = "qt_nstpath= E:\\develop\\Qt\\win-3.3.1";5 static const char QT_INSTALL_BINS [267] = "qt_binpath= E:\\develop\\Qt\\win-3.3.1\\bin";6 static const char QT_INSTALL_DOCS [267] = "qt_docpath= E:\\develop\\Qt\\win-3.3.1\\doc";7 static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath= E:\\develop\\Qt\\win-3.3.1\\include";8 static const char QT_INSTALL_LIBS [267] = "qt_libpath= E:\\develop\\Qt\\win-3.3.1\\lib";9 static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath= E:\\develop\\Qt\\win-3.3.1\\plugins";10 static const char QT_INSTALL_DATA [267] = "qt_datpath= E:\\develop\\Qt\\win-3.3.1";11 static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath= E:\\develop\\Qt\\win-3.3.1\\translations";4 static const char QT_INSTALL_PREFIX [267] = "qt_nstpath=C:\\Qt\\3.3.1"; 5 static const char QT_INSTALL_BINS [267] = "qt_binpath=C:\\Qt\\3.3.1\\bin"; 6 static const char QT_INSTALL_DOCS [267] = "qt_docpath=C:\\Qt\\3.3.1\\doc"; 7 static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath=C:\\Qt\\3.3.1\\include"; 8 static const char QT_INSTALL_LIBS [267] = "qt_libpath=C:\\Qt\\3.3.1\\lib"; 9 static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath=C:\\Qt\\3.3.1\\plugins"; 10 static const char QT_INSTALL_DATA [267] = "qt_datpath=C:\\Qt\\3.3.1"; 11 static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath=C:\\Qt\\3.3.1\\translations"; 12 12 13 13 /* strlen( "qt_xxxpath=" ) == 11 */ -
trunk/src/tools/qcriticalsection_p.cpp
r7 r8 36 36 #if defined(QT_THREAD_SUPPORT) 37 37 38 #include "qt_windows.h"39 40 38 #include <private/qcriticalsection_p.h> 41 39 40 #if defined(Q_WS_WIN) 41 # include "qt_windows.h" 42 #elif defined(Q_OS_OS2) 43 # include "qt_os2.h" 44 #endif 45 46 #if defined(Q_WS_WIN) 42 47 class QCriticalSectionPrivate 43 48 { … … 47 52 CRITICAL_SECTION section; 48 53 }; 49 54 #endif 50 55 51 56 QCriticalSection::QCriticalSection() 52 57 { 58 #if defined(Q_WS_WIN) 53 59 d = new QCriticalSectionPrivate; 54 60 InitializeCriticalSection( &d->section ); 61 #endif 55 62 } 56 63 57 64 QCriticalSection::~QCriticalSection() 58 65 { 66 #if defined(Q_WS_WIN) 59 67 DeleteCriticalSection( &d->section ); 60 68 delete d; 69 #endif 61 70 } 62 71 63 72 void QCriticalSection::enter() 64 73 { 74 #if defined(Q_WS_WIN) 65 75 EnterCriticalSection( &d->section ); 76 #elif defined(Q_OS_OS2) 77 DosEnterCritSec(); 78 #endif 66 79 } 67 80 68 81 void QCriticalSection::leave() 69 82 { 83 #if defined(Q_WS_WIN) 70 84 LeaveCriticalSection( &d->section ); 85 #elif defined(Q_OS_OS2) 86 DosExitCritSec(); 87 #endif 71 88 } 72 89 -
trunk/src/tools/qcriticalsection_p.h
r7 r8 38 38 39 39 #ifndef QT_H 40 #include "qglobal.h" 40 41 #endif // QT_H 41 42 … … 54 55 #if defined(QT_THREAD_SUPPORT) 55 56 56 #if defined(Q_WS_WIN) 57 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 57 58 58 59 /* … … 60 61 */ 61 62 63 #if defined(Q_WS_WIN) 62 64 class QCriticalSectionPrivate; 65 #endif 63 66 64 67 class QCriticalSection … … 70 73 void leave(); 71 74 75 #if defined(Q_WS_WIN) 72 76 private: 73 77 QCriticalSectionPrivate *d; 78 #endif 74 79 }; 75 80 -
trunk/src/tools/qdatetime.cpp
r7 r8 51 51 #endif 52 52 53 #if defined(Q_OS_OS2) 54 #include <unidef.h> 55 #include <sys/timeb.h> 56 #endif 57 53 58 static const uint FIRST_DAY = 2361222; // Julian day for 1752-09-14 54 59 static const int FIRST_YEAR = 1752; // ### wrong for many countries … … 515 520 } 516 521 #endif 517 #ifndef Q_WS_WIN 522 #if defined(Q_OS_OS2) 523 UniChar buffer[256]; 524 tm tt; 525 memset( &tt, 0, sizeof( tm ) ); 526 tt.tm_mon = month - 1; 527 LocaleObject lo = qt_os2DefLocaleObj(); 528 if (lo) 529 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 530 (UniChar *)L"%b", &tt ) 531 ) 532 return QString::fromUcs2( buffer ); 533 #elif !defined(Q_WS_WIN) 518 534 char buffer[255]; 519 535 tm tt; … … 561 577 } 562 578 #endif 563 #ifndef Q_WS_WIN 579 #if defined(Q_OS_OS2) 580 UniChar buffer[256]; 581 tm tt; 582 memset( &tt, 0, sizeof( tm ) ); 583 tt.tm_mon = month - 1; 584 LocaleObject lo = qt_os2DefLocaleObj(); 585 if (lo) 586 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 587 (UniChar *)L"%B", &tt ) 588 ) 589 return QString::fromUcs2( buffer ); 590 #elif !defined(Q_WS_WIN) 564 591 char buffer[255]; 565 592 tm tt; … … 615 642 } 616 643 #endif 617 #ifndef Q_WS_WIN 644 #if defined(Q_OS_OS2) 645 UniChar buffer[256]; 646 tm tt; 647 memset( &tt, 0, sizeof( tm ) ); 648 tt.tm_wday = ( weekday == 7 ) ? 0 : weekday; 649 LocaleObject lo = qt_os2DefLocaleObj(); 650 if (lo) 651 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 652 (UniChar *)L"%a", &tt ) 653 ) 654 return QString::fromUcs2( buffer ); 655 #elif !defined(Q_WS_WIN) 618 656 char buffer[255]; 619 657 tm tt; … … 663 701 } 664 702 #endif 665 #ifndef Q_WS_WIN 703 #if defined(Q_OS_OS2) 704 UniChar buffer[256]; 705 tm tt; 706 memset( &tt, 0, sizeof( tm ) ); 707 tt.tm_wday = ( weekday == 7 ) ? 0 : weekday; 708 LocaleObject lo = qt_os2DefLocaleObj(); 709 if (lo) 710 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 711 (UniChar *)L"%A", &tt ) 712 ) 713 return QString::fromUcs2( buffer ); 714 #elif !defined(Q_WS_WIN) 666 715 char buffer[255]; 667 716 tm tt; … … 729 778 case Qt::LocalDate: 730 779 { 731 #ifndef Q_WS_WIN 780 #if defined(Q_OS_OS2) 781 tm tt; 782 memset( &tt, 0, sizeof( tm ) ); 783 UniChar buf[256]; 784 tt.tm_mday = day(); 785 tt.tm_mon = month() - 1; 786 tt.tm_year = year() - 1900; 787 788 LocaleObject lo = qt_os2DefLocaleObj(); 789 if (lo) 790 if ( UniStrftime( lo, buf, sizeof( buf ) / sizeof( UniChar ), 791 (UniChar *)L"%x", &tt ) 792 ) 793 return QString::fromUcs2( buf ); 794 #elif !defined(Q_WS_WIN) 732 795 tm tt; 733 796 memset( &tt, 0, sizeof( tm ) ); … … 1395 1458 case Qt::LocalDate: 1396 1459 { 1397 #ifndef Q_WS_WIN 1460 #if defined(Q_OS_OS2) 1461 tm tt; 1462 memset( &tt, 0, sizeof( tm ) ); 1463 UniChar buf[256]; 1464 tt.tm_sec = second(); 1465 tt.tm_min = minute(); 1466 tt.tm_hour = hour(); 1467 1468 LocaleObject lo = qt_os2DefLocaleObj(); 1469 if (lo) 1470 if ( UniStrftime( lo, buf, sizeof( buf ) / sizeof( UniChar ), 1471 (UniChar *)L"%X", &tt ) 1472 ) 1473 return QString::fromUcs2( buf ); 1474 #elif !defined(Q_WS_WIN) 1398 1475 tm tt; 1399 1476 memset( &tt, 0, sizeof( tm ) ); … … 1743 1820 ct->ds = (uint)( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1744 1821 1000 * t->tm_sec + tv.tv_usec / 1000 ); 1822 #elif defined(Q_OS_OS2) 1823 timeb ltime; 1824 ::ftime( <ime ); 1825 tm *t; 1826 if ( ts == Qt::LocalTime ) 1827 t = localtime( <ime.time ); 1828 else 1829 t = gmtime( <ime.time ); 1830 ct->ds = (uint) ( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1831 1000 * t->tm_sec + ltime.millitm ); 1745 1832 #else 1746 1833 time_t ltime; // no millisecond resolution … … 1748 1835 tm *t; 1749 1836 if ( ts == Qt::LocalTime ) 1750 localtime( <ime );1837 t = localtime( <ime ); 1751 1838 else 1752 gmtime( <ime );1839 t = gmtime( <ime ); 1753 1840 ct->ds = (uint) ( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1754 1841 1000 * t->tm_sec ); -
trunk/src/tools/qdir.cpp
r7 r8 68 68 A QDir can point to a file using either a relative or an absolute 69 69 path. Absolute paths begin with the directory separator "/" 70 (optionally preceded by a drive specification under Windows ). If70 (optionally preceded by a drive specification under Windows and OS/2). If 71 71 you always use "/" as a directory separator, Qt will translate 72 72 your paths to conform to the underlying operating system. Relative … … 116 116 The list of root directories is provided by drives(); on Unix 117 117 systems this returns a list containing one root directory, "/"; on 118 Windows the list will usually contain "C:/", and possibly "D:/",118 Windows or OS/2 the list will usually contain "C:/", and possibly "D:/", 119 119 etc. 120 120 … … 281 281 The path can be either absolute or relative. Absolute paths begin 282 282 with the directory separator "/" (optionally preceded by a drive 283 specification under Windows ). Relative file names begin with a283 specification under Windows and OS/2). Relative file names begin with a 284 284 directory name or a file name and specify a path relative to the 285 285 current directory. An example of an absolute path is the string … … 403 403 404 404 QString tmp = absPath(); 405 #if def Q_OS_WIN32405 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 406 406 if ( fileName[0].isLetter() && fileName[1] == ':' ) { 407 #if defined(Q_OS_OS2) 408 #if defined(Q_CC_GNU) 409 char drv = fileName.upper()[0].latin1(); 410 if ( _getdrive() != drv ) { 411 char buf[PATH_MAX]; 412 _getcwd1( buf, drv ); 413 #else 414 int drv = fileName.upper()[0].latin1() - 'A' + 1; 415 if ( _getdrive() != drv ) { 416 char buf[PATH_MAX]; 417 _getdcwd( drv, buf, PATH_MAX ); 418 #endif 419 tmp = buf; 420 #else 407 421 int drv = fileName.upper()[0].latin1() - 'A' + 1; 408 422 if ( _getdrive() != drv ) { … … 416 430 tmp = buf; 417 431 } ); 432 #endif 418 433 if ( !tmp.endsWith("\\") ) 419 434 tmp += "\\"; … … 445 460 "c:\winnt\system32". 446 461 462 On OS/2, convertSeparators("c:/os2/system") returns 463 "c:\os2\system". 464 447 465 The returned string may be the same as the argument on some 448 466 operating systems, for example on Unix. … … 1083 1101 /*! 1084 1102 Returns the native directory separator; "/" under UNIX (including 1085 Mac OS X) and "\" under Windows .1103 Mac OS X) and "\" under Windows and OS/2. 1086 1104 1087 1105 You do not need to use this function to build file paths. If you … … 1126 1144 environment variable). If none of these exist "C:\" is used. 1127 1145 1146 Under OS/2 the \c HOME environment variable is also used. If it 1147 does not exist the path is formed by concatenating the \c 1148 HOMEDRIVE and \c HOMEPATH environment variables. If they don't 1149 exist the rootDirPath() is used (which always returns "x:/" where \c x 1150 is the system boot drive letter). 1151 1128 1152 Under non-Windows operating systems the \c HOME environment 1129 1153 variable is used if it exists, otherwise rootDirPath() is used. -
trunk/src/tools/qfile.cpp
r7 r8 139 139 140 140 Qt uses Unicode file names. If you want to do your own I/O on Unix 141 systems you may want to use encodeName() (and decodeName()) to141 and OS/2 systems you may want to use encodeName() (and decodeName()) to 142 142 convert the file name into the local encoding. 143 143 … … 565 565 /*! 566 566 When you use QFile, QFileInfo, and QDir to access the file system 567 with Qt, you can use Unicode file names. On Unix , these file names568 are converted to an 8-bit encoding. If you want to do your own569 file I/O on Unix , you should convert the file name using this567 with Qt, you can use Unicode file names. On Unix and OS/2, these file 568 names are converted to an 8-bit encoding. If you want to do your own 569 file I/O on Unix or OS/2, you should convert the file name using this 570 570 function. On Windows NT/2000, Unicode file names are supported 571 571 directly in the file system and this function should be avoided. -
trunk/src/tools/qfiledefs_p.h
r7 r8 54 54 struct QFileInfoCache 55 55 { 56 #if defined(Q_WS_WIN) 56 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 57 57 QT_STATBUF st; 58 58 #else -
trunk/src/tools/qfileinfo.cpp
r7 r8 64 64 A QFileInfo can point to a file with either a relative or an 65 65 absolute file path. Absolute file paths begin with the directory 66 separator "/" (or with a drive specification on Windows ). Relative66 separator "/" (or with a drive specification on Windows and OS/2). Relative 67 67 file names begin with a directory name or a file name and specify 68 68 a path relative to the current working directory. An example of an … … 130 130 rights of the current user, you should use isReadable(), isWritable() and 131 131 isExecutable(). 132 133 @@TODO: describe OS/2 semantics regarding permissions. 132 134 */ 133 135 … … 266 268 The \a file can also include an absolute or relative file path. 267 269 Absolute paths begin with the directory separator (e.g. "/" under 268 Unix) or a drive specification (under Windows ). Relative file270 Unix) or a drive specification (under Windows and OS/2). Relative file 269 271 names begin with a directory name or a file name and specify a 270 272 path relative to the current directory. … … 529 531 } 530 532 531 #if ndef Q_WS_WIN533 #if !defined(Q_WS_WIN) && !defined(Q_OS_OS2) 532 534 bool QFileInfo::isHidden() const 533 535 { … … 654 656 The absolute path name consists of the full path and the file 655 657 name. On Unix this will always begin with the root, '/', 656 directory. On Windows this will always begin 'D:/' where D is a658 directory. On Windows and OS/2 this will always begin 'D:/' where D is a 657 659 drive letter, except for network shares that are not mapped to a 658 660 drive letter, in which case the path will begin '//sharename/'. … … 672 674 QString tmp; 673 675 if ( QDir::isRelativePath(fn) 674 #if defined(Q_OS_WIN32) 676 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 675 677 && fn[1] != ':' 676 678 #endif -
trunk/src/tools/qglobal.cpp
r7 r8 47 47 #if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_OS_TEMP) 48 48 #include <crtdbg.h> 49 #endif 50 51 #if defined(Q_OS_OS2) 52 #include "qt_os2.h" 49 53 #endif 50 54 … … 359 363 \endcode 360 364 361 Under X11 , the text is printed to stderr. Under Windows, the text365 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 362 366 is sent to the debugger. 363 367 … … 392 396 \endcode 393 397 394 Under X11 , the text is printed to stderr. Under Windows, the text398 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 395 399 is sent to the debugger. 396 400 … … 426 430 \endcode 427 431 428 Under X11 , the text is printed to stderr. Under Windows, the text432 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 429 433 is sent to the debugger. 430 434 … … 652 656 error code will be used if possible. Use this method to handle 653 657 failures in platform specific API calls. 658 659 Under OS/2, the value -1 for \a code should only be used after Presentation 660 Manager calls. 654 661 655 662 This function does nothing when Qt is built with \c QT_NO_DEBUG … … 689 696 } ); 690 697 LocalFree( (HLOCAL)string ); 698 #elif defined(Q_OS_OS2) 699 if ( code != -1 ) { 700 CHAR buf [256] = {0}; 701 ULONG len = 0; 702 APIRET rc = DosGetMessage( NULL, 0, buf, sizeof(buf) - 1, code, "OSO001.MSG", &len ); 703 if ( !rc ) { 704 buf[len] = '\0'; 705 qWarning( "%s\n\tError %s", msg, buf ); 706 } else { 707 if ( rc == ERROR_MR_MSG_TOO_LONG ) 708 qWarning( 709 "%s\n\tError code SYS%04d, " 710 "type help %d in the command prompt to get more information", 711 msg, code, code ); 712 else 713 qWarning( "%s\n\tError code %d (system error)", msg, code ); 714 } 715 } else { 716 code = (int) WinGetLastError( 0 ); 717 if ( code ) 718 qWarning( "%s\n\tError code %08X (PM error)", msg, code ); 719 else 720 qWarning( msg ); 721 } 691 722 #else 692 723 if ( code != -1 ) … … 858 889 859 890 The default message handler prints the message to the standard 860 output under X11 or to the debugger under Windows. If it is a891 output under X11 and OS/2 or to the debugger under Windows. If it is a 861 892 fatal message, the application aborts immediately. 862 893 -
trunk/src/tools/qgpluginmanager.cpp
r7 r8 315 315 return; 316 316 317 #if defined(Q_OS_WIN32) 317 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 318 318 QString filter = "*.dll"; 319 319 #elif defined(Q_OS_MACX) -
trunk/src/tools/qlibrary.cpp
r7 r8 1 //depot/qt/3/src/tools/qlibrary.cpp#9 - edit change 123005 (text)2 1 /**************************************************************************** 3 2 ** $Id$ … … 123 122 QLibrary lib( "mylib.dll" ); 124 123 \endcode 125 on Windows , and124 on Windows and OS/2, and 126 125 \code 127 126 QLibrary lib( "libmylib.so" ); … … 178 177 with a C++ compiler. On Windows you also have to explicitly export 179 178 the function from the DLL using the \c {__declspec(dllexport)} 180 compiler directive. 179 compiler directive. 181 180 182 181 \code … … 197 196 \endcode 198 197 198 On OS/2 you should create a .DEF file that describes what functions are 199 exported and use it when linking your DLL (@@TODO: add more info and an 200 example). 201 199 202 On Darwin and Mac OS X this function uses code from dlcompat, part of the 200 203 OpenDarwin project. … … 385 388 QString str = lib.library(); 386 389 \endcode 387 will set \e str to "mylib.dll" on Windows , and "libmylib.so" on Linux.390 will set \e str to "mylib.dll" on Windows and OS/2, and "libmylib.so" on Linux. 388 391 */ 389 392 QString QLibrary::library() const … … 394 397 QString filename = libfile; 395 398 396 #if defined(Q_WS_WIN) 399 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 397 400 if ( filename.findRev( '.' ) <= filename.findRev( '/' ) ) 398 401 filename += ".dll"; -
trunk/src/tools/qlibrary_p.h
r7 r8 64 64 QLibraryPrivate( QLibrary *lib ); 65 65 66 #if def Q_WS_WIN66 #if defined(Q_WS_WIN) 67 67 HINSTANCE pHnd; 68 #elif defined(Q_OS_OS2) 69 HMODULE pHnd; 68 70 #else 69 71 void *pHnd; -
trunk/src/tools/qlocale.cpp
r7 r8 53 53 # define isnan(d) _isnan(d) 54 54 # endif 55 #endif 55 #elif defined(Q_OS_OS2) && defined(Q_CC_GNU) 56 # undef NAN 57 # undef INFINITY 58 #endif 59 56 60 57 61 #if !defined( QWS ) && defined( Q_OS_MAC ) -
trunk/src/tools/qsettings.cpp
r7 r8 74 74 75 75 On Unix systems, QSettings uses text files to store settings. On Windows 76 systems, QSettings uses the system registry. On Mac OS X, QSettings uses77 the Carbon preferences API.76 and OS/2 systems, QSettings uses the system registry. On Mac OS X, 77 QSettings uses the Carbon preferences API. 78 78 79 79 Each setting comprises an identifying key and the data associated with … … 160 160 \endcode 161 161 162 Since settings for Windows a re stored in the registry there are162 Since settings for Windows and OS/2 are stored in the registry there are 163 163 some size limitations as follows: 164 164 \list … … 225 225 226 226 For cross-platform applications you should ensure that the 227 \link #sizelimit Windows size limitations \endlink are not exceeded.227 \link #sizelimit Windows and OS/2 size limitations \endlink are not exceeded. 228 228 */ 229 229 … … 233 233 \value Mac Macintosh execution environments 234 234 \value Unix Mac OS X, Unix, Linux and Unix-like execution environments 235 \value Windows Windows execution environments235 \value Windows Windows and OS/2 execution environments 236 236 */ 237 237 … … 333 333 return; 334 334 335 #if ndef Q_WS_WIN335 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 336 336 HANDLE lockfd = openlock( filename, Q_LOCKREAD ); 337 337 #endif … … 356 356 file.close(); 357 357 358 #if ndef Q_WS_WIN358 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 359 359 closelock( lockfd ); 360 360 #endif … … 456 456 : groupDirty( TRUE ), modified(FALSE), globalScope(TRUE) 457 457 { 458 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))458 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 459 459 if ( format != QSettings::Ini ) 460 460 return; … … 697 697 698 698 When \a s is \e Windows and the execution environment is \e not 699 Windows the function does nothing. Similarly when \a s is \e Unix and699 Windows or OS/2 the function does nothing. Similarly when \a s is \e Unix and 700 700 the execution environment is \e not Unix the function does nothing. 701 701 702 When \a s is \e Windows, and the execution environment is Windows , the702 When \a s is \e Windows, and the execution environment is Windows or OS/2, the 703 703 search path list will be used as the first subfolder of the "Software" 704 704 folder in the registry. … … 781 781 void QSettings::insertSearchPath( System s, const QString &path) 782 782 { 783 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))783 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 784 784 if ( d->sysd ) { 785 785 d->sysInsertSearchPath( s, path ); … … 788 788 #endif 789 789 790 #if !defined(Q_WS_WIN) 790 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 791 791 if ( s == Windows ) 792 792 return; 793 793 #endif 794 #if !defined(Q_WS_WIN) 794 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 795 795 if ( s == Mac ) 796 796 return; … … 804 804 } 805 805 806 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))806 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 807 807 if ( d->sysd && s != Unix ) { 808 808 #else … … 816 816 817 817 QString realPath = path; 818 #if defined(Q_WS_WIN) 818 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 819 819 QString defPath = d->globalScope ? d->searchPaths.first() : d->searchPaths.last(); 820 820 realPath = defPath + path; … … 844 844 } 845 845 846 #if def Q_WS_WIN846 #if defined(Q_WS_WIN) || defined (Q_WS_PM) 847 847 if ( d->sysd ) { 848 848 d->sysRemoveSearchPath( s, path ); … … 850 850 } 851 851 #endif 852 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))852 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 853 853 if ( d->sysd && s != Unix ) { 854 854 #else … … 876 876 Q_CHECK_PTR(d); 877 877 878 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))878 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 879 879 d->sysd = 0; 880 880 d->sysInit(); … … 893 893 Q_CHECK_PTR(d); 894 894 895 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))895 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 896 896 d->sysd = 0; 897 897 if ( format == Native ) … … 911 911 sync(); 912 912 913 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))913 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 914 914 if ( d->sysd ) 915 915 d->sysClear(); … … 926 926 bool QSettings::sync() 927 927 { 928 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))928 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 929 929 if ( d->sysd ) 930 930 return d->sysSync(); … … 981 981 } 982 982 983 #if ndef Q_WS_WIN983 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 984 984 HANDLE lockfd = openlock( filename, Q_LOCKWRITE ); 985 985 #endif … … 1055 1055 file.remove(); 1056 1056 1057 #if ndef Q_WS_WIN1057 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 1058 1058 closelock( lockfd ); 1059 1059 #endif … … 1093 1093 } 1094 1094 1095 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1095 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1096 1096 if ( d->sysd ) 1097 1097 return d->sysReadBoolEntry( grp_key, def, ok ); … … 1145 1145 } 1146 1146 1147 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1147 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1148 1148 if ( d->sysd ) 1149 1149 return d->sysReadDoubleEntry( grp_key, def, ok ); … … 1190 1190 } 1191 1191 1192 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1192 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1193 1193 if ( d->sysd ) 1194 1194 return d->sysReadNumEntry( grp_key, def, ok ); … … 1236 1236 } 1237 1237 1238 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1238 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1239 1239 if ( d->sysd ) 1240 1240 return d->sysReadEntry( grp_key, def, ok ); … … 1311 1311 } 1312 1312 1313 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1313 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1314 1314 if ( d->sysd ) 1315 1315 return d->sysWriteEntry( grp_key, value ); … … 1342 1342 } 1343 1343 1344 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1344 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1345 1345 if ( d->sysd ) 1346 1346 return d->sysWriteEntry( grp_key, value ); … … 1372 1372 } 1373 1373 1374 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1374 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1375 1375 if ( d->sysd ) 1376 1376 return d->sysWriteEntry( grp_key, value ); … … 1425 1425 } 1426 1426 1427 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1427 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1428 1428 if ( d->sysd ) 1429 1429 return d->sysWriteEntry( grp_key, value ); … … 1486 1486 } 1487 1487 1488 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1488 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1489 1489 if ( d->sysd ) 1490 1490 return d->sysRemoveEntry( grp_key ); … … 1564 1564 } 1565 1565 1566 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1566 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1567 1567 if ( d->sysd ) 1568 1568 return d->sysEntryList( grp_key ); … … 1660 1660 } 1661 1661 1662 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1662 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1663 1663 if ( d->sysd ) 1664 1664 return d->sysSubkeyList( grp_key ); … … 1753 1753 } 1754 1754 1755 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1755 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1756 1756 if ( d->sysd ) 1757 1757 return QDateTime(); … … 1961 1961 void QSettings::setPath( const QString &domain, const QString &product, Scope scope ) 1962 1962 { 1963 // On Windows , any trailing ".com(\..*)" is stripped from the domain. The1963 // On Windows and OS/2, any trailing ".com(\..*)" is stripped from the domain. The 1964 1964 // Global scope corresponds to HKEY_LOCAL_MACHINE, and User corresponds to 1965 1965 // HKEY_CURRENT_USER. Note that on some installations, not all users can … … 1982 1982 int lastDot = domain.findRev( '.' ); 1983 1983 1984 #if defined(Q_WS_WIN) 1984 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1985 1985 actualSearchPath = "/" + domain.mid( 0, lastDot ) + "/" + product; 1986 1986 insertSearchPath( Windows, actualSearchPath ); -
trunk/src/tools/qsettings_p.h
r7 r8 106 106 bool globalScope :1; 107 107 108 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))108 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 109 109 // system dependent implementations to use the 110 110 // system specific setting database (ie. registry on Windows) -
trunk/src/tools/qstring.cpp
r7 r8 62 62 #if defined(Q_WS_WIN) 63 63 #include "qt_windows.h" 64 #endif 65 #if defined(Q_OS_OS2) 66 #include <unidef.h> 67 #include <uconv.h> 64 68 #endif 65 69 #if !defined( QT_NO_COMPONENT ) && !defined( QT_LITE_COMPONENT ) … … 5701 5705 /*! 5702 5706 Returns the string encoded in a locale-specific format. On X11, 5703 this is the QTextCodec::codecForLocale(). On Windows , it is a5707 this is the QTextCodec::codecForLocale(). On Windows and OS/2, it is a 5704 5708 system-defined encoding. On Mac OS X, this always uses UTF-8 as 5705 5709 the encoding. … … 5731 5735 return isNull() ? QCString("") : qt_winQString2MB( *this ); 5732 5736 #endif 5737 #if defined(Q_OS_OS2) 5738 return isNull() ? QCString("") : qt_os2QString2MB( *this ); 5739 #endif 5733 5740 #ifdef Q_WS_QWS 5734 5741 return utf8(); // ### if there is any 8 bit format supported? … … 5780 5787 return qt_winMB2QString( local8Bit ); 5781 5788 #endif 5789 #if defined(Q_OS_OS2) 5790 return qt_os2MB2QString( local8Bit, len ); 5791 #endif 5782 5792 #ifdef Q_WS_QWS 5783 5793 return fromUtf8(local8Bit,len); … … 6193 6203 return 0; 6194 6204 } 6205 #elif defined(Q_OS_OS2) 6206 LocaleObject lo = qt_os2DefLocaleObj(); 6207 if (lo) 6208 return UniStrcoll( lo, (UniChar*) ucs2(), (UniChar *) s.ucs2() ); 6209 else 6210 return ucstrcmp( *this, s ); 6195 6211 #elif defined(Q_WS_MACX) 6196 6212 int delta = 0; … … 6928 6944 6929 6945 #endif // Q_OS_WIN32 6946 6947 #if defined (Q_OS_OS2) 6948 6949 static LocaleObject qt_os2DefLocaleObj_var = NULL; 6950 static UconvObject qt_os2DefUconvObj_var = NULL; 6951 6952 const LocaleObject qt_os2DefLocaleObj() 6953 { 6954 if ( !qt_os2DefLocaleObj_var ) 6955 UniCreateLocaleObject( UNI_UCS_STRING_POINTER, (UniChar *)L"", 6956 &qt_os2DefLocaleObj_var ); 6957 return qt_os2DefLocaleObj_var; 6958 } 6959 6960 const UconvObject qt_os2DefUconvObj() 6961 { 6962 if ( !qt_os2DefUconvObj_var ) 6963 UniCreateUconvObject( (UniChar *)L"", &qt_os2DefUconvObj_var ); 6964 return qt_os2DefUconvObj_var; 6965 } 6966 6967 QCString qt_os2QString2MB( const QString& s, int uclen ) 6968 { 6969 if ( uclen < 0 || (uint) uclen > s.length() ) 6970 uclen = s.length(); 6971 if ( s.isNull() ) 6972 return QCString(); 6973 if ( uclen == 0 ) 6974 return QCString(""); 6975 6976 UniChar *ucPtr = (UniChar *) s.unicode(); 6977 size_t ucLeft = uclen; 6978 6979 size_t mblen = uclen; 6980 QCString mbBuf( mblen + 1 ); 6981 char *mbPtr = mbBuf.data(); 6982 size_t mbLeft = mblen; 6983 6984 size_t nonIdent = 0; 6985 UconvObject uo = qt_os2DefUconvObj(); 6986 int rc; 6987 6988 while ( ucLeft ) { 6989 rc = UniUconvFromUcs ( uo, &ucPtr, &ucLeft, (void**)&mbPtr, &mbLeft, &nonIdent ); 6990 if ( rc == ULS_BUFFERFULL ) { 6991 size_t mbDone = mblen - mbLeft; 6992 size_t ucDone = uclen - ucLeft; 6993 // assume that ucLeft/mbLeft is an approximation of ucDone/mbDone 6994 mblen = mbDone + (ucLeft * mbDone) / ucDone; 6995 mbBuf.resize( mblen + 1 ); 6996 mbPtr = mbBuf.data() + mbDone; 6997 } else if ( rc != ULS_SUCCESS ) { 6998 #ifndef QT_NO_DEBUG 6999 // Fail. 7000 qWarning("UniUconvFromUcs cannot convert multibyte text (error %d): %s (UTF8)", 7001 rc, s.utf8().data()); 7002 #endif 7003 break; 7004 } 7005 } 7006 mbBuf[ mblen - mbLeft ] = '\0'; 7007 return mbBuf; 7008 } 7009 7010 // WATCH OUT: mblen must NOT include the NUL (in contrast with qt_winMB2QString) 7011 QString qt_os2MB2QString( const char* mb, int mblen ) 7012 { 7013 if ( !mb ) 7014 return QString::null; 7015 if ( mblen < 0 ) { 7016 mblen = strlen( mb ); 7017 } else { 7018 char *end = (char *) memchr (mb, '\0', mblen); 7019 if ( end ) 7020 mblen = end - mb; 7021 } 7022 if ( !mblen ) 7023 return QString::null; 7024 7025 const char *mbPtr = mb; 7026 size_t mbLeft = mblen; 7027 7028 size_t uclen = mblen; 7029 QMemArray<UniChar> ucBuf( uclen ); 7030 UniChar *ucPtr = ucBuf.data(); 7031 size_t ucLeft = uclen; 7032 7033 size_t nonIdent = 0; 7034 UconvObject uo = qt_os2DefUconvObj(); 7035 int rc; 7036 7037 while ( mbLeft ) { 7038 rc = UniUconvToUcs ( uo, (void**)&mbPtr, &mbLeft, &ucPtr, &ucLeft, &nonIdent ); 7039 if ( rc == ULS_BUFFERFULL ) { 7040 size_t ucDone = uclen - ucLeft; 7041 size_t mbDone = mblen - mbLeft; 7042 // assume that mbLeft/ucLeft is an approximation of mbDone/ucDone 7043 uclen = ucDone + (mbLeft * ucDone) / mbDone; 7044 ucBuf.resize( uclen ); 7045 ucPtr = ucBuf.data() + ucDone; 7046 } else if ( rc != ULS_SUCCESS ) { 7047 #ifndef QT_NO_DEBUG 7048 // Fail. 7049 qWarning("UniUconvFromUcs cannot convert multibyte text (error %d)", rc); 7050 #endif 7051 break; 7052 } 7053 } 7054 uclen -= ucLeft; 7055 if ( uclen == 0 ) 7056 return QString::null; 7057 QString s( (QChar*)ucBuf.data(), uclen ); 7058 return s; 7059 } 7060 7061 #endif // Q_OS_OS2 -
trunk/src/tools/qt_tools.pri
r7 r8 91 91 } 92 92 93 os2:SOURCES += $$TOOLS_CPP/qdir_pm.cpp \ 94 $$TOOLS_CPP/qfile_pm.cpp \ 95 $$TOOLS_CPP/qfileinfo_pm.cpp \ 96 $$TOOLS_CPP/qlibrary_pm.cpp \ 97 $$TOOLS_CPP/qsettings_pm.cpp \ 98 $$TOOLS_CPP/qmutex_pm.cpp \ 99 $$TOOLS_CPP/qwaitcondition_pm.cpp \ 100 $$TOOLS_CPP/qthreadstorage_pm.cpp \ 101 $$TOOLS_CPP/qcriticalsection_p.cpp 102 93 103 offmac:SOURCES += $$TOOLS_CPP/qdir_mac.cpp \ 94 104 $$TOOLS_CPP/qfile_mac.cpp \ … … 102 112 103 113 mac:!x11:!embedded:SOURCES += $$TOOLS_CPP/qsettings_mac.cpp 104 mac { 114 mac { 105 115 SOURCES+=3rdparty/dlcompat/dlfcn.c 106 116 INCLUDEPATH+=3rdparty/dlcompat … … 149 159 } 150 160 } 151 -
trunk/src/tools/qthreadinstance_p.h
r7 r8 88 88 static void finish( QThreadInstance * ); 89 89 #endif // Q_OS_WIN32 90 91 #ifdef Q_OS_OS2 92 TID thread_id; 93 int waiters; 94 95 static void _System start( void * ); 96 static void finish( QThreadInstance * ); 97 #endif // Q_OS_OS2 90 98 }; 91 99 -
trunk/src/widgets/qdockwindow.cpp
r7 r8 391 391 timer = new QTimer( this ); 392 392 connect( timer, SIGNAL( timeout() ), this, SLOT( minimize() ) ); 393 #if def Q_WS_WIN393 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 394 394 setCursor( SizeAllCursor ); 395 395 #endif -
trunk/src/widgets/qlabel.cpp
r7 r8 280 280 ( ( textformat == AutoText ) && QStyleSheet::mightBeRichText(ltext) ) ); 281 281 #else 282 bool useRichText = TRUE;282 bool useRichText = FALSE; 283 283 #endif 284 284 #ifndef QT_NO_ACCEL … … 711 711 712 712 if ( x + w < cr.right() ) 713 reg = reg.unite( QRect( x + w, cr.y(), cr.right() - x - w , cr.height() ) );713 reg = reg.unite( QRect( x + w, cr.y(), cr.right() - x - w + 1, cr.height() ) ); 714 714 if ( y + h < cr.bottom() ) 715 reg = reg.unite( QRect( cr.x(), y + h, cr.width(), cr.bottom() - y - h ) );715 reg = reg.unite( QRect( cr.x(), y + h, cr.width(), cr.bottom() - y - h + 1 ) ); 716 716 717 717 erase( reg ); -
trunk/src/widgets/qlineedit.cpp
r7 r8 1379 1379 case Key_Left: 1380 1380 case Key_Right: 1381 #if defined (Q_WS_WIN) 1381 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1382 1382 case Key_Insert: 1383 1383 case Key_Delete: … … 1636 1636 } 1637 1637 break; 1638 #if defined (Q_WS_WIN) 1638 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1639 1639 case Key_Insert: 1640 1640 copy(); … … 1713 1713 case Key_Delete: 1714 1714 if ( !d->readOnly ) { 1715 #if defined (Q_WS_WIN) 1715 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1716 1716 if ( e->state() & ShiftButton ) { 1717 1717 cut(); … … 1722 1722 } 1723 1723 break; 1724 #if defined (Q_WS_WIN) 1724 #if defined (Q_WS_WIN) || (defined (Q_WS_PM) && !defined (QT_NO_CLIPBOARD)) 1725 1725 case Key_Insert: 1726 1726 if ( !d->readOnly && e->state() & ShiftButton ) -
trunk/src/widgets/qpopupmenu.cpp
r7 r8 1509 1509 itemh = sz.height(); 1510 1510 1511 if ( ncols > 1 && y + itemh > contentsRect().bottom() ) {1512 if ( y < contentsRect().bottom() ) {1513 QRect rect(x, y, itemw, contentsRect().bottom() - y );1511 if ( ncols > 1 && y + itemh - 1 > contentsRect().bottom() ) { 1512 if ( y <= contentsRect().bottom() ) { 1513 QRect rect(x, y, itemw, contentsRect().bottom() - y + 1); 1514 1514 if(!p->hasClipping() || p->clipRegion().contains(rect)) { 1515 1515 flags = QStyle::Style_Default; … … 1528 1528 ++row; 1529 1529 } 1530 if ( y < contentsRect().bottom() ) {1531 QRect rect(x, y, itemw, contentsRect().bottom() - y );1530 if ( y <= contentsRect().bottom() ) { 1531 QRect rect(x, y, itemw, contentsRect().bottom() - y + 1); 1532 1532 if(!p->hasClipping() || p->clipRegion().contains(rect)) { 1533 1533 flags = QStyle::Style_Default; … … 1676 1676 actSig( mi->id(), b); 1677 1677 } 1678 #endif 1679 #if defined(Q_WS_PM) 1680 #ifndef QT_NO_WHATSTHIS 1681 else 1682 #endif 1683 //@@TODO (dmik): we need to play a sound when a disabled item is activated 1684 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 1685 // globally in Qt? 1686 WinAlarm( HWND_DESKTOP, WA_ERROR ); 1678 1687 #endif 1679 1688 } else if ( popup ) { … … 1919 1928 #endif 1920 1929 mi = mitems->at( actItem ); 1921 if ( !mi->isEnabled() && !b ) 1930 if ( !mi->isEnabled() && !b ) { 1931 #if defined(Q_WS_PM) 1932 //@@TODO (dmik): we need to play a sound when a disabled item is activated 1933 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 1934 // globally in Qt? 1935 WinAlarm( HWND_DESKTOP, WA_ERROR ); 1936 #endif 1922 1937 break; 1938 } 1923 1939 popup = mi->popup(); 1924 1940 if ( popup ) { … … 2009 2025 popup->setFirstItemActive(); 2010 2026 } else { 2027 #if !defined(Q_WS_PM) // do it later, only in case of item activation 2011 2028 byeMenuBar(); 2029 #endif 2012 2030 #ifndef QT_NO_WHATSTHIS 2013 2031 bool b = QWhatsThis::inWhatsThisMode(); … … 2016 2034 #endif 2017 2035 if ( mi->isEnabledAndVisible() || b ) { 2036 #if defined(Q_WS_PM) 2037 byeMenuBar(); 2038 #endif 2018 2039 active_popup_menu = this; 2019 2040 QGuardedPtr<QSignal> signal = mi->signal(); … … 2023 2044 active_popup_menu = 0; 2024 2045 } 2046 #if defined(Q_WS_PM) 2047 //@@TODO (dmik): we need to play a sound when the disabled item is activated 2048 // to conform to the OS/2 CUA. Btw, should'n it be supported by QAccessibility 2049 // globally in Qt? 2050 else 2051 WinAlarm( HWND_DESKTOP, WA_ERROR ); 2052 #endif 2025 2053 } 2026 2054 } else if ( clashCount > 1 ) { // Clashes, highlight next... -
trunk/src/widgets/qscrollview.cpp
r7 r8 579 579 580 580 QScrollView::QScrollView( QWidget *parent, const char *name, WFlags f ) : 581 QFrame( parent, name, f & (~WStaticContents) & (~WResizeNoErase) )582 { 583 WFlags flags = WResizeNoErase| (f&WPaintClever) | (f&WRepaintNoErase) | (f&WStaticContents);581 QFrame( parent, name, f & (~WStaticContents) & (~WResizeNoErase) & (~WRepaintNoErase) ) 582 { 583 WFlags flags = (f&WResizeNoErase) | (f&WPaintClever) | (f&WRepaintNoErase) | (f&WStaticContents); 584 584 d = new QScrollViewData( this, flags ); 585 585 -
trunk/src/widgets/qsplitter.cpp
r7 r8 507 507 { 508 508 QPainter paint( this ); 509 paint.setPen( gray);509 paint.setPen( NoPen ); 510 510 paint.setBrush( gray ); 511 511 paint.setRasterOp( XorROP ); … … 513 513 const int rBord = 3; // customizable? 514 514 int hw = handleWidth(); 515 516 int p1, p2, op1, op2, tmp; 517 if ( p >= 0 ) { 518 p1 = p + hw / 2 - rBord; 519 p2 = p1 + 2 * rBord - 1; 520 } 521 if ( opaqueOldPos >= 0 ) { 522 op1 = opaqueOldPos + hw / 2 - rBord; 523 op2 = op1 + 2 * rBord - 1; 524 // exclude overlapping area to avoid flicker 525 if ( p >= 0 ) { 526 if ( p2 >= op1 && p2 <= op2 ) { 527 tmp = op1; 528 op1 = p2 + 1; 529 p2 = tmp - 1; 530 } else if ( p1 >= op1 && p1 <= op2 ) { 531 tmp = op2; 532 op2 = p1 - 1; 533 p1 = tmp + 1; 534 } 535 } 536 } 515 537 if ( orient == Horizontal ) { 516 538 if ( opaqueOldPos >= 0 ) 517 paint.drawRect( opaqueOldPos + hw / 2 - rBord, r.y(), 518 2 * rBord, r.height() ); 539 paint.drawRect( op1, r.y(), op2 - op1 + 1, r.height() ); 519 540 if ( p >= 0 ) 520 paint.drawRect( p + hw / 2 - rBord, r.y(), 2 * rBord, r.height() );541 paint.drawRect( p1, r.y(), p2 - p1 + 1, r.height() ); 521 542 } else { 522 543 if ( opaqueOldPos >= 0 ) 523 paint.drawRect( r.x(), opaqueOldPos + hw / 2 - rBord, 524 r.width(), 2 * rBord ); 544 paint.drawRect( r.x(), op1, r.width(), op2 - op1 + 1 ); 525 545 if ( p >= 0 ) 526 paint.drawRect( r.x(), p + hw / 2 - rBord, r.width(), 2 * rBord);546 paint.drawRect( r.x(), p1, r.width(), p2 - p1 + 1 ); 527 547 } 528 548 opaqueOldPos = p; -
trunk/src/widgets/qtextedit.cpp
r7 r8 1162 1162 case Key_Home: 1163 1163 case Key_End: 1164 #if defined (Q_WS_WIN) 1164 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1165 1165 case Key_Insert: 1166 1166 case Key_Delete: … … 1172 1172 } else { 1173 1173 switch ( ke->key() ) { 1174 #if defined (Q_WS_WIN) 1174 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1175 1175 case Key_Insert: 1176 1176 ke->accept(); … … 1276 1276 break; 1277 1277 case Key_Delete: 1278 #if defined (Q_WS_WIN) 1278 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1279 1279 if ( e->state() & ShiftButton ) { 1280 1280 cut(); … … 1294 1294 if ( e->state() & ShiftButton ) 1295 1295 paste(); 1296 #if defined (Q_WS_WIN) 1296 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1297 1297 else if ( e->state() & ControlButton ) 1298 1298 copy(); … … 1302 1302 break; 1303 1303 case Key_Backspace: 1304 #if defined (Q_WS_WIN) 1304 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1305 1305 if ( e->state() & AltButton ) { 1306 1306 if (e->state() & ControlButton ) { … … 1517 1517 doKeyboardAction( ActionKill ); 1518 1518 break; 1519 #if defined(Q_WS_WIN) 1519 #if defined(Q_WS_WIN) || defined (Q_WS_PM) 1520 1520 case Key_Insert: 1521 1521 copy(); … … 2408 2408 emitLinkClicked( u.toString( FALSE, FALSE ) ); 2409 2409 } 2410 #ifndef QT_NO_TEXTBROWSER 2410 2411 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 2411 2412 QConnectionList *clist = receivers( … … 2418 2419 } 2419 2420 } 2421 #endif 2420 2422 2421 2423 // emitting linkClicked() may result in that the cursor winds … … 4724 4726 } 4725 4727 if (!doc->focusIndicator.name.isEmpty()) { 4728 #ifndef QT_NO_TEXTBROWSER 4726 4729 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 4727 4730 QConnectionList *clist = receivers( … … 4736 4739 } 4737 4740 } 4741 #endif 4738 4742 } 4739 4743 #ifndef QT_NO_CURSOR … … 4749 4753 copy(); 4750 4754 break; 4751 #if def Q_WS_WIN4755 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 4752 4756 case Key_Insert: 4753 4757 copy(); … … 5010 5014 } 5011 5015 } else { 5012 #if defined(Q_OS_WIN32) 5016 #if defined(Q_OS_WIN32) || defined (Q_OS_OS2) 5013 5017 // Need to convert CRLF to LF 5014 5018 t.replace( "\r\n", "\n" ); … … 6692 6696 int endLine = startLine + nLines; 6693 6697 6694 if ( startLine >= d->od->numLines ) 6695 return; 6698 if ( startLine >= d->od->numLines ) { 6699 #if defined (Q_WS_PM) 6700 // see below for more info 6701 p->eraseRect( clipx, clipy, clipw, cliph ); 6702 #endif 6703 return; 6704 } 6705 6696 6706 if ( (startLine + nLines) > d->od->numLines ) 6697 6707 nLines = d->od->numLines - startLine; … … 6842 6852 td->draw( p, r.x(), r.y(), r.width(), r.height(), colorGroup() ); 6843 6853 p->translate( 0, -(clipy - offset) ); 6854 6855 #if defined (Q_WS_PM) 6856 // QTextEdit has WResizeNoErase and WRepaintNoErase flags (actually applied 6857 // to the viewport()), so we must erase areas not covered by the text doc. 6858 // [Win32 version feels ok without this, because it doesn't actually 6859 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 6860 // erases the background before WM_PAINT and after every resize]. 6861 6862 int tw = td->width(); 6863 // calculate the height the text doc will occupy starting with clipy 6864 int th = td->height() - offset; 6865 if ( clipx + clipw > td->width() ) { 6866 // erase background to the left of every line 6867 p->eraseRect( tw, clipy, clipx + clipw - tw, th ); 6868 } 6869 if ( cliph > th ) { 6870 // erase background under the text doc 6871 p->eraseRect( clipx, clipy + th, clipw, cliph - th ); 6872 } 6873 #endif 6874 6844 6875 delete td; 6845 6876 } -
trunk/src/widgets/qtitlebar.cpp
r7 r8 58 58 #if defined(Q_WS_WIN) 59 59 #include "qt_windows.h" 60 #elif defined(Q_WS_PM) 61 #include "qt_os2.h" 60 62 #endif 61 63 … … 189 191 } 190 192 191 #if def Q_WS_WIN193 #if defined (Q_WS_WIN) 192 194 extern QRgb qt_colorref2qrgb(COLORREF col); 195 #elif defined (Q_WS_PM) 196 extern QRgb qt_sysclr2qrgb( LONG sysClr ); 193 197 #endif 194 198 … … 196 200 { 197 201 QPalette pal = palette(); 202 203 #if defined (Q_WS_PM) 204 // we always use PM system colors for titlebars (regardless of 205 // QApplication::desktopSettingsAware()), because the simulation will 206 // most likely produce the same color both for an active and inactive title. 207 pal.setColor( QPalette::Active, QColorGroup::Highlight, 208 QColor( qt_sysclr2qrgb( SYSCLR_ACTIVETITLE ) ) ); 209 pal.setColor( QPalette::Active, QColorGroup::Base, 210 pal.active().highlight() ); 211 pal.setColor( QPalette::Active, QColorGroup::HighlightedText, 212 QColor( qt_sysclr2qrgb( SYSCLR_ACTIVETITLETEXT ) ) ); 213 pal.setColor( QPalette::Inactive, QColorGroup::Highlight, 214 QColor( qt_sysclr2qrgb( SYSCLR_INACTIVETITLE ) ) ); 215 pal.setColor( QPalette::Inactive, QColorGroup::Base, 216 pal.inactive().highlight() ); 217 pal.setColor( QPalette::Inactive, QColorGroup::HighlightedText, 218 QColor( qt_sysclr2qrgb( SYSCLR_INACTIVETITLETEXT ) ) ); 219 #else 198 220 199 221 bool colorsInitialized = FALSE; … … 239 261 pal.setColor( QPalette::Inactive, QColorGroup::HighlightedText, palette().inactive().background() ); 240 262 } 263 #endif // Q_WS_PM 241 264 242 265 setPalette( pal ); -
trunk/src/widgets/qtooltip.cpp
r7 r8 126 126 int wakeUpDelay; 127 127 QTimer fallAsleep; 128 #ifdef Q_WS_PM 129 QTimer doAllowAnimation; 130 #endif 128 131 129 132 QPtrDict<Tip> *tips; … … 164 167 connect( &wakeUp, SIGNAL(timeout()), SLOT(showTip()) ); 165 168 connect( &fallAsleep, SIGNAL(timeout()), SLOT(hideTip()) ); 169 #ifdef Q_WS_PM 170 connect( &doAllowAnimation, SIGNAL(timeout()), SLOT(allowAnimation()) ); 171 #endif 166 172 removeTimer = new QTimer( this ); 167 173 } … … 589 595 void QTipManager::hideTip() 590 596 { 597 #ifdef Q_WS_PM 598 // OS/2 PM has a very low limit on the number of simultaneous PM timers, 599 // so we reuse the same timer instead of creating a new one every time this 600 // function is invoked (it can happen more frequently than once per 250 ms). 601 doAllowAnimation.start( 250, TRUE ); 602 #else 591 603 QTimer::singleShot( 250, this, SLOT(allowAnimation()) ); 604 #endif 592 605 preventAnimation = TRUE; 593 606 -
trunk/src/widgets/qwidgetresizehandler.cpp
r7 r8 45 45 #if defined(Q_WS_WIN) 46 46 #include "qt_windows.h" 47 #elif defined(Q_WS_PM) 48 #include "qt_os2.h" 47 49 #endif 48 50 … … 306 308 ; 307 309 } ); 310 #elif defined(Q_WS_PM) 311 QMSG qmsg; 312 while( WinPeekMsg( 0, &qmsg, widget->winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE ) ) 313 ; 308 314 #endif 309 315
Note:
See TracChangeset
for help on using the changeset viewer.