From 8bb8052f6214b30b86f193f89d2fccc83147289a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 21 Sep 2010 08:14:56 +0000 Subject: [PATCH] 2010-09-21 01:15 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/doc/en/class_qbrush.txt * contrib/hbqt/qtgui/doc/en/class_qcolor.txt * contrib/hbqt/qtgui/doc/en/class_qicon.txt * contrib/hbqt/qtgui/doc/en/class_qimage.txt * contrib/hbqt/qtgui/doc/en/class_qpixmap.txt * contrib/hbqt/qtgui/g/QBrush.cpp * contrib/hbqt/qtgui/g/QColor.cpp * contrib/hbqt/qtgui/g/QIcon.cpp * contrib/hbqt/qtgui/g/QImage.cpp * contrib/hbqt/qtgui/g/QPixmap.cpp * contrib/hbqt/qtgui/g/TQBrush.prg * contrib/hbqt/qtgui/g/TQColor.prg * contrib/hbqt/qtgui/g/TQIcon.prg * contrib/hbqt/qtgui/g/TQImage.prg * contrib/hbqt/qtgui/g/TQPixmap.prg * Re-generated. * contrib/hbqt/qtgui/qth/QBrush.qth * contrib/hbqt/qtgui/qth/QColor.qth * contrib/hbqt/qtgui/qth/QIcon.qth * contrib/hbqt/qtgui/qth/QImage.qth * contrib/hbqt/qtgui/qth/QPixmap.qth + Implemented: many-to-one method calling protocol. Refined: constructors. * contrib/hbqt/tests/demoqt.prg * contrib/hbxbp/xbpstatic.prg * contrib/hbide/hbqreportsmanager.prg * contrib/hbide/hbqtoolbar.prg ! Adopted to many-to-one changes as per above. --- harbour/ChangeLog | 32 +++ harbour/contrib/hbide/hbqreportsmanager.prg | 14 +- harbour/contrib/hbide/hbqtoolbar.prg | 2 +- .../hbqt/qtgui/doc/en/class_qbrush.txt | 25 +- .../hbqt/qtgui/doc/en/class_qcolor.txt | 3 +- .../contrib/hbqt/qtgui/doc/en/class_qicon.txt | 7 +- .../hbqt/qtgui/doc/en/class_qimage.txt | 36 +-- .../hbqt/qtgui/doc/en/class_qpixmap.txt | 10 +- harbour/contrib/hbqt/qtgui/g/QBrush.cpp | 89 ++++-- harbour/contrib/hbqt/qtgui/g/QColor.cpp | 81 +++--- harbour/contrib/hbqt/qtgui/g/QIcon.cpp | 97 ++++--- harbour/contrib/hbqt/qtgui/g/QImage.cpp | 270 +++++++++--------- harbour/contrib/hbqt/qtgui/g/QPixmap.cpp | 251 ++++++++-------- harbour/contrib/hbqt/qtgui/g/TQBrush.prg | 15 +- harbour/contrib/hbqt/qtgui/g/TQColor.prg | 30 +- harbour/contrib/hbqt/qtgui/g/TQIcon.prg | 35 +-- harbour/contrib/hbqt/qtgui/g/TQImage.prg | 135 ++++----- harbour/contrib/hbqt/qtgui/g/TQPixmap.prg | 110 ++++--- harbour/contrib/hbqt/qtgui/qth/QBrush.qth | 97 +++++-- harbour/contrib/hbqt/qtgui/qth/QColor.qth | 58 +++- harbour/contrib/hbqt/qtgui/qth/QIcon.qth | 64 ++++- harbour/contrib/hbqt/qtgui/qth/QImage.qth | 226 ++++++++++++--- harbour/contrib/hbqt/qtgui/qth/QPixmap.qth | 207 +++++++++++--- harbour/contrib/hbqt/tests/demoqt.prg | 4 +- harbour/contrib/hbxbp/xbpstatic.prg | 2 +- 25 files changed, 1181 insertions(+), 719 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ae94082873..a82e351e05 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,38 @@ The license applies to all entries newer than 2009-04-28. */ +2010-09-21 01:15 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/doc/en/class_qbrush.txt + * contrib/hbqt/qtgui/doc/en/class_qcolor.txt + * contrib/hbqt/qtgui/doc/en/class_qicon.txt + * contrib/hbqt/qtgui/doc/en/class_qimage.txt + * contrib/hbqt/qtgui/doc/en/class_qpixmap.txt + * contrib/hbqt/qtgui/g/QBrush.cpp + * contrib/hbqt/qtgui/g/QColor.cpp + * contrib/hbqt/qtgui/g/QIcon.cpp + * contrib/hbqt/qtgui/g/QImage.cpp + * contrib/hbqt/qtgui/g/QPixmap.cpp + * contrib/hbqt/qtgui/g/TQBrush.prg + * contrib/hbqt/qtgui/g/TQColor.prg + * contrib/hbqt/qtgui/g/TQIcon.prg + * contrib/hbqt/qtgui/g/TQImage.prg + * contrib/hbqt/qtgui/g/TQPixmap.prg + * Re-generated. + + * contrib/hbqt/qtgui/qth/QBrush.qth + * contrib/hbqt/qtgui/qth/QColor.qth + * contrib/hbqt/qtgui/qth/QIcon.qth + * contrib/hbqt/qtgui/qth/QImage.qth + * contrib/hbqt/qtgui/qth/QPixmap.qth + + Implemented: many-to-one method calling protocol. + Refined: constructors. + + * contrib/hbqt/tests/demoqt.prg + * contrib/hbxbp/xbpstatic.prg + * contrib/hbide/hbqreportsmanager.prg + * contrib/hbide/hbqtoolbar.prg + ! Adopted to many-to-one changes as per above. + 2010-09-20 18:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/tests/demoqt.prg diff --git a/harbour/contrib/hbide/hbqreportsmanager.prg b/harbour/contrib/hbide/hbqreportsmanager.prg index 2fa3caadc0..843e38db7a 100644 --- a/harbour/contrib/hbide/hbqreportsmanager.prg +++ b/harbour/contrib/hbide/hbqreportsmanager.prg @@ -537,7 +537,7 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 ) IF qRC:contains( qEvent:pos() ) qAct := QAction():from( ::pAct ) - qIcon := QIcon():from( qAct:icon() ) + qIcon := QIcon( qAct:icon() ) ::qByte := QByteArray( qAct:text() ) @@ -545,7 +545,7 @@ METHOD HbqReportsManager:execEvent( cEvent, p, p1, p2 ) ::qMime:setData( "application/x-menuitem", ::qByte ) ::qMime:setHtml( qAct:text() ) - ::qPix := QPixmap():from( qIcon:pixmap_1( 16,16 ) ) + ::qPix := QPixmap( qIcon:pixmap( 16,16 ) ) ::qDrag := QDrag( hbide_setIde():oDlg:oWidget ) ::qDrag:setMimeData( ::qMime ) @@ -2458,8 +2458,8 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect ) textH = QFontMetricsF():from( qPainter:font() ):height() ENDIF - qPix := QPixmap():from( ::pixmap() ) - image := QImage():from( qPix:toImage() ) + qPix := QPixmap( ::pixmap() ) + image := QImage( qPix:toImage() ) IF image:isNull() qPainter:drawRect( qRect ) @@ -2470,10 +2470,10 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect ) SWITCH paintType CASE HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_KEEP_ASPECT_RATIO - img := QImage():from( image:scaled_1( rc:width(), rc:height() - textH, Qt_KeepAspectRatio, Qt_SmoothTransformation ) ) + img := QImage( image:scaled( rc:width(), rc:height() - textH, Qt_KeepAspectRatio, Qt_SmoothTransformation ) ) EXIT CASE HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_IGNORE_ASPECT_RATIO - img := QImage():from( image:scaled_1( rc:width(), rc:height() - textH, Qt_IgnoreAspectRatio, Qt_SmoothTransformation ) ) + img := QImage( image:scaled( rc:width(), rc:height() - textH, Qt_IgnoreAspectRatio, Qt_SmoothTransformation ) ) EXIT CASE HBQT_GRAPHICSITEM_CENTER_PICTURE_TO_ITEM point:setX( point:x() + ( rc:width() - image:width() ) / 2 ) @@ -2488,7 +2488,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect ) ch -= 2 * cy point:setY( 0 ) ENDIF - img := QImage():from( image:copy_1( cx, cy, cw, ch ) ) + img := QImage( image:copy( cx, cy, cw, ch ) ) EXIT CASE HBQT_GRAPHICSITEM_RESIZE_ITEM_TO_PICTURE img := image diff --git a/harbour/contrib/hbide/hbqtoolbar.prg b/harbour/contrib/hbide/hbqtoolbar.prg index 77671c420c..a1af3c8dd2 100644 --- a/harbour/contrib/hbide/hbqtoolbar.prg +++ b/harbour/contrib/hbide/hbqtoolbar.prg @@ -175,7 +175,7 @@ METHOD HbqToolbar:execEvent( cEvent, p, p1 ) ::qMime:setData( "application/x-toolbaricon", ::qByte ) ::qMime:setHtml( ::hItems[ p1 ]:objectName() ) - ::qPix := QPixmap():from( QIcon():from( ::hItems[ p1 ]:icon ):pixmap_1( 16,16 ) ) + ::qPix := QPixmap( QIcon( ::hItems[ p1 ]:icon ):pixmap( 16,16 ) ) ::qDrag := QDrag( hbide_setIde():oDlg:oWidget ) ::qDrag:setMimeData( ::qMime ) diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qbrush.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qbrush.txt index 13061c6688..f07ef891fc 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qbrush.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qbrush.txt @@ -29,8 +29,7 @@ * :color() -> pQColor * :isOpaque() -> lBool * :matrix() -> pQMatrix - * :setColor( pColor ) -> NIL - * :setColor_1( nColor ) -> NIL + * :setColor( ... ) -> NIL * :setMatrix( pMatrix ) -> NIL * :setStyle( nStyle ) -> NIL * :setTexture( pPixmap ) -> NIL @@ -44,17 +43,17 @@ * $DESCRIPTION$ * * $EXAMPLES$ - * oBrush := QBrush():new() - * oBrush := QBrush():new( pQBrush ) - * oBrush := QBrush():new( nQt_GlobalColor ) - * oBrush := QBrush():new( nQt_GlobalColor, nQt_BrushStyle ) - * oBrush := QBrush():new( pQColor, nQt_BrushStyle ) - * oBrush := QBrush():new( pQColor, pQPixmap ) - * oBrush := QBrush():new( nQt_GlobalColor, pQPixmap ) - * oBrush := QBrush():new( "QPixmap" , pQPixmap ) - * oBrush := QBrush():new( "QImage" , pQImage ) - * oBrush := QBrush():new( "QGradient", pQGradient ) - * oBrush := QBrush():new( "QColor" , pQColor, [ nQt_BrushStyle = Qt_SolidPattern ] ) + * oBrush := QBrush() + * oBrush := QBrush( pQBrush ) + * oBrush := QBrush( nQt_GlobalColor ) + * oBrush := QBrush( nQt_GlobalColor, nQt_BrushStyle ) + * oBrush := QBrush( pQColor, nQt_BrushStyle ) + * oBrush := QBrush( pQColor, pQPixmap ) + * oBrush := QBrush( nQt_GlobalColor, pQPixmap ) + * oBrush := QBrush( "QPixmap" , pQPixmap ) + * oBrush := QBrush( "QImage" , pQImage ) + * oBrush := QBrush( "QGradient", pQGradient ) + * oBrush := QBrush( "QColor" , pQColor, [ nQt_BrushStyle = Qt_SolidPattern ] ) * * $TESTS$ * diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qcolor.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qcolor.txt index b3adb29b48..cec04f2ab0 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qcolor.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qcolor.txt @@ -67,8 +67,7 @@ * :setNamedColor( cName ) -> NIL * :setRed( nRed ) -> NIL * :setRedF( nRed ) -> NIL - * :setRgb( nRgb ) -> NIL - * :setRgb_1( nR, nG, nB, nA ) -> NIL + * :setRgb( ... ) -> NIL * :setRgba( nRgba ) -> NIL * :setRgbF( nR, nG, nB, nA ) -> NIL * :spec() -> nSpec diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qicon.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qicon.txt index 8008b6004e..693de61827 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qicon.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qicon.txt @@ -32,11 +32,8 @@ * :availableSizes( nMode, nState ) -> pQList * :cacheKey() -> nQint64 * :isNull() -> lBool - * :paint( pPainter, pRect, nAlignment, nMode, nState ) -> NIL - * :paint_1( pPainter, nX, nY, nW, nH, nAlignment, nMode, nState ) -> NIL - * :pixmap( pSize, nMode, nState ) -> pQPixmap - * :pixmap_1( nW, nH, nMode, nState ) -> pQPixmap - * :pixmap_2( nExtent, nMode, nState ) -> pQPixmap + * :paint( ... ) -> NIL + * :pixmap( ... ) -> pQPixmap * * $DESCRIPTION$ * diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qimage.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qimage.txt index 2f70d6d1a8..d9da47520d 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qimage.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qimage.txt @@ -42,19 +42,15 @@ * :invertPixels( nMode ) -> NIL * :isGrayscale() -> lBool * :isNull() -> lBool - * :load( cFileName, pFormat ) -> lBool - * :load_1( pDevice, pFormat ) -> lBool + * :load( ... ) -> lBool * :loadFromData( pData, pFormat ) -> lBool * :numBytes() -> nInt * :numColors() -> nInt * :offset() -> pQPoint - * :pixel( pPosition ) -> nQRgb - * :pixel_1( nX, nY ) -> nQRgb - * :pixelIndex( pPosition ) -> nInt - * :pixelIndex_1( nX, nY ) -> nInt + * :pixel( ... ) -> nQRgb + * :pixelIndex( ... ) -> nInt * :rect() -> pQRect - * :save( cFileName, pFormat, nQuality ) -> lBool - * :save_1( pDevice, pFormat, nQuality ) -> lBool + * :save( ... ) -> lBool * :scanLine( nI ) -> pUchar * :scanLine_1( nI ) -> pUchar * :setColor( nIndex, nColorValue ) -> NIL @@ -62,28 +58,26 @@ * :setDotsPerMeterY( nY ) -> NIL * :setNumColors( nNumColors ) -> NIL * :setOffset( pOffset ) -> NIL - * :setPixel( pPosition, nIndex_or_rgb ) -> NIL - * :setPixel_1( nX, nY, nIndex_or_rgb ) -> NIL + * :setPixel( ... ) -> NIL * :setText( cKey, cText ) -> NIL * :size() -> pQSize * :text( cKey ) -> cQString * :textKeys() -> pQStringList - * :valid( pPos ) -> lBool - * :valid_1( nX, nY ) -> lBool + * :valid( ... ) -> lBool * :width() -> nInt * * $DESCRIPTION$ * * $EXAMPLES$ - * oImage := QImage():new() - * oImage := QImage():new( pQSize, cFormat ) - * oImage := QImage():new( iWidth, iHeight, cFormat ) - * oImage := QImage():new( @cData, iWidth, iHeight, cFormat ) - * oImage := QImage():new( cData , iWidth, iHeight, cFormat ) - * oImage := QImage():new( @cData, iWidth, iHeight, iBytesPerLine, cFormat ) - * oImage := QImage():new( cData , iWidth, iHeight, iBytesPerLine, cFormat ) - * oImage := QImage():new( cFileName [, cFormat ] ) - * oImage := QImage():new( pQImage ) + * oImage := QImage() + * oImage := QImage( pQSize, cFormat ) + * oImage := QImage( iWidth, iHeight, cFormat ) + * oImage := QImage( @cData, iWidth, iHeight, cFormat ) + * oImage := QImage( cData , iWidth, iHeight, cFormat ) + * oImage := QImage( @cData, iWidth, iHeight, iBytesPerLine, cFormat ) + * oImage := QImage( cData , iWidth, iHeight, iBytesPerLine, cFormat ) + * oImage := QImage( cFileName [, cFormat ] ) + * oImage := QImage( pQImage ) * * $TESTS$ * diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qpixmap.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qpixmap.txt index 2232c96b87..1c52a08922 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qpixmap.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qpixmap.txt @@ -28,13 +28,10 @@ * $METHODS$ * :cacheKey() -> nQint64 * :createHeuristicMask( lClipTight ) -> pQBitmap - * :createMaskFromColor( pMaskColor, nMode ) -> pQBitmap - * :createMaskFromColor_1( pMaskColor ) -> pQBitmap + * :createMaskFromColor( ... ) -> pQBitmap * :depth() -> nInt * :detach() -> NIL - * :fill( pColor ) -> NIL - * :fill_1( pWidget, pOffset ) -> NIL - * :fill_2( pWidget, nX, nY ) -> NIL + * :fill( ... ) -> NIL * :hasAlpha() -> lBool * :hasAlphaChannel() -> lBool * :height() -> nInt @@ -44,8 +41,7 @@ * :loadFromData( pData, pFormat, nFlags ) -> lBool * :mask() -> pQBitmap * :rect() -> pQRect - * :save( cFileName, pFormat, nQuality ) -> lBool - * :save_1( pDevice, pFormat, nQuality ) -> lBool + * :save( ... ) -> lBool * :setAlphaChannel( pAlphaChannel ) -> NIL * :setMask( pMask ) -> NIL * :size() -> pQSize diff --git a/harbour/contrib/hbqt/qtgui/g/QBrush.cpp b/harbour/contrib/hbqt/qtgui/g/QBrush.cpp index 85db7cfc4f..b1bd559663 100644 --- a/harbour/contrib/hbqt/qtgui/g/QBrush.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QBrush.cpp @@ -66,6 +66,21 @@ #if QT_VERSION >= 0x040500 /*----------------------------------------------------------------------*/ +/* + * Constructed[ 13/17 [ 76.47% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * + * *** Commented out protos which construct fine but do not compile *** + * + * //const QGradient * gradient () const + * //void setColor ( const QColor & color ) + * //void setColor ( Qt::GlobalColor color ) + */ + #include #include @@ -145,27 +160,54 @@ HB_FUNC( QT_QBRUSH ) if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - pObj = new QBrush( *hbqt_par_QBrush( 1 ) ) ; + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QBrush ) + { + pObj = new QBrush( *hbqt_par_QBrush( 1 ) ) ; + } + if( q->type == HBQT_TYPE_QPixmap ) + { + pObj = new QBrush( *hbqt_par_QPixmap( 1 ) ) ; + } + if( q->type == HBQT_TYPE_QImage ) + { + pObj = new QBrush( *hbqt_par_QImage( 1 ) ) ; + } + if( q->type == HBQT_TYPE_QGradient ) + { + pObj = new QBrush( *hbqt_par_QGradient( 1 ) ) ; + } + if( q->type == HBQT_TYPE_QColor ) + { + pObj = new QBrush( *hbqt_par_QColor( 1 ), Qt::SolidPattern ) ; + } + } + else + { + pObj = new QBrush( *hbqt_par_QBrush( 1 ) ) ; + } } else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) ; + pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) ; } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { - pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ; + pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ; } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) { - pObj = new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ; + pObj = new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ; } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) { - pObj = new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ; + pObj = new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ; } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) { - pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ; + pObj = new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ; } else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) { @@ -173,28 +215,28 @@ HB_FUNC( QT_QBRUSH ) if( objName == ( QString ) "QPixmap" ) { - pObj = new QBrush( *hbqt_par_QPixmap( 2 ) ) ; + pObj = new QBrush( *hbqt_par_QPixmap( 2 ) ) ; } else if( objName == ( QString ) "QImage" ) { - pObj = new QBrush( *hbqt_par_QImage( 2 ) ) ; + pObj = new QBrush( *hbqt_par_QImage( 2 ) ) ; } else if( objName == ( QString ) "QGradient" ) { - pObj = new QBrush( *hbqt_par_QGradient( 2 ) ) ; + pObj = new QBrush( *hbqt_par_QGradient( 2 ) ) ; } else if( objName == ( QString ) "QColor" ) { - pObj = new QBrush( *hbqt_par_QColor( 2 ), HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ; + pObj = new QBrush( *hbqt_par_QColor( 2 ), HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ; } else { - pObj = new QBrush() ; + pObj = new QBrush() ; } } else { - pObj = new QBrush() ; + pObj = new QBrush() ; } hb_retptrGC( hbqt_gcAllocate_QBrush( ( void * ) pObj, true ) ); @@ -237,26 +279,21 @@ HB_FUNC( QT_QBRUSH_MATRIX ) } /* - * void setColor ( const QColor & color ) + * void setColor ( ... ) */ HB_FUNC( QT_QBRUSH_SETCOLOR ) { QBrush * p = hbqt_par_QBrush( 1 ); if( p ) { - ( p )->setColor( *hbqt_par_QColor( 2 ) ); - } -} - -/* - * void setColor ( Qt::GlobalColor color ) - */ -HB_FUNC( QT_QBRUSH_SETCOLOR_1 ) -{ - QBrush * p = hbqt_par_QBrush( 1 ); - if( p ) - { - ( p )->setColor( ( Qt::GlobalColor ) hb_parni( 2 ) ); + if( HB_ISPOINTER( 2 ) ) + { + ( p )->setColor( *hbqt_par_QColor( 2 ) ); + } + else if( HB_ISNUM( 2 ) ) + { + ( p )->setColor( ( Qt::GlobalColor ) hb_parni( 2 ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/g/QColor.cpp b/harbour/contrib/hbqt/qtgui/g/QColor.cpp index 5d0673dba9..2dd1391223 100644 --- a/harbour/contrib/hbqt/qtgui/g/QColor.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QColor.cpp @@ -70,6 +70,25 @@ * enum Spec { Rgb, Hsv, Cmyk, Invalid } */ +/* + * Constructed[ 63/71 [ 88.73% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + * + * *** Commented out protos which construct fine but do not compile *** + * + * //void setRgb ( QRgb rgb ) + * //void setRgb ( int r, int g, int b, int a = 255 ) + * //bool allowX11ColorNames () + * //QColor fromRgb ( QRgb rgb ) + * //QColor fromRgb ( int r, int g, int b, int a = 255 ) + * //void setAllowX11ColorNames ( bool enabled ) + */ + #include #include @@ -147,36 +166,36 @@ HB_FUNC( QT_QCOLOR ) { if( hb_pcount() == 1 && HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 ) { - pObj = new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) ; + pObj = new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) ; } else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - pObj = new QColor( ( QRgb ) hb_parni( 1 ) ) ; + pObj = new QColor( ( QRgb ) hb_parni( 1 ) ) ; } else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - pObj = new QColor( hbqt_par_QString( 1 ) ) ; + pObj = new QColor( hbqt_par_QString( 1 ) ) ; } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - pObj = new QColor( *hbqt_par_QColor( 1 ) ) ; + pObj = new QColor( *hbqt_par_QColor( 1 ) ) ; } else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - pObj = new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) ; + pObj = new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) ; } else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - pObj = new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ; + pObj = new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ; } else { - pObj = new QColor() ; + pObj = new QColor() ; } } else { - pObj = new QColor() ; + pObj = new QColor() ; } hb_retptrGC( hbqt_gcAllocate_QColor( ( void * ) pObj, true ) ); @@ -777,26 +796,21 @@ HB_FUNC( QT_QCOLOR_SETREDF ) } /* - * void setRgb ( QRgb rgb ) + * void setRgb ( ... ) */ HB_FUNC( QT_QCOLOR_SETRGB ) { QColor * p = hbqt_par_QColor( 1 ); if( p ) { - ( p )->setRgb( hb_parnl( 2 ) ); - } -} - -/* - * void setRgb ( int r, int g, int b, int a = 255 ) - */ -HB_FUNC( QT_QCOLOR_SETRGB_1 ) -{ - QColor * p = hbqt_par_QColor( 1 ); - if( p ) - { - ( p )->setRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ); + if( hb_pcount() == 2 && HB_ISNUM( 2 ) ) + { + ( p )->setRgb( hb_parnl( 2 ) ); + } + else if( hb_pcount() >= 4 && HB_ISNUM( 2 ) ) + { + ( p )->setRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ); + } } } @@ -981,26 +995,21 @@ HB_FUNC( QT_QCOLOR_FROMHSVF ) } /* - * QColor fromRgb ( QRgb rgb ) + * QColor fromRgb ( ... ) */ HB_FUNC( QT_QCOLOR_FROMRGB ) { QColor * p = hbqt_par_QColor( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parnl( 2 ) ) ), true ) ); - } -} - -/* - * QColor fromRgb ( int r, int g, int b, int a = 255 ) - */ -HB_FUNC( QT_QCOLOR_FROMRGB_1 ) -{ - QColor * p = hbqt_par_QColor( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ) ), true ) ); + if( hb_pcount() == 2 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parnl( 2 ) ) ), true ) ); + } + else if( hb_pcount() >= 4 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ) ), true ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/g/QIcon.cpp b/harbour/contrib/hbqt/qtgui/g/QIcon.cpp index 796a336300..a9c9768df0 100644 --- a/harbour/contrib/hbqt/qtgui/g/QIcon.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QIcon.cpp @@ -71,6 +71,24 @@ * enum State { Off, On } */ +/* + * Constructed[ 8/15 [ 53.33% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + * + * *** Commented out protos which construct fine but do not compile *** + * + * //void paint ( QPainter * painter, const QRect & rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const + * //void paint ( QPainter * painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const + * //QPixmap pixmap ( const QSize & size, Mode mode = Normal, State state = Off ) const + * //QPixmap pixmap ( int w, int h, Mode mode = Normal, State state = Off ) const + * //QPixmap pixmap ( int extent, Mode mode = Normal, State state = Off ) const // Not Implemented + */ + #include #include @@ -146,15 +164,30 @@ HB_FUNC( QT_QICON ) if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - pObj = new QIcon( hbqt_par_QString( 1 ) ) ; + pObj = new QIcon( hbqt_par_QString( 1 ) ) ; } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - pObj = new QIcon( *hbqt_par_QPixmap( 1 ) ) ; + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QIcon ) + { + pObj = new QIcon( *hbqt_par_QIcon( 1 ) ) ; + } + else if( q->type == HBQT_TYPE_QPixmap ) + { + pObj = new QIcon( *hbqt_par_QPixmap( 1 ) ) ; + } + } + else + { + pObj = new QIcon( *hbqt_par_QIcon( 1 ) ) ; + } } else { - pObj = new QIcon() ; + pObj = new QIcon() ; } hb_retptrGC( hbqt_gcAllocate_QIcon( ( void * ) pObj, true ) ); @@ -235,62 +268,40 @@ HB_FUNC( QT_QICON_ISNULL ) } /* - * void paint ( QPainter * painter, const QRect & rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const + * void paint ( ... ) */ HB_FUNC( QT_QICON_PAINT ) { QIcon * p = hbqt_par_QIcon( 1 ); if( p ) { - ( p )->paint( hbqt_par_QPainter( 2 ), *hbqt_par_QRect( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::Alignment ) hb_parni( 4 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 5 ) ? ( QIcon::Mode ) hb_parni( 5 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 6 ) ? ( QIcon::State ) hb_parni( 6 ) : ( QIcon::State ) QIcon::Off ) ); + if( HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + ( p )->paint( hbqt_par_QPainter( 2 ), *hbqt_par_QRect( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::Alignment ) hb_parni( 4 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 5 ) ? ( QIcon::Mode ) hb_parni( 5 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 6 ) ? ( QIcon::State ) hb_parni( 6 ) : ( QIcon::State ) QIcon::Off ) ); + } + else if( HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->paint( hbqt_par_QPainter( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( HB_ISNUM( 7 ) ? ( Qt::Alignment ) hb_parni( 7 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 8 ) ? ( QIcon::Mode ) hb_parni( 8 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 9 ) ? ( QIcon::State ) hb_parni( 9 ) : ( QIcon::State ) QIcon::Off ) ); + } } } /* - * void paint ( QPainter * painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const - */ -HB_FUNC( QT_QICON_PAINT_1 ) -{ - QIcon * p = hbqt_par_QIcon( 1 ); - if( p ) - { - ( p )->paint( hbqt_par_QPainter( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( HB_ISNUM( 7 ) ? ( Qt::Alignment ) hb_parni( 7 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 8 ) ? ( QIcon::Mode ) hb_parni( 8 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 9 ) ? ( QIcon::State ) hb_parni( 9 ) : ( QIcon::State ) QIcon::Off ) ); - } -} - -/* - * QPixmap pixmap ( const QSize & size, Mode mode = Normal, State state = Off ) const + * QPixmap pixmap ( ... ) */ HB_FUNC( QT_QICON_PIXMAP ) { QIcon * p = hbqt_par_QIcon( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( QIcon::Mode ) hb_parni( 3 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 4 ) ? ( QIcon::State ) hb_parni( 4 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); - } -} - -/* - * QPixmap pixmap ( int w, int h, Mode mode = Normal, State state = Off ) const - */ -HB_FUNC( QT_QICON_PIXMAP_1 ) -{ - QIcon * p = hbqt_par_QIcon( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); - } -} - -/* - * QPixmap pixmap ( int extent, Mode mode = Normal, State state = Off ) const - */ -HB_FUNC( QT_QICON_PIXMAP_2 ) -{ - QIcon * p = hbqt_par_QIcon( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( hb_parni( 2 ), ( HB_ISNUM( 3 ) ? ( QIcon::Mode ) hb_parni( 3 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 4 ) ? ( QIcon::State ) hb_parni( 4 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); + if( HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( QIcon::Mode ) hb_parni( 3 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 4 ) ? ( QIcon::State ) hb_parni( 4 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/g/QImage.cpp b/harbour/contrib/hbqt/qtgui/g/QImage.cpp index 9cafc306f2..53c93466e1 100644 --- a/harbour/contrib/hbqt/qtgui/g/QImage.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QImage.cpp @@ -72,18 +72,45 @@ */ /* - * Constructed[ 60/64 [ 93.75% ] ] + * Constructed[ 51/82 [ 62.20% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * * QVector colorTable () const * QImage convertToFormat ( Format format, const QVector & colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor ) const + * } + * } + * } + * } + * } + * } * void setColorTable ( const QVector colors ) + * } + * } + * } * * *** Commented out protos which construct fine but do not compile *** * + * //QImage copy ( const QRect & rectangle = QRect() ) const + * //QImage copy ( int x, int y, int width, int height ) const + * //bool load ( const QString & fileName, const char * format = 0 ) + * //bool load ( QIODevice * device, const char * format ) * // bool loadFromData ( const uchar * data, int len, const char * format = 0 ) + * //QRgb pixel ( const QPoint & position ) const + * //QRgb pixel ( int x, int y ) const + * //int pixelIndex ( const QPoint & position ) const + * //int pixelIndex ( int x, int y ) const + * //bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const + * //bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const + * //QImage scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * //QImage scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * //void setPixel ( const QPoint & position, uint index_or_rgb ) + * //void setPixel ( int x, int y, uint index_or_rgb ) + * //QImage transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + * //QImage transformed ( const QTransform & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + * //bool valid ( const QPoint & pos ) const + * //bool valid ( int x, int y ) const */ #include @@ -165,37 +192,37 @@ HB_FUNC( QT_QIMAGE ) { QImage * pObj = NULL; - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - pObj = new QImage( *hbqt_par_QImage( 1 ) ) ; + pObj = new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ; } - else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - pObj = new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ; + pObj = new QImage( *hbqt_par_QImage( 1 ) ) ; } else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) { - pObj = new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ; + pObj = new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ; } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) { - pObj = new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ; + pObj = new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ; } else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - pObj = new QImage( hb_parni( 1 ), hb_parni( 2 ), ( QImage::Format ) hb_parni( 3 ) ) ; + pObj = new QImage( hb_parni( 1 ), hb_parni( 2 ), ( QImage::Format ) hb_parni( 3 ) ) ; } else if( hb_pcount() == 4 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - pObj = new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( QImage::Format ) hb_parni( 4 ) ) ; + pObj = new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( QImage::Format ) hb_parni( 4 ) ) ; } else if( hb_pcount() == 5 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) { - pObj = new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( QImage::Format ) hb_parni( 5 ) ) ; + pObj = new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( QImage::Format ) hb_parni( 5 ) ) ; } else { - pObj = new QImage() ; + pObj = new QImage() ; } hb_retptrGC( hbqt_gcAllocate_QImage( ( void * ) pObj, true ) ); @@ -298,26 +325,25 @@ HB_FUNC( QT_QIMAGE_CONVERTTOFORMAT ) } /* - * QImage copy ( const QRect & rectangle = QRect() ) const + * QImage copy ( ... ) */ HB_FUNC( QT_QIMAGE_COPY ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); - } -} - -/* - * QImage copy ( int x, int y, int width, int height ) const - */ -HB_FUNC( QT_QIMAGE_COPY_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); + } + else if( hb_pcount() == 5 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + } + else + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( QRect() ) ), true ) ); + } } } @@ -478,28 +504,23 @@ HB_FUNC( QT_QIMAGE_ISNULL ) } /* - * bool load ( const QString & fileName, const char * format = 0 ) + * bool load ( ... ) */ HB_FUNC( QT_QIMAGE_LOAD ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - void * pText; - hb_retl( ( p )->load( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ) ) ); - hb_strfree( pText ); - } -} - -/* - * bool load ( QIODevice * device, const char * format ) - */ -HB_FUNC( QT_QIMAGE_LOAD_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retl( ( p )->load( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ) ) ); + if( hb_pcount() == 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->load( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + hb_retl( ( p )->load( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ) ) ); + } } } @@ -564,50 +585,40 @@ HB_FUNC( QT_QIMAGE_OFFSET ) } /* - * QRgb pixel ( const QPoint & position ) const + * QRgb pixel ( ... ) */ HB_FUNC( QT_QIMAGE_PIXEL ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retnl( ( p )->pixel( *hbqt_par_QPoint( 2 ) ) ); + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retnl( ( p )->pixel( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 2 ) ) + { + hb_retnl( ( p )->pixel( hb_parni( 2 ), hb_parni( 3 ) ) ); + } } } /* - * QRgb pixel ( int x, int y ) const - */ -HB_FUNC( QT_QIMAGE_PIXEL_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retnl( ( p )->pixel( hb_parni( 2 ), hb_parni( 3 ) ) ); - } -} - -/* - * int pixelIndex ( const QPoint & position ) const + * int pixelIndex ( ... ) */ HB_FUNC( QT_QIMAGE_PIXELINDEX ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retni( ( p )->pixelIndex( *hbqt_par_QPoint( 2 ) ) ); - } -} - -/* - * int pixelIndex ( int x, int y ) const - */ -HB_FUNC( QT_QIMAGE_PIXELINDEX_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retni( ( p )->pixelIndex( hb_parni( 2 ), hb_parni( 3 ) ) ); + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retni( ( p )->pixelIndex( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 2 ) ) + { + hb_retni( ( p )->pixelIndex( hb_parni( 2 ), hb_parni( 3 ) ) ); + } } } @@ -636,52 +647,42 @@ HB_FUNC( QT_QIMAGE_RGBSWAPPED ) } /* - * bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const + * bool save ( ... ) */ HB_FUNC( QT_QIMAGE_SAVE ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - void * pText; - hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); - hb_strfree( pText ); + if( hb_pcount() >= 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + } } } /* - * bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const - */ -HB_FUNC( QT_QIMAGE_SAVE_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); - } -} - -/* - * QImage scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * QImage scaled ( ... ) */ HB_FUNC( QT_QIMAGE_SCALED ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); - } -} - -/* - * QImage scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const - */ -HB_FUNC( QT_QIMAGE_SCALED_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } } } @@ -794,26 +795,21 @@ HB_FUNC( QT_QIMAGE_SETOFFSET ) } /* - * void setPixel ( const QPoint & position, uint index_or_rgb ) + * void setPixel ( ... ) */ HB_FUNC( QT_QIMAGE_SETPIXEL ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - ( p )->setPixel( *hbqt_par_QPoint( 2 ), hb_parni( 3 ) ); - } -} - -/* - * void setPixel ( int x, int y, uint index_or_rgb ) - */ -HB_FUNC( QT_QIMAGE_SETPIXEL_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - ( p )->setPixel( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) ) + { + ( p )->setPixel( *hbqt_par_QPoint( 2 ), hb_parni( 3 ) ); + } + else if( hb_pcount() == 4 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->setPixel( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + } } } @@ -870,50 +866,42 @@ HB_FUNC( QT_QIMAGE_TEXTKEYS ) } /* - * QImage transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + * QImage transformed ( ... ) */ HB_FUNC( QT_QIMAGE_TRANSFORMED ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QTransform ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( q->type == HBQT_TYPE_QMatrix ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } } } /* - * QImage transformed ( const QTransform & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const - */ -HB_FUNC( QT_QIMAGE_TRANSFORMED_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); - } -} - -/* - * bool valid ( const QPoint & pos ) const + * bool valid ( ... ) */ HB_FUNC( QT_QIMAGE_VALID ) { QImage * p = hbqt_par_QImage( 1 ); if( p ) { - hb_retl( ( p )->valid( *hbqt_par_QPoint( 2 ) ) ); - } -} - -/* - * bool valid ( int x, int y ) const - */ -HB_FUNC( QT_QIMAGE_VALID_1 ) -{ - QImage * p = hbqt_par_QImage( 1 ); - if( p ) - { - hb_retl( ( p )->valid( hb_parni( 2 ), hb_parni( 3 ) ) ); + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->valid( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->valid( hb_parni( 2 ), hb_parni( 3 ) ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/g/QPixmap.cpp b/harbour/contrib/hbqt/qtgui/g/QPixmap.cpp index e13d7925d2..55358d2872 100644 --- a/harbour/contrib/hbqt/qtgui/g/QPixmap.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QPixmap.cpp @@ -71,6 +71,51 @@ * enum ShareMode { ImplicitlyShared, ExplicitlyShared } */ +/* + * Constructed[ 32/66 [ 48.48% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + * } + * } + * } + * } + * } + * + * *** Commented out protos which construct fine but do not compile *** + * + * // QRgb * clut () const + * //QPixmap copy ( const QRect & rectangle = QRect() ) const + * //QPixmap copy ( int x, int y, int width, int height ) const + * //QBitmap createMaskFromColor ( const QColor & maskColor, Qt::MaskMode mode ) const + * //QBitmap createMaskFromColor ( const QColor & maskColor ) const + * //void fill ( const QColor & color = Qt::white ) + * //void fill ( const QWidget * widget, const QPoint & offset ) + * //void fill ( const QWidget * widget, int x, int y ) + * // Qt::HANDLE handle () const + * // bool loadFromData ( const uchar * data, uint len, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * // int numCols () const + * // const uchar * qwsBits () const + * // int qwsBytesPerLine () const + * //bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const + * //bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const + * //QPixmap scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * //QPixmap scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * // CGImageRef toMacCGImageRef () const + * //HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const + * //QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const + * //QPixmap transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + * //QPixmap fromMacCGImageRef ( CGImageRef image ) + * //QPixmap fromWinHBITMAP ( HBITMAP bitmap, HBitmapFormat format = NoAlpha ) + * //QPixmap fromX11Pixmap ( Qt::HANDLE pixmap, ShareMode mode = ImplicitlyShared ) + * //QPixmap grabWidget ( QWidget * widget, const QRect & rectangle ) + * //QPixmap grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) + * //QPixmap grabWindow ( WId window, int x = 0, int y = 0, int width = -1, int height = -1 ) + */ + #include #include @@ -150,7 +195,22 @@ HB_FUNC( QT_QPIXMAP ) } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - pObj = new QPixmap( *hbqt_par_QPixmap( 1 ) ) ; + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QPixmap ) + { + pObj = new QPixmap( *hbqt_par_QPixmap( 1 ) ) ; + } + if( q->type == HBQT_TYPE_QSize ) + { + pObj = new QPixmap( *hbqt_par_QSize( 1 ) ) ; + } + } + else + { + pObj = new QPixmap( *hbqt_par_QPixmap( 1 ) ) ; + } } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { @@ -189,26 +249,25 @@ HB_FUNC( QT_QPIXMAP_CACHEKEY ) } /* - * QPixmap copy ( const QRect & rectangle = QRect() ) const + * QPixmap copy ( ... ) */ HB_FUNC( QT_QPIXMAP_COPY ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); - } -} - -/* - * QPixmap copy ( int x, int y, int width, int height ) const - */ -HB_FUNC( QT_QPIXMAP_COPY_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); + } + else if( hb_pcount() == 5 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + } + else + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( QRect() ) ), true ) ); + } } } @@ -225,26 +284,25 @@ HB_FUNC( QT_QPIXMAP_CREATEHEURISTICMASK ) } /* - * QBitmap createMaskFromColor ( const QColor & maskColor, Qt::MaskMode mode ) const + * QBitmap createMaskFromColor ( ... ) */ HB_FUNC( QT_QPIXMAP_CREATEMASKFROMCOLOR ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ), ( Qt::MaskMode ) hb_parni( 3 ) ) ), true ) ); - } -} - -/* - * QBitmap createMaskFromColor ( const QColor & maskColor ) const - */ -HB_FUNC( QT_QPIXMAP_CREATEMASKFROMCOLOR_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ) ) ), true ) ); + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ) ) ), true ) ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ), ( Qt::MaskMode ) hb_parni( 3 ) ) ), true ) ); + } + else + { + ( p )->copy( QRect() ); + } } } @@ -273,38 +331,25 @@ HB_FUNC( QT_QPIXMAP_DETACH ) } /* - * void fill ( const QColor & color = Qt::white ) + * void fill ( ... ) */ HB_FUNC( QT_QPIXMAP_FILL ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - ( p )->fill( *hbqt_par_QColor( 2 ) ); - } -} - -/* - * void fill ( const QWidget * widget, const QPoint & offset ) - */ -HB_FUNC( QT_QPIXMAP_FILL_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - ( p )->fill( hbqt_par_QWidget( 2 ), *hbqt_par_QPoint( 3 ) ); - } -} - -/* - * void fill ( const QWidget * widget, int x, int y ) - */ -HB_FUNC( QT_QPIXMAP_FILL_2 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - ( p )->fill( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + if( hb_pcount() == 4 && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->fill( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + ( p )->fill( hbqt_par_QWidget( 2 ), *hbqt_par_QPoint( 3 ) ); + } + else + { + ( p )->fill( *hbqt_par_QColor( 2 ) ); + } } } @@ -419,52 +464,42 @@ HB_FUNC( QT_QPIXMAP_RECT ) } /* - * bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const + * bool save ( ... ) */ HB_FUNC( QT_QPIXMAP_SAVE ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - void * pText; - hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); - hb_strfree( pText ); + if( hb_pcount() >= 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + } } } /* - * bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const - */ -HB_FUNC( QT_QPIXMAP_SAVE_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); - } -} - -/* - * QPixmap scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + * QPixmap scaled ( ... ) */ HB_FUNC( QT_QPIXMAP_SCALED ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); - } -} - -/* - * QPixmap scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const - */ -HB_FUNC( QT_QPIXMAP_SCALED_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } } } @@ -541,26 +576,23 @@ HB_FUNC( QT_QPIXMAP_TOIMAGE ) } /* - * QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const + * QPixmap transformed ( ... ) */ HB_FUNC( QT_QPIXMAP_TRANSFORMED ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); - } -} + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); -/* - * QPixmap transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const - */ -HB_FUNC( QT_QPIXMAP_TRANSFORMED_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + if( q->type == HBQT_TYPE_QTransform ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( q->type == HBQT_TYPE_QMatrix ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } } } @@ -601,26 +633,21 @@ HB_FUNC( QT_QPIXMAP_FROMIMAGE ) } /* - * QPixmap grabWidget ( QWidget * widget, const QRect & rectangle ) + * QPixmap grabWidget ( ... ) */ HB_FUNC( QT_QPIXMAP_GRABWIDGET ) { QPixmap * p = hbqt_par_QPixmap( 1 ); if( p ) { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), *hbqt_par_QRect( 3 ) ) ), true ) ); - } -} - -/* - * QPixmap grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) - */ -HB_FUNC( QT_QPIXMAP_GRABWIDGET_1 ) -{ - QPixmap * p = hbqt_par_QPixmap( 1 ); - if( p ) - { - hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, -1 ), hb_parnidef( 6, -1 ) ) ), true ) ); + if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), *hbqt_par_QRect( 3 ) ) ), true ) ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, -1 ), hb_parnidef( 6, -1 ) ) ), true ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/g/TQBrush.prg b/harbour/contrib/hbqt/qtgui/g/TQBrush.prg index 89ac937dda..87849709ac 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQBrush.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQBrush.prg @@ -74,8 +74,7 @@ CREATE CLASS QBrush INHERIT HbQtObjectHandler FUNCTION HB_QBrush METHOD color() METHOD isOpaque() METHOD matrix() - METHOD setColor( pColor ) - METHOD setColor_1( nColor ) + METHOD setColor( ... ) METHOD setMatrix( pMatrix ) METHOD setStyle( nStyle ) METHOD setTexture( pPixmap ) @@ -110,12 +109,12 @@ METHOD QBrush:matrix() RETURN Qt_QBrush_matrix( ::pPtr ) -METHOD QBrush:setColor( pColor ) - RETURN Qt_QBrush_setColor( ::pPtr, hbqt_ptr( pColor ) ) - - -METHOD QBrush:setColor_1( nColor ) - RETURN Qt_QBrush_setColor_1( ::pPtr, nColor ) +METHOD QBrush:setColor( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QBrush_setColor( ::pPtr, ... ) METHOD QBrush:setMatrix( pMatrix ) diff --git a/harbour/contrib/hbqt/qtgui/g/TQColor.prg b/harbour/contrib/hbqt/qtgui/g/TQColor.prg index 153813cd84..292bec5fbc 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQColor.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQColor.prg @@ -115,8 +115,7 @@ CREATE CLASS QColor INHERIT HbQtObjectHandler FUNCTION HB_QColor METHOD setNamedColor( cName ) METHOD setRed( nRed ) METHOD setRedF( nRed ) - METHOD setRgb( nRgb ) - METHOD setRgb_1( nR, nG, nB, nA ) + METHOD setRgb( ... ) METHOD setRgba( nRgba ) METHOD setRgbF( nR, nG, nB, nA ) METHOD spec() @@ -132,8 +131,7 @@ CREATE CLASS QColor INHERIT HbQtObjectHandler FUNCTION HB_QColor METHOD fromCmykF( nC, nM, nY, nK, nA ) METHOD fromHsv( nH, nS, nV, nA ) METHOD fromHsvF( nH, nS, nV, nA ) - METHOD fromRgb( nRgb ) - METHOD fromRgb_1( nR, nG, nB, nA ) + METHOD fromRgb( ... ) METHOD fromRgbF( nR, nG, nB, nA ) METHOD fromRgba( nRgba ) @@ -325,12 +323,12 @@ METHOD QColor:setRedF( nRed ) RETURN Qt_QColor_setRedF( ::pPtr, nRed ) -METHOD QColor:setRgb( nRgb ) - RETURN Qt_QColor_setRgb( ::pPtr, nRgb ) - - -METHOD QColor:setRgb_1( nR, nG, nB, nA ) - RETURN Qt_QColor_setRgb_1( ::pPtr, nR, nG, nB, nA ) +METHOD QColor:setRgb( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QColor_setRgb( ::pPtr, ... ) METHOD QColor:setRgba( nRgba ) @@ -393,12 +391,12 @@ METHOD QColor:fromHsvF( nH, nS, nV, nA ) RETURN Qt_QColor_fromHsvF( ::pPtr, nH, nS, nV, nA ) -METHOD QColor:fromRgb( nRgb ) - RETURN Qt_QColor_fromRgb( ::pPtr, nRgb ) - - -METHOD QColor:fromRgb_1( nR, nG, nB, nA ) - RETURN Qt_QColor_fromRgb_1( ::pPtr, nR, nG, nB, nA ) +METHOD QColor:fromRgb( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QColor_fromRgb( ::pPtr, ... ) METHOD QColor:fromRgbF( nR, nG, nB, nA ) diff --git a/harbour/contrib/hbqt/qtgui/g/TQIcon.prg b/harbour/contrib/hbqt/qtgui/g/TQIcon.prg index 4497fbe7a5..49b32c206f 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQIcon.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQIcon.prg @@ -77,11 +77,8 @@ CREATE CLASS QIcon INHERIT HbQtObjectHandler FUNCTION HB_QIcon METHOD availableSizes( nMode, nState ) METHOD cacheKey() METHOD isNull() - METHOD paint( pPainter, pRect, nAlignment, nMode, nState ) - METHOD paint_1( pPainter, nX, nY, nW, nH, nAlignment, nMode, nState ) - METHOD pixmap( pSize, nMode, nState ) - METHOD pixmap_1( nW, nH, nMode, nState ) - METHOD pixmap_2( nExtent, nMode, nState ) + METHOD paint( ... ) + METHOD pixmap( ... ) ENDCLASS @@ -119,22 +116,18 @@ METHOD QIcon:isNull() RETURN Qt_QIcon_isNull( ::pPtr ) -METHOD QIcon:paint( pPainter, pRect, nAlignment, nMode, nState ) - RETURN Qt_QIcon_paint( ::pPtr, hbqt_ptr( pPainter ), hbqt_ptr( pRect ), nAlignment, nMode, nState ) +METHOD QIcon:paint( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QIcon_paint( ::pPtr, ... ) -METHOD QIcon:paint_1( pPainter, nX, nY, nW, nH, nAlignment, nMode, nState ) - RETURN Qt_QIcon_paint_1( ::pPtr, hbqt_ptr( pPainter ), nX, nY, nW, nH, nAlignment, nMode, nState ) - - -METHOD QIcon:pixmap( pSize, nMode, nState ) - RETURN Qt_QIcon_pixmap( ::pPtr, hbqt_ptr( pSize ), nMode, nState ) - - -METHOD QIcon:pixmap_1( nW, nH, nMode, nState ) - RETURN Qt_QIcon_pixmap_1( ::pPtr, nW, nH, nMode, nState ) - - -METHOD QIcon:pixmap_2( nExtent, nMode, nState ) - RETURN Qt_QIcon_pixmap_2( ::pPtr, nExtent, nMode, nState ) +METHOD QIcon:pixmap( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QIcon_pixmap( ::pPtr, ... ) diff --git a/harbour/contrib/hbqt/qtgui/g/TQImage.prg b/harbour/contrib/hbqt/qtgui/g/TQImage.prg index 209088f6a6..51e6c4f4a1 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQImage.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQImage.prg @@ -79,8 +79,7 @@ CREATE CLASS QImage INHERIT HbQtObjectHandler FUNCTION HB_QImage METHOD cacheKey() METHOD color( nI ) METHOD convertToFormat( nFormat, nFlags ) - METHOD copy( pRectangle ) - METHOD copy_1( nX, nY, nWidth, nHeight ) + METHOD copy( ... ) METHOD createAlphaMask( nFlags ) METHOD createHeuristicMask( lClipTight ) METHOD createMaskFromColor( nColor, nMode ) @@ -94,23 +93,18 @@ CREATE CLASS QImage INHERIT HbQtObjectHandler FUNCTION HB_QImage METHOD invertPixels( nMode ) METHOD isGrayscale() METHOD isNull() - METHOD load( cFileName, pFormat ) - METHOD load_1( pDevice, pFormat ) + METHOD load( ... ) METHOD loadFromData( pData, pFormat ) METHOD mirrored( lHorizontal, lVertical ) METHOD numBytes() METHOD numColors() METHOD offset() - METHOD pixel( pPosition ) - METHOD pixel_1( nX, nY ) - METHOD pixelIndex( pPosition ) - METHOD pixelIndex_1( nX, nY ) + METHOD pixel( ... ) + METHOD pixelIndex( ... ) METHOD rect() METHOD rgbSwapped() - METHOD save( cFileName, pFormat, nQuality ) - METHOD save_1( pDevice, pFormat, nQuality ) - METHOD scaled( pSize, nAspectRatioMode, nTransformMode ) - METHOD scaled_1( nWidth, nHeight, nAspectRatioMode, nTransformMode ) + METHOD save( ... ) + METHOD scaled( ... ) METHOD scaledToHeight( nHeight, nMode ) METHOD scaledToWidth( nWidth, nMode ) METHOD scanLine( nI ) @@ -120,16 +114,13 @@ CREATE CLASS QImage INHERIT HbQtObjectHandler FUNCTION HB_QImage METHOD setDotsPerMeterY( nY ) METHOD setNumColors( nNumColors ) METHOD setOffset( pOffset ) - METHOD setPixel( pPosition, nIndex_or_rgb ) - METHOD setPixel_1( nX, nY, nIndex_or_rgb ) + METHOD setPixel( ... ) METHOD setText( cKey, cText ) METHOD size() METHOD text( cKey ) METHOD textKeys() - METHOD transformed( pMatrix, nMode ) - METHOD transformed_1( pMatrix, nMode ) - METHOD valid( pPos ) - METHOD valid_1( nX, nY ) + METHOD transformed( ... ) + METHOD valid( ... ) METHOD width() ENDCLASS @@ -176,12 +167,12 @@ METHOD QImage:convertToFormat( nFormat, nFlags ) RETURN Qt_QImage_convertToFormat( ::pPtr, nFormat, nFlags ) -METHOD QImage:copy( pRectangle ) - RETURN Qt_QImage_copy( ::pPtr, hbqt_ptr( pRectangle ) ) - - -METHOD QImage:copy_1( nX, nY, nWidth, nHeight ) - RETURN Qt_QImage_copy_1( ::pPtr, nX, nY, nWidth, nHeight ) +METHOD QImage:copy( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_copy( ::pPtr, ... ) METHOD QImage:createAlphaMask( nFlags ) @@ -236,12 +227,12 @@ METHOD QImage:isNull() RETURN Qt_QImage_isNull( ::pPtr ) -METHOD QImage:load( cFileName, pFormat ) - RETURN Qt_QImage_load( ::pPtr, cFileName, hbqt_ptr( pFormat ) ) - - -METHOD QImage:load_1( pDevice, pFormat ) - RETURN Qt_QImage_load_1( ::pPtr, hbqt_ptr( pDevice ), hbqt_ptr( pFormat ) ) +METHOD QImage:load( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_load( ::pPtr, ... ) METHOD QImage:loadFromData( pData, pFormat ) @@ -264,20 +255,20 @@ METHOD QImage:offset() RETURN Qt_QImage_offset( ::pPtr ) -METHOD QImage:pixel( pPosition ) - RETURN Qt_QImage_pixel( ::pPtr, hbqt_ptr( pPosition ) ) +METHOD QImage:pixel( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_pixel( ::pPtr, ... ) -METHOD QImage:pixel_1( nX, nY ) - RETURN Qt_QImage_pixel_1( ::pPtr, nX, nY ) - - -METHOD QImage:pixelIndex( pPosition ) - RETURN Qt_QImage_pixelIndex( ::pPtr, hbqt_ptr( pPosition ) ) - - -METHOD QImage:pixelIndex_1( nX, nY ) - RETURN Qt_QImage_pixelIndex_1( ::pPtr, nX, nY ) +METHOD QImage:pixelIndex( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_pixelIndex( ::pPtr, ... ) METHOD QImage:rect() @@ -288,20 +279,20 @@ METHOD QImage:rgbSwapped() RETURN Qt_QImage_rgbSwapped( ::pPtr ) -METHOD QImage:save( cFileName, pFormat, nQuality ) - RETURN Qt_QImage_save( ::pPtr, cFileName, hbqt_ptr( pFormat ), nQuality ) +METHOD QImage:save( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_save( ::pPtr, ... ) -METHOD QImage:save_1( pDevice, pFormat, nQuality ) - RETURN Qt_QImage_save_1( ::pPtr, hbqt_ptr( pDevice ), hbqt_ptr( pFormat ), nQuality ) - - -METHOD QImage:scaled( pSize, nAspectRatioMode, nTransformMode ) - RETURN Qt_QImage_scaled( ::pPtr, hbqt_ptr( pSize ), nAspectRatioMode, nTransformMode ) - - -METHOD QImage:scaled_1( nWidth, nHeight, nAspectRatioMode, nTransformMode ) - RETURN Qt_QImage_scaled_1( ::pPtr, nWidth, nHeight, nAspectRatioMode, nTransformMode ) +METHOD QImage:scaled( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_scaled( ::pPtr, ... ) METHOD QImage:scaledToHeight( nHeight, nMode ) @@ -340,12 +331,12 @@ METHOD QImage:setOffset( pOffset ) RETURN Qt_QImage_setOffset( ::pPtr, hbqt_ptr( pOffset ) ) -METHOD QImage:setPixel( pPosition, nIndex_or_rgb ) - RETURN Qt_QImage_setPixel( ::pPtr, hbqt_ptr( pPosition ), nIndex_or_rgb ) - - -METHOD QImage:setPixel_1( nX, nY, nIndex_or_rgb ) - RETURN Qt_QImage_setPixel_1( ::pPtr, nX, nY, nIndex_or_rgb ) +METHOD QImage:setPixel( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_setPixel( ::pPtr, ... ) METHOD QImage:setText( cKey, cText ) @@ -364,20 +355,20 @@ METHOD QImage:textKeys() RETURN Qt_QImage_textKeys( ::pPtr ) -METHOD QImage:transformed( pMatrix, nMode ) - RETURN Qt_QImage_transformed( ::pPtr, hbqt_ptr( pMatrix ), nMode ) +METHOD QImage:transformed( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_transformed( ::pPtr, ... ) -METHOD QImage:transformed_1( pMatrix, nMode ) - RETURN Qt_QImage_transformed_1( ::pPtr, hbqt_ptr( pMatrix ), nMode ) - - -METHOD QImage:valid( pPos ) - RETURN Qt_QImage_valid( ::pPtr, hbqt_ptr( pPos ) ) - - -METHOD QImage:valid_1( nX, nY ) - RETURN Qt_QImage_valid_1( ::pPtr, nX, nY ) +METHOD QImage:valid( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QImage_valid( ::pPtr, ... ) METHOD QImage:width() diff --git a/harbour/contrib/hbqt/qtgui/g/TQPixmap.prg b/harbour/contrib/hbqt/qtgui/g/TQPixmap.prg index 92be660847..0f83668306 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQPixmap.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQPixmap.prg @@ -73,16 +73,12 @@ CREATE CLASS QPixmap INHERIT HbQtObjectHandler, HB_QPaintDevice FUNCTION HB_QPix METHOD alphaChannel() METHOD cacheKey() - METHOD copy( pRectangle ) - METHOD copy_1( nX, nY, nWidth, nHeight ) + METHOD copy( ... ) METHOD createHeuristicMask( lClipTight ) - METHOD createMaskFromColor( pMaskColor, nMode ) - METHOD createMaskFromColor_1( pMaskColor ) + METHOD createMaskFromColor( ... ) METHOD depth() METHOD detach() - METHOD fill( pColor ) - METHOD fill_1( pWidget, pOffset ) - METHOD fill_2( pWidget, nX, nY ) + METHOD fill( ... ) METHOD hasAlpha() METHOD hasAlphaChannel() METHOD height() @@ -92,23 +88,19 @@ CREATE CLASS QPixmap INHERIT HbQtObjectHandler, HB_QPaintDevice FUNCTION HB_QPix METHOD loadFromData( pData, pFormat, nFlags ) METHOD mask() METHOD rect() - METHOD save( cFileName, pFormat, nQuality ) - METHOD save_1( pDevice, pFormat, nQuality ) - METHOD scaled( nWidth, nHeight, nAspectRatioMode, nTransformMode ) - METHOD scaled_1( pSize, nAspectRatioMode, nTransformMode ) + METHOD save( ... ) + METHOD scaled( ... ) METHOD scaledToHeight( nHeight, nMode ) METHOD scaledToWidth( nWidth, nMode ) METHOD setAlphaChannel( pAlphaChannel ) METHOD setMask( pMask ) METHOD size() METHOD toImage() - METHOD transformed( pTransform, nMode ) - METHOD transformed_1( pMatrix, nMode ) + METHOD transformed( ... ) METHOD width() METHOD defaultDepth() METHOD fromImage( pImage, nFlags ) - METHOD grabWidget( pWidget, pRectangle ) - METHOD grabWidget_1( pWidget, nX, nY, nWidth, nHeight ) + METHOD grabWidget( ... ) METHOD trueMatrix( pMatrix, nWidth, nHeight ) METHOD trueMatrix_1( pM, nW, nH ) @@ -132,24 +124,24 @@ METHOD QPixmap:cacheKey() RETURN Qt_QPixmap_cacheKey( ::pPtr ) -METHOD QPixmap:copy( pRectangle ) - RETURN Qt_QPixmap_copy( ::pPtr, hbqt_ptr( pRectangle ) ) - - -METHOD QPixmap:copy_1( nX, nY, nWidth, nHeight ) - RETURN Qt_QPixmap_copy_1( ::pPtr, nX, nY, nWidth, nHeight ) +METHOD QPixmap:copy( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_copy( ::pPtr, ... ) METHOD QPixmap:createHeuristicMask( lClipTight ) RETURN Qt_QPixmap_createHeuristicMask( ::pPtr, lClipTight ) -METHOD QPixmap:createMaskFromColor( pMaskColor, nMode ) - RETURN Qt_QPixmap_createMaskFromColor( ::pPtr, hbqt_ptr( pMaskColor ), nMode ) - - -METHOD QPixmap:createMaskFromColor_1( pMaskColor ) - RETURN Qt_QPixmap_createMaskFromColor_1( ::pPtr, hbqt_ptr( pMaskColor ) ) +METHOD QPixmap:createMaskFromColor( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_createMaskFromColor( ::pPtr, ... ) METHOD QPixmap:depth() @@ -160,16 +152,12 @@ METHOD QPixmap:detach() RETURN Qt_QPixmap_detach( ::pPtr ) -METHOD QPixmap:fill( pColor ) - RETURN Qt_QPixmap_fill( ::pPtr, hbqt_ptr( pColor ) ) - - -METHOD QPixmap:fill_1( pWidget, pOffset ) - RETURN Qt_QPixmap_fill_1( ::pPtr, hbqt_ptr( pWidget ), hbqt_ptr( pOffset ) ) - - -METHOD QPixmap:fill_2( pWidget, nX, nY ) - RETURN Qt_QPixmap_fill_2( ::pPtr, hbqt_ptr( pWidget ), nX, nY ) +METHOD QPixmap:fill( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_fill( ::pPtr, ... ) METHOD QPixmap:hasAlpha() @@ -208,20 +196,20 @@ METHOD QPixmap:rect() RETURN Qt_QPixmap_rect( ::pPtr ) -METHOD QPixmap:save( cFileName, pFormat, nQuality ) - RETURN Qt_QPixmap_save( ::pPtr, cFileName, hbqt_ptr( pFormat ), nQuality ) +METHOD QPixmap:save( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_save( ::pPtr, ... ) -METHOD QPixmap:save_1( pDevice, pFormat, nQuality ) - RETURN Qt_QPixmap_save_1( ::pPtr, hbqt_ptr( pDevice ), hbqt_ptr( pFormat ), nQuality ) - - -METHOD QPixmap:scaled( nWidth, nHeight, nAspectRatioMode, nTransformMode ) - RETURN Qt_QPixmap_scaled( ::pPtr, nWidth, nHeight, nAspectRatioMode, nTransformMode ) - - -METHOD QPixmap:scaled_1( pSize, nAspectRatioMode, nTransformMode ) - RETURN Qt_QPixmap_scaled_1( ::pPtr, hbqt_ptr( pSize ), nAspectRatioMode, nTransformMode ) +METHOD QPixmap:scaled( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_scaled( ::pPtr, ... ) METHOD QPixmap:scaledToHeight( nHeight, nMode ) @@ -248,12 +236,12 @@ METHOD QPixmap:toImage() RETURN Qt_QPixmap_toImage( ::pPtr ) -METHOD QPixmap:transformed( pTransform, nMode ) - RETURN Qt_QPixmap_transformed( ::pPtr, hbqt_ptr( pTransform ), nMode ) - - -METHOD QPixmap:transformed_1( pMatrix, nMode ) - RETURN Qt_QPixmap_transformed_1( ::pPtr, hbqt_ptr( pMatrix ), nMode ) +METHOD QPixmap:transformed( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_transformed( ::pPtr, ... ) METHOD QPixmap:width() @@ -268,12 +256,12 @@ METHOD QPixmap:fromImage( pImage, nFlags ) RETURN Qt_QPixmap_fromImage( ::pPtr, hbqt_ptr( pImage ), nFlags ) -METHOD QPixmap:grabWidget( pWidget, pRectangle ) - RETURN Qt_QPixmap_grabWidget( ::pPtr, hbqt_ptr( pWidget ), hbqt_ptr( pRectangle ) ) - - -METHOD QPixmap:grabWidget_1( pWidget, nX, nY, nWidth, nHeight ) - RETURN Qt_QPixmap_grabWidget_1( ::pPtr, hbqt_ptr( pWidget ), nX, nY, nWidth, nHeight ) +METHOD QPixmap:grabWidget( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPixmap_grabWidget( ::pPtr, ... ) METHOD QPixmap:trueMatrix( pMatrix, nWidth, nHeight ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth index 27b8948f68..58bc099e47 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth @@ -56,23 +56,23 @@ QObject = no -Inherits = +Inherits = Type = PlainObject -New = +New = -oBrush := QBrush():new() -oBrush := QBrush():new( pQBrush ) -oBrush := QBrush():new( nQt_GlobalColor ) -oBrush := QBrush():new( nQt_GlobalColor, nQt_BrushStyle ) -oBrush := QBrush():new( pQColor, nQt_BrushStyle ) -oBrush := QBrush():new( pQColor, pQPixmap ) -oBrush := QBrush():new( nQt_GlobalColor, pQPixmap ) -oBrush := QBrush():new( "QPixmap" , pQPixmap ) -oBrush := QBrush():new( "QImage" , pQImage ) -oBrush := QBrush():new( "QGradient", pQGradient ) -oBrush := QBrush():new( "QColor" , pQColor, [ nQt_BrushStyle = Qt_SolidPattern ] ) +oBrush := QBrush() +oBrush := QBrush( pQBrush ) +oBrush := QBrush( nQt_GlobalColor ) +oBrush := QBrush( nQt_GlobalColor, nQt_BrushStyle ) +oBrush := QBrush( pQColor, nQt_BrushStyle ) +oBrush := QBrush( pQColor, pQPixmap ) +oBrush := QBrush( nQt_GlobalColor, pQPixmap ) +oBrush := QBrush( "QPixmap" , pQPixmap ) +oBrush := QBrush( "QImage" , pQImage ) +oBrush := QBrush( "QGradient", pQGradient ) +oBrush := QBrush( "QColor" , pQColor, [ nQt_BrushStyle = Qt_SolidPattern ] ) @@ -96,27 +96,54 @@ HB_FUNC( QT_QBRUSH ) { if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QBrush( 1 ) ) ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QBrush ) + { + hb_retptr( new QBrush( *hbqt_par_QBrush( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QPixmap ) + { + hb_retptr( new QBrush( *hbqt_par_QPixmap( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QImage ) + { + hb_retptr( new QBrush( *hbqt_par_QImage( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QGradient ) + { + hb_retptr( new QBrush( *hbqt_par_QGradient( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QColor ) + { + hb_retptr( new QBrush( *hbqt_par_QColor( 1 ), Qt::SolidPattern ) ); + } + } + else + { + hb_retptr( new QBrush( *hbqt_par_QBrush( 1 ) ) ); + } } else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) ); + hb_retptr( new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) ); } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { - hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); + hb_retptr( new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); + hb_retptr( new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ); + hb_retptr( new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) { - hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ); + hb_retptr( new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) { @@ -124,28 +151,28 @@ HB_FUNC( QT_QBRUSH ) if( objName == ( QString ) "QPixmap" ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QPixmap( 2 ) ) ); + hb_retptr( new QBrush( *hbqt_par_QPixmap( 2 ) ) ); } else if( objName == ( QString ) "QImage" ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QImage( 2 ) ) ); + hb_retptr( new QBrush( *hbqt_par_QImage( 2 ) ) ); } else if( objName == ( QString ) "QGradient" ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QGradient( 2 ) ) ); + hb_retptr( new QBrush( *hbqt_par_QGradient( 2 ) ) ); } else if( objName == ( QString ) "QColor" ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 2 ), HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ); + hb_retptr( new QBrush( *hbqt_par_QColor( 2 ), HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ); } else { - hb_retptr( ( QBrush* ) new QBrush() ); + hb_retptr( new QBrush() ); } } else { - hb_retptr( ( QBrush* ) new QBrush() ); + hb_retptr( new QBrush() ); } } @@ -155,8 +182,24 @@ const QColor & color () const //const QGradient * gradient () const bool isOpaque () const const QMatrix & matrix () const -void setColor ( const QColor & color ) -void setColor ( Qt::GlobalColor color ) + +void setColor ( ... ){ + QBrush * p = hbqt_par_QBrush( 1 ); + if( p ) + { + if( HB_ISPOINTER( 2 ) ) + { + ( p )->setColor( *hbqt_par_QColor( 2 ) ); + } + else if( HB_ISNUM( 2 ) ) + { + ( p )->setColor( ( Qt::GlobalColor ) hb_parni( 2 ) ); + } + } +} +//void setColor ( const QColor & color ) +//void setColor ( Qt::GlobalColor color ) + void setMatrix ( const QMatrix & matrix ) void setStyle ( Qt::BrushStyle style ) void setTexture ( const QPixmap & pixmap ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QColor.qth b/harbour/contrib/hbqt/qtgui/qth/QColor.qth index a9dea64ffe..0e92f06d7e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QColor.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QColor.qth @@ -90,36 +90,36 @@ HB_FUNC( QT_QCOLOR ) { if( hb_pcount() == 1 && HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 ) { - hb_retptr( ( QColor* ) new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); + hb_retptr( new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); } else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - hb_retptr( ( QColor* ) new QColor( ( QRgb ) hb_parni( 1 ) ) ); + hb_retptr( new QColor( ( QRgb ) hb_parni( 1 ) ) ); } else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) ); + hb_retptr( new QColor( hbqt_par_QString( 1 ) ) ); } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QColor* ) new QColor( *hbqt_par_QColor( 1 ) ) ); + hb_retptr( new QColor( *hbqt_par_QColor( 1 ) ) ); } else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) ); + hb_retptr( new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) ); } else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); + hb_retptr( new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); } else { - hb_retptr( ( QColor* ) new QColor() ); + hb_retptr( new QColor() ); } } else { - hb_retptr( ( QColor* ) new QColor() ); + hb_retptr( new QColor() ); } } @@ -174,13 +174,25 @@ void setNamedColor ( const QString & name ) void setRed ( int red ) void setRedF ( qreal red ) -# functions below are swapped as we are used to pass RGB() as composite color -# -void setRgb ( QRgb rgb ) -void setRgb ( int r, int g, int b, int a = 255 ) +void setRgb ( ... ){ + QColor * p = hbqt_par_QColor( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISNUM( 2 ) ) + { + ( p )->setRgb( hb_parnl( 2 ) ); + } + else if( hb_pcount() >= 4 && HB_ISNUM( 2 ) ) + { + ( p )->setRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ); + } + } +} +//void setRgb ( QRgb rgb ) +//void setRgb ( int r, int g, int b, int a = 255 ) + void setRgba ( QRgb rgba ) void setRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 ) -# Spec spec () const QColor toCmyk () const @@ -198,8 +210,24 @@ QColor fromCmyk ( int c, int m, int y, int k, int a = 255 ) QColor fromCmykF ( qreal c, qreal m, qreal y, qreal k, qreal a = 1.0 ) QColor fromHsv ( int h, int s, int v, int a = 255 ) QColor fromHsvF ( qreal h, qreal s, qreal v, qreal a = 1.0 ) -QColor fromRgb ( QRgb rgb ) -QColor fromRgb ( int r, int g, int b, int a = 255 ) + +QColor fromRgb ( ... ){ + QColor * p = hbqt_par_QColor( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parnl( 2 ) ) ), true ) ); + } + else if( hb_pcount() >= 4 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->fromRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, 255 ) ) ), true ) ); + } + } +} +//QColor fromRgb ( QRgb rgb ) +//QColor fromRgb ( int r, int g, int b, int a = 255 ) + QColor fromRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 ) QColor fromRgba ( QRgb rgba ) //void setAllowX11ColorNames ( bool enabled ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QIcon.qth b/harbour/contrib/hbqt/qtgui/qth/QIcon.qth index 2bffbdf7bf..815239d8ae 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QIcon.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QIcon.qth @@ -57,7 +57,7 @@ QObject = no Type = PlainObject -New = +New = @@ -83,15 +83,30 @@ HB_FUNC( QT_QICON ) { if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - hb_retptr( ( QIcon* ) new QIcon( hbqt_par_QString( 1 ) ) ); + hb_retptr( new QIcon( hbqt_par_QString( 1 ) ) ); } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QIcon* ) new QIcon( *hbqt_par_QPixmap( 1 ) ) ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QIcon ) + { + hb_retptr( new QIcon( *hbqt_par_QIcon( 1 ) ) ); + } + else if( q->type == HBQT_TYPE_QPixmap ) + { + hb_retptr( new QIcon( *hbqt_par_QPixmap( 1 ) ) ); + } + } + else + { + hb_retptr( new QIcon( *hbqt_par_QIcon( 1 ) ) ); + } } else { - hb_retptr( ( QIcon* ) new QIcon() ); + hb_retptr( new QIcon() ); } } @@ -108,11 +123,42 @@ void addPixmap ( const QPixmap & pixmap, Mode mode = Normal, State state = Off ) QList availableSizes ( Mode mode = Normal, State state = Off ) const qint64 cacheKey () const bool isNull () const -void paint ( QPainter * painter, const QRect & rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const -void paint ( QPainter * painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const -QPixmap pixmap ( const QSize & size, Mode mode = Normal, State state = Off ) const -QPixmap pixmap ( int w, int h, Mode mode = Normal, State state = Off ) const -QPixmap pixmap ( int extent, Mode mode = Normal, State state = Off ) const + +void paint ( ... ){ + QIcon * p = hbqt_par_QIcon( 1 ); + if( p ) + { + if( HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + ( p )->paint( hbqt_par_QPainter( 2 ), *hbqt_par_QRect( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::Alignment ) hb_parni( 4 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 5 ) ? ( QIcon::Mode ) hb_parni( 5 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 6 ) ? ( QIcon::State ) hb_parni( 6 ) : ( QIcon::State ) QIcon::Off ) ); + } + else if( HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->paint( hbqt_par_QPainter( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( HB_ISNUM( 7 ) ? ( Qt::Alignment ) hb_parni( 7 ) : ( Qt::Alignment ) Qt::AlignCenter ), ( HB_ISNUM( 8 ) ? ( QIcon::Mode ) hb_parni( 8 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 9 ) ? ( QIcon::State ) hb_parni( 9 ) : ( QIcon::State ) QIcon::Off ) ); + } + } +} +//void paint ( QPainter * painter, const QRect & rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const +//void paint ( QPainter * painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) const + +QPixmap pixmap ( ... ){ + QIcon * p = hbqt_par_QIcon( 1 ); + if( p ) + { + if( HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( QIcon::Mode ) hb_parni( 3 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 4 ) ? ( QIcon::State ) hb_parni( 4 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ) ), true ) ); + } + } +} +//QPixmap pixmap ( const QSize & size, Mode mode = Normal, State state = Off ) const +//QPixmap pixmap ( int w, int h, Mode mode = Normal, State state = Off ) const +//QPixmap pixmap ( int extent, Mode mode = Normal, State state = Off ) const // Not Implemented + diff --git a/harbour/contrib/hbqt/qtgui/qth/QImage.qth b/harbour/contrib/hbqt/qtgui/qth/QImage.qth index 65b2ed287d..df297ad57d 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QImage.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QImage.qth @@ -63,15 +63,15 @@ New = -oImage := QImage():new() -oImage := QImage():new( pQSize, cFormat ) -oImage := QImage():new( iWidth, iHeight, cFormat ) -oImage := QImage():new( @cData, iWidth, iHeight, cFormat ) -oImage := QImage():new( cData , iWidth, iHeight, cFormat ) -oImage := QImage():new( @cData, iWidth, iHeight, iBytesPerLine, cFormat ) -oImage := QImage():new( cData , iWidth, iHeight, iBytesPerLine, cFormat ) -oImage := QImage():new( cFileName [, cFormat ] ) -oImage := QImage():new( pQImage ) +oImage := QImage() +oImage := QImage( pQSize, cFormat ) +oImage := QImage( iWidth, iHeight, cFormat ) +oImage := QImage( @cData, iWidth, iHeight, cFormat ) +oImage := QImage( cData , iWidth, iHeight, cFormat ) +oImage := QImage( @cData, iWidth, iHeight, iBytesPerLine, cFormat ) +oImage := QImage( cData , iWidth, iHeight, iBytesPerLine, cFormat ) +oImage := QImage( cFileName [, cFormat ] ) +oImage := QImage( pQImage ) @@ -95,37 +95,37 @@ oImage := QImage():new( pQImage ) */ HB_FUNC( QT_QIMAGE ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { - hb_retptr( ( QImage* ) new QImage( *hbqt_par_QImage( 1 ) ) ); + hb_retptr( new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ); } - else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QImage* ) new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ); + hb_retptr( new QImage( *hbqt_par_QImage( 1 ) ) ); } else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) { - hb_retptr( ( QImage* ) new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ); + hb_retptr( new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ); } else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) { - hb_retptr( ( QImage* ) new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ); + hb_retptr( new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ); } else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - hb_retptr( ( QImage* ) new QImage( hb_parni( 1 ), hb_parni( 2 ), ( QImage::Format ) hb_parni( 3 ) ) ); + hb_retptr( new QImage( hb_parni( 1 ), hb_parni( 2 ), ( QImage::Format ) hb_parni( 3 ) ) ); } else if( hb_pcount() == 4 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - hb_retptr( ( QImage* ) new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( QImage::Format ) hb_parni( 4 ) ) ); + hb_retptr( new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( QImage::Format ) hb_parni( 4 ) ) ); } else if( hb_pcount() == 5 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) { - hb_retptr( ( QImage* ) new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( QImage::Format ) hb_parni( 5 ) ) ); + hb_retptr( new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( QImage::Format ) hb_parni( 5 ) ) ); } else { - hb_retptr( ( QImage* ) new QImage() ); + hb_retptr( new QImage() ); } } @@ -144,10 +144,31 @@ int bytesPerLine () const qint64 cacheKey () const QRgb color ( int i ) const QVector colorTable () const + QImage convertToFormat ( Format format, Qt::ImageConversionFlags flags = Qt::AutoColor ) const QImage convertToFormat ( Format format, const QVector & colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor ) const -QImage copy ( const QRect & rectangle = QRect() ) const -QImage copy ( int x, int y, int width, int height ) const + +QImage copy ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); + } + else if( hb_pcount() == 5 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + } + else + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->copy( QRect() ) ), true ) ); + } + } +} +//QImage copy ( const QRect & rectangle = QRect() ) const +//QImage copy ( int x, int y, int width, int height ) const + QImage createAlphaMask ( Qt::ImageConversionFlags flags = Qt::AutoColor ) const QImage createHeuristicMask ( bool clipTight = true ) const QImage createMaskFromColor ( QRgb color, Qt::MaskMode mode = Qt::MaskInColor ) const @@ -161,24 +182,106 @@ int height () const void invertPixels ( InvertMode mode = InvertRgb ) bool isGrayscale () const bool isNull () const -bool load ( const QString & fileName, const char * format = 0 ) -bool load ( QIODevice * device, const char * format ) + +bool load ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->load( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + hb_retl( ( p )->load( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ) ) ); + } + } +} +//bool load ( const QString & fileName, const char * format = 0 ) +//bool load ( QIODevice * device, const char * format ) + // bool loadFromData ( const uchar * data, int len, const char * format = 0 ) bool loadFromData ( const QByteArray & data, const char * format = 0 ) QImage mirrored ( bool horizontal = false, bool vertical = true ) const int numBytes () const int numColors () const QPoint offset () const -QRgb pixel ( const QPoint & position ) const -QRgb pixel ( int x, int y ) const -int pixelIndex ( const QPoint & position ) const -int pixelIndex ( int x, int y ) const + +QRgb pixel ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retnl( ( p )->pixel( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 2 ) ) + { + hb_retnl( ( p )->pixel( hb_parni( 2 ), hb_parni( 3 ) ) ); + } + } +} +//QRgb pixel ( const QPoint & position ) const +//QRgb pixel ( int x, int y ) const + +int pixelIndex ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retni( ( p )->pixelIndex( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 2 ) ) + { + hb_retni( ( p )->pixelIndex( hb_parni( 2 ), hb_parni( 3 ) ) ); + } + } +} +//int pixelIndex ( const QPoint & position ) const +//int pixelIndex ( int x, int y ) const + QRect rect () const QImage rgbSwapped () const -bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const -bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const -QImage scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const -QImage scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + +bool save ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + } + } +} +//bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const +//bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const + +QImage scaled ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + } +} +//QImage scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const +//QImage scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + QImage scaledToHeight ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) const QImage scaledToWidth ( int width, Qt::TransformationMode mode = Qt::FastTransformation ) const uchar * scanLine ( int i ) @@ -189,16 +292,65 @@ void setDotsPerMeterX ( int x ) void setDotsPerMeterY ( int y ) void setNumColors ( int numColors ) void setOffset ( const QPoint & offset ) -void setPixel ( const QPoint & position, uint index_or_rgb ) -void setPixel ( int x, int y, uint index_or_rgb ) + +void setPixel ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) ) + { + ( p )->setPixel( *hbqt_par_QPoint( 2 ), hb_parni( 3 ) ); + } + else if( hb_pcount() == 4 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->setPixel( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + } + } +} +//void setPixel ( const QPoint & position, uint index_or_rgb ) +//void setPixel ( int x, int y, uint index_or_rgb ) + void setText ( const QString & key, const QString & text ) QSize size () const QString text ( const QString & key = QString() ) const QStringList textKeys () const -QImage transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const -QImage transformed ( const QTransform & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const -bool valid ( const QPoint & pos ) const -bool valid ( int x, int y ) const + +QImage transformed ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QTransform ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( q->type == HBQT_TYPE_QMatrix ) + { + hb_retptrGC( hbqt_gcAllocate_QImage( new QImage( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + } +} +//QImage transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const +//QImage transformed ( const QTransform & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + +bool valid ( ... ){ + QImage * p = hbqt_par_QImage( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->valid( *hbqt_par_QPoint( 2 ) ) ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->valid( hb_parni( 2 ), hb_parni( 3 ) ) ); + } + } +} +//bool valid ( const QPoint & pos ) const +//bool valid ( int x, int y ) const + int width () const diff --git a/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth b/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth index c9d9af2d7f..5e13d5c641 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth @@ -58,7 +58,7 @@ QObject = no Inherits = QPaintDevice Type = PlainObject -New = +New = @@ -89,7 +89,22 @@ HB_FUNC( QT_QPIXMAP ) } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( new QPixmap( *hbqt_par_QPixmap( 1 ) ) ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + if( q ) + { + if( q->type == HBQT_TYPE_QPixmap ) + { + hb_retptr( new QPixmap( *hbqt_par_QPixmap( 1 ) ) ); + } + if( q->type == HBQT_TYPE_QSize ) + { + hb_retptr( new QPixmap( *hbqt_par_QSize( 1 ) ) ); + } + } + else + { + hb_retptr( new QPixmap( *hbqt_par_QPixmap( 1 ) ) ); + } } else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { @@ -113,45 +128,133 @@ qint64 cacheKey () const # // QRgb * clut () const # -QPixmap copy ( const QRect & rectangle = QRect() ) const -QPixmap copy ( int x, int y, int width, int height ) const + +QPixmap copy ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ), true ) ); + } + else if( hb_pcount() == 5 && HB_ISNUM( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ) ) ), true ) ); + } + else + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->copy( QRect() ) ), true ) ); + } + } +} +//QPixmap copy ( const QRect & rectangle = QRect() ) const +//QPixmap copy ( int x, int y, int width, int height ) const + QBitmap createHeuristicMask ( bool clipTight = true ) const -QBitmap createMaskFromColor ( const QColor & maskColor, Qt::MaskMode mode ) const -QBitmap createMaskFromColor ( const QColor & maskColor ) const + +QBitmap createMaskFromColor ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() == 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ) ) ), true ) ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QBitmap( new QBitmap( ( p )->createMaskFromColor( *hbqt_par_QColor( 2 ), ( Qt::MaskMode ) hb_parni( 3 ) ) ), true ) ); + } + else + { + ( p )->copy( QRect() ); + } + } +} +//QBitmap createMaskFromColor ( const QColor & maskColor, Qt::MaskMode mode ) const +//QBitmap createMaskFromColor ( const QColor & maskColor ) const + int depth () const void detach () -void fill ( const QColor & color = Qt::white ) -void fill ( const QWidget * widget, const QPoint & offset ) -void fill ( const QWidget * widget, int x, int y ) -# + +void fill ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() == 4 && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) ) + { + ( p )->fill( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ) ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + ( p )->fill( hbqt_par_QWidget( 2 ), *hbqt_par_QPoint( 3 ) ); + } + else + { + ( p )->fill( *hbqt_par_QColor( 2 ) ); + } + } +} +//void fill ( const QColor & color = Qt::white ) +//void fill ( const QWidget * widget, const QPoint & offset ) +//void fill ( const QWidget * widget, int x, int y ) + // Qt::HANDLE handle () const -# + bool hasAlpha () const bool hasAlphaChannel () const int height () const bool isNull () const bool isQBitmap () const bool load ( const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) -# + // bool loadFromData ( const uchar * data, uint len, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) -# + bool loadFromData ( const QByteArray & data, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) QBitmap mask () const -# -// int numCols () const -# -// const uchar * qwsBits () const -# -// int qwsBytesPerLine () const -# -QRect rect () const -bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const -bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const -# Swapped -QPixmap scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const -QPixmap scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const -# +// int numCols () const +// const uchar * qwsBits () const +// int qwsBytesPerLine () const + +QRect rect () const + +bool save ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISCHAR( 2 ) ) + { + void * pText; + hb_retl( ( p )->save( hb_parstr_utf8( 2, &pText, NULL ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + hb_strfree( pText ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retl( ( p )->save( hbqt_par_QIODevice( 2 ), hbqt_par_char( 3 ), hb_parnidef( 4, -1 ) ) ); + } + } +} +//bool save ( const QString & fileName, const char * format = 0, int quality = -1 ) const +//bool save ( QIODevice * device, const char * format = 0, int quality = -1 ) const + + +QPixmap scaled ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNUM( 4 ) ? ( Qt::AspectRatioMode ) hb_parni( 4 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 5 ) ? ( Qt::TransformationMode ) hb_parni( 5 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( hb_pcount() >= 3 && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->scaled( *hbqt_par_QSize( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::AspectRatioMode ) hb_parni( 3 ) : ( Qt::AspectRatioMode ) Qt::IgnoreAspectRatio ), ( HB_ISNUM( 4 ) ? ( Qt::TransformationMode ) hb_parni( 4 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + } +} +//QPixmap scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const +//QPixmap scaled ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const + QPixmap scaledToHeight ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) const QPixmap scaledToWidth ( int width, Qt::TransformationMode mode = Qt::FastTransformation ) const @@ -159,21 +262,53 @@ void setAlphaChannel ( const QPixmap & alphaChannel ) void setMask ( const QBitmap & mask ) QSize size () const QImage toImage () const -# -// CGImageRef toMacCGImageRef () const -# -//HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const -QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const -QPixmap transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const -int width () const +// CGImageRef toMacCGImageRef () const +//HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const + +QPixmap transformed ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QTransform ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QTransform( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + else if( q->type == HBQT_TYPE_QMatrix ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->transformed( *hbqt_par_QMatrix( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::TransformationMode ) hb_parni( 3 ) : ( Qt::TransformationMode ) Qt::FastTransformation ) ) ), true ) ); + } + } +} +//QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const +//QPixmap transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const + +int width () const int defaultDepth () QPixmap fromImage ( const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor ) //QPixmap fromMacCGImageRef ( CGImageRef image ) //QPixmap fromWinHBITMAP ( HBITMAP bitmap, HBitmapFormat format = NoAlpha ) //QPixmap fromX11Pixmap ( Qt::HANDLE pixmap, ShareMode mode = ImplicitlyShared ) -QPixmap grabWidget ( QWidget * widget, const QRect & rectangle ) -QPixmap grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) + +QPixmap grabWidget ( ... ){ + QPixmap * p = hbqt_par_QPixmap( 1 ); + if( p ) + { + if( hb_pcount() == 3 && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), *hbqt_par_QRect( 3 ) ) ), true ) ); + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + { + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->grabWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parnidef( 5, -1 ), hb_parnidef( 6, -1 ) ) ), true ) ); + } + } +} +//QPixmap grabWidget ( QWidget * widget, const QRect & rectangle ) +//QPixmap grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) + //QPixmap grabWindow ( WId window, int x = 0, int y = 0, int width = -1, int height = -1 ) QTransform trueMatrix ( const QTransform & matrix, int width, int height ) QMatrix trueMatrix ( const QMatrix & m, int w, int h ) diff --git a/harbour/contrib/hbqt/tests/demoqt.prg b/harbour/contrib/hbqt/tests/demoqt.prg index 5f8ca7dd74..7095ba684d 100644 --- a/harbour/contrib/hbqt/tests/demoqt.prg +++ b/harbour/contrib/hbqt/tests/demoqt.prg @@ -367,10 +367,10 @@ STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) // oBrushBackItem0x0 := QBrush() oBrushBackItem0x0:setStyle( 1 ) // Solid Color - oBrushBackItem0x0:setColor_1( 10 ) // http://doc.qtsoftware.com/4.5/qt.html#GlobalColor-enum + oBrushBackItem0x0:setColor( 10 ) // http://doc.qtsoftware.com/4.5/qt.html#GlobalColor-enum // oBrushForeItem0x0 := QBrush() - oBrushForeItem0x0:setColor_1( 7 ) + oBrushForeItem0x0:setColor( 7 ) // oGridItem0x0 := QTableWidgetItem() oGridItem0x0:setBackground( oBrushBackItem0x0 ) diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg index 81392bbc81..622f19e95c 100644 --- a/harbour/contrib/hbxbp/xbpstatic.prg +++ b/harbour/contrib/hbxbp/xbpstatic.prg @@ -407,7 +407,7 @@ METHOD XbpStatic:setCaption( xCaption, cDll ) /* Harbour can also implement if icon be displayed scaled or proportionate */ - oPixmap:pPtr := oIcon:pixmap_1( ::aSize[ 1 ], ::aSize[ 2 ] ) + oPixmap:pPtr := oIcon:pixmap( ::aSize[ 1 ], ::aSize[ 2 ] ) pPixmap := oPixmap:scaled( ::aSize[ 1 ], ::aSize[ 2 ] ) ::oWidget:setPixmap( pPixmap )