From 817176348af786d1ef1f012c94af85c0568c3ead Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 20 Sep 2010 00:59:45 +0000 Subject: [PATCH] 2010-09-19 17:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + contrib/hbqt/qtcore/g/THBQEvents.prg + contrib/hbqt/qtcore/g/THBQSlots.prg + Missings from prev commit of Viktor. * contrib/hbqt/qtgui/doc/en/class_qpainter.txt * contrib/hbqt/qtgui/g/QPainter.cpp * contrib/hbqt/qtgui/g/TQPainter.prg * contrib/hbqt/qtgui/qth/QPainter.qth + More streamlined many-to-one function calls. Still a work in progress. * contrib/hbide/hbqreportsmanager.prg * contrib/hbide/ideactions.prg * contrib/hbide/idemain.prg * contrib/hbide/idesaveload.prg + Implemented: Harbour level codepage protocol. Please make experiments. WARNING: you may need to re-select appropriate codepage from menu option before saving any source. Better would be - select codepage as above and exit hbIDE, reenter. --- harbour/ChangeLog | 24 + harbour/contrib/hbide/hbqreportsmanager.prg | 57 +- harbour/contrib/hbide/ideactions.prg | 46 +- harbour/contrib/hbide/idemain.prg | 8 +- harbour/contrib/hbide/idesaveload.prg | 2 +- harbour/contrib/hbqt/qtcore/g/THBQEvents.prg | 100 ++++ harbour/contrib/hbqt/qtcore/g/THBQSlots.prg | 105 ++++ .../hbqt/qtgui/doc/en/class_qpainter.txt | 32 +- harbour/contrib/hbqt/qtgui/g/QPainter.cpp | 513 +++++------------- harbour/contrib/hbqt/qtgui/g/TQPainter.prg | 152 +----- harbour/contrib/hbqt/qtgui/qth/QPainter.qth | 166 ++++-- 11 files changed, 570 insertions(+), 635 deletions(-) create mode 100644 harbour/contrib/hbqt/qtcore/g/THBQEvents.prg create mode 100644 harbour/contrib/hbqt/qtcore/g/THBQSlots.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7b660befa8..d1d5d0b98a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,30 @@ The license applies to all entries newer than 2009-04-28. */ +2010-09-19 17:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + + contrib/hbqt/qtcore/g/THBQEvents.prg + + contrib/hbqt/qtcore/g/THBQSlots.prg + + Missings from prev commit of Viktor. + + * contrib/hbqt/qtgui/doc/en/class_qpainter.txt + * contrib/hbqt/qtgui/g/QPainter.cpp + * contrib/hbqt/qtgui/g/TQPainter.prg + * contrib/hbqt/qtgui/qth/QPainter.qth + + More streamlined many-to-one function calls. + Still a work in progress. + + * contrib/hbide/hbqreportsmanager.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/idemain.prg + * contrib/hbide/idesaveload.prg + + Implemented: Harbour level codepage protocol. + Please make experiments. + + WARNING: you may need to re-select appropriate + codepage from menu option + before saving any source. Better would be - select + codepage as above and exit hbIDE, reenter. + 2010-09-20 01:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/make.hbs + Stop build in case a contrib build failed. diff --git a/harbour/contrib/hbide/hbqreportsmanager.prg b/harbour/contrib/hbide/hbqreportsmanager.prg index cefe6aca39..7a5cdceced 100644 --- a/harbour/contrib/hbide/hbqreportsmanager.prg +++ b/harbour/contrib/hbide/hbqreportsmanager.prg @@ -2277,33 +2277,34 @@ METHOD HqrGraphicsItem:drawSelection( qPainter, qRect ) /*----------------------------------------------------------------------*/ METHOD HqrGraphicsItem:draw( qPainter, qRect, lDrawSelection ) + LOCAL qRectF := QRectF( qRect ) DEFAULT lDrawSelection TO .t. ::setupPainter( qPainter, lDrawSelection ) SWITCH ::cType - CASE "Barcode" ; ::drawBarcode( qPainter, qRect ) ; EXIT - CASE "Image" ; ::drawImage( qPainter, qRect ) ; EXIT - CASE "Chart" ; ::drawChart( qPainter, qRect ) ; EXIT - CASE "Gradient" ; ::drawGradient( qPainter, qRect ) ; EXIT - CASE "Text" ; ::drawText( qPainter, qRect ) ; EXIT - CASE "Field" ; ::drawField( qPainter, qRect ) ; EXIT - CASE "Rectangle" ; ::drawRect( qPainter, qRect ) ; EXIT - CASE "RoundRect" ; ::drawRoundRect( qPainter, qRect ) ; EXIT - CASE "Ellipse" ; ::drawEllipse( qPainter, qRect ) ; EXIT - CASE "LineH" ; ::drawLine( qPainter, qRect ) ; EXIT - CASE "LineV" ; ::drawLine( qPainter, qRect ) ; EXIT - CASE "LineDR" ; ::drawLine( qPainter, qRect ) ; EXIT - CASE "LineDL" ; ::drawLine( qPainter, qRect ) ; EXIT - CASE "Arc" ; ::drawArc( qPainter, qRect ) ; EXIT - CASE "Chord" ; ::drawChord( qPainter, qRect ) ; EXIT - CASE "Diamond" ; ::drawDiamond( qPainter, qRect ) ; EXIT - CASE "Triangle" ; ::drawTriangle( qPainter, qRect ) ; EXIT + CASE "Barcode" ; ::drawBarcode( qPainter, qRectF ) ; EXIT + CASE "Image" ; ::drawImage( qPainter, qRectF ) ; EXIT + CASE "Chart" ; ::drawChart( qPainter, qRectF ) ; EXIT + CASE "Gradient" ; ::drawGradient( qPainter, qRectF ) ; EXIT + CASE "Text" ; ::drawText( qPainter, qRectF ) ; EXIT + CASE "Field" ; ::drawField( qPainter, qRectF ) ; EXIT + CASE "Rectangle" ; ::drawRect( qPainter, qRectF ) ; EXIT + CASE "RoundRect" ; ::drawRoundRect( qPainter, qRectF ) ; EXIT + CASE "Ellipse" ; ::drawEllipse( qPainter, qRectF ) ; EXIT + CASE "LineH" ; ::drawLine( qPainter, qRectF ) ; EXIT + CASE "LineV" ; ::drawLine( qPainter, qRectF ) ; EXIT + CASE "LineDR" ; ::drawLine( qPainter, qRectF ) ; EXIT + CASE "LineDL" ; ::drawLine( qPainter, qRectF ) ; EXIT + CASE "Arc" ; ::drawArc( qPainter, qRectF ) ; EXIT + CASE "Chord" ; ::drawChord( qPainter, qRectF ) ; EXIT + CASE "Diamond" ; ::drawDiamond( qPainter, qRectF ) ; EXIT + CASE "Triangle" ; ::drawTriangle( qPainter, qRectF ) ; EXIT ENDSWITCH IF lDrawSelection - ::drawSelection( qPainter, qRect ) + ::drawSelection( qPainter, qRectF ) ENDIF RETURN Self @@ -2340,7 +2341,6 @@ METHOD HqrGraphicsItem:drawLine( qPainter, qRect ) qPainter:drawLine( qRect:right(), qRect:y(), qRect:x(), qRect:bottom() ) EXIT case HBQT_GRAPHICSITEM_LINE_FORWARDDIAGONAL - //qPainter:drawLine_4( qRect:x(), qRect:y(), qRect:right(), qRect:bottom() ) qPainter:drawLine( QPointF( qRect:x(), qRect:y() ), QPointF( qRect:right(), qRect:bottom() ) ) EXIT ENDSWITCH @@ -2397,14 +2397,15 @@ METHOD HqrGraphicsItem:drawChord( qPainter, qRect ) /*----------------------------------------------------------------------*/ METHOD HqrGraphicsItem:drawText( qPainter, qRect ) - qPainter:drawText_2( qRect, ::textFlags(), ::text() ) + //qPainter:drawText_2( qRect, ::textFlags(), ::text() ) + qPainter:drawText( qRect, ::textFlags(), ::text() ) RETURN Self /*----------------------------------------------------------------------*/ METHOD HqrGraphicsItem:drawField( qPainter, qRect ) - qPainter:setRenderHint( QPainter_TextAntialiasing ) - qPainter:drawText_2( qRect, ::textFlags(), ::text() ) + //qPainter:drawText_2( qRect, ::textFlags(), ::text() ) + qPainter:drawText( qRect, ::textFlags(), ::text() ) RETURN Self /*----------------------------------------------------------------------*/ @@ -2449,7 +2450,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect ) LOCAL cText := "Picture" LOCAL qObj := ::oWidget - rc := QRectF():from( qRect:adjusted( 1, 1, -2, -2 ) ) + rc := QRectF( qRect:adjusted( 1, 1, -2, -2 ) ) textH := 0 sw := 0 @@ -2502,7 +2503,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRect ) point:setY( point:y() + textH ) ENDIF - qPainter:drawImage_2( point, img ) + qPainter:drawImage( point, img ) ENDIF qPainter:setPen( QPen( textColor ) ) @@ -2617,19 +2618,19 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect ) NEXT y := 0 FOR i := 1 TO nPlanes - qPainter:drawText_2( QRectF( rc:x(), rc:y() + y, maxLabelWidth, nFHeight ), ; + qPainter:drawText( QRectF( rc:x(), rc:y() + y, maxLabelWidth, nFHeight ), ; Qt_AlignRight + Qt_AlignVCenter, hb_ntos( Int( ( maxpv - chartStep * ( i - 1 ) ) / powVal ) ) ) y += valstep NEXT - qPainter:drawLine_4( rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y(), rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y() + qRect:height() ) + qPainter:drawLine( rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y(), rc:x() + maxLabelWidth + 1 / UNIT / 4, rc:y() + qRect:height() ) rc := QRectF():from( rc:adjusted( maxLabelWidth + 1 / UNIT / 4, 0, 0, 0 ) ) ENDIF IF m_showGrid y := nFHeight / 2 FOR i := 1 TO nPlanes - qPainter:drawLine_4( rc:x(), rc:y() + y, rc:x() + rc:width(), rc:y() + y ) + qPainter:drawLine( rc:x(), rc:y() + y, rc:x() + rc:width(), rc:y() + y ) y += valstep NEXT ENDIF @@ -2651,7 +2652,7 @@ METHOD HqrGraphicsItem:drawChart( qPainter, qRect ) qPainter:fillRect( QRectF( rc:x() + x, rc:y() + py * maxpv - py * cv[ 2 ] * powVal, barWidth, py * cv[ 2 ] * powVal ), br ) IF m_showLabels - qPainter:drawText_2( QRectF( rc:x() + x - m_barsIdentation / 2, rc:y() + py * maxpv - iif( cv[ 2 ] >= 0, nFHeight, 0 ), ; + qPainter:drawText( QRectF( rc:x() + x - m_barsIdentation / 2, rc:y() + py * maxpv - iif( cv[ 2 ] >= 0, nFHeight, 0 ), ; barWidth + m_barsIdentation, nFHeight ), Qt_AlignCenter, hb_ntos( Int( cv[ 2 ] ) ) ) ENDIF x += barWidth + m_barsIdentation diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index cfb10151d8..e3d94e8c2d 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -617,9 +617,9 @@ METHOD IdeActions:buildMainMenu() hbide_menuAddSep( oSubMenu ) oSubMenu:addItem( { ::getAction( "TB_Tools" ), {|| oIde:execAction( "Tools" ) } } ) hbide_menuAddSep( oSubMenu ) - #if 0 - oSubMenu2 := hbide_buildCodecMenu( oIde, oSubMenu ) - oSubMenu2:title := "~Encoding" + #if 1 + oSubMenu2 := hbide_buildCDPMenu( oIde, oSubMenu ) //hbide_buildCodecMenu( oIde, oSubMenu ) + oSubMenu2:title := "~CodePage" oSubMenu:addItem( { oSubMenu2, NIL } ) #endif oMenuBar:addItem( { oSubMenu, NIL } ) @@ -907,3 +907,43 @@ FUNCTION hbide_mnuFindItem( oIde, cCaption ) RETURN nil /*----------------------------------------------------------------------*/ + +#include "hbextcdp.ch" + +STATIC FUNCTION hbide_buildCDPMenu( oIde, oMenu ) + LOCAL oSubMenu, cdp + + oSubMenu := XbpMenu():new( oMenu ):create() + + FOR EACH cdp IN get_list_of_real_codepages() + oSubMenu:addItem( { hb_cdpUniID( cdp ), get_cdp_block( oIde, hb_cdpUniID( cdp ) ) } ) + NEXT + + RETURN oSubMenu + +STATIC FUNCTION get_cdp_block( oIde, cCodePage ) + RETURN {|| oIde:setCodec( cCodePage ) } + +STATIC FUNCTION get_list_of_real_codepages() + LOCAL s_uni, cdp + + s_uni := { => } + FOR EACH cdp IN hb_cdpList() + s_uni[ hb_cdpUniID( cdp ) ] := cdp + NEXT + + RETURN s_uni + +FUNCTION hbide_getCDPforID( cCodec ) + LOCAL cdp + + FOR EACH cdp IN hb_cdpList() + IF hb_cdpUniID( cdp ) == cCodec + cCodec := cdp + EXIT + ENDIF + NEXT + + RETURN cCodec + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idemain.prg b/harbour/contrib/hbide/idemain.prg index ab16de4971..eaa2bb4f1b 100644 --- a/harbour/contrib/hbide/idemain.prg +++ b/harbour/contrib/hbide/idemain.prg @@ -435,7 +435,7 @@ METHOD HbIde:create( aParams ) hbide_loadSkltns( Self ) /* Set Codec at the Begining - no interface display */ - ::cWrkCodec := hb_cdpSelect() + hb_cdpSelect( ::cWrkCodec ) /* Load IDE|User defined Themes */ ::oTH := IdeThemes():new( Self, ::oINI:getThemesFile() ):create() @@ -1434,9 +1434,11 @@ METHOD HbIde:setCodec( cCodec ) DEFAULT cCodec TO ::cWrkCodec - ::cWrkCodec := cCodec + ::cWrkCodec := hbide_getCDPforID( cCodec ) - ::oDK:setStatusText( SB_PNL_CODEC, hb_cdpUniID( ::cWrkCodec ) ) + ::oDK:setStatusText( SB_PNL_CODEC, ::cWrkCodec + ":" + hb_cdpUniID( ::cWrkCodec ) ) + + hb_cdpSelect( ::cWrkCodec ) RETURN Self diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 8b0911b295..92ffecf14a 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -587,7 +587,7 @@ METHOD IdeINI:load( cHbideIni ) // CASE "CurrentProject" ; ::oIde:cWrkProject := cVal ; EXIT CASE "CurrentTheme" ; ::oIde:cWrkTheme := cVal ; EXIT - CASE "CurrentCodec" ; ::oIde:cWrkCodec := "UTF-8" ; EXIT + CASE "CurrentCodec" ; ::oIde:cWrkCodec := cVal ; EXIT CASE "CurrentEnvironment" ; ::oIde:cWrkEnvironment := cVal ; EXIT CASE "CurrentFind" ; ::oIde:cWrkFind := cVal ; EXIT CASE "CurrentFolderFind" ; ::oIde:cWrkFolderFind := cVal ; EXIT diff --git a/harbour/contrib/hbqt/qtcore/g/THBQEvents.prg b/harbour/contrib/hbqt/qtcore/g/THBQEvents.prg new file mode 100644 index 0000000000..0b991e6f31 --- /dev/null +++ b/harbour/contrib/hbqt/qtcore/g/THBQEvents.prg @@ -0,0 +1,100 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009-2010 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +FUNCTION HBQEvents( ... ) + RETURN HB_HBQEvents():new( ... ) + + +CREATE CLASS HBQEvents INHERIT HbQtObjectHandler, HB_QObject FUNCTION HB_HBQEvents + + METHOD new( ... ) + + METHOD hbConnect( xObj, nEvent, xBlock ) + METHOD hbDisconnect( xObj, nEvent ) + METHOD hbClear() + + ENDCLASS + + +METHOD HBQEvents:new( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + ::pPtr := Qt_HBQEvents( ... ) + RETURN Self + + +METHOD HBQEvents:hbConnect( xObj, nEvent, xBlock ) + RETURN Qt_HBQEvents_hbConnect( ::pPtr, xObj, nEvent, xBlock ) + + +METHOD HBQEvents:hbDisconnect( xObj, nEvent ) + RETURN Qt_HBQEvents_hbDisconnect( ::pPtr, xObj, nEvent ) + + +METHOD HBQEvents:hbClear() + RETURN Qt_HBQEvents_hbClear( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qtcore/g/THBQSlots.prg b/harbour/contrib/hbqt/qtcore/g/THBQSlots.prg new file mode 100644 index 0000000000..56fc0d4fd2 --- /dev/null +++ b/harbour/contrib/hbqt/qtcore/g/THBQSlots.prg @@ -0,0 +1,105 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009-2010 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +FUNCTION HBQSlots( ... ) + RETURN HB_HBQSlots():new( ... ) + + +CREATE CLASS HBQSlots INHERIT HbQtObjectHandler, HB_QObject FUNCTION HB_HBQSlots + + METHOD new( ... ) + + METHOD hbConnect( xPObj, pSlot, xBBlock ) + METHOD hbDisconnect( xObj, pSlot ) + METHOD hbIsConnected( xObj, pSlot ) + METHOD hbClear() + + ENDCLASS + + +METHOD HBQSlots:new( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + ::pPtr := Qt_HBQSlots( ... ) + RETURN Self + + +METHOD HBQSlots:hbConnect( xPObj, pSlot, xBBlock ) + RETURN Qt_HBQSlots_hbConnect( ::pPtr, xPObj, hbqt_ptr( pSlot ), xBBlock ) + + +METHOD HBQSlots:hbDisconnect( xObj, pSlot ) + RETURN Qt_HBQSlots_hbDisconnect( ::pPtr, xObj, hbqt_ptr( pSlot ) ) + + +METHOD HBQSlots:hbIsConnected( xObj, pSlot ) + RETURN Qt_HBQSlots_hbIsConnected( ::pPtr, xObj, hbqt_ptr( pSlot ) ) + + +METHOD HBQSlots:hbClear() + RETURN Qt_HBQSlots_hbClear( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_qpainter.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_qpainter.txt index ff4852ac7b..f92852f7db 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_qpainter.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_qpainter.txt @@ -58,15 +58,7 @@ * :drawEllipse_2( nX, nY, nWidth, nHeight ) -> NIL * :drawEllipse_3( pCenter, nRx, nRy ) -> NIL * :drawEllipse_4( pCenter, nRx, nRy ) -> NIL - * :drawImage( pTarget, pImage, pSource, nFlags ) -> NIL - * :drawImage_1( pTarget, pImage, pSource, nFlags ) -> NIL - * :drawImage_2( pPoint, pImage ) -> NIL - * :drawImage_3( pPoint, pImage ) -> NIL - * :drawImage_4( pPoint, pImage, pSource, nFlags ) -> NIL - * :drawImage_5( pPoint, pImage, pSource, nFlags ) -> NIL - * :drawImage_6( pRectangle, pImage ) -> NIL - * :drawImage_7( pRectangle, pImage ) -> NIL - * :drawImage_8( nX, nY, pImage, nSx, nSy, nSw, nSh, nFlags ) -> NIL + * :drawImage( ... ) -> NIL * :drawLine( ... ) -> NIL * :drawLines( pLines, nLineCount ) -> NIL * :drawLines_1( pLines, nLineCount ) -> NIL @@ -79,18 +71,7 @@ * :drawPie( pRectangle, nStartAngle, nSpanAngle ) -> NIL * :drawPie_1( pRectangle, nStartAngle, nSpanAngle ) -> NIL * :drawPie_2( nX, nY, nWidth, nHeight, nStartAngle, nSpanAngle ) -> NIL - * :hbDrawPixmap( ... ) -> NIL - * :drawPixmap( pTarget, pPixmap, pSource ) -> NIL - * :drawPixmap_1( pTarget, pPixmap, pSource ) -> NIL - * :drawPixmap_2( pPoint, pPixmap, pSource ) -> NIL - * :drawPixmap_3( pPoint, pPixmap, pSource ) -> NIL - * :drawPixmap_4( pPoint, pPixmap ) -> NIL - * :drawPixmap_5( pPoint, pPixmap ) -> NIL - * :drawPixmap_6( nX, nY, pPixmap ) -> NIL - * :drawPixmap_7( pRectangle, pPixmap ) -> NIL - * :drawPixmap_8( nX, nY, nWidth, nHeight, pPixmap ) -> NIL - * :drawPixmap_9( nX, nY, nW, nH, pPixmap, nSx, nSy, nSw, nSh ) -> NIL - * :drawPixmap_10( nX, nY, pPixmap, nSx, nSy, nSw, nSh ) -> NIL + * :drawPixmap( ... ) -> NIL * :drawPoint( pPosition ) -> NIL * :drawPoint_1( pPosition ) -> NIL * :drawPoint_2( nX, nY ) -> NIL @@ -114,14 +95,7 @@ * :drawRoundedRect( pRect, nXRadius, nYRadius, nMode ) -> NIL * :drawRoundedRect_1( pRect, nXRadius, nYRadius, nMode ) -> NIL * :drawRoundedRect_2( nX, nY, nW, nH, nXRadius, nYRadius, nMode ) -> NIL - * :hbDrawText( ... ) -> NIL - * :drawText( pPosition, cText ) -> NIL - * :drawText_1( pPosition, cText ) -> NIL - * :drawText_2( pRectangle, nFlags, cText, pBoundingRect ) -> NIL - * :drawText_3( pRectangle, nFlags, cText, pBoundingRect ) -> NIL - * :drawText_4( nX, nY, cText ) -> NIL - * :drawText_5( nX, nY, nWidth, nHeight, nFlags, cText, pBoundingRect ) -> NIL - * :drawText_6( pRectangle, cText, pOption ) -> NIL + * :drawText( ... ) -> NIL * :drawTiledPixmap( pRectangle, pPixmap, pPosition ) -> NIL * :drawTiledPixmap_1( pRectangle, pPixmap, pPosition ) -> NIL * :drawTiledPixmap_2( nX, nY, nWidth, nHeight, pPixmap, nSx, nSy ) -> NIL diff --git a/harbour/contrib/hbqt/qtgui/g/QPainter.cpp b/harbour/contrib/hbqt/qtgui/g/QPainter.cpp index df92d764c4..80b7af3e46 100644 --- a/harbour/contrib/hbqt/qtgui/g/QPainter.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QPainter.cpp @@ -73,12 +73,14 @@ */ /* - * Constructed[ 180/194 [ 92.78% ] ] + * Constructed[ 154/197 [ 78.17% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * * } + * } + * } * void drawLines ( const QVector & pointPairs ) * void drawLines ( const QVector & pointPairs ) * void drawLines ( const QVector & lines ) @@ -90,11 +92,38 @@ * * *** Commented out protos which construct fine but do not compile *** * + * //void drawImage ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * //void drawImage ( const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * //void drawImage ( const QPointF & point, const QImage & image ) + * //void drawImage ( const QPoint & point, const QImage & image ) + * //void drawImage ( const QPointF & point, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * //void drawImage ( const QPoint & point, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * //void drawImage ( const QRectF & rectangle, const QImage & image ) + * //void drawImage ( const QRect & rectangle, const QImage & image ) + * //void drawImage ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor ) * //void drawLine ( const QLineF & line ) * //void drawLine ( const QLine & line ) * //void drawLine ( const QPoint & p1, const QPoint & p2 ) * //void drawLine ( const QPointF & p1, const QPointF & p2 ) * //void drawLine ( int x1, int y1, int x2, int y2 ) + * //void drawPixmap ( const QRectF & target, const QPixmap & pixmap, const QRectF & source ) + * //void drawPixmap ( const QRect & target, const QPixmap & pixmap, const QRect & source ) + * //void drawPixmap ( const QPointF & point, const QPixmap & pixmap, const QRectF & source ) + * //void drawPixmap ( const QPoint & point, const QPixmap & pixmap, const QRect & source ) + * //void drawPixmap ( const QPointF & point, const QPixmap & pixmap ) + * //void drawPixmap ( const QPoint & point, const QPixmap & pixmap ) + * //void drawPixmap ( int x, int y, const QPixmap & pixmap ) + * //void drawPixmap ( const QRect & rectangle, const QPixmap & pixmap ) + * //void drawPixmap ( int x, int y, int width, int height, const QPixmap & pixmap ) + * //void drawPixmap ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) + * //void drawPixmap ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) + * //void drawText ( const QPointF & position, const QString & text ) + * //void drawText ( const QPoint & position, const QString & text ) + * //void drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) + * //void drawText ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 ) + * //void drawText ( int x, int y, const QString & text ) + * //void drawText ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 ) + * //void drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() ) */ #include @@ -570,110 +599,62 @@ HB_FUNC( QT_QPAINTER_DRAWELLIPSE_4 ) } /* - * void drawImage ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) + * void drawImage ( ... ) */ HB_FUNC( QT_QPAINTER_DRAWIMAGE ) { QPainter * p = hbqt_par_QPainter( 1 ); if( p ) { - ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ), ( HB_ISNUM( 5 ) ? ( Qt::ImageConversionFlags ) hb_parni( 5 ) : ( Qt::ImageConversionFlags ) Qt::AutoColor ) ); - } -} + if( hb_pcount() >= 4 ) + { + if( HB_ISNUM( 2 ) ) + { + ( p )->drawImage( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QImage( 4 ), hb_parni( 5 ), hb_parni( 6 ), HB_ISNUM( 7 ) ? hb_parni( 7 ) : -1, HB_ISNUM( 8 ) ? hb_parni( 8 ) : -1, ( Qt::ImageConversionFlags ) ( HB_ISNUM( 9 ) ? hb_parni( 9 ) : Qt::AutoColor ) ); + } + else + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); -/* - * void drawImage ( const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_1 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ), ( HB_ISNUM( 5 ) ? ( Qt::ImageConversionFlags ) hb_parni( 5 ) : ( Qt::ImageConversionFlags ) Qt::AutoColor ) ); - } -} + if( q->type == HBQT_TYPE_QRectF ) + { + ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ) ); + } + } + } + else if( hb_pcount() == 3 ) + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); -/* - * void drawImage ( const QPointF & point, const QImage & image ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_2 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ) ); - } -} - -/* - * void drawImage ( const QPoint & point, const QImage & image ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_3 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ) ); - } -} - -/* - * void drawImage ( const QPointF & point, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_4 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ), ( HB_ISNUM( 5 ) ? ( Qt::ImageConversionFlags ) hb_parni( 5 ) : ( Qt::ImageConversionFlags ) Qt::AutoColor ) ); - } -} - -/* - * void drawImage ( const QPoint & point, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_5 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ), ( HB_ISNUM( 5 ) ? ( Qt::ImageConversionFlags ) hb_parni( 5 ) : ( Qt::ImageConversionFlags ) Qt::AutoColor ) ); - } -} - -/* - * void drawImage ( const QRectF & rectangle, const QImage & image ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_6 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ) ); - } -} - -/* - * void drawImage ( const QRect & rectangle, const QImage & image ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_7 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ) ); - } -} - -/* - * void drawImage ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor ) - */ -HB_FUNC( QT_QPAINTER_DRAWIMAGE_8 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawImage( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QImage( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parnidef( 7, -1 ), hb_parnidef( 8, -1 ), ( HB_ISNUM( 9 ) ? ( Qt::ImageConversionFlags ) hb_parni( 9 ) : ( Qt::ImageConversionFlags ) Qt::AutoColor ) ); + if( q->type == HBQT_TYPE_QRectF ) + { + ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ) ); + } + } } } @@ -855,196 +836,68 @@ HB_FUNC( QT_QPAINTER_DRAWPIE_2 ) } /* - * void hbDrawPixmap ( ... ) - */ -HB_FUNC( QT_QPAINTER_HBDRAWPIXMAP ) -{ - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); - if( p && p->ph ) - { - switch( hb_pcount() ) - { - case 10: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ), hb_parni( 7 ), hb_parni( 8 ), hb_parni( 9 ), hb_parni( 10 ) ); - break; - case 8: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parni( 7 ), hb_parni( 8 ) ); - break; - case 6: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ) ); - break; - case 4: - if( HB_ISNUM( 2 ) ) - { - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ) ); - } - else - { - if( p->type == HBQT_TYPE_QRectF ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); - } - else if( p->type == HBQT_TYPE_QRect ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); - } - else if( p->type == HBQT_TYPE_QPointF ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); - } - else if( p->type == HBQT_TYPE_QPoint ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); - } - } - break; - case 3: - if( p->type == HBQT_TYPE_QRect ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ) ); - } - else if( p->type == HBQT_TYPE_QPointF ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ) ); - } - else if( p->type == HBQT_TYPE_QPoint ) - { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ) ); - } - break; - } - } -} - -/* - * void drawPixmap ( const QRectF & target, const QPixmap & pixmap, const QRectF & source ) + * void drawPixmap ( ... ) */ HB_FUNC( QT_QPAINTER_DRAWPIXMAP ) { QPainter * p = hbqt_par_QPainter( 1 ); if( p ) { - ( p )->drawPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); - } -} + switch( hb_pcount() ) + { + case 10: + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ), hb_parni( 7 ), hb_parni( 8 ), hb_parni( 9 ), hb_parni( 10 ) ); + break; + case 8: + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parni( 7 ), hb_parni( 8 ) ); + break; + case 6: + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ) ); + break; + case 4: + if( HB_ISNUM( 2 ) ) + { + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ) ); + } + else + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); -/* - * void drawPixmap ( const QRect & target, const QPixmap & pixmap, const QRect & source ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_1 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); - } -} + if( q->type == HBQT_TYPE_QRectF ) + { + ( p )->drawPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); + } + } + break; + case 3: + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); -/* - * void drawPixmap ( const QPointF & point, const QPixmap & pixmap, const QRectF & source ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_2 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); - } -} - -/* - * void drawPixmap ( const QPoint & point, const QPixmap & pixmap, const QRect & source ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_3 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); - } -} - -/* - * void drawPixmap ( const QPointF & point, const QPixmap & pixmap ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_4 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ) ); - } -} - -/* - * void drawPixmap ( const QPoint & point, const QPixmap & pixmap ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_5 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ) ); - } -} - -/* - * void drawPixmap ( int x, int y, const QPixmap & pixmap ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_6 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ) ); - } -} - -/* - * void drawPixmap ( const QRect & rectangle, const QPixmap & pixmap ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_7 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ) ); - } -} - -/* - * void drawPixmap ( int x, int y, int width, int height, const QPixmap & pixmap ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_8 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ) ); - } -} - -/* - * void drawPixmap ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_9 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ), hb_parni( 7 ), hb_parni( 8 ), hb_parni( 9 ), hb_parni( 10 ) ); - } -} - -/* - * void drawPixmap ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) - */ -HB_FUNC( QT_QPAINTER_DRAWPIXMAP_10 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parni( 7 ), hb_parni( 8 ) ); + if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ) ); + } + break; + } } } @@ -1325,9 +1178,9 @@ HB_FUNC( QT_QPAINTER_DRAWROUNDEDRECT_2 ) } /* - * void hbDrawText ( ... ) + * void drawText ( ... ) */ -HB_FUNC( QT_QPAINTER_HBDRAWTEXT ) +HB_FUNC( QT_QPAINTER_DRAWTEXT ) { QPainter * p = hbqt_par_QPainter( 1 ); if( p ) @@ -1376,104 +1229,6 @@ HB_FUNC( QT_QPAINTER_HBDRAWTEXT ) } } -/* - * void drawText ( const QPointF & position, const QString & text ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( *hbqt_par_QPointF( 2 ), hb_parstr_utf8( 3, &pText, NULL ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( const QPoint & position, const QString & text ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_1 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( *hbqt_par_QPoint( 2 ), hb_parstr_utf8( 3, &pText, NULL ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_2 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( *hbqt_par_QRectF( 2 ), hb_parni( 3 ), hb_parstr_utf8( 4, &pText, NULL ), hbqt_par_QRectF( 5 ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_3 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( *hbqt_par_QRect( 2 ), hb_parni( 3 ), hb_parstr_utf8( 4, &pText, NULL ), hbqt_par_QRect( 5 ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( int x, int y, const QString & text ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_4 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( hb_parni( 2 ), hb_parni( 3 ), hb_parstr_utf8( 4, &pText, NULL ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_5 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parstr_utf8( 7, &pText, NULL ), hbqt_par_QRect( 8 ) ); - hb_strfree( pText ); - } -} - -/* - * void drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() ) - */ -HB_FUNC( QT_QPAINTER_DRAWTEXT_6 ) -{ - QPainter * p = hbqt_par_QPainter( 1 ); - if( p ) - { - void * pText; - ( p )->drawText( *hbqt_par_QRectF( 2 ), hb_parstr_utf8( 3, &pText, NULL ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) ); - hb_strfree( pText ); - } -} - /* * void drawTiledPixmap ( const QRectF & rectangle, const QPixmap & pixmap, const QPointF & position = QPointF() ) */ diff --git a/harbour/contrib/hbqt/qtgui/g/TQPainter.prg b/harbour/contrib/hbqt/qtgui/g/TQPainter.prg index bdffeba48d..5e9c3f082d 100644 --- a/harbour/contrib/hbqt/qtgui/g/TQPainter.prg +++ b/harbour/contrib/hbqt/qtgui/g/TQPainter.prg @@ -103,15 +103,7 @@ CREATE CLASS QPainter INHERIT HbQtObjectHandler FUNCTION HB_QPainter METHOD drawEllipse_2( nX, nY, nWidth, nHeight ) METHOD drawEllipse_3( pCenter, nRx, nRy ) METHOD drawEllipse_4( pCenter, nRx, nRy ) - METHOD drawImage( pTarget, pImage, pSource, nFlags ) - METHOD drawImage_1( pTarget, pImage, pSource, nFlags ) - METHOD drawImage_2( pPoint, pImage ) - METHOD drawImage_3( pPoint, pImage ) - METHOD drawImage_4( pPoint, pImage, pSource, nFlags ) - METHOD drawImage_5( pPoint, pImage, pSource, nFlags ) - METHOD drawImage_6( pRectangle, pImage ) - METHOD drawImage_7( pRectangle, pImage ) - METHOD drawImage_8( nX, nY, pImage, nSx, nSy, nSw, nSh, nFlags ) + METHOD drawImage( ... ) METHOD drawLine( ... ) METHOD drawLines( pLines, nLineCount ) METHOD drawLines_1( pLines, nLineCount ) @@ -124,18 +116,7 @@ CREATE CLASS QPainter INHERIT HbQtObjectHandler FUNCTION HB_QPainter METHOD drawPie( pRectangle, nStartAngle, nSpanAngle ) METHOD drawPie_1( pRectangle, nStartAngle, nSpanAngle ) METHOD drawPie_2( nX, nY, nWidth, nHeight, nStartAngle, nSpanAngle ) - METHOD hbDrawPixmap( ... ) - METHOD drawPixmap( pTarget, pPixmap, pSource ) - METHOD drawPixmap_1( pTarget, pPixmap, pSource ) - METHOD drawPixmap_2( pPoint, pPixmap, pSource ) - METHOD drawPixmap_3( pPoint, pPixmap, pSource ) - METHOD drawPixmap_4( pPoint, pPixmap ) - METHOD drawPixmap_5( pPoint, pPixmap ) - METHOD drawPixmap_6( nX, nY, pPixmap ) - METHOD drawPixmap_7( pRectangle, pPixmap ) - METHOD drawPixmap_8( nX, nY, nWidth, nHeight, pPixmap ) - METHOD drawPixmap_9( nX, nY, nW, nH, pPixmap, nSx, nSy, nSw, nSh ) - METHOD drawPixmap_10( nX, nY, pPixmap, nSx, nSy, nSw, nSh ) + METHOD drawPixmap( ... ) METHOD drawPoint( pPosition ) METHOD drawPoint_1( pPosition ) METHOD drawPoint_2( nX, nY ) @@ -159,14 +140,7 @@ CREATE CLASS QPainter INHERIT HbQtObjectHandler FUNCTION HB_QPainter METHOD drawRoundedRect( pRect, nXRadius, nYRadius, nMode ) METHOD drawRoundedRect_1( pRect, nXRadius, nYRadius, nMode ) METHOD drawRoundedRect_2( nX, nY, nW, nH, nXRadius, nYRadius, nMode ) - METHOD hbDrawText( ... ) - METHOD drawText( pPosition, cText ) - METHOD drawText_1( pPosition, cText ) - METHOD drawText_2( pRectangle, nFlags, cText, pBoundingRect ) - METHOD drawText_3( pRectangle, nFlags, cText, pBoundingRect ) - METHOD drawText_4( nX, nY, cText ) - METHOD drawText_5( nX, nY, nWidth, nHeight, nFlags, cText, pBoundingRect ) - METHOD drawText_6( pRectangle, cText, pOption ) + METHOD drawText( ... ) METHOD drawTiledPixmap( pRectangle, pPixmap, pPosition ) METHOD drawTiledPixmap_1( pRectangle, pPixmap, pPosition ) METHOD drawTiledPixmap_2( nX, nY, nWidth, nHeight, pPixmap, nSx, nSy ) @@ -392,40 +366,12 @@ METHOD QPainter:drawEllipse_4( pCenter, nRx, nRy ) RETURN Qt_QPainter_drawEllipse_4( ::pPtr, hbqt_ptr( pCenter ), nRx, nRy ) -METHOD QPainter:drawImage( pTarget, pImage, pSource, nFlags ) - RETURN Qt_QPainter_drawImage( ::pPtr, hbqt_ptr( pTarget ), hbqt_ptr( pImage ), hbqt_ptr( pSource ), nFlags ) - - -METHOD QPainter:drawImage_1( pTarget, pImage, pSource, nFlags ) - RETURN Qt_QPainter_drawImage_1( ::pPtr, hbqt_ptr( pTarget ), hbqt_ptr( pImage ), hbqt_ptr( pSource ), nFlags ) - - -METHOD QPainter:drawImage_2( pPoint, pImage ) - RETURN Qt_QPainter_drawImage_2( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pImage ) ) - - -METHOD QPainter:drawImage_3( pPoint, pImage ) - RETURN Qt_QPainter_drawImage_3( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pImage ) ) - - -METHOD QPainter:drawImage_4( pPoint, pImage, pSource, nFlags ) - RETURN Qt_QPainter_drawImage_4( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pImage ), hbqt_ptr( pSource ), nFlags ) - - -METHOD QPainter:drawImage_5( pPoint, pImage, pSource, nFlags ) - RETURN Qt_QPainter_drawImage_5( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pImage ), hbqt_ptr( pSource ), nFlags ) - - -METHOD QPainter:drawImage_6( pRectangle, pImage ) - RETURN Qt_QPainter_drawImage_6( ::pPtr, hbqt_ptr( pRectangle ), hbqt_ptr( pImage ) ) - - -METHOD QPainter:drawImage_7( pRectangle, pImage ) - RETURN Qt_QPainter_drawImage_7( ::pPtr, hbqt_ptr( pRectangle ), hbqt_ptr( pImage ) ) - - -METHOD QPainter:drawImage_8( nX, nY, pImage, nSx, nSy, nSw, nSh, nFlags ) - RETURN Qt_QPainter_drawImage_8( ::pPtr, nX, nY, hbqt_ptr( pImage ), nSx, nSy, nSw, nSh, nFlags ) +METHOD QPainter:drawImage( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + RETURN Qt_QPainter_drawImage( ::pPtr, ... ) METHOD QPainter:drawLine( ... ) @@ -480,56 +426,12 @@ METHOD QPainter:drawPie_2( nX, nY, nWidth, nHeight, nStartAngle, nSpanAngle ) RETURN Qt_QPainter_drawPie_2( ::pPtr, nX, nY, nWidth, nHeight, nStartAngle, nSpanAngle ) -METHOD QPainter:hbDrawPixmap( ... ) +METHOD QPainter:drawPixmap( ... ) LOCAL p FOR EACH p IN { ... } hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) NEXT - RETURN Qt_QPainter_hbDrawPixmap( ::pPtr, ... ) - - -METHOD QPainter:drawPixmap( pTarget, pPixmap, pSource ) - RETURN Qt_QPainter_drawPixmap( ::pPtr, hbqt_ptr( pTarget ), hbqt_ptr( pPixmap ), hbqt_ptr( pSource ) ) - - -METHOD QPainter:drawPixmap_1( pTarget, pPixmap, pSource ) - RETURN Qt_QPainter_drawPixmap_1( ::pPtr, hbqt_ptr( pTarget ), hbqt_ptr( pPixmap ), hbqt_ptr( pSource ) ) - - -METHOD QPainter:drawPixmap_2( pPoint, pPixmap, pSource ) - RETURN Qt_QPainter_drawPixmap_2( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pPixmap ), hbqt_ptr( pSource ) ) - - -METHOD QPainter:drawPixmap_3( pPoint, pPixmap, pSource ) - RETURN Qt_QPainter_drawPixmap_3( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pPixmap ), hbqt_ptr( pSource ) ) - - -METHOD QPainter:drawPixmap_4( pPoint, pPixmap ) - RETURN Qt_QPainter_drawPixmap_4( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pPixmap ) ) - - -METHOD QPainter:drawPixmap_5( pPoint, pPixmap ) - RETURN Qt_QPainter_drawPixmap_5( ::pPtr, hbqt_ptr( pPoint ), hbqt_ptr( pPixmap ) ) - - -METHOD QPainter:drawPixmap_6( nX, nY, pPixmap ) - RETURN Qt_QPainter_drawPixmap_6( ::pPtr, nX, nY, hbqt_ptr( pPixmap ) ) - - -METHOD QPainter:drawPixmap_7( pRectangle, pPixmap ) - RETURN Qt_QPainter_drawPixmap_7( ::pPtr, hbqt_ptr( pRectangle ), hbqt_ptr( pPixmap ) ) - - -METHOD QPainter:drawPixmap_8( nX, nY, nWidth, nHeight, pPixmap ) - RETURN Qt_QPainter_drawPixmap_8( ::pPtr, nX, nY, nWidth, nHeight, hbqt_ptr( pPixmap ) ) - - -METHOD QPainter:drawPixmap_9( nX, nY, nW, nH, pPixmap, nSx, nSy, nSw, nSh ) - RETURN Qt_QPainter_drawPixmap_9( ::pPtr, nX, nY, nW, nH, hbqt_ptr( pPixmap ), nSx, nSy, nSw, nSh ) - - -METHOD QPainter:drawPixmap_10( nX, nY, pPixmap, nSx, nSy, nSw, nSh ) - RETURN Qt_QPainter_drawPixmap_10( ::pPtr, nX, nY, hbqt_ptr( pPixmap ), nSx, nSy, nSw, nSh ) + RETURN Qt_QPainter_drawPixmap( ::pPtr, ... ) METHOD QPainter:drawPoint( pPosition ) @@ -624,40 +526,12 @@ METHOD QPainter:drawRoundedRect_2( nX, nY, nW, nH, nXRadius, nYRadius, nMode ) RETURN Qt_QPainter_drawRoundedRect_2( ::pPtr, nX, nY, nW, nH, nXRadius, nYRadius, nMode ) -METHOD QPainter:hbDrawText( ... ) +METHOD QPainter:drawText( ... ) LOCAL p FOR EACH p IN { ... } hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) NEXT - RETURN Qt_QPainter_hbDrawText( ::pPtr, ... ) - - -METHOD QPainter:drawText( pPosition, cText ) - RETURN Qt_QPainter_drawText( ::pPtr, hbqt_ptr( pPosition ), cText ) - - -METHOD QPainter:drawText_1( pPosition, cText ) - RETURN Qt_QPainter_drawText_1( ::pPtr, hbqt_ptr( pPosition ), cText ) - - -METHOD QPainter:drawText_2( pRectangle, nFlags, cText, pBoundingRect ) - RETURN Qt_QPainter_drawText_2( ::pPtr, hbqt_ptr( pRectangle ), nFlags, cText, hbqt_ptr( pBoundingRect ) ) - - -METHOD QPainter:drawText_3( pRectangle, nFlags, cText, pBoundingRect ) - RETURN Qt_QPainter_drawText_3( ::pPtr, hbqt_ptr( pRectangle ), nFlags, cText, hbqt_ptr( pBoundingRect ) ) - - -METHOD QPainter:drawText_4( nX, nY, cText ) - RETURN Qt_QPainter_drawText_4( ::pPtr, nX, nY, cText ) - - -METHOD QPainter:drawText_5( nX, nY, nWidth, nHeight, nFlags, cText, pBoundingRect ) - RETURN Qt_QPainter_drawText_5( ::pPtr, nX, nY, nWidth, nHeight, nFlags, cText, hbqt_ptr( pBoundingRect ) ) - - -METHOD QPainter:drawText_6( pRectangle, cText, pOption ) - RETURN Qt_QPainter_drawText_6( ::pPtr, hbqt_ptr( pRectangle ), cText, hbqt_ptr( pOption ) ) + RETURN Qt_QPainter_drawText( ::pPtr, ... ) METHOD QPainter:drawTiledPixmap( pRectangle, pPixmap, pPosition ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QPainter.qth b/harbour/contrib/hbqt/qtgui/qth/QPainter.qth index e9c7141fe7..31f598fb3e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPainter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPainter.qth @@ -76,7 +76,7 @@ HB_FUNC( QT_QPAINTER ) else { hb_retptr( new QPainter() ); - } + } } @@ -124,15 +124,71 @@ void drawEllipse ( int x, int y, int width, int height ) void drawEllipse ( const QPointF & center, qreal rx, qreal ry ) void drawEllipse ( const QPoint & center, int rx, int ry ) -void drawImage ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) -void drawImage ( const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) -void drawImage ( const QPointF & point, const QImage & image ) -void drawImage ( const QPoint & point, const QImage & image ) -void drawImage ( const QPointF & point, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) -void drawImage ( const QPoint & point, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) -void drawImage ( const QRectF & rectangle, const QImage & image ) -void drawImage ( const QRect & rectangle, const QImage & image ) -void drawImage ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor ) +void drawImage ( ... ){ + QPainter * p = hbqt_par_QPainter( 1 ); + if( p ) + { + if( hb_pcount() >= 4 ) + { + if( HB_ISNUM( 2 ) ) + { + ( p )->drawImage( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QImage( 4 ), hb_parni( 5 ), hb_parni( 6 ), HB_ISNUM( 7 ) ? hb_parni( 7 ) : -1, HB_ISNUM( 8 ) ? hb_parni( 8 ) : -1, ( Qt::ImageConversionFlags ) ( HB_ISNUM( 9 ) ? hb_parni( 9 ) : Qt::AutoColor ) ); + } + else + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QRectF ) + { + ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRectF( 4 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ), *hbqt_par_QRect( 4 ) ); + } + } + } + else if( hb_pcount() == 3 ) + { + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QRectF ) + { + ( p )->drawImage( *hbqt_par_QRectF( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QRect ) + { + ( p )->drawImage( *hbqt_par_QRect( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPointF ) + { + ( p )->drawImage( *hbqt_par_QPointF( 2 ), *hbqt_par_QImage( 3 ) ); + } + else if( q->type == HBQT_TYPE_QPoint ) + { + ( p )->drawImage( *hbqt_par_QPoint( 2 ), *hbqt_par_QImage( 3 ) ); + } + } + } +} +} +//void drawImage ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) +//void drawImage ( const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) +//void drawImage ( const QPointF & point, const QImage & image ) +//void drawImage ( const QPoint & point, const QImage & image ) +//void drawImage ( const QPointF & point, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) +//void drawImage ( const QPoint & point, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) +//void drawImage ( const QRectF & rectangle, const QImage & image ) +//void drawImage ( const QRect & rectangle, const QImage & image ) +//void drawImage ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor ) void drawLine ( ... ){ QPainter * p = hbqt_par_QPainter( 1 ); @@ -158,7 +214,7 @@ void drawLine ( ... ){ } break; case 2: - { + { HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); if( q->type == HBQT_TYPE_QLineF ) @@ -199,74 +255,78 @@ void drawPie ( const QRectF & rectangle, int startAngle, int spanAngle ) void drawPie ( const QRect & rectangle, int startAngle, int spanAngle ) void drawPie ( int x, int y, int width, int height, int startAngle, int spanAngle ) -void hbDrawPixmap ( ... ){ - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); - if( p && p->ph ) +void drawPixmap ( ... ){ + QPainter * p = hbqt_par_QPainter( 1 ); + if( p ) { switch( hb_pcount() ) { case 10: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ), hb_parni( 7 ), hb_parni( 8 ), hb_parni( 9 ), hb_parni( 10 ) ); + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ), hb_parni( 7 ), hb_parni( 8 ), hb_parni( 9 ), hb_parni( 10 ) ); break; case 8: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parni( 7 ), hb_parni( 8 ) ); + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ), hb_parni( 5 ), hb_parni( 6 ), hb_parni( 7 ), hb_parni( 8 ) ); break; case 6: - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ) ); + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), *hbqt_par_QPixmap( 6 ) ); break; case 4: if( HB_ISNUM( 2 ) ) { - hbqt_par_QPainter( 1 )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ) ); - } + ( p )->drawPixmap( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QPixmap( 4 ) ); + } else { - if( p->type == HBQT_TYPE_QRectF ) + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QRectF ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); + ( p )->drawPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); } - else if( p->type == HBQT_TYPE_QRect ) + else if( q->type == HBQT_TYPE_QRect ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); + ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); } - else if( p->type == HBQT_TYPE_QPointF ) + else if( q->type == HBQT_TYPE_QPointF ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); + ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRectF( 4 ) ); } - else if( p->type == HBQT_TYPE_QPoint ) + else if( q->type == HBQT_TYPE_QPoint ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); + ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QRect( 4 ) ); } } break; case 3: - if( p->type == HBQT_TYPE_QRect ) + HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + if( q->type == HBQT_TYPE_QRect ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ) ); + ( p )->drawPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ) ); } - else if( p->type == HBQT_TYPE_QPointF ) + else if( q->type == HBQT_TYPE_QPointF ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ) ); + ( p )->drawPixmap( *hbqt_par_QPointF( 2 ), *hbqt_par_QPixmap( 3 ) ); } - else if( p->type == HBQT_TYPE_QPoint ) + else if( q->type == HBQT_TYPE_QPoint ) { - hbqt_par_QPainter( 1 )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ) ); + ( p )->drawPixmap( *hbqt_par_QPoint( 2 ), *hbqt_par_QPixmap( 3 ) ); } break; } } } -void drawPixmap ( const QRectF & target, const QPixmap & pixmap, const QRectF & source ) -void drawPixmap ( const QRect & target, const QPixmap & pixmap, const QRect & source ) -void drawPixmap ( const QPointF & point, const QPixmap & pixmap, const QRectF & source ) -void drawPixmap ( const QPoint & point, const QPixmap & pixmap, const QRect & source ) -void drawPixmap ( const QPointF & point, const QPixmap & pixmap ) -void drawPixmap ( const QPoint & point, const QPixmap & pixmap ) -void drawPixmap ( int x, int y, const QPixmap & pixmap ) -void drawPixmap ( const QRect & rectangle, const QPixmap & pixmap ) -void drawPixmap ( int x, int y, int width, int height, const QPixmap & pixmap ) -void drawPixmap ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) -void drawPixmap ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) +//void drawPixmap ( const QRectF & target, const QPixmap & pixmap, const QRectF & source ) +//void drawPixmap ( const QRect & target, const QPixmap & pixmap, const QRect & source ) +//void drawPixmap ( const QPointF & point, const QPixmap & pixmap, const QRectF & source ) +//void drawPixmap ( const QPoint & point, const QPixmap & pixmap, const QRect & source ) +//void drawPixmap ( const QPointF & point, const QPixmap & pixmap ) +//void drawPixmap ( const QPoint & point, const QPixmap & pixmap ) +//void drawPixmap ( int x, int y, const QPixmap & pixmap ) +//void drawPixmap ( const QRect & rectangle, const QPixmap & pixmap ) +//void drawPixmap ( int x, int y, int width, int height, const QPixmap & pixmap ) +//void drawPixmap ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) +//void drawPixmap ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) void drawPoint ( const QPointF & position ) @@ -301,7 +361,7 @@ void drawRoundedRect ( const QRectF & rect, qreal xRadius, qreal yRadius, Qt::Si void drawRoundedRect ( const QRect & rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize ) void drawRoundedRect ( int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize ) -void hbDrawText ( ... ){ +void drawText ( ... ){ QPainter * p = hbqt_par_QPainter( 1 ); if( p ) { @@ -310,7 +370,7 @@ void hbDrawText ( ... ){ if( HB_ISNUM( 2 ) ) { if( iP >= 7 ) - { + { ( p )->drawText( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), hbqt_par_QString( 7 ), ( HB_ISPOINTER( 8 ) ? hbqt_par_QRect( 8 ) : 0 ) ); } else if( iP == 4 ) @@ -348,13 +408,13 @@ void hbDrawText ( ... ){ } } } -void drawText ( const QPointF & position, const QString & text ) -void drawText ( const QPoint & position, const QString & text ) -void drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) -void drawText ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 ) -void drawText ( int x, int y, const QString & text ) -void drawText ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 ) -void drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() ) +//void drawText ( const QPointF & position, const QString & text ) +//void drawText ( const QPoint & position, const QString & text ) +//void drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) +//void drawText ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 ) +//void drawText ( int x, int y, const QString & text ) +//void drawText ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 ) +//void drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() ) void drawTiledPixmap ( const QRectF & rectangle, const QPixmap & pixmap, const QPointF & position = QPointF() ) void drawTiledPixmap ( const QRect & rectangle, const QPixmap & pixmap, const QPoint & position = QPoint() )