- Timestamp:
- Jan 19, 2006, 10:22:10 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/qwidget.h
r8 r57 946 946 uint opacity : 8; // Stores opacity level on Windows/Mac OS X. 947 947 #endif 948 //@@TODO (dmik): savedFlags seems not to be used by OS/2 version. enclose it with ifndef? 948 #if !defined(Q_WS_PM) 949 949 uint savedFlags; // Save widgetflags while showing fullscreen 950 #endif 950 951 short basew, baseh; // base sizes 951 952 #if defined(Q_WS_X11) … … 974 975 WId fId; // frame window handle 975 976 HSWITCH swEntry; // window list entry handle 977 HPOINTER pmIcon; // internal OS/2 icon 976 978 #endif 977 979 QRect normalGeometry; // used by showMin/maximized/FullScreen -
trunk/src/kernel/qwidget.cpp
r8 r57 1130 1130 x->ussize = 0; 1131 1131 #endif 1132 #if !defined(Q_WS_PM) 1132 1133 x->savedFlags = 0; 1134 #endif 1133 1135 #if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) 1134 1136 x->decor_allocated_region = QRegion(); -
trunk/src/kernel/qwidget_pm.cpp
r53 r57 769 769 } 770 770 771 //@@TODO (dmik): later772 ///*773 // Create an icon mask the way Windows wants it using CreateBitmap.774 //*/775 //776 //HBITMAP qt_createIconMask( const QBitmap &bitmap )777 //{778 // QImage bm = bitmap.convertToImage();779 // int w = bm.width();780 // int h = bm.height();781 // int bpl = ((w+15)/16)*2; // bpl, 16 bit alignment782 // uchar *bits = new uchar[bpl*h];783 // bm.invertPixels();784 // for ( int y=0; y<h; y++ )785 // memcpy( bits+y*bpl, bm.scanLine(y), bpl );786 // HBITMAP hbm = CreateBitmap( w, h, 1, 1, bits );787 // delete [] bits;788 // return hbm;789 //}790 791 771 void QWidget::setIcon( const QPixmap &pixmap ) 792 772 { 793 qWarning( "QWidget::setIcon() is not yet implemented on OS/2" ); 794 //@@TODO (dmik): later 795 // QTLWExtra* x = topData(); 796 // delete x->icon; 797 // x->icon = 0; 798 // if ( x->winIcon ) { 799 // DestroyIcon( x->winIcon ); 800 // x->winIcon = 0; 801 // } 802 // if ( !pixmap.isNull() ) { // valid icon 803 // QPixmap pm( pixmap.size(), pixmap.depth(), QPixmap::NormalOptim ); 804 // QBitmap mask( pixmap.size(), FALSE, QPixmap::NormalOptim ); 805 // if ( pixmap.mask() ) { 806 // pm.fill( black ); // make masked area black 807 // bitBlt( &mask, 0, 0, pixmap.mask() ); 808 // } else { 809 // mask.fill( color1 ); 810 // } 811 // bitBlt( &pm, 0, 0, &pixmap ); 812 // HBITMAP im = qt_createIconMask(mask); 813 // ICONINFO ii; 814 // ii.fIcon = TRUE; 815 // ii.hbmMask = im; 816 // ii.hbmColor = pm.hbm(); 817 // ii.xHotspot = 0; 818 // ii.yHotspot = 0; 819 // x->icon = new QPixmap( pixmap ); 820 // x->winIcon = CreateIconIndirect( &ii ); 821 // DeleteObject( im ); 822 // } 823 // SendMessageA( winId(), WM_SETICON, 0, /* ICON_SMALL */ 824 // (long)x->winIcon ); 825 // SendMessageA( winId(), WM_SETICON, 1, /* ICON_BIG */ 826 // (long)x->winIcon ); 827 // 828 // QEvent e( QEvent::IconChange ); 829 // QApplication::sendEvent( this, &e ); 773 QTLWExtra* x = topData(); 774 delete x->icon; 775 x->icon = 0; 776 HPOINTER oldIcon = x->pmIcon; 777 x->pmIcon = 0; 778 779 if ( !pixmap.isNull() ) { // valid icon 780 x->icon = new QPixmap( pixmap ); 781 782 if ( isTopLevel() ) { 783 const QPixmap *normal = 0; 784 const QPixmap *mini = 0; 785 786 // QPixmap::createIcon() is not yet capable to create both normal 787 // and mini icons (due to a bug in WinCreateIconIndirect), so 788 // if the specified pixmap is equal or larger than the normal icon 789 // size, then we create a normal icon, otherwise a mini one. 790 791 int iconw = WinQuerySysValue( HWND_DESKTOP, SV_CXICON ); 792 int iconh = WinQuerySysValue( HWND_DESKTOP, SV_CYICON ); 793 if ( pixmap.width() >= iconw && pixmap.height() >= iconh ) { 794 normal = &pixmap; 795 } else { 796 mini = &pixmap; 797 } 798 799 x->pmIcon = QPixmap::createIcon( false, 0, 0, normal, mini ); 800 } 801 } 802 803 if ( isTopLevel() ) 804 WinSendMsg( x->fId, WM_SETICON, MPFROMLONG( x->pmIcon ), 0 ); 805 806 if ( oldIcon ) 807 WinDestroyPointer( oldIcon ); 808 809 QEvent e( QEvent::IconChange ); 810 QApplication::sendEvent( this, &e ); 830 811 } 831 812 … … 1747 1728 void QWidget::createTLSysExtra() 1748 1729 { 1749 //@@TODO (dmik): remove?1750 // extra->topextra->winIcon = 0;1751 1730 extra->topextra->fId = 0; 1752 1731 extra->topextra->swEntry = 0; 1732 extra->topextra->pmIcon = 0; 1753 1733 } 1754 1734 1755 1735 void QWidget::deleteTLSysExtra() 1756 1736 { 1757 if ( extra->topextra->swEntry ) { 1737 if ( extra->topextra->pmIcon ) 1738 WinDestroyPointer( extra->topextra->pmIcon ); 1739 if ( extra->topextra->swEntry ) 1758 1740 WinRemoveSwitchEntry( extra->topextra->swEntry ); 1759 }1760 1741 // frame window (extra->topextra->fId) is destroyed in 1761 1742 // destroy() if it exists 1762 //@@TODO (dmik): remove?1763 // if ( extra->topextra->winIcon )1764 // DestroyIcon( extra->topextra->winIcon );1765 1743 } 1766 1744
Note:
See TracChangeset
for help on using the changeset viewer.