diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2e83359bda..a49ccd0dc6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,39 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-09 09:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/gtwvt/gtwvt.c + * Indenting. + + * INSTALL + + Added new ghostscript link. [Tamas Tevesz] + (left the old one as it has some information the new one doesn't) + + * contrib/hbqt/hbmk2_qt.hbs + * contrib/hbqt/qtgui/qth/*.qth + * contrib/hbqt/qtcore/hbqt_pointer.cpp + * contrib/hbqt/qtcore/hbqt.h + * contrib/hbqt/qtcore/qth/*.qth + * contrib/hbqt/qtnetwork/qth/*.qth + * contrib/hbqt/qscintilla/qth/*.qth + * contrib/hbqt/qtdesigner/qth/*.qth + + Patch to move wrapper code to C++. [Francesco Perillo] + * My mods: + - Restored the way registerResource() is implemented. + (TODO: needs generic solution) + - Formatting, some cleanups. + - Minor corrections in generated code format (more TBD) + - Deleted some unused code + - Refixed strcpy() usage. + - Added C++ puller for __QT* symbol. + - Added manual version of HBQEventsFromPointer() which is still needed + by hbqtcore. (TOFIX) + Please test. + ; TOFIX: Remove remaining generated .prg, holding this code: + FUNCTION QtClass( ... ) + RETURN HB_QtClass():new( ... ) + Any takers? + 2011-03-08 23:53 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbgs/core.c * HB_GSAPI_REVISION() changed to return integer result like the diff --git a/harbour/INSTALL b/harbour/INSTALL index 58c91d3575..4634ccebd8 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -1513,6 +1513,7 @@ HARBOUR HB_WITH_GD - GD Graphics Library [multiplatform, free, open-source] http://www.boutell.com/gd/ HB_WITH_GS - Ghostscript [multiplatform, free, open-source] + http://www.ghostscript.com/ http://pages.cs.wisc.edu/~ghost/ HB_WITH_JPEG - jpeglib [multiplatform, free, open-source] http://www.ijg.org/ diff --git a/harbour/contrib/hbqt/hbmk2_qt.hbs b/harbour/contrib/hbqt/hbmk2_qt.hbs index 17a03c8daa..b2a65d5d36 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_qt.hbs @@ -1082,7 +1082,7 @@ CREATE CLASS HbQtSource METHOD buildMethodBody( oMtd ) METHOD buildDOC() METHOD buildClass() - METHOD getMethodBody( oMtd, cMtdName, nClsType ) + METHOD getMethodBody( oMtd, cMtdName, aMethods, nClsType ) METHOD buildClassEx() ENDCLASS @@ -1091,6 +1091,7 @@ ENDCLASS METHOD HbQtSource:new( cQtModule, cQtVer, cQTHFileName, cCPPFileName, cPRGFileName, cDOCFileName ) LOCAL cQth, s, n, i, n1, b_, tmp, cOrg, fBody_ + LOCAL f ::hRef := { => } hb_HKeepOrder( ::hRef, .T. ) @@ -1144,10 +1145,13 @@ METHOD HbQtSource:new( cQtModule, cQtVer, cQTHFileName, cCPPFileName, cPRGFileNa /* Separate constructor function */ ::new_:= {} - ::cFunc := "HB_FUNC( QT_" + upper( ::cQtObject ) + " )" + f := "HB_FUNC( QT_" + upper( ::cQtObject ) + " )" + ::cFunc := "HB_FUNC_STATIC( NEW )" - n := ascan( ::code_, {|e| ::cFunc $ e } ) - FOR i := n TO len( ::code_ ) + n := ascan( ::code_, {|e| f $ e } ) + + aadd( ::new_, ::cFunc ) + FOR i := n+1 TO len( ::code_ ) aadd( ::new_, ::code_[ i ] ) IF trim( ::code_[ i ] ) == "}" n1 := i @@ -1283,14 +1287,17 @@ METHOD HbQtSource:new( cQtModule, cQtVer, cQTHFileName, cCPPFileName, cPRGFileNa /*----------------------------------------------------------------------*/ METHOD HbQtSource:build() - LOCAL i, s, oMtd, tmp, tmp1 - LOCAL aLine, aClsExt + LOCAL i, s, oMtd, tmp, tmp1, n, k + LOCAL aLine + LOCAL uQtObject + + uQtObject := upper( ::cQtObject ) ::hRef[ ::cQtObject ] := NIL /* Methods Body */ FOR EACH oMtd IN ::aMethods - ::buildMethodBody( oMtd ) + ::buildMethodBody( oMtd, ::aMethods ) NEXT /* Pull .cpp copyright text */ @@ -1341,8 +1348,23 @@ METHOD HbQtSource:build() /*----------------------------------------------------------------------*/ /* Generate necessary declarations */ + aadd( aLine, "" ) + aadd( aLine, "HB_EXTERN_BEGIN" ) aadd( aLine, "" ) + aadd( aLine, "HB_FUNC_EXTERN( __HB" + Upper( ::cQtModule ) + " );" ) + FOR EACH s IN ::hRef + aadd( aLine, "HB_FUNC_EXTERN( HB_" + upper( s:__enumKey() ) + " );" ) + NEXT + aadd( aLine, "" ) + aadd( aLine, "void _hb_force_link_" + ::cQtObject +"( void )" ) + aadd( aLine, "{" ) + aadd( aLine, " HB_FUNC_EXEC( __HB" + Upper( ::cQtModule ) + " );" ) + FOR EACH s IN ::hRef + aadd( aLine, " HB_FUNC_EXEC( HB_" + upper( s:__enumKey() ) + " );" ) + NEXT + aadd( aLine, "}" ) + aadd( aLine, "" ) FOR EACH s IN ::hRef aadd( aLine, "extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_" + s:__enumKey() + " );" ) NEXT @@ -1353,6 +1375,46 @@ METHOD HbQtSource:build() aadd( aLine, "" ) aadd( aLine, "HB_EXTERN_END" ) aadd( aLine, "" ) + aadd( aLine, "HB_FUNC_EXTERN( " + uQtObject + " );" ) + aadd( aLine, "" ) + aadd( aLine, "HB_INIT_SYMBOLS_BEGIN( __HBQT_CLS_" + uQtObject + "__ )" ) + // aadd( aLine, ' { "' + uQtObject + '", { HB_FS_PUBLIC | HB_FS_LOCAL }, { HB_FUNCNAME( ' + uQtObject + ' ) }, NULL },' ) + aadd( aLine, ' { "HB_' + uQtObject + '", { HB_FS_PUBLIC | HB_FS_LOCAL }, { HB_FUNCNAME( HB_' + uQtObject + ' ) }, NULL }' ) + aadd( aLine, "HB_INIT_SYMBOLS_END( __HBQT_CLS_" + uQtObject + "__ )" ) + + aadd( aLine, "" ) + aadd( aLine, "static void s_registerMethods( HB_USHORT uiClass );" ) + aadd( aLine, "" ) + + n := ascan( ::cls_, {|e_| left( lower( e_[ 1 ] ), 7 ) == "inherit" .and. !empty( e_[ 2 ] ) } ) + s := upper( "HbQtObjectHandler" + iif( n > 0, ", " + strtran( ::cls_[ n, 2 ], "Q", "HB_Q" ), "" ) ) + FOR EACH k IN hb_aTokens( s, "," ) + aadd( aLine, "HB_FUNC_EXTERN( " + upper(alltrim(k)) + " );" ) + NEXT + aadd( aLine, "HB_FUNC_EXTERN( HB_" + uQtObject + " );" ) + aadd( aLine, "" ) + + + aadd( aLine, "HB_FUNC( HB_" + uQtObject + " )" ) + aadd( aLine, "{" ) + aadd( aLine, " static PHB_ITEM s_oClass = NULL;" ) + aadd( aLine, " if( s_oClass == NULL )" ) + aadd( aLine, " {" ) + aadd( aLine, " s_oClass = hb_itemNew( NULL );" ) + FOR EACH k IN hb_aTokens( s, "," ) + aadd( aLine, " HB_FUNC_EXEC( " + upper( alltrim( k ) ) + " );" ) + NEXT + aadd( aLine, ' PHB_ITEM oClass = hbqt_defineClassBegin( "' + uQtObject + '", s_oClass, "' + s + '" );' ) + aadd( aLine, " if( oClass )" ) + aadd( aLine, " {" ) + aadd( aLine, " s_registerMethods( hb_objGetClass( hb_stackReturnItem() ) );" ) + aadd( aLine, " hbqt_defineClassEnd( s_oClass, oClass );" ) + aadd( aLine, " }" ) + aadd( aLine, " return;" ) + aadd( aLine, " }" ) + aadd( aLine, ' hb_objSendMsg( s_oClass, "Instance", 0 );' ) + aadd( aLine, "}" ) + FOR EACH s IN ::hRef IF s:__enumKey() == "QList" /* TOFIX: Ugly hack */ @@ -1504,15 +1566,32 @@ METHOD HbQtSource:build() /* Build the constructor */ aadd( aLine, ::new_[ 1 ] ) // Func definition + aadd( aLine, ::new_[ 2 ] ) // { + aeval( ::getConstructor( 0 ), {|e| aadd( aLine, e ) } ) /* Insert Functions */ aeval( ::txt_, {|e| aadd( aLine, strtran( e, chr( 13 ) ) ) } ) /* A try to generate classes on C++ level - only for QObject, QPaintDevice, QWidget */ - IF !empty( aClsExt := ::buildClassEx() ) - aeval( aClsExt, {|e| aadd( aLine, strtran( e, chr( 13 ) ) ) } ) +// + //IF !empty( aClsExt := ::buildClassEx() ) +// +// aeval( aClsExt, {|e| aadd( aLine, strtran( e, chr( 13 ) ) ) } ) +// + // ENDIF + + aadd( aLine, '' ) + aadd( aLine, 'static void s_registerMethods( HB_USHORT uiClass )' ) + aadd( aLine, '{' ) + aadd( aLine, ' hb_clsAdd( uiClass, ' +padr( '"new"',35) +', HB_FUNCNAME( ' + padr( upper( "NEW" ),35) + ' ) );' ) + FOR EACH oMtd IN ::aMethods + IF !empty( oMtd:cHBFunc ) + aadd( aLine, ' hb_clsAdd( uiClass, ' +padr( '"' + oMtd:cHBFunc +'"',35) +', HB_FUNCNAME( ' + padr( upper( oMtd:cHBFunc ),35) + ' ) );' ) ENDIF + NEXT + aadd( aLine, '}' ) + aadd( aLine, '' ) /* Footer */ hbqtgen_BuildFooter( @aLine, ::cQtVer ) @@ -1533,7 +1612,6 @@ METHOD HbQtSource:build() METHOD HbQtSource:getConstructor( nClsType ) LOCAL i, s, aLine := {} - aadd( aLine, ::new_[ 2 ] ) // { IF nClsType == 1 aadd( aLine, " if( s_p" + ::cQtObject + " == NULL )" ) @@ -1564,7 +1642,7 @@ METHOD HbQtSource:getConstructor( nClsType ) NEXT aadd( aLine, " " ) IF nClsType == 0 - aadd( aLine, " hb_retptrGC( hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, " + iif( ::isDetached, "false", "true" ) + " ) );" ) + aadd( aLine, " hbqt_itemPushReturn( hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, " + iif( ::isDetached, "false", "true" ) + " ) , hb_stackSelfItem() );" ) ELSE aadd( aLine, " hb_arraySetPtrGC( pObject, 1, hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, true ) );" ) ENDIF @@ -1583,13 +1661,39 @@ METHOD HbQtSource:getConstructor( nClsType ) /*----------------------------------------------------------------------*/ -METHOD HbQtSource:getMethodBody( oMtd, cMtdName, nClsType ) +METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType ) LOCAL FP, cTmp, n + LOCAL v, t_ LOCAL txt_:= {} + LOCAL ooMtd, i, a_ + LOCAL q - aadd( txt_, "/* " + strtran( oMtd:cProto, chr(13) ) + " */" ) - //aadd( txt_, "HB_FUNC" + iif( nClsType == 1, "_STATIC", "" ) + "( " + cMtdName + " )" ) - aadd( txt_, "HB_FUNC( " + cMtdName + " )" ) + HB_SYMBOL_UNUSED( cMtdName ) + + // list all the overloaded methods + a_ := {} + FOR EACH ooMtd IN aMethods + IF ooMtd:cFun == oMtd:cFun + aadd( a_, ooMtd ) + ENDIF + NEXT + + oMtd:cCmd := StrTran( oMtd:cCmd, "( )", "()" ) + ";" + + // check for methods already worked + IF ( ascan( ::func_, {|e_| e_[ 1 ] == oMtd:cFun } ) ) > 0 + return {} + ENDIF + + oMtd:cHBFunc := oMtd:cFun + aadd( ::func_, { oMtd:cFun, 0, "" } ) + + aadd( txt_, "/* " + strtran( oMtd:cProto, chr( 13 ) ) + " */" ) + + v := "_" + lower( substr( ::cQtObject, 2 ) ) + + + aadd( txt_, "HB_FUNC_STATIC( " + upper( oMtd:cHBFunc ) + " )" ) aadd( txt_, "{" ) IF !empty( oMtd:fBody_ ) @@ -1598,75 +1702,108 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, nClsType ) IF ! oMtd:isConstructor cTmp := ::cQtObject + iif( ::isList, "< void * >", "" ) IF nClsType == 0 - aadd( txt_, " " + cTmp + " * p = hbqt_par_" + ::cQtObject + "( 1 );" ) + aadd( txt_, " " + cTmp + " * " + v + " = ( " + cTmp + " * ) hbqt_pPtrFromObj( 0 );" ) ELSEIF nClsType == 1 - aadd( txt_, " " + cTmp + " * p = ( " + cTmp + " * ) hbqt_getqtptr();" ) + aadd( txt_, " " + cTmp + " * " + v + " = ( " + cTmp + " * ) hbqt_getqtptr();" ) ENDIF ENDIF /* Insert parameters by reference */ - IF ! empty( oMtd:aPre ) - FOR n := 1 TO len( oMtd:aPre ) - aadd( txt_, " " + oMtd:aPre[ n, 1 ] ) - NEXT - aadd( txt_, "" ) - ENDIF +//REMMED IF ! empty( oMtd:aPre ) +//REMMED FOR n := 1 TO len( oMtd:aPre ) +//REMMED aadd( txt_, " " + oMtd:aPre[ n, 1 ] ) +//REMMED NEXT +//REMMED aadd( txt_, "" ) +//REMMED ENDIF /* One line function body */ +// FP: to check, modificare come sopra IF ! oMtd:isConstructor - IF nClsType == 0 - FP := strtran( oMtd:cCmd, "hbqt_par_" + ::cQtObject + "( 1 )", "( p )" ) - ELSEIF nClsType == 1 - FP := oMtd:cCmdN // strtran( oMtd:cCmdN, "hbqt_par_" + ::cQtObject + "( 1 )", "( p )" ) + aadd( txt_, " if( " + v + " )" ) + aadd( txt_, " {" ) + aadd( txt_, " int pcount = hb_pcount();" ) + ENDIF + + for i := 1 to len( a_ ) + IF ! a_[i]:isConstructor + // change only the first occurrence of the string, to not change parameters + FP := strtran( a_[i]:cCmd, "hbqt_par_" + ::cQtObject + "( 1 )", v, 1, 1 ) + ELSE + FP := oMtd:cCmd ENDIF - aadd( txt_, " if( p )" ) - IF oMtd:nDetach > 0 .OR. "hb_parstr_utf8(" $ oMtd:cCmd - aadd( txt_, " {" ) + + /* Manage Re-Attached */ + IF a_[i]:nAttach > 0 + FP := strtran( FP, ", false", ", true" ) ENDIF - ELSE - FP := oMtd:cCmd - ENDIF - /* Manage Re-Attached */ - IF oMtd:nAttach > 0 - FP := strtran( FP, ", false", ", true" ) - ENDIF + DO CASE + CASE a_[i]:nArgs == 0 + aadd( txt_," " + iif( i > 1 , "else if", "if" ) + "( pcount == 0 )" ) + aadd( txt_," {" ) + aadd( txt_," " + FP + ";" ) + aadd( txt_," }" ) + OTHERWISE - /* Manage detached Argument */ - IF oMtd:nDetach > 0 - aadd( txt_, " hbqt_detachgcpointer( " + hb_ntos( oMtd:nDetach + iif( nClsType == 0, 1, 0 ) ) + " );" ) - ENDIF + t_ := __TY_TYPEScpp( a_[i], a_[i]:nArgsReal ) // return string of checks for real arguments - IF "hb_parstr_utf8(" $ oMtd:cCmd - aadd( txt_, " void * pText = NULL;" ) - ENDIF + if ! empty( t_ ) + t_ := " && " + t_ + endif - IF ! oMtd:isConstructor - aadd( txt_, " " + FP ) - ELSE - aadd( txt_, " " + FP ) - ENDIF + for n := a_[i]:nArgsReal+1 to a_[i]:nArgs + t_ += " && ( pcount < " + hb_ntos( n )+ " || " + hbide_paramCheckStrCpp( a_[i]:hArgs[ n ]:cTypeHB, n, a_[i]:hArgs[ n ]:cCast ) + ")" + next - IF "hb_parstr_utf8(" $ oMtd:cCmd - aadd( txt_, " hb_strfree( pText );" ) - ENDIF - IF ! oMtd:isConstructor - IF oMtd:nDetach > 0 .OR. "hb_parstr_utf8(" $ oMtd:cCmd - aadd( txt_, " }" ) - ENDIF - ENDIF + aadd( txt_, " " + iif( i > 1 , "else if", "if" ) +"( pcount " + ; + iif( a_[i]:nArgsReal == a_[i]:nArgs , "==", "<=" ) + ; + hb_ntos( a_[i]:nArgs ) + " " + t_ + " )" ) - /* Return values back to PRG */ - IF ! empty( oMtd:aPre ) - aadd( txt_, "" ) - FOR n := 1 TO len( oMtd:aPre ) - IF nClsType == 0 - aadd( txt_, " " + oMtd:aPre[ n, 4 ] + "( " + oMtd:aPre[ n, 3 ] + ", " + hb_ntos( oMtd:aPre[ n, 2 ] ) + " );" ) - ELSEIF nClsType == 1 - aadd( txt_, " " + oMtd:aPreN[ n, 4 ] + "( " + oMtd:aPreN[ n, 3 ] + ", " + hb_ntos( oMtd:aPreN[ n, 2 ] ) + " );" ) + aadd( txt_, " {" ) + + IF ! empty( a_[i]:aPre ) + FOR n := 1 TO len( a_[i]:aPre ) + aadd( txt_, " " + a_[i]:aPre[ n, 1 ] ) + NEXT + aadd( txt_, "" ) ENDIF - NEXT - ENDIF + + /* Manage detached Argument */ + IF a_[i]:nDetach > 0 + aadd( txt_, " hbqt_detachgcpointer( " + hb_ntos( a_[i]:nDetach ) + " );" ) + ENDIF + + IF "hb_parstr_utf8(" $ a_[i]:cCmd + aadd( txt_, " void * pText = NULL;" ) + ENDIF + + IF ! a_[i]:isConstructor + aadd( txt_, " " + FP + "; /* REM A1 */" ) + ELSE + aadd( txt_, " " + FP + "; /* REM A2 */") + ENDIF + + IF "hb_parstr_utf8(" $ a_[i]:cCmd + aadd( txt_, " hb_strfree( pText );" ) + ENDIF + + /* Return values back to PRG */ + IF ! empty( a_[i]:aPre ) + aadd( txt_, "" ) + FOR q := 1 TO len( a_[i]:aPre ) + aadd( txt_, " " + a_[i]:aPre[ q, 4 ] + "( " + a_[i]:aPre[ q, 3 ] + ", " + hb_ntos( a_[i]:aPre[ q, 2 ] ) + " );" ) + NEXT + ENDIF + + aadd( txt_, " }" ) + ENDCASE + NEXT + ENDIF + + IF empty( oMtd:fBody_ ) + aadd( txt_, " else " ) + aadd( txt_, " hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); " ) + aadd( txt_, " }" ) ENDIF aadd( txt_, "}" ) aadd( txt_, "" ) @@ -1676,25 +1813,14 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, nClsType ) /*----------------------------------------------------------------------*/ METHOD HbQtSource:buildMethodBody( oMtd ) - LOCAL n, cFunc LOCAL aBdy + LOCAL cFunc oMtd:cCmd := StrTran( oMtd:cCmd, "( )", "()" ) + ";" oMtd:cCmdN := StrTran( oMtd:cCmdN, "( )", "()" ) + ";" - IF ( n := ascan( ::func_, {|e_| e_[ 1 ] == oMtd:cFun } ) ) > 0 - ::func_[ n,2 ]++ - oMtd:cHBFunc := oMtd:cFun + "_" + hb_ntos( ::func_[ n, 2 ] ) - oMtd:isSibling := .t. - IF ( n := ascan( ::aMethods, {|o| o:cFun == oMtd:cFun } ) ) > 0 /* and it must be */ - ::aMethods[ n ]:nSiblings++ - ENDIF - ELSE - oMtd:cHBFunc := oMtd:cFun - aadd( ::func_, { oMtd:cFun, 0, "" } ) - ENDIF + aBdy := ::getMethodBody( oMtd, "QT_" + upper( ::cQtObject ) + "_" + upper( oMtd:cHBFunc ), ::aMethods, 0 ) - aBdy := ::getMethodBody( oMtd, "QT_" + upper( ::cQtObject ) + "_" + upper( oMtd:cHBFunc ), 0 ) aeval( aBdy, {|e| aadd( ::txt_, e ) } ) cFunc := iif( ::areMethodsClubbed, hbqtgen_stripLastFrom( oMtd:cHBFunc, "_" ), oMtd:cHBFunc ) @@ -1758,7 +1884,7 @@ METHOD HbQtSource:buildClassEx() aadd( aClsEx, '' ) #endif FOR EACH oMtd IN ::aMethods - aBdy := ::getMethodBody( oMtd, 'Q' + uObj + '_' + upper( oMtd:cHBFunc ), 1 ) + aBdy := ::getMethodBody( oMtd, 'Q' + uObj + '_' + upper( oMtd:cHBFunc ), ::aMethods, 1 ) aeval( aBdy, {|e| aadd( aClsEx, e ) } ) NEXT aadd( aClsEx, '' ) @@ -1769,7 +1895,9 @@ METHOD HbQtSource:buildClassEx() //aadd( aClsEx, ' hb_clsAdd( usClassH, "PPTR", HB_FUNCNAME( Q' + uObj + '_PPTR ) );' ) //aadd( aClsEx, ' hb_clsAdd( usClassH, "_PPTR", HB_FUNCNAME( Q' + uObj + '__PPTR ) );' ) FOR EACH oMtd IN ::aMethods - aadd( aClsEx, ' hb_clsAdd( usClassH, "' + oMtd:cHBFunc +'", HB_FUNCNAME( Q' + uObj + '_' + upper( oMtd:cHBFunc ) + ' ) );' ) + IF ! empty( oMtd:cHBFunc ) + aadd( aClsEx, ' hb_clsAdd( usClassH, ' +padr( '"' + oMtd:cHBFunc + '"', 30) +', HB_FUNCNAME( ' + padr( upper( oMtd:cHBFunc ), 30 ) + ' ) );' ) + ENDIF NEXT aadd( aClsEx, '' ) aadd( aClsEx, ' return usClassH;' ) @@ -1799,7 +1927,7 @@ METHOD HbQtSource:buildClassEx() /*----------------------------------------------------------------------*/ METHOD HbQtSource:buildClass() - LOCAL s, n, cM, cC, oMtd, oArg, cP, txt_:={}, a_, cMtd, lClub + LOCAL cM, cC, oMtd, oArg, cP, txt_:= {}, lClub lClub := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "clubmethods" .AND. lower( e_[ 2 ] ) == "no" } ) == 0 @@ -1815,7 +1943,7 @@ METHOD HbQtSource:buildClass() cM := alltrim( cM ) ; cM := iif( right( cM,1 ) == ",", substr( cM, 1, len( cM ) - 1 ), cM ) cC := allTrim( cC ) ; cC := iif( right( cC,1 ) == ",", substr( cC, 1, len( cC ) - 1 ), cC ) - cM := oMtd:cHBFunc + "(" + iif( empty( cM ), "", " " ) + cM + iif( empty( cM ), "", " " ) + ")" + cM := oMtd:cHBFunc + "(" + iif( empty( cM ), "", " " ) + cM + iif( empty( cM ), "", " " ) + ")" cC := "Qt_" + ::cQtObject + "_" + oMtd:cHBFunc + "(" + iif( empty( cC ), "", " " ) + cC + iif( empty( cC ), "", " " ) + ")" oMtd:cMtdDef := cM @@ -1825,87 +1953,13 @@ METHOD HbQtSource:buildClass() txt_ := hbqtgen_BuildCopyrightText( 1 ) - aadd( txt_, "" ) - aadd( txt_, "REQUEST __HB" + Upper( ::cQtModule ) ) aadd( txt_, "" ) aadd( txt_, "FUNCTION " + ::cQtObject + "( ... )" ) aadd( txt_, " RETURN HB_" + ::cQtObject + "():new( ... )" ) aadd( txt_, "" ) - aadd( txt_, "FUNCTION " + ::cQtObject + "FromPointer( ... )" ) - aadd( txt_, " RETURN HB_" + ::cQtObject + "():fromPointer( ... )" ) - aadd( txt_, "" ) - n := ascan( ::cls_, {|e_| left( lower( e_[ 1 ] ), 7 ) == "inherit" .and. !empty( e_[ 2 ] ) } ) - s := "CREATE CLASS " + ::cQtObject + " INHERIT HbQtObjectHandler" + iif( n > 0, ", " + strtran( ::cls_[ n, 2 ], "Q", "HB_Q" ), "" ) + " FUNCTION HB_" + ::cQtObject - - aadd( txt_, s ) aadd( txt_, " " ) - aadd( txt_, " METHOD new( ... )" ) aadd( txt_, " " ) - FOR EACH oMtd IN ::aMethods - IF oMtd:areFuncClubbed - cMtd := " METHOD " + oMtd:cHBFunc //+ "( ... )" - ELSE - cMtd := " METHOD " + oMtd:cHBFunc - ENDIF - cMtd := PadR( cMtd, max( 40, len( cMtd ) ) ) + ; - " // " + PadR( "( " + oMtd:cDocs + " )", max( 50, len( "( " + oMtd:cDocs + " )" ) ) ) + ; - " -> " + hbqtgen_prgRetNormalize( oMtd:cPrgRet ) - - IF oMtd:areFuncClubbed - IF ! oMtd:isSibling - aadd( txt_, cMtd ) - ELSE - aadd( txt_, space( 40 ) + ; - " // " + PadR( "( " + oMtd:cDocs + " )", max( 50, len( "( " + oMtd:cDocs + " )" ) ) ) + ; - " -> " + hbqtgen_prgRetNormalize( oMtd:cPrgRet ) ) - ENDIF - ELSE - aadd( txt_, cMtd ) - ENDIF - NEXT - aadd( txt_, " " ) - aadd( txt_, " ENDCLASS" ) - aadd( txt_, " " ) - aadd( txt_, "METHOD " + ::cQtObject + ":new( ... )" ) - aadd( txt_, " LOCAL p" ) - aadd( txt_, " FOR EACH p IN { ... }" ) - aadd( txt_, " hb_pvalue( p:__enumIndex(), __hbqt_ptr( p ) )" ) - aadd( txt_, " NEXT" ) - aadd( txt_, " ::pPtr := Qt_" + ::cQtObject + "( ... )" ) - aadd( txt_, " RETURN Self" ) - aadd( txt_, " " ) - - FOR EACH oMtd IN ::aMethods - IF "..." $ oMtd:cMtdDef /* reworked at c++ level - embed as is */ - aadd( txt_, "METHOD " + ::cQtObject + ":" + oMtd:cMtdDef ) - hbide_addReturnMethod( txt_, oMtd, ::cQtObject, 3, 1, .f., .f., 0, NIL ) - aadd( txt_, "" ) - - ELSEIF oMtd:areFuncClubbed .AND. oMtd:nSiblings > 0 /* has more calls with same name */ - aadd( txt_, "METHOD " + ::cQtObject + ":" + oMtd:cHBFunc + "( ... )" ) - a_:= hbide_pullSameMethods( oMtd:cFun, ::aMethods, ::cQtObject ) - aeval( a_, {|e| aadd( txt_, e ) } ) - aadd( txt_, " RETURN __hbqt_error()" ) - aadd( txt_, "" ) - - ELSEIF oMtd:areFuncClubbed .AND. oMtd:isSibling /* is another call with same name handedlled previously - do nothing */ - // Skip - - ELSE /* as usual */ - IF oMtd:areFuncClubbed - aadd( txt_, "METHOD " + ::cQtObject + ":" + oMtd:cHBFunc + "( ... )" ) - a_:= hbide_pullSameMethods( oMtd:cFun, ::aMethods, ::cQtObject ) - aeval( a_, {|e| aadd( txt_, e ) } ) - aadd( txt_, " RETURN __hbqt_error()" ) - aadd( txt_, "" ) - ELSE - aadd( txt_, "METHOD " + ::cQtObject + ":" + oMtd:cHBFunc + "( ... )" ) - hbide_addReturnMethod( txt_, oMtd, ::cQtObject, 3, 1, .f., .f., 0, NIL ) - aadd( txt_, "" ) - ENDIF - ENDIF - NEXT IF !empty( ::subCls_ ) aadd( txt_, "" ) @@ -1931,293 +1985,49 @@ STATIC FUNCTION hbqtgen_prgRetNormalize( cPrgRet ) /*----------------------------------------------------------------------*/ -STATIC FUNCTION hbide_pullSameMethods( cFun, aMethods, cQtObject ) - LOCAL i, oMtd, a_:={}, b_:={}, c_:={}, nArgs, n, txt_:={} - LOCAL cSpc, cCrc, lFirst, nMtds, nTySame, lInIf +STATIC FUNCTION hbide_paramCheckStrCpp( cType, nArg, cCast ) - FOR EACH oMtd IN aMethods - IF oMtd:cFun == cFun - aadd( a_, oMtd ) - ENDIF - NEXT - asort( a_, , , {|e,f| strzero( e:nArgs,2 ) + iif( e:nArgs == 0, "", e:hArgs[ 1 ]:cTypeHB ) > strzero( f:nArgs, 2 ) + iif( f:nArgs == 0, "", f:hArgs[ 1 ]:cTypeHB ) } ) - - /* know the maximum groups by number of parameters - first CASE */ - aeval( a_, {|o| iif( ascan( b_, o:nArgs ) == 0, aadd( b_, o:nArgs ), NIL ) } ) - - /* also take into account optional arguments if any */ - FOR EACH oMtd IN a_ - IF oMtd:nArgsReal < oMtd:nArgs - FOR i := oMtd:nArgs - 1 TO oMtd:nArgsReal STEP -1 - IF ascan( b_, i ) == 0 - aadd( b_, i ) - ENDIF - NEXT - ENDIF - NEXT - - /* Build the structure number of parameters wise */ - FOR EACH nArgs IN b_ - aadd( c_, { nArgs, {}, {}, {} } ) - n := len( c_ ) - FOR EACH oMtd IN a_ - IF oMtd:nArgs == nArgs - aadd( c_[ n,2 ], oMtd ) - ENDIF - NEXT - /* Again append methods with optional arguments */ - FOR EACH oMtd IN a_ - IF oMtd:nArgsReal < oMtd:nArgs - FOR i := oMtd:nArgs - 1 TO oMtd:nArgsReal STEP -1 - IF i == nArgs - aadd( c_[ n,2 ], oMtd ) - ENDIF - NEXT - ENDIF - NEXT - NEXT - - /* stack groups based on parameters descending */ - asort( c_, , , {|e,f| e[ 1 ] > f[ 1 ] } ) - - /* again sort no of arguments based methods by type of arguments */ - FOR i := 10 TO 0 STEP -1 /* consider maximum 10 arguments */ - IF ( n := ascan( c_, {|e_| e_[ 1 ] == i } ) ) > 0 - a_:= c_[ n,2 ] - asort( a_, , , {|e,f| __TY( e, c_[ n,1 ] ) < __TY( f, c_[ n,1 ] ) } ) - ENDIF - NEXT - - cSpc := " " - aadd( txt_, cSpc + "SWITCH PCount()" ) - FOR EACH b_ IN c_ - n := b_[ 1 ] - a_:= b_[ 2 ] - aadd( txt_, cSpc + "CASE " + hb_ntos( n ) ) /* number of parameters */ - cCrc := "xxx" - nMtds := 0 - lInIf := .f. - nTySame := 0 - IF n > 0 - lFirst := .t. - aadd( txt_, cSpc + cSpc + "DO CASE" ) /* type of parameters */ - ENDIF - FOR EACH oMtd IN a_ - IF n > 0 - IF cCrc != __TY( oMtd, n ) - cCrc := __TY( oMtd, n ) - nMtds := 0 - nTySame := 0 - aeval( a_, {|o| iif( __TY( o,n ) == cCrc, nTySame++, NIL ) } ) - lInIf := oMtd:nArgQCast > 0 .AND. oMtd:nArgQCast <= n .AND. nTySame > 1 - IF ! lFirst - lFirst := .t. - aadd( txt_, cSpc + cSpc + "ENDCASE" ) - ENDIF - aadd( txt_, cSpc + cSpc + "CASE " + __TY_TYPES( oMtd,n ) ) - ENDIF - ENDIF - nMtds++ - hbide_addReturnMethod( txt_, oMtd, cQtObject, iif( n == 0, 6, 9 ), nMtds, .t., lInIf, nTySame, n ) - NEXT - IF n > 0 - aadd( txt_, cSpc + cSpc + "ENDCASE" ) - aadd( txt_, cSpc + cSpc + "EXIT" ) - ENDIF - NEXT - aadd( txt_, cSpc + "ENDSWITCH" ) - - RETURN txt_ - -/*----------------------------------------------------------------------*/ - -STATIC PROCEDURE hbide_addReturnMethod( txt_, oM, cQtObject, nInd, nCount, lClubbed, lInIf, nTySame, nArgToCheck ) - LOCAL cFun, sp := space( nInd ) - LOCAL cRetCast := oM:oRet:cCast - LOCAL cRetCastT := trim( cRetCast ) - LOCAL cPostFix := "" - LOCAL cPreFix - - HB_SYMBOL_UNUSED( lClubbed ) - - IF lInIf == NIL - lInIf := .F. - ENDIF - IF nTySame == NIL - nTySame := 0 - ENDIF - IF nArgToCheck == NIL - nArgToCheck := oM:nArgs - ENDIF - - cPreFix := "" - - IF ! ( "::" $ cRetCast ) .AND. ; - ! ( "<" $ cRetCast ) .AND. ; - ! ( cRetCast $ "QString,QRgb" ) .AND. ; - ( left( cRetCast, 1 ) == "Q" .OR. left( cRetCast, 3 ) == "HBQ" ) - - cFun := cRetCast + "FromPointer( " + "Qt_" + cQtObject + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )" - - ELSEIF "<" $ cRetCast - cFun := "QList" + "FromPointer( " + "Qt_" + cQtObject + "_" + oM:cHBFunc + "( ::pPtr, ... )" + " )" - - ELSE - cFun := "Qt_" + cQtObject + "_" + oM:cHBFunc + "( ::pPtr, ... )" - - ENDIF - - IF nTySame > 0 .AND. lInIf - // HB_TRACE( HB_TR_DEBUG, oM:nArgQCast, oM:nArgs ) - - IF oM:nArgQCast == 0 - aadd( txt_, sp + "// " + "RETURN " + cFun + cPostFix ) - // HB_TRACE( HB_TR_DEBUG, "// RETURN " + cFun + cPostFix ) /* needed to refine the engine further */ - IF nTySame > 1 .AND. nCount == nTySame - aadd( txt_, sp + "ENDSWITCH" ) - ENDIF - RETURN - ENDIF - - IF nTySame > 1 .AND. nCount == 1 - aadd( txt_, sp + "SWITCH " + hbide_getSwitch( oM, nArgToCheck ) ) - ENDIF - IF nTySame > 1 - aadd( txt_, sp + "CASE " + hbide_getCase( oM, nArgToCheck ) ) - IF cRetCastT == "void" - aadd( txt_, sp + " " + cPrefix + cFun + " ; " + "RETURN Self" + cPostFix ) - ELSE - aadd( txt_, sp + " " + cPrefix + "RETURN " + cFun + cPostFix ) - ENDIF - ELSE - aadd( txt_, sp + "IF __objGetClsName( hb_pvalue( " + hb_ntos( oM:nArgQCast ) + " ) ) == " + '"' + upper( oM:hArgs[ oM:nArgQCast ]:cCast ) + '"' ) - IF cRetCastT == "void" - aadd( txt_, sp + " " + cPrefix + cFun + " ; " + "RETURN Self" + cPostFix ) - ELSE - aadd( txt_, sp + " " + cPrefix + "RETURN " + cFun + cPostFix ) - ENDIF - aadd( txt_, sp + "ENDIF" ) - ENDIF - IF nTySame > 1 .AND. nCount == nTySame - aadd( txt_, sp + "ENDSWITCH" ) - ENDIF - ELSE - IF nCount > 1 - aadd( txt_, sp + "// " + "RETURN " + cFun + cPostFix ) - // HB_TRACE( HB_TR_DEBUG, "// RETURN " + cFun + cPostFix ) /* needed to refine the engine further */ - ELSE - IF "..." $ cFun - IF cRetCastT == "void" - aadd( txt_, sp + cPrefix + cFun + " ; " + "RETURN Self" + cPostFix ) - ELSE - aadd( txt_, sp + cPrefix + "RETURN " + cFun + cPostFix ) - ENDIF - ELSE - IF cRetCastT == "void" - aadd( txt_, sp + cFun + " ; " + "RETURN Self" + cPostFix ) - ELSE - aadd( txt_, sp + "RETURN " + cFun + cPostFix ) - ENDIF - ENDIF - ENDIF - ENDIF - - RETURN - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION hbide_getCase( oMtd, nArgs ) - LOCAL nFirst := oMtd:nArgQCast - LOCAL n, oArg, nNext := 0 - - FOR EACH oArg IN oMtd:hArgs - n := oArg:__enumIndex() - IF n > nFirst .AND. n <= nArgs - IF oArg:cTypeHB $ "O" // "PO" - nNext := n - EXIT - ENDIF - ENDIF - NEXT - - IF nNext > 0 - RETURN '"' + upper( oMtd:hArgs[ nFirst ]:cCast ) + upper( oMtd:hArgs[ nNext ]:cCast ) + '"' - ELSE - RETURN '"' + upper( oMtd:hArgs[ nFirst ]:cCast ) + '"' - ENDIF - - RETURN "" - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION hbide_getSwitch( oMtd, nArgs ) - LOCAL nFirst := oMtd:nArgQCast - LOCAL n, oArg, nNext := 0 - - FOR EACH oArg IN oMtd:hArgs - n := oArg:__enumIndex() - IF n > nFirst .AND. n <= nArgs - IF oArg:cTypeHB $ "PO" - nNext := n - EXIT - ENDIF - ENDIF - NEXT - - IF nNext > 0 - RETURN "__objGetClsName( hb_pvalue( " + hb_ntos( nFirst ) + " ) )" + " + " + "__objGetClsName( hb_pvalue( " + hb_ntos( nNext ) + " ) )" - ELSE - RETURN "__objGetClsName( hb_pvalue( " + hb_ntos( nFirst ) + " ) )" - ENDIF - - RETURN "" - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION hbide_paramCheckStr( cType, nArg ) + HB_SYMBOL_UNUSED( cCast ) SWITCH cType CASE "PB" -// RETURN "( " + "hb_isBlock( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + " .OR. " + "hb_isPointer( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )" - RETURN "( " + " hb_pvalue( " + hb_ntos( nArg ) + " )" + " != NIL )" - CASE "P" - RETURN "hb_isPointer( hb_pvalue( " + hb_ntos( nArg ) + " ) )" +// RETURN "( " + "hb_isBlock( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + " .OR. " + "hb_isPointer( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )" + RETURN "! HB_ISNIL( " + hb_ntos( nArg ) + " )" + CASE "P" //TODO + RETURN "HB_ISPOINTER( " + hb_ntos( nArg ) + " )" CASE "O" - RETURN "hb_isObject( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + // RETURN "hbqt_isObjectType( " + hb_ntos( nArg ) + ", HBQT_TYPE_" + cCast + " )" + RETURN "HB_ISOBJECT( " + hb_ntos( nArg ) + " )" CASE "CO" - RETURN "( hb_isObject( hb_pvalue( " + hb_ntos( nArg ) + " ) ) .OR. hb_isChar( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )" + // RETURN "( hbqt_isObjectType( " + hb_ntos( nArg ) + " , HBQT_TYPE_" + cCast + " ) || HB_ISCHAR( " + hb_ntos( nArg ) + " ) )" + RETURN "( HB_ISOBJECT( " + hb_ntos( nArg ) + " ) || HB_ISCHAR( " + hb_ntos( nArg ) + " ) )" + CASE "N*" + RETURN "HB_ISBYREF( " + hb_ntos( nArg ) + " )" CASE "N" - RETURN "hb_isNumeric( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + RETURN "HB_ISNUM( " + hb_ntos( nArg ) + " )" + CASE "L*" + RETURN "HB_ISBYREF( " + hb_ntos( nArg ) + " )" CASE "L" - RETURN "hb_isLogical( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + RETURN "HB_ISLOG( " + hb_ntos( nArg ) + " )" CASE "C" - RETURN "hb_isChar( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + RETURN "HB_ISCHAR( " + hb_ntos( nArg ) + " )" ENDSWITCH + RETURN "" - /*----------------------------------------------------------------------*/ -STATIC FUNCTION __TY_TYPES( oM, nArgs ) +STATIC FUNCTION __TY_TYPEScpp( oM, nArgs ) LOCAL i, s := "" FOR i := 1 TO nArgs - s += hbide_paramCheckStr( oM:hArgs[ i ]:cTypeHB, i ) + " .AND. " + s += hbide_paramCheckStrCpp( oM:hArgs[ i ]:cTypeHB, i, oM:hArgs[ i ]:cCast ) + " && " NEXT - IF " .AND. " $ s - s := substr( s, 1, len( s ) - 7 ) + IF " && " $ s + s := substr( s, 1, len( s ) - 4 ) ENDIF RETURN s /*----------------------------------------------------------------------*/ -STATIC FUNCTION __TY( oM, nArgs ) - LOCAL i, s := "" - FOR i := 1 TO nArgs - s += PadR( oM:hArgs[ i ]:cTypeHB, 3 ) - NEXT - RETURN s - -/*----------------------------------------------------------------------*/ - METHOD HbQtSource:buildDOC() LOCAL cText, n, n1, n2, nLen, pWidget, cRet, cLib, i, cInherits @@ -2379,7 +2189,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) IF !empty( oMtd:cPar ) /* Arguments Parsing */ aArg := hb_ATokens( oMtd:cPar, "," ) - aeval( aArg, {|e,i| aArg[ i ] := alltrim( e ) } ) + aeval( aArg, {| e, i | aArg[ i ] := alltrim( e ) } ) FOR EACH cArg IN aArg nIndex := cArg:__enumIndex() @@ -2387,7 +2197,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg := HbqtArgument():new( cArg, ::cQtObject, ::enum_, .f., .f. ) oMtd:hArgs[ nIndex ] := oArg - oMtd:nHBIdx := nIndex + 1 // iif( oMtd:isConstructor, 0, 1 ) + oMtd:nHBIdx := nIndex // iif( oMtd:isConstructor, 0, 1 ) oMtd:nHBIdxN := nIndex cHBIdx := hb_ntos( oMtd:nHBIdx ) cHBIdxN := hb_ntos( nIndex ) @@ -2430,7 +2240,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg:cBody := "&i" + oMtd:cDocNM oArg:cBodyN := "&i" + oMtd:cDocNM oArg:cDoc := "@n" + oMtd:cDocNM - oArg:cTypeHB := "N" + oArg:cTypeHB := "N*" CASE oArg:cCast $ ::cIntLong .and. oArg:lFar aadd( oMtd:aPre, { oArg:cCast + " i" + oMtd:cDocNM + " = 0;", oMtd:nHBIdx, "i" + oMtd:cDocNM, "hb_stornl" } ) @@ -2438,7 +2248,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg:cBody := "&i" + oMtd:cDocNM oArg:cBodyN := "&i" + oMtd:cDocNM oArg:cDoc := "@n" + oMtd:cDocNM - oArg:cTypeHB := "N" + oArg:cTypeHB := "N*" CASE oArg:cCast $ ::cIntLongLong .and. oArg:lFar aadd( oMtd:aPre, { oArg:cCast + " i" + oMtd:cDocNM + " = 0;", oMtd:nHBIdx, "i" + oMtd:cDocNM, "hb_stornint" } ) @@ -2446,7 +2256,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg:cBody := "&i" + oMtd:cDocNM oArg:cBodyN := "&i" + oMtd:cDocNM oArg:cDoc := "@n" + oMtd:cDocNM - oArg:cTypeHB := "N" + oArg:cTypeHB := "N*" CASE oArg:cCast $ ::cInt IF !empty( oArg:cDefault ) .AND. !( oArg:cDefault == "0" ) @@ -2498,7 +2308,7 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg:cBody := "&qr" + oMtd:cDocNM oArg:cBodyN := "&qr" + oMtd:cDocNM oArg:cDoc := "@n" + oMtd:cDocNM - oArg:cTypeHB := "N" + oArg:cTypeHB := "N*" CASE oArg:cCast $ "double,qreal,float" oArg:cBody := "hb_parnd( " + cHBIdx + " )" @@ -2509,7 +2319,12 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) CASE oArg:cCast == "uchar" .and. oArg:lFar .and. ! oArg:lConst /* TOFIX: Such code is not valid and should never be generated (const->non-const) [vszakats] */ oArg:cBody := "( uchar * ) hb_parc( " + cHBIdx + " )" - oArg:cBodyN := "( uchar * ) hb_parc( " + cHBIdxN + " )" + oArg:cDoc := "c" + oMtd:cDocNM + oArg:cTypeHB := "C" + + CASE oArg:cCast == "uchar" .and. oArg:lFar .and. oArg:lConst + oArg:cBody := "( const uchar * ) hb_parc( " + cHBIdx + " )" + oArg:cBodyN := "( uchar ) hb_parni( " + cHBIdxN + " )" oArg:cDoc := "c" + oMtd:cDocNM oArg:cTypeHB := "C" @@ -2585,13 +2400,13 @@ METHOD HbQtSource:parseProto( cProto, fBody_ ) oArg:cBodyN := "hb_parstr_utf8( " + cHBIdxN + ", &pText, NULL )" oArg:cDoc := "c" + oMtd:cDocNM // oArg:cCast - W R O N G oArg:cTypeHB := "C" - +#if 0 CASE oArg:cCast == "FT_Face" oArg:cBody := "hbqt_par_FT_Face( " + cHBIdx + " )" oArg:cBodyN := "hbqt_par_FT_Face( " + cHBIdxN + " )" oArg:cDoc := "c" + oMtd:cDocNM oArg:cTypeHB := "C" - +#endif CASE oArg:cCast == "QIcon" cRef := "QIcon" s := "*hbqt_par_QIcon( " + cHBIdx + " )" @@ -2706,13 +2521,13 @@ METHOD HbQtSource:buildCppCode( oMtd ) oMtd:cParas := iif( oMtd:isVariable(), "", "( " + oMtd:cParas + " )" ) oMtd:cParasN := iif( oMtd:isVariable(), "", "( " + oMtd:cParasN + " )" ) oMtd:cCmn := oMtd:cWdg + oMtd:cFun + oMtd:cParas - oMtd:cCmnN := "( p )->" + oMtd:cFun + oMtd:cParasN + oMtd:cCmnN := "( _" + lower( substr( ::cQtObject, 2 ) ) + " )->" + oMtd:cFun + oMtd:cParasN oMtd:cDocNMRet := HBQTGEN_THIS_PROPER( oRet:cName ) DO CASE CASE oMtd:isConstructor - oMtd:cCmd := "hb_retptrGC( hbqt_gcAllocate_" + ::cQtObject + "( new " + oRet:cCast + "( " + cPara + " ), true ) )" - oMtd:cCmdN := "hb_retptrGC( hbqt_gcAllocate_" + ::cQtObject + "( new " + oRet:cCast + "( " + cParaN + " ), true ) )" + oMtd:cCmd := "hbqt_create_objectGC( hbqt_gcAllocate_" + ::cQtObject + "( new " + oRet:cCast + "( " + cPara + " ), true )" + ', "HB_' + upper(::cQtObject) +'")' + oMtd:cCmdN := "hbqt_create_objectGC( hbqt_gcAllocate_" + ::cQtObject + "( new " + oRet:cCast + "( " + cParaN + " ), true )" + ', "HB_' + upper( ::cQtObject ) + '")' oMtd:cPrgRet := "o" + ::cQtObject // "p" CASE "<" $ oRet:cCast @@ -2735,8 +2550,8 @@ METHOD HbQtSource:buildCppCode( oMtd ) oMtd:cPrgRet := "" OTHERWISE cRef := "QList" - oMtd:cCmd := "hb_retptrGC( hbqt_gcAllocate_QList( new " + oRet:cCast + "( " + oMtd:cCmn + " ), true ) )" - oMtd:cCmdN := "hb_retptrGC( hbqt_gcAllocate_QList( new " + oRet:cCast + "( " + oMtd:cCmnN + " ), true ) )" + oMtd:cCmd := "hbqt_create_objectGC( hbqt_gcAllocate_QList( new " + oRet:cCast + "( " + oMtd:cCmn + " ), true ) " + ', "HB_' + upper( ::cQtObject ) + '" )' + oMtd:cCmdN := "hbqt_create_objectGC( hbqt_gcAllocate_QList( new " + oRet:cCast + "( " + oMtd:cCmnN + " ), true ) " + ', "HB_' + upper( ::cQtObject ) + '" )' oMtd:cPrgRet := "o" + oMtd:cDocNMRet ENDCASE @@ -2823,8 +2638,8 @@ METHOD HbQtSource:buildCppCode( oMtd ) oRet:lConst .AND. ; "Abstract" $ oRet:cCast cRef := oRet:cCast - oMtd:cCmd := "hb_retptrGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmn + ", false ) )" - oMtd:cCmdN := "hb_retptrGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmnN + ", false ) )" + oMtd:cCmd := "hbqt_create_objectGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmn + ", false ) " + ', "HB_' + upper( ::cQtObject ) + '" )' + oMtd:cCmdN := "hbqt_create_objectGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmnN + ", false ) " + ', "HB_' + upper( ::cQtObject ) + '" )' oMtd:cPrgRet := "o" + oMtd:cDocNMRet //p CASE hbqtgen_isAqtObject( oRet:cCast ) .AND. ; @@ -2832,8 +2647,8 @@ METHOD HbQtSource:buildCppCode( oMtd ) oRet:lConst .AND. ; oRet:lVirt cRef := oRet:cCast - oMtd:cCmd := "hb_retptrGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmn + ", false ) )" - oMtd:cCmdN := "hb_retptrGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmnN + ", false ) )" + oMtd:cCmd := "hbqt_create_objectGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmn + ", false ) " + ', "HB_' + upper( ::cQtObject ) + '" )' + oMtd:cCmdN := "hbqt_create_objectGC( hbqt_gcAllocate_" + oRet:cCast + "( ( void * ) " + oMtd:cCmnN + ", false ) " + ', "HB_' + upper( ::cQtObject ) + '" )' oMtd:cPrgRet := "o" + oMtd:cDocNMRet //p CASE hbqtgen_isAqtObject( oRet:cCast ) .AND. ; @@ -2870,14 +2685,11 @@ METHOD HbQtSource:buildCppCode( oMtd ) oMtd:cCmd := hbqtgen_Get_Command( oRet:cCast, oMtd:cCmn ) oMtd:cCmdN := hbqtgen_Get_Command( oRet:cCast, oMtd:cCmnN ) oMtd:cPrgRet := "o" + oMtd:cDocNMRet //p - ELSE oMtd:cError := "<<< " + oMtd:cProto + " | " + oRet:cCast + " >>>" oMtd:cCmd := "" oMtd:cCmdN := "" oMtd:cPrgRet := "" - //OutStd( oMtd:cError + hb_eol() ) - ENDIF ENDCASE @@ -3059,7 +2871,7 @@ METHOD HbqtArgument:new( cTxt, cQtObject, enum_, lConstL, lIsRetArg ) /*----------------------------------------------------------------------*/ STATIC FUNCTION hbqtgen_Get_Command_1( cWgt, cCmn ) - RETURN "hb_retptrGC( hbqt_gcAllocate_" + cWgt + "( new " + cWgt + "( *( " + cCmn + " ) ), true ) )" + RETURN "hbqt_create_objectGC( hbqt_gcAllocate_" + cWgt + "( new " + cWgt + "( *( " + cCmn + " ) ), true ) , " + '"HB_' + upper( cWgt ) +'")' /*----------------------------------------------------------------------*/ @@ -3070,9 +2882,9 @@ STATIC FUNCTION hbqtgen_Get_Command( cWgt, cCmn, lNew ) ENDIF IF lNew - RETURN "hb_retptrGC( hbqt_gcAllocate_" + cWgt + "( new " + cWgt + "( " + cCmn + " ), true ) )" + RETURN "hbqt_create_objectGC( hbqt_gcAllocate_" + cWgt + "( new " + cWgt + "( " + cCmn + " ), true ) , " + '"HB_' + upper( cWgt ) +'" )' ELSE - RETURN "hb_retptrGC( hbqt_gcAllocate_" + cWgt + "( " + cCmn + ", false ) )" + RETURN "hbqt_create_objectGC( hbqt_gcAllocate_" + cWgt + "( " + cCmn + ", false ) , " + '"HB_' + upper( cWgt ) +'" )' ENDIF RETURN "" @@ -3123,7 +2935,7 @@ STATIC FUNCTION hbqtgen_PullOutFuncBody( protos_, nFrom ) /*----------------------------------------------------------------------*/ STATIC FUNCTION hbqtgen_isAqtObject( cCast ) - RETURN left( cCast, 1 ) == "Q" .OR. left( cCast, 3 ) == "HBQ" + RETURN Left( cCast, 1 ) == "Q" .OR. Left( cCast, 3 ) == "HBQ" /*----------------------------------------------------------------------*/ @@ -3132,8 +2944,6 @@ STATIC FUNCTION hbqtgen_CreateTarget( cFile, txt_ ) AEval( txt_, { |e| cContent += RTrim( e ) + hb_eol() } ) -// OUTSTD( "OUT: ", cFile, hb_eol() ) - RETURN hb_MemoWrit( cFile, cContent ) /*----------------------------------------------------------------------*/ @@ -3149,11 +2959,15 @@ STATIC FUNCTION hbqtgen_BuildCopyrightText( nMode, cQtVer ) aadd( txt_, "" ) IF nMode == 0 aadd( txt_, '#include "hbqt.h"' ) + aadd( txt_, '#include "hbapiitm.h"' ) + aadd( txt_, '#include "hbvm.h"' ) + aadd( txt_, '#include "hbapierr.h"' ) + aadd( txt_, '#include "hbstack.h"' ) + aadd( txt_, '#include "hbdefs.h"' ) + aadd( txt_, '#include "hbapicls.h"' ) aadd( txt_, "" ) aadd( txt_, "#if QT_VERSION >= " + cQtVer ) aadd( txt_, "" ) - ELSEIF nMode == 1 - aadd( txt_, '#include "hbclass.ch"' ) ENDIF RETURN txt_ diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciDocument.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciDocument.qth index 4f249d503c..ab5327fe97 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciDocument.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciDocument.qth @@ -36,7 +36,7 @@ Folder = hbqscintilla */ HB_FUNC( QT_QSCIDOCUMENT ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QsciDocument( *hbqt_par_QsciDocument( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciLexerCPP.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciLexerCPP.qth index ebb874a313..14f473d7f4 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciLexerCPP.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciLexerCPP.qth @@ -36,7 +36,7 @@ Folder = hbqscintilla */ HB_FUNC( QT_QSCILEXERCPP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QsciLexerCPP( hbqt_par_QObject( 1 ) ) ); } @@ -44,7 +44,7 @@ HB_FUNC( QT_QSCILEXERCPP ) { __HB_RETPTRGC__( new QsciLexerCPP( 0, hb_parl( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISLOG( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISLOG( 2 ) ) { __HB_RETPTRGC__( new QsciLexerCPP( hbqt_par_QObject( 1 ), hb_parl( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciLexerFlagship.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciLexerFlagship.qth index e1a0fb4e56..ead7062f83 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciLexerFlagship.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciLexerFlagship.qth @@ -36,7 +36,7 @@ Folder = hbqscintilla */ HB_FUNC( QT_QSCILEXERFLAGSHIP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QsciLexerFlagship( hbqt_par_QObject( 1 ) ) ); } @@ -44,7 +44,7 @@ HB_FUNC( QT_QSCILEXERFLAGSHIP ) { __HB_RETPTRGC__( new QsciLexerFlagship( 0, hb_parl( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISLOG( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISLOG( 2 ) ) { __HB_RETPTRGC__( new QsciLexerFlagship( hbqt_par_QObject( 1 ), hb_parl( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciScintilla.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciScintilla.qth index 7d65511896..2fa619f36e 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciScintilla.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciScintilla.qth @@ -73,7 +73,7 @@ Folder = hbqscintilla */ HB_FUNC( QT_QSCISCINTILLA ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QsciScintilla( hbqt_par_QWidget( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciStyledText.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciStyledText.qth index 67a51a9cf2..82c6909ef5 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciStyledText.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciStyledText.qth @@ -40,7 +40,7 @@ HB_FUNC( QT_QSCISTYLEDTEXT ) { __HB_RETPTRGC__( new QsciStyledText( hbqt_par_QString( 1 ), hb_parni( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QsciStyledText( hbqt_par_QString( 1 ), *hbqt_par_QsciStyle( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/hbqt.h b/harbour/contrib/hbqt/qtcore/hbqt.h index 4b23e3613e..3e16b68409 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt.h +++ b/harbour/contrib/hbqt/qtcore/hbqt.h @@ -97,13 +97,17 @@ extern HB_EXPORT void * hbqt_gcpointer( int iParam ); extern HB_EXPORT void * hbqt_detachgcpointer( int iParam ); extern HB_EXPORT const HB_GC_FUNCS * hbqt_gcFuncs( void ); extern HB_EXPORT void * hbqt_pPtrFromObj( int iParam ); -extern HB_EXPORT int hbqt_IsObjectType( int iParam, HB_U32 iType ); +extern HB_EXPORT int hbqt_isObjectType( int iParam, HB_U32 iType ); /* check if parameter iParam is EXACTLY of type iType */ extern HB_EXPORT void hbqt_errRT_ARG( void ); extern HB_EXPORT PHB_ITEM hbqt_defineClassBegin( const char* szClsName, PHB_ITEM s_oClass, const char* szParentClsStr ); extern HB_EXPORT void hbqt_defineClassEnd( PHB_ITEM s_oClass, PHB_ITEM oClass ); extern HB_EXPORT void * hbqt_getqtptr( void ); extern HB_EXPORT PHB_ITEM hbqt_create_object( void * pObject, const char * pszObjectName ); extern HB_EXPORT PHB_ITEM hbqt_create_objectGC( void * pObject, const char * pszObjectName ); +extern HB_EXPORT void hbqt_itemPushReturn( void* ptr, PHB_ITEM pSelf ); +extern HB_EXPORT void hbqt_set_pptr( void * ptr, PHB_ITEM pSelf ); +extern HB_EXPORT HBQT_GC_T * hbqt_getObjectGC( int iParam ); /* returns a pointer to the HBQT_GC_T area */ + HB_EXTERN_END #define hbqt_par_QString( n ) ( ( QString ) hb_parcx( n ) ) diff --git a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg index e7e8ac3329..931da8691b 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg +++ b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg @@ -121,6 +121,14 @@ METHOD HbQtObjectHandler:onError() /*----------------------------------------------------------------------*/ +/* TOFIX: Eliminate that */ +STATIC FUNCTION HBQEventsFromPointer( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), __hbqt_ptr( p ) ) + NEXT + RETURN HB_HBQEvents():fromPointer( ... ) + METHOD HbQtObjectHandler:connect( cnEvent, bBlock ) LOCAL nResult diff --git a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp index 3b56fe3b22..d78a0606c4 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp @@ -55,7 +55,9 @@ #include "hbqt.h" +#include "hbapi.h" #include "hbapiitm.h" +#include "hbapicls.h" #include "hbinit.h" #include "hbapierr.h" #include "hbvm.h" @@ -175,34 +177,135 @@ void * hbqt_gcpointer( int iParam ) void * hbqt_pPtrFromObj( int iParam ) { + static PHB_DYNS s_pDyns_hPPtrAssign = NULL; PHB_ITEM pObj; + void * pointer; HB_TRACE( HB_TR_DEBUG, ( "hbqt_pPtrFromObj( %d )", iParam ) ); + if( ! s_pDyns_hPPtrAssign ) + s_pDyns_hPPtrAssign = hb_dynsymGetCase( "PPTR" ); + pObj = hb_param( iParam, HB_IT_ANY ); if( hb_itemType( pObj ) == HB_IT_OBJECT ) { - hb_vmPushSymbol( hb_dynsymSymbol( hb_dynsymFindName( "PPTR" ) ) ); + HB_TRACE( HB_TR_DEBUG, ( "hbqt_pPtrFromObj= IS_OBJECT" ) ); + hb_vmPushDynSym( s_pDyns_hPPtrAssign ); hb_vmPush( pObj ); hb_vmSend( 0 ); - return hbqt_gcpointer( -1 ); + pointer = hbqt_gcpointer( -1 ); + + if ( iParam == 0 && ! pointer ) + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + + return pointer; } else if( hb_itemType( pObj ) == HB_IT_POINTER ) - return hbqt_gcpointer( iParam ); + { + HB_TRACE( HB_TR_DEBUG, ( "hbqt_pPtrFromObj= IS_POINTER" ) ); + pointer = hbqt_gcpointer( iParam ); + + if ( iParam == 0 && ! pointer ) + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + + return pointer; + } else { HB_TRACE( HB_TR_DEBUG, ( "hbqt_pPtrFromObj(): returns NULL" ) ); + if ( iParam == 0 ) + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); return NULL; /* TODO: Still better if RTE. */ } } -int hbqt_IsObjectType( int iParam, HB_U32 iType ) +void hbqt_set_pptr( void * ptr, PHB_ITEM pSelf ) +{ + static PHB_DYNS s_pDyns_hPPtrAssign = NULL; + + HB_TRACE( HB_TR_DEBUG, ( "hbqt_set_pptr( ptr =%p, pSelf=%p )", ptr, pSelf ) ); + // get the position of _PPTR member, the + // leading underscore because I want to write to it + + if( ! s_pDyns_hPPtrAssign ) + s_pDyns_hPPtrAssign = hb_dynsymGetCase( "_PPTR" ); + + if( pSelf == NULL ) + { + HB_TRACE( HB_TR_DEBUG, ( "hbqt_set_pptr(): returns NULL" ) ); + return; /* TODO: Still better if RTE. */ + } + + // push the _PPTR address + hb_vmPushDynSym( s_pDyns_hPPtrAssign ); + + // push the instance we want change _PPTR value + // it was already on the stack, but we push a pointer to it + hb_vmPush( pSelf ); + + // push the actual value + hb_vmPushPointerGC( ptr ); + + // run the command with 1 parameter + hb_vmSend( 1 ); +} + +void hbqt_itemPushReturn( void* ptr, PHB_ITEM pSelf ) +{ + HB_TRACE( HB_TR_DEBUG, ( "itemPushReturn( ptr =%p, pSelf=%p )", ptr, pSelf ) ); + // get the position of _PPTR member, the + // leading underscore because I want to write to it + + if( pSelf == NULL ) + pSelf = hb_stackSelfItem(); + + hbqt_set_pptr( ptr, pSelf ); + + if( hb_stackReturnItem() != pSelf ) + hb_itemReturn( pSelf ); +} + + +HBQT_GC_T * hbqt_getObjectGC( int iParam ) +{ + static PHB_DYNS s_pDyns_hPPtr= NULL; + PHB_ITEM pItem; + + if( ! s_pDyns_hPPtr) + s_pDyns_hPPtr = hb_dynsymGetCase( "PPTR" ); + + if( ( pItem = hb_param( iParam, HB_IT_OBJECT ) ) != NULL ) + { + HBQT_GC_T * p; + + hb_vmPushDynSym( s_pDyns_hPPtr ); + hb_vmPush( pItem ); + hb_vmSend( 0 ); + + pItem = hb_param( -1, HB_IT_POINTER ); + + if( pItem ) + { + p = ( HBQT_GC_T * ) hb_itemGetPtrGC( pItem, hbqt_gcFuncs() ); + + return p; + } + } + + /* hbqt_errRT_ARG(); */ /* NOTE: Could not check type for whatever reason */ + + + return NULL; +} + + +int hbqt_isObjectType( int iParam, HB_U32 iType ) { PHB_ITEM pItem; - HB_TRACE( HB_TR_DEBUG, ( "hbqt_IsObjectType( %d )", iParam ) ); + HB_TRACE( HB_TR_DEBUG, ( "hbqt_isObjectType( %d )", iParam ) ); if( ( pItem = hb_param( iParam, HB_IT_OBJECT ) ) != NULL ) { @@ -329,7 +432,7 @@ HB_FUNC( __HBQT_SETUTF8 ) hb_vmSetCDP( cdp ); } -PHB_ITEM hbqt_defineClassBegin( const char* szClsName, PHB_ITEM s_oClass, const char* szParentClsStr ) +PHB_ITEM hbqt_defineClassBegin( const char* szClsName, PHB_ITEM s_oClass, const char * szParentClsStr ) { static PHB_DYNS s__CLSLOCKDEF = NULL; @@ -343,45 +446,50 @@ PHB_ITEM hbqt_defineClassBegin( const char* szClsName, PHB_ITEM s_oClass, const hb_vmPushItemRef( s_oClass ); hb_vmDo( 1 ); - if( hb_itemGetL( hb_stackReturnItem() ) ) + if( hb_itemGetL( hb_stackReturnItem() ) && szParentClsStr ) { static PHB_DYNS s___HBCLASS = NULL; + char * pszParentClsBuffer = hb_strdup( szParentClsStr ); + char* szSingleClsName; + if( s___HBCLASS == NULL ) s___HBCLASS = hb_dynsymGetCase( "HBCLASS" ); + PHB_ITEM pClsName = hb_itemNew( NULL ); PHB_ITEM pSuper = hb_itemNew( NULL ); - if( szParentClsStr ) + PHB_ITEM pSym_ClsFunc = hb_itemNew( NULL ); + + hb_itemPutC( pClsName, szClsName ); + + /* array with parent classes (at least ONE) */ + hb_arrayNew( pSuper, 0 ); + + HB_TRACE( HB_TR_DEBUG, ("%s: dCB 3", szClsName ) ); + + szSingleClsName = strtok( pszParentClsBuffer, " ," ); + + PHB_ITEM pItem = hb_itemNew( NULL ); + + while( szSingleClsName != NULL ) { - hb_arrayNew( pSuper, 0 ); - - char * pszParentClsBuffer = hb_strdup( szParentClsStr ); - char * szSingleClsName; - - szSingleClsName = strtok( pszParentClsBuffer, " ," ); - - PHB_ITEM pItem = hb_itemNew( NULL ); - - while( szSingleClsName != NULL ) - { - hb_itemPutC( pItem, szSingleClsName ); - hb_arrayAdd( pSuper, hb_itemPutSymbol( pItem, hb_dynsymGetCase( szSingleClsName )->pSymbol ) ); - szSingleClsName = strtok( NULL, " ," ); - } - hb_itemRelease( pItem ); - - hb_xfree( pszParentClsBuffer ); + hb_itemPutC( pItem, szSingleClsName ); + hb_arrayAdd( pSuper, hb_itemPutSymbol( pItem, hb_dynsymGetCase( szSingleClsName )->pSymbol ) ); + szSingleClsName = strtok( NULL, " ," ); } + hb_itemRelease( pItem ); + + hb_itemPutSymbol( pSym_ClsFunc, hb_dynsymGetCase( szClsName )->pSymbol ); hb_vmPushDynSym( s___HBCLASS ); hb_vmPushNil(); hb_vmDo( 0 ); - PHB_ITEM pClsName = hb_itemNew( NULL ); - hb_itemPutC( pClsName, szClsName ); +// TODO: change this hack + char test[ HB_SYMBOL_NAME_LEN + 1 ]; + hb_snprintf( test, sizeof( test ), "HB_%s", szClsName ); - PHB_ITEM pSym_ClsFunc = hb_itemNew( NULL ); - hb_itemPutSymbol( pSym_ClsFunc, hb_dynsymGetCase( szClsName )->pSymbol ); + hb_itemPutSymbol( pSym_ClsFunc, hb_dynsymGetCase( test )->pSymbol ); hb_objSendMsg( hb_stackReturnItem(), "New", 3, pClsName, pSuper, pSym_ClsFunc ); @@ -393,11 +501,6 @@ PHB_ITEM hbqt_defineClassBegin( const char* szClsName, PHB_ITEM s_oClass, const hb_objSendMsg( oClass, "Create", 0 ); hb_objSendMsg( oClass, "Instance", 0 ); -#if 0 - PHB_ITEM pDataName = hb_itemNew( NULL ); - hb_itemPutC( pDataName, "PPTR" ); - hb_objSendMsg( oClass, "AddData", 1, pDataName ); -#endif } return oClass; diff --git a/harbour/contrib/hbqt/qtcore/hbqtcore.hbx b/harbour/contrib/hbqt/qtcore/hbqtcore.hbx index 28b76ad32e..543a343f12 100644 --- a/harbour/contrib/hbqt/qtcore/hbqtcore.hbx +++ b/harbour/contrib/hbqt/qtcore/hbqtcore.hbx @@ -28,11 +28,8 @@ #endif DYNAMIC HBQEVENTS -DYNAMIC HBQEVENTSFROMPOINTER DYNAMIC HBQSLOTS -DYNAMIC HBQSLOTSFROMPOINTER DYNAMIC HBQSTRING -DYNAMIC HBQSTRINGFROMPOINTER DYNAMIC HBQTOBJECTHANDLER DYNAMIC HBQT_FINDCHILD DYNAMIC HBQT_ISEQUAL @@ -100,124 +97,65 @@ DYNAMIC HB_QTRANSLATOR DYNAMIC HB_QURL DYNAMIC HB_QVARIANT DYNAMIC QABSTRACTITEMMODEL -DYNAMIC QABSTRACTITEMMODELFROMPOINTER DYNAMIC QABSTRACTLISTMODEL -DYNAMIC QABSTRACTLISTMODELFROMPOINTER DYNAMIC QABSTRACTTABLEMODEL -DYNAMIC QABSTRACTTABLEMODELFROMPOINTER DYNAMIC QBITARRAY -DYNAMIC QBITARRAYFROMPOINTER DYNAMIC QBUFFER -DYNAMIC QBUFFERFROMPOINTER DYNAMIC QBYTEARRAY -DYNAMIC QBYTEARRAYFROMPOINTER DYNAMIC QCHAR -DYNAMIC QCHARFROMPOINTER DYNAMIC QCOREAPPLICATION -DYNAMIC QCOREAPPLICATIONFROMPOINTER DYNAMIC QDATASTREAM -DYNAMIC QDATASTREAMFROMPOINTER DYNAMIC QDATE -DYNAMIC QDATEFROMPOINTER DYNAMIC QDATETIME -DYNAMIC QDATETIMEFROMPOINTER DYNAMIC QDIR -DYNAMIC QDIRFROMPOINTER DYNAMIC QEVENT -DYNAMIC QEVENTFROMPOINTER DYNAMIC QEVENTLOOP -DYNAMIC QEVENTLOOPFROMPOINTER DYNAMIC QFILE -DYNAMIC QFILEFROMPOINTER DYNAMIC QFILEINFO -DYNAMIC QFILEINFOFROMPOINTER DYNAMIC QGENERICARGUMENT -DYNAMIC QGENERICARGUMENTFROMPOINTER DYNAMIC QGENERICRETURNARGUMENT -DYNAMIC QGENERICRETURNARGUMENTFROMPOINTER DYNAMIC QIODEVICE -DYNAMIC QIODEVICEFROMPOINTER DYNAMIC QLATIN1CHAR -DYNAMIC QLATIN1CHARFROMPOINTER DYNAMIC QLATIN1STRING -DYNAMIC QLATIN1STRINGFROMPOINTER DYNAMIC QLINE DYNAMIC QLINEF -DYNAMIC QLINEFFROMPOINTER -DYNAMIC QLINEFROMPOINTER DYNAMIC QLIST -DYNAMIC QLISTFROMPOINTER DYNAMIC QLOCALE -DYNAMIC QLOCALEFROMPOINTER DYNAMIC QMETACLASSINFO -DYNAMIC QMETACLASSINFOFROMPOINTER DYNAMIC QMETAENUM -DYNAMIC QMETAENUMFROMPOINTER DYNAMIC QMETAMETHOD -DYNAMIC QMETAMETHODFROMPOINTER DYNAMIC QMETAOBJECT -DYNAMIC QMETAOBJECTFROMPOINTER DYNAMIC QMETAPROPERTY -DYNAMIC QMETAPROPERTYFROMPOINTER DYNAMIC QMETATYPE -DYNAMIC QMETATYPEFROMPOINTER DYNAMIC QMIMEDATA -DYNAMIC QMIMEDATAFROMPOINTER DYNAMIC QMODELINDEX -DYNAMIC QMODELINDEXFROMPOINTER DYNAMIC QOBJECT -DYNAMIC QOBJECTFROMPOINTER DYNAMIC QPOINT DYNAMIC QPOINTF -DYNAMIC QPOINTFFROMPOINTER -DYNAMIC QPOINTFROMPOINTER DYNAMIC QPROCESS -DYNAMIC QPROCESSFROMPOINTER DYNAMIC QRECT DYNAMIC QRECTF -DYNAMIC QRECTFFROMPOINTER -DYNAMIC QRECTFROMPOINTER DYNAMIC QREGEXP -DYNAMIC QREGEXPFROMPOINTER DYNAMIC QRESOURCE -DYNAMIC QRESOURCEFROMPOINTER DYNAMIC QSETTINGS -DYNAMIC QSETTINGSFROMPOINTER DYNAMIC QSHAREDBUILD DYNAMIC QSIGNALMAPPER -DYNAMIC QSIGNALMAPPERFROMPOINTER DYNAMIC QSIZE DYNAMIC QSIZEF -DYNAMIC QSIZEFFROMPOINTER -DYNAMIC QSIZEFROMPOINTER DYNAMIC QSTRINGLIST -DYNAMIC QSTRINGLISTFROMPOINTER DYNAMIC QSTRINGREF -DYNAMIC QSTRINGREFFROMPOINTER DYNAMIC QTEXTBOUNDARYFINDER -DYNAMIC QTEXTBOUNDARYFINDERFROMPOINTER DYNAMIC QTEXTCODEC -DYNAMIC QTEXTCODECFROMPOINTER DYNAMIC QTEXTDECODER -DYNAMIC QTEXTDECODERFROMPOINTER DYNAMIC QTEXTENCODER -DYNAMIC QTEXTENCODERFROMPOINTER DYNAMIC QTEXTSTREAM -DYNAMIC QTEXTSTREAMFROMPOINTER DYNAMIC QTHREAD -DYNAMIC QTHREADFROMPOINTER DYNAMIC QTIME -DYNAMIC QTIMEFROMPOINTER DYNAMIC QTIMELINE -DYNAMIC QTIMELINEFROMPOINTER DYNAMIC QTIMER -DYNAMIC QTIMERFROMPOINTER DYNAMIC QTRANSLATOR -DYNAMIC QTRANSLATORFROMPOINTER DYNAMIC QURL -DYNAMIC QURLFROMPOINTER DYNAMIC QVARIANT -DYNAMIC QVARIANTFROMPOINTER DYNAMIC QVERSION DYNAMIC __HBQTCORE DYNAMIC __HBQT_ERROR diff --git a/harbour/contrib/hbqt/qtcore/qth/QAbstractEventDispatcher.qth b/harbour/contrib/hbqt/qtcore/qth/QAbstractEventDispatcher.qth index 487477f532..0e90877694 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QAbstractEventDispatcher.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QAbstractEventDispatcher.qth @@ -27,7 +27,7 @@ New = */ HB_FUNC( QT_QABSTRACTEVENTDISPATCHER ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QAbstractEventDispatcher( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth b/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth index 06f12894ab..334f9d2571 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth @@ -38,7 +38,7 @@ HB_FUNC( QT_QGENERICARGUMENT ) { __HB_RETPTRGC__( new QGenericArgument( hb_parc( 1 ), 0 ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QGenericArgument( hb_parc( 1 ), hb_parptr( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth b/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth index a67834f296..60290ac02d 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth @@ -38,7 +38,7 @@ HB_FUNC( QT_QGENERICRETURNARGUMENT ) { __HB_RETPTRGC__( new QGenericReturnArgument( hb_parc( 1 ), 0 ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QGenericReturnArgument( hb_parc( 1 ), hb_parptr( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QIODevice.qth b/harbour/contrib/hbqt/qtcore/qth/QIODevice.qth index c92b317921..89e1bb5f24 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QIODevice.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QIODevice.qth @@ -29,7 +29,7 @@ Constructor = no */ HB_FUNC( QT_QIODEVICE ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { // __HB_RETPTRGC__( new QIODevice( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QLine.qth b/harbour/contrib/hbqt/qtcore/qth/QLine.qth index 1f9f83a71f..b9f25a3a87 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QLine.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QLine.qth @@ -30,11 +30,11 @@ New = */ HB_FUNC( QT_QLINE ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QLine( *hbqt_par_QLine( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QLine( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QPoint.qth b/harbour/contrib/hbqt/qtcore/qth/QPoint.qth index ae4d534294..803d58fb33 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QPoint.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QPoint.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QPOINT ) { __HB_RETPTRGC__( new QPoint( hb_parni( 1 ), hb_parni( 2 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPoint( *hbqt_par_QPoint( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QPointF.qth b/harbour/contrib/hbqt/qtcore/qth/QPointF.qth index aeb6fe228b..efca8fb8d6 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QPointF.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QPointF.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QPOINTF ) { __HB_RETPTRGC__( new QPointF( ( qreal ) hb_parnd( 1 ), ( qreal ) hb_parnd( 2 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPointF( *hbqt_par_QPoint( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QProcess.qth b/harbour/contrib/hbqt/qtcore/qth/QProcess.qth index 9bdb963bf7..7d1f5b9d35 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QProcess.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QProcess.qth @@ -27,7 +27,7 @@ New = */ HB_FUNC( QT_QPROCESS ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QProcess( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QRect.qth b/harbour/contrib/hbqt/qtcore/qth/QRect.qth index f482697b0f..c71f410f5d 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QRect.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QRect.qth @@ -31,11 +31,11 @@ New = */ HB_FUNC( QT_QRECT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QRect( *hbqt_par_QRect( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth index 884b4cdaf8..1c240c551f 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth @@ -31,11 +31,11 @@ New = */ HB_FUNC( QT_QRECTF ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QRectF( *hbqt_par_QRectF( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QRectF( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QResource.qth b/harbour/contrib/hbqt/qtcore/qth/QResource.qth index 621706d7c2..f93a608ade 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QResource.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QResource.qth @@ -48,8 +48,40 @@ void setFileName ( const QString & file ) void setLocale ( const QLocale & locale ) qint64 size () const -bool registerResource ( const QString & rccFileName, const QString & mapRoot = QString() ) -bool registerResource ( const uchar * rccData, const QString & mapRoot = QString() ) +bool registerResource ( const QString & rccFileName, const QString & mapRoot = QString() ) { + QResource * _resource = ( QResource * ) hbqt_pPtrFromObj( 0 ); + if( _resource ) + { + int pcount = hb_pcount(); + if( pcount <= 2 && HB_ISCHAR( 1 ) && ( pcount < 2 || HB_ISCHAR( 2 ) ) ) + { + void * pText1 = NULL; + void * pText2 = NULL; + hb_retl( _resource->registerResource( hb_parstr_utf8( 1, &pText1, NULL ), hb_parstr_utf8( 2, &pText2, NULL ) ) ); /* REM A1 */ + hb_strfree( pText1 ); + hb_strfree( pText2 ); + } + else + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } +} + +bool registerResource_1 ( const uchar * rccData, const QString & mapRoot = QString() ) { + QResource * _resource = ( QResource * ) hbqt_pPtrFromObj( 0 ); + if( _resource ) + { + int pcount = hb_pcount(); + if( pcount <= 2 && HB_ISCHAR( 1 ) && ( pcount < 2 || HB_ISCHAR( 2 ) ) ) + { + void * pText = NULL; + hb_retl( _resource->registerResource( ( const uchar * ) hb_parc( 1 ), hb_parstr_utf8( 2, &pText, NULL ) ) ); /* REM A1 */ + hb_strfree( pText ); + } + else + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } +} + QStringList searchPaths () bool unregisterResource ( const QString & rccFileName, const QString & mapRoot = QString() ) bool unregisterResource ( const uchar * rccData, const QString & mapRoot = QString() ) diff --git a/harbour/contrib/hbqt/qtcore/qth/QSize.qth b/harbour/contrib/hbqt/qtcore/qth/QSize.qth index a015b387be..de47016b81 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QSize.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QSize.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QSIZE ) { __HB_RETPTRGC__( new QSize( hb_parni( 1 ), hb_parni( 2 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QSize( *hbqt_par_QSize( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QStringRef.qth b/harbour/contrib/hbqt/qtcore/qth/QStringRef.qth index 290db4a5bd..864d530fa6 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QStringRef.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QStringRef.qth @@ -35,7 +35,7 @@ HB_FUNC( QT_QSTRINGREF ) { __HB_RETPTRGC__( new QStringRef( ( const QString *) hb_parcx( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QStringRef( * hbqt_par_QStringRef( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QUrl.qth b/harbour/contrib/hbqt/qtcore/qth/QUrl.qth index 3c06b98946..5876912e18 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QUrl.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QUrl.qth @@ -35,7 +35,7 @@ HB_FUNC( QT_QURL ) { __HB_RETPTRGC__( new QUrl( hbqt_par_QString( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QUrl( *hbqt_par_QUrl( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormEditorInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormEditorInterface.qth index 8ab6266074..d40f8ad7f4 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormEditorInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormEditorInterface.qth @@ -38,7 +38,7 @@ folder = hbqtdesigner */ HB_FUNC( QT_QDESIGNERFORMEDITORINTERFACE ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QDesignerFormEditorInterface( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth index 9136b53da6..a9401f419e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth @@ -34,7 +34,7 @@ HB_FUNC( QT_HBQGRAPHICSITEM ) { __HB_RETPTRGC__( new HBQGraphicsItem( hb_parni( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new HBQGraphicsItem( hb_parni( 1 ), hbqt_par_QGraphicsItem( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth index 0f46b75626..4e8e9a4a12 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth @@ -29,7 +29,7 @@ New = */ HB_FUNC( QT_HBQGRAPHICSSCENE ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new HBQGraphicsScene( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth b/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth index 3300b60c0d..02b412eb7a 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth @@ -37,7 +37,7 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT ) { __HB_RETPTRGC__( new HBQPlainTextEdit() ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new HBQPlainTextEdit( hbqt_par_QWidget( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QAction.qth b/harbour/contrib/hbqt/qtgui/qth/QAction.qth index 5f0798f244..bb29e9c482 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QAction.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QAction.qth @@ -32,12 +32,16 @@ Calls = QT_QAction */ HB_FUNC( QT_QACTION ) { - if( HB_ISPOINTER( 1 ) ) - __HB_RETPTRGC__( new QAction( hbqt_par_QObject( 1 ) ) ); - else if( HB_ISPOINTER( 2 ) ) - __HB_RETPTRGC__( new QAction( hbqt_par_QString( 1 ), hbqt_par_QObject( 2 ) ) ); - else if( HB_ISPOINTER( 3 ) ) + int pcount; + pcount = hb_pcount(); + if( pcount==3 && HB_ISOBJECT( 1 ) && HB_ISOBJECT(2) && HB_ISOBJECT( 3 ) ) __HB_RETPTRGC__( new QAction( *hbqt_par_QIcon( 1 ), hbqt_par_QString( 2 ), hbqt_par_QObject( 3 ) ) ); + else if( pcount==2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT(2) ) + __HB_RETPTRGC__( new QAction( hbqt_par_QString( 1 ), hbqt_par_QObject( 2 ) ) ); + else if( pcount == 1 && HB_ISOBJECT( 1 ) ) + __HB_RETPTRGC__( new QAction( hbqt_par_QObject( 1 ) ) ); + else + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth b/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth index e6e7d161a6..3ac4c1d2af 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth @@ -26,7 +26,7 @@ New = */ HB_FUNC( QT_QACTIONGROUP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QActionGroup( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QApplication.qth b/harbour/contrib/hbqt/qtgui/qth/QApplication.qth index 832e77efb6..2384996e02 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QApplication.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QApplication.qth @@ -44,7 +44,7 @@ HB_EXTERN_END HB_FUNC( QT_QAPPLICATION ) { //__HB_RETPTRGC__( ( QApplication * ) __hbqtgui_app() ); - hb_retptr( __hbqtgui_app() ); + hbqt_itemPushReturn( hbqt_gcAllocate_QApplication( (void *) __hbqtgui_app(), false) , hb_stackSelfItem() ); } HB_FUNC( QT_QAPPLICATION_EXECUTE ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QBitmap.qth b/harbour/contrib/hbqt/qtgui/qth/QBitmap.qth index cd4c82c459..a8c5856a5f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QBitmap.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QBitmap.qth @@ -32,7 +32,7 @@ New = */ HB_FUNC( QT_QBITMAP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QBitmap( *hbqt_par_QBitmap( 1 ) ) ); } @@ -48,7 +48,7 @@ HB_FUNC( QT_QBITMAP ) { __HB_RETPTRGC__( new QBitmap( hb_parni( 1 ), hb_parni( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { if( ( QString ) "QPixmap" == hbqt_par_QString( 1 ) ) { diff --git a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth index 8397e1d3b7..a9dbffa23e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth @@ -38,9 +38,9 @@ New = */ HB_FUNC( QT_QBRUSH ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hbqt_getObjectGC( 1 ); if( q ) { if( q->type == HBQT_TYPE_QBrush ) @@ -77,43 +77,18 @@ HB_FUNC( QT_QBRUSH ) { __HB_RETPTRGC__( new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } - else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) - { - QString objName = hbqt_par_QString( 1 ); - - if( objName == ( QString ) "QPixmap" ) - { - __HB_RETPTRGC__( new QBrush( *hbqt_par_QPixmap( 2 ) ) ); - } - else if( objName == ( QString ) "QImage" ) - { - __HB_RETPTRGC__( new QBrush( *hbqt_par_QImage( 2 ) ) ); - } - else if( objName == ( QString ) "QGradient" ) - { - __HB_RETPTRGC__( new QBrush( *hbqt_par_QGradient( 2 ) ) ); - } - else if( objName == ( QString ) "QColor" ) - { - __HB_RETPTRGC__( new QBrush( *hbqt_par_QColor( 2 ), HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ); - } - else - { - __HB_RETPTRGC__( new QBrush() ); - } - } else { __HB_RETPTRGC__( new QBrush() ); diff --git a/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth b/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth index 1275e614c3..d48b52023a 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth @@ -27,7 +27,7 @@ New = */ HB_FUNC( QT_QBUTTONGROUP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QButtonGroup( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QColor.qth b/harbour/contrib/hbqt/qtgui/qth/QColor.qth index 82514c9ed0..8209d36845 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QColor.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QColor.qth @@ -48,7 +48,7 @@ HB_FUNC( QT_QCOLOR ) { __HB_RETPTRGC__( new QColor( hbqt_par_QString( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QColor( *hbqt_par_QColor( 1 ) ) ); } @@ -60,15 +60,10 @@ HB_FUNC( QT_QCOLOR ) { __HB_RETPTRGC__( new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); } - else - { - __HB_RETPTRGC__( new QColor() ); - } + else hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } else - { - __HB_RETPTRGC__( new QColor() ); - } + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth b/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth index c5555b929a..b640095d38 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth @@ -30,7 +30,7 @@ Calls = QT_QComboBox */ HB_FUNC( QT_QCOMBOBOX ) { - __HB_RETPTRGC__( new QComboBox( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); + __HB_RETPTRGC__( new QComboBox( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth index 8d74e0eb08..421061064c 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth @@ -28,15 +28,15 @@ New = */ HB_FUNC( QT_QCONTEXTMENUEVENT ) { - if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ) ) ); } - else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); } - else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) && HB_ISNUM( 4 ) ) + else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) && HB_ISNUM( 4 ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ), ( Qt::KeyboardModifiers ) hb_parni( 4 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QCursor.qth b/harbour/contrib/hbqt/qtgui/qth/QCursor.qth index 53a60cefa1..115bb889ab 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QCursor.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QCursor.qth @@ -39,11 +39,11 @@ HB_FUNC( QT_QCURSOR ) { __HB_RETPTRGC__( new QCursor( ( Qt::CursorShape ) hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QCursor( *hbqt_par_QCursor( 1 ) ) ); } - else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { QString objName = hbqt_par_QString( 1 ); @@ -56,7 +56,7 @@ HB_FUNC( QT_QCURSOR ) __HB_RETPTRGC__( new QCursor() ); } } - else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() >= 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QCursor( *hbqt_par_QBitmap( 1 ), *hbqt_par_QBitmap( 2 ), HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1, HB_ISNUM( 4 ) ? hb_parni( 4 ) : -1 ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDoubleValidator.qth b/harbour/contrib/hbqt/qtgui/qth/QDoubleValidator.qth index 40c9219427..a496ffccc1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDoubleValidator.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDoubleValidator.qth @@ -31,9 +31,9 @@ HB_FUNC( QT_QDOUBLEVALIDATOR ) { if( hb_pcount() >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - __HB_RETPTRGC__( new QDoubleValidator( hb_parnd( 1 ), hb_parnd( 2 ), hb_parni( 3 ), HB_ISPOINTER( 4 ) ? hbqt_par_QObject( 4 ) : 0 ) ); + __HB_RETPTRGC__( new QDoubleValidator( hb_parnd( 1 ), hb_parnd( 2 ), hb_parni( 3 ), HB_ISOBJECT( 4 ) ? hbqt_par_QObject( 4 ) : 0 ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QDoubleValidator( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth index d6ad84205c..453b82145b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth @@ -28,7 +28,7 @@ Constructor = no */ HB_FUNC( QT_QDRAGENTEREVENT ) { - if( hb_pcount() == 5 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) + if( hb_pcount() == 5 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) && HB_ISOBJECT( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) { __HB_RETPTRGC__( new QDragEnterEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth index 3c306d54c2..3731027d13 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth @@ -29,7 +29,7 @@ Constructor = no */ HB_FUNC( QT_QDRAGMOVEEVENT ) { - if( hb_pcount() >= 5 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) + if( hb_pcount() >= 5 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) && HB_ISOBJECT( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) { __HB_RETPTRGC__( new QDragMoveEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ), ( QEvent::Type ) ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : QEvent::DragMove ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth index 0c97296b24..aa1618db7c 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth @@ -28,7 +28,7 @@ Constructor = no */ HB_FUNC( QT_QDROPEVENT ) { - if( hb_pcount() >= 5 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) + if( hb_pcount() >= 5 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) && HB_ISOBJECT( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) { __HB_RETPTRGC__( new QDropEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ), ( QEvent::Type ) ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : QEvent::Drop ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFileDialog.qth b/harbour/contrib/hbqt/qtgui/qth/QFileDialog.qth index e6d9c9651c..c75bf62cc1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFileDialog.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFileDialog.qth @@ -27,11 +27,11 @@ New = pParent, nFlags */ HB_FUNC( QT_QFILEDIALOG ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFileDialog( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) 0 ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QFileDialog( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFont.qth b/harbour/contrib/hbqt/qtgui/qth/QFont.qth index 3313fd4d91..c2c9346065 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFont.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFont.qth @@ -46,11 +46,11 @@ HB_FUNC( QT_QFONT ) { __HB_RETPTRGC__( new QFont( hbqt_par_QString( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFont( *hbqt_par_QFont( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QFont( *hbqt_par_QFont( 1 ), hbqt_par_QPaintDevice( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth b/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth index 87cbf0fe16..f2cad22f7e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth @@ -26,11 +26,11 @@ New = pParent */ HB_FUNC( QT_QFONTDIALOG ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFontDialog( hbqt_par_QWidget( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QFontDialog( *hbqt_par_QFont( 1 ), hbqt_par_QWidget( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontInfo.qth b/harbour/contrib/hbqt/qtgui/qth/QFontInfo.qth index 290f82a17a..069f30326b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontInfo.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontInfo.qth @@ -27,11 +27,11 @@ New = pParent */ HB_FUNC( QT_QFONTINFO ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFontInfo( *hbqt_par_QFontInfo( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QFontInfo( *hbqt_par_QFont( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth b/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth index 807ffb15b0..fff1d4c638 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth @@ -31,18 +31,18 @@ New = */ HB_FUNC( QT_QFONTMETRICS ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFontMetrics( *hbqt_par_QFontMetrics( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { if( hbqt_par_QString( 1 ) == ( QString ) "QFont" ) { __HB_RETPTRGC__( new QFontMetrics( *hbqt_par_QFont( 2 ) ) ); } } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QFontMetrics( *hbqt_par_QFont( 1 ), hbqt_par_QPaintDevice( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth b/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth index c18ed4dc9a..ea139396c0 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth @@ -32,11 +32,11 @@ New = */ HB_FUNC( QT_QFONTMETRICSF ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFontMetricsF( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { if( hbqt_par_QString( 1 ) == ( QString ) "QFont" ) { @@ -47,7 +47,7 @@ HB_FUNC( QT_QFONTMETRICSF ) __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFontMetrics( 2 ) ) ); } } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFont( 1 ), hbqt_par_QPaintDevice( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsEllipseItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsEllipseItem.qth index 0de831e843..37bf7b7ca8 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsEllipseItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsEllipseItem.qth @@ -32,14 +32,14 @@ HB_FUNC( QT_QGRAPHICSELLIPSEITEM ) { if( hb_pcount() >= 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - __HB_RETPTRGC__( new QGraphicsEllipseItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISPOINTER( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsEllipseItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISOBJECT( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); } - else if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QRectF ) { - __HB_RETPTRGC__( new QGraphicsEllipseItem( *hbqt_par_QRectF( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsEllipseItem( *hbqt_par_QRectF( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsGridLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsGridLayout.qth index 069613560e..11b0b8820b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsGridLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsGridLayout.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QGRAPHICSGRIDLAYOUT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsGridLayout( hbqt_par_QGraphicsLayoutItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemAnimation.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemAnimation.qth index d2485fcc1a..7dc9f28103 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemAnimation.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemAnimation.qth @@ -30,7 +30,7 @@ New = */ HB_FUNC( QT_QGRAPHICSITEMANIMATION ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsItemAnimation( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemGroup.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemGroup.qth index d9711351e1..a25b82d48f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemGroup.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsItemGroup.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QGRAPHICSITEMGROUP ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsItemGroup( hbqt_par_QGraphicsItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLineItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLineItem.qth index 6449d211eb..f99322a100 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLineItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLineItem.qth @@ -33,14 +33,14 @@ HB_FUNC( QT_QGRAPHICSLINEITEM ) { if( hb_pcount() >= 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - __HB_RETPTRGC__( new QGraphicsLineItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISPOINTER( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsLineItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISOBJECT( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); } - else if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QLineF ) { - __HB_RETPTRGC__( new QGraphicsLineItem( *hbqt_par_QLineF( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsLineItem( *hbqt_par_QLineF( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth index 1e20daecff..95efbcddeb 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth @@ -33,9 +33,9 @@ HB_FUNC( QT_QGRAPHICSLINEARLAYOUT ) { if( HB_ISNUM( 1 ) ) { - __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsLayoutItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsLayoutItem( 2 ) : 0 ) ) ); } - else if( HB_ISPOINTER( 1 ) ) + else if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsLinearLayout( hbqt_par_QGraphicsLayoutItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPathItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPathItem.qth index c75e7275e3..0b969bdc8b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPathItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPathItem.qth @@ -29,12 +29,12 @@ New = */ HB_FUNC( QT_QGRAPHICSPATHITEM ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QPainterPath ) { - __HB_RETPTRGC__( new QGraphicsPathItem( *hbqt_par_QPainterPath( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsPathItem( *hbqt_par_QPainterPath( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPixmapItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPixmapItem.qth index 56e4435393..1d6a0616eb 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPixmapItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPixmapItem.qth @@ -29,12 +29,12 @@ New = */ HB_FUNC( QT_QGRAPHICSPIXMAPITEM ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QPixmap ) { - __HB_RETPTRGC__( new QGraphicsPixmapItem( *hbqt_par_QPixmap( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsPixmapItem( *hbqt_par_QPixmap( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPolygonItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPolygonItem.qth index a7c436184d..86e57b8efe 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsPolygonItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsPolygonItem.qth @@ -29,12 +29,12 @@ New = */ HB_FUNC( QT_QGRAPHICSPOLYGONITEM ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QPolygonF ) { - __HB_RETPTRGC__( new QGraphicsPolygonItem( *hbqt_par_QPolygonF( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsPolygonItem( *hbqt_par_QPolygonF( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth index 2612c0c669..da70cce268 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QGRAPHICSPROXYWIDGET ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsProxyWidget( hbqt_par_QGraphicsItem( 1 ), ( Qt::WindowFlags ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : 0 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsRectItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsRectItem.qth index d3d0ed83dc..98dd689778 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsRectItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsRectItem.qth @@ -32,14 +32,14 @@ HB_FUNC( QT_QGRAPHICSRECTITEM ) { if( hb_pcount() >= 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - __HB_RETPTRGC__( new QGraphicsRectItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISPOINTER( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsRectItem( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISOBJECT( 5 ) ? hbqt_par_QGraphicsItem( 5 ) : 0 ) ) ); } - else if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QRectF ) { - __HB_RETPTRGC__( new QGraphicsRectItem( *hbqt_par_QRectF( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsRectItem( *hbqt_par_QRectF( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsScene.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsScene.qth index 2c525b5214..110bb74eb7 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsScene.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsScene.qth @@ -32,14 +32,14 @@ HB_FUNC( QT_QGRAPHICSSCENE ) { if( hb_pcount() >= 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { - __HB_RETPTRGC__( new QGraphicsScene( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISPOINTER( 5 ) ? hbqt_par_QObject( 5 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsScene( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), ( HB_ISOBJECT( 5 ) ? hbqt_par_QObject( 5 ) : 0 ) ) ); } - else if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * p = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( p->type == HBQT_TYPE_QRectF ) { - __HB_RETPTRGC__( new QGraphicsScene( *hbqt_par_QRectF( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QObject( 2 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsScene( *hbqt_par_QRectF( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QObject( 2 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsSimpleTextItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsSimpleTextItem.qth index 766e1ce9f5..48982b82a4 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsSimpleTextItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsSimpleTextItem.qth @@ -34,9 +34,9 @@ HB_FUNC( QT_QGRAPHICSSIMPLETEXTITEM ) { if( HB_ISCHAR( 1 ) ) { - __HB_RETPTRGC__( new QGraphicsSimpleTextItem( hbqt_par_QString( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsSimpleTextItem( hbqt_par_QString( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); } - else if( HB_ISPOINTER( 1 ) ) + else if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsSimpleTextItem( hbqt_par_QGraphicsItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsSvgItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsSvgItem.qth index 9c528dff9f..64cb88c05e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsSvgItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsSvgItem.qth @@ -32,9 +32,9 @@ HB_FUNC( QT_QGRAPHICSSVGITEM ) { if( HB_ISCHAR( 1 ) ) { - __HB_RETPTRGC__( new QGraphicsSvgItem( hbqt_par_QString( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsSvgItem( hbqt_par_QString( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); } - else if( HB_ISPOINTER( 1 ) ) + else if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsSvgItem( hbqt_par_QGraphicsItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsTextItem.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsTextItem.qth index 149e9d42e5..4746a73271 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsTextItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsTextItem.qth @@ -36,9 +36,9 @@ HB_FUNC( QT_QGRAPHICSTEXTITEM ) { if( HB_ISCHAR( 1 ) ) { - __HB_RETPTRGC__( new QGraphicsTextItem( hbqt_par_QString( 1 ), ( HB_ISPOINTER( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsTextItem( hbqt_par_QString( 1 ), ( HB_ISOBJECT( 2 ) ? hbqt_par_QGraphicsItem( 1 ) : 0 ) ) ); } - else if( HB_ISPOINTER( 1 ) ) + else if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsTextItem( hbqt_par_QGraphicsItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth index ac8199575e..bb737eca9f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth @@ -29,15 +29,15 @@ New = */ HB_FUNC( QT_QGRAPHICSVIEW ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsView( hbqt_par_QWidget( 1 ) ) ); } - else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { if( ( QString ) "QGraphicsScene" == hbqt_par_QString( 1 ) ) { - __HB_RETPTRGC__( new QGraphicsView( hbqt_par_QGraphicsScene( 2 ), ( HB_ISPOINTER( 3 ) ? hbqt_par_QWidget( 3 ) : 0 ) ) ); + __HB_RETPTRGC__( new QGraphicsView( hbqt_par_QGraphicsScene( 2 ), ( HB_ISOBJECT( 3 ) ? hbqt_par_QWidget( 3 ) : 0 ) ) ); } else { diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsWidget.qth index d9523b716c..524463f224 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsWidget.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QGRAPHICSWIDGET ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QGraphicsWidget( hbqt_par_QGraphicsItem( 1 ), ( Qt::WindowFlags ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : 0 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth index c144115e9c..da32c395e8 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth @@ -28,7 +28,7 @@ Destructor = */ HB_FUNC( QT_QHELPEVENT ) { - if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) + if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) ) { __HB_RETPTRGC__( new QHelpEvent( ( QEvent::Type ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QIcon.qth b/harbour/contrib/hbqt/qtgui/qth/QIcon.qth index 03f092a8bf..630002f1d3 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QIcon.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QIcon.qth @@ -33,33 +33,22 @@ New = */ HB_FUNC( QT_QICON ) { - if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) - { - __HB_RETPTRGC__( new QIcon( hbqt_par_QString( 1 ) ) ); - } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) - { - HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); - if( q ) - { - if( q->type == HBQT_TYPE_QIcon ) - { - __HB_RETPTRGC__( new QIcon( *hbqt_par_QIcon( 1 ) ) ); - } - else if( q->type == HBQT_TYPE_QPixmap ) - { - __HB_RETPTRGC__( new QIcon( *hbqt_par_QPixmap( 1 ) ) ); - } - } - else - { - __HB_RETPTRGC__( new QIcon( *hbqt_par_QIcon( 1 ) ) ); - } - } + + int pcount = hb_pcount(); + if( pcount == 0 ) + __HB_RETPTRGC__( new QIcon() ); else - { - __HB_RETPTRGC__( new QIcon() ); - } + if( pcount == 1 ) + { + if ( HB_ISCHAR( 1 ) ) + __HB_RETPTRGC__( new QIcon( hbqt_par_QString( 1 ) ) ); + else if( hb_pcount() == 1 && hbqt_isObjectType( 1, HBQT_TYPE_QIcon ) ) + __HB_RETPTRGC__( new QIcon( *hbqt_par_QIcon( 1 ) ) ); + else if( hb_pcount() == 1 && hbqt_isObjectType( 1, HBQT_TYPE_QPixmap ) ) + __HB_RETPTRGC__( new QIcon( *hbqt_par_QPixmap( 1 ) ) ); + else hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } + else hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QImage.qth b/harbour/contrib/hbqt/qtgui/qth/QImage.qth index 52d80b5351..84983710c9 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QImage.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QImage.qth @@ -43,7 +43,7 @@ HB_FUNC( QT_QIMAGE ) { __HB_RETPTRGC__( new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QImage( *hbqt_par_QImage( 1 ) ) ); } @@ -51,7 +51,7 @@ HB_FUNC( QT_QIMAGE ) { __HB_RETPTRGC__( new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QInputMethodEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QInputMethodEvent.qth index 0b116a23d9..dd636dac4f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QInputMethodEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QInputMethodEvent.qth @@ -29,7 +29,7 @@ Destructor = */ HB_FUNC( QT_QINPUTMETHODEVENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QInputMethodEvent( *hbqt_par_QInputMethodEvent( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QIntValidator.qth b/harbour/contrib/hbqt/qtgui/qth/QIntValidator.qth index ef07017dcd..7f1cad7c20 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QIntValidator.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QIntValidator.qth @@ -29,11 +29,11 @@ Destructor = */ HB_FUNC( QT_QINTVALIDATOR ) { - if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) ) + if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISOBJECT( 3 ) ) { __HB_RETPTRGC__( new QIntValidator( hb_parni( 1 ), hb_parni( 2 ), hbqt_par_QObject( 3 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QIntValidator( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QItemDelegate.qth b/harbour/contrib/hbqt/qtgui/qth/QItemDelegate.qth index 0304631e64..be0f01960f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QItemDelegate.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QItemDelegate.qth @@ -34,7 +34,7 @@ New = */ HB_FUNC( QT_QITEMDELEGATE ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QItemDelegate( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QItemEditorFactory.qth b/harbour/contrib/hbqt/qtgui/qth/QItemEditorFactory.qth index 276cc40377..a6be15d999 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QItemEditorFactory.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QItemEditorFactory.qth @@ -35,7 +35,7 @@ New = */ HB_FUNC( QT_QITEMEDITORFACTORY ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QItemEditorFactory() ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QItemSelectionModel.qth b/harbour/contrib/hbqt/qtgui/qth/QItemSelectionModel.qth index 8d9859d605..7c214a1cc7 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QItemSelectionModel.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QItemSelectionModel.qth @@ -29,7 +29,7 @@ Destructor = */ HB_FUNC( QT_QITEMSELECTIONMODEL ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QItemSelectionModel( hbqt_par_QAbstractItemModel( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QKeyEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QKeyEvent.qth index 733dd5f929..3a4ede0f31 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QKeyEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QKeyEvent.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QKEYEVENT ) { __HB_RETPTRGC__( new QKeyEvent( ( QEvent::Type ) hb_parni( 1 ), hb_parni( 2 ), ( Qt::KeyboardModifiers ) hb_parni( 3 ), HB_ISCHAR( 4 ) ? hbqt_par_QString( 4 ) : QString(), HB_ISLOG( 5 ) ? hb_parl( 5 ) : false, HB_ISNUM( 6 ) ? hb_parni( 6 ) : 1 ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QKeyEvent( *hbqt_par_QKeyEvent( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QKeySequence.qth b/harbour/contrib/hbqt/qtgui/qth/QKeySequence.qth index f3d80fc4e7..b0f840d027 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QKeySequence.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QKeySequence.qth @@ -32,7 +32,7 @@ New = */ HB_FUNC( QT_QKEYSEQUENCE ) { - if( HB_ISPOINTER( 1 ) ) + if( HB_ISOBJECT( 1 ) ) __HB_RETPTRGC__( new QKeySequence( *hbqt_par_QKeySequence( 1 ) ) ); else if( HB_ISCHAR( 1 ) ) __HB_RETPTRGC__( new QKeySequence( hbqt_par_QString( 1 ) ) ); diff --git a/harbour/contrib/hbqt/qtgui/qth/QLinearGradient.qth b/harbour/contrib/hbqt/qtgui/qth/QLinearGradient.qth index 18fe030fb5..006bb065d8 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QLinearGradient.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QLinearGradient.qth @@ -29,11 +29,11 @@ New = */ HB_FUNC( QT_QLINEARGRADIENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QLinearGradient( *hbqt_par_QLinearGradient( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QLinearGradient( *hbqt_par_QPointF( 1 ), *hbqt_par_QPointF( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QListWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QListWidget.qth index b52bd8d2d6..db2dd73597 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QListWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QListWidget.qth @@ -26,7 +26,7 @@ New = pParent */ HB_FUNC( QT_QLISTWIDGET ) { - __HB_RETPTRGC__( new QListWidget( HB_ISPOINTER( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); + __HB_RETPTRGC__( new QListWidget( HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMdiArea.qth b/harbour/contrib/hbqt/qtgui/qth/QMdiArea.qth index 50697cab69..c4d55d8f2f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMdiArea.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMdiArea.qth @@ -32,7 +32,7 @@ New = */ HB_FUNC( QT_QMDIAREA ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QMdiArea( hbqt_par_QWidget( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMdiSubWindow.qth b/harbour/contrib/hbqt/qtgui/qth/QMdiSubWindow.qth index c441a0e16c..9f4e99adf8 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMdiSubWindow.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMdiSubWindow.qth @@ -32,7 +32,7 @@ New = */ HB_FUNC( QT_QMDISUBWINDOW ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QMdiSubWindow( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMenu.qth b/harbour/contrib/hbqt/qtgui/qth/QMenu.qth index 7207c73713..59249cd212 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMenu.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMenu.qth @@ -29,11 +29,11 @@ HB_FUNC( QT_QMENU ) { if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) ) { - __HB_RETPTRGC__( new QMenu( hbqt_par_QString( 1 ), HB_ISPOINTER( 2 ) ? hbqt_par_QWidget( 2 ) : 0 ) ); + __HB_RETPTRGC__( new QMenu( hbqt_par_QString( 1 ), HB_ISOBJECT( 2 ) ? hbqt_par_QWidget( 2 ) : 0 ) ); } else { - __HB_RETPTRGC__( new QMenu( HB_ISPOINTER( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); + __HB_RETPTRGC__( new QMenu( HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMenuBar.qth b/harbour/contrib/hbqt/qtgui/qth/QMenuBar.qth index ae4de98bd0..61aa2f3a3f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMenuBar.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMenuBar.qth @@ -26,7 +26,7 @@ New = pParent */ HB_FUNC( QT_QMENUBAR ) { - __HB_RETPTRGC__( new QMenuBar( HB_ISPOINTER( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); + __HB_RETPTRGC__( new QMenuBar( HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMouseEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QMouseEvent.qth index a55b0ed63a..25354dafd9 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMouseEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMouseEvent.qth @@ -29,7 +29,7 @@ New = */ HB_FUNC( QT_QMOUSEEVENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QMouseEvent( *hbqt_par_QMouseEvent( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth index 521ea03aeb..671259ba99 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth @@ -29,11 +29,11 @@ Constructor = no */ HB_FUNC( QT_QMOVEEVENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QMoveEvent( *hbqt_par_QMoveEvent( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QMoveEvent( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth index 48aad23f00..65b625f634 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth @@ -28,13 +28,15 @@ New = */ HB_FUNC( QT_QPAINTEVENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_IsObjectType( 1, HBQT_TYPE_QRegion ) ) + QString objName = ( QString ) hbqt_par_QString( 1 ); + + if( objName == ( QString ) "QRect" ) { __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QRegion( 1 ) ) ); } - else if( hbqt_IsObjectType( 1, HBQT_TYPE_QRect ) ) + else if( objName == ( QString ) "QRegion" ) { __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QRect( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPainter.qth b/harbour/contrib/hbqt/qtgui/qth/QPainter.qth index 0d09e16452..a65e876818 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPainter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPainter.qth @@ -26,7 +26,7 @@ New = pDevice */ HB_FUNC( QT_QPAINTER ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPainter( hbqt_par_QPaintDevice( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPalette.qth b/harbour/contrib/hbqt/qtgui/qth/QPalette.qth index ba7cb0cbb9..3448891681 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPalette.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPalette.qth @@ -38,11 +38,11 @@ HB_FUNC( QT_QPALETTE ) { __HB_RETPTRGC__( new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPalette( *hbqt_par_QPalette( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QPalette( *hbqt_par_QColor( 1 ), *hbqt_par_QColor( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPen.qth b/harbour/contrib/hbqt/qtgui/qth/QPen.qth index 9d78cebff4..8f77ff3fbb 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPen.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPen.qth @@ -36,11 +36,11 @@ HB_FUNC( QT_QPEN ) { __HB_RETPTRGC__( new QPen( ( Qt::PenStyle ) hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPen( *hbqt_par_QPen( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { QString objName = ( QString ) hbqt_par_QString( 1 ); @@ -53,7 +53,7 @@ HB_FUNC( QT_QPEN ) __HB_RETPTRGC__( new QPen() ); } } - else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() >= 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { Qt::PenStyle iStyle = HB_ISNUM( 3 ) ? ( Qt::PenStyle ) hb_parni( 3 ) : Qt::SolidLine; Qt::PenCapStyle iCap = HB_ISNUM( 4 ) ? ( Qt::PenCapStyle ) hb_parni( 4 ) : Qt::SquareCap; diff --git a/harbour/contrib/hbqt/qtgui/qth/QPicture.qth b/harbour/contrib/hbqt/qtgui/qth/QPicture.qth index 215016180e..977ff4b4f6 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPicture.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPicture.qth @@ -39,7 +39,7 @@ HB_FUNC( QT_QPICTURE ) { __HB_RETPTRGC__( new QPicture( hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPicture( *hbqt_par_QPicture( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth b/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth index 6d1243066a..05a83ceb67 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPixmap.qth @@ -38,9 +38,9 @@ HB_FUNC( QT_QPIXMAP ) { __HB_RETPTRGC__( new QPixmap( hbqt_par_QString( 1 ), ( const char * ) 0, Qt::AutoColor ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + HBQT_GC_T * q = ( HBQT_GC_T * ) hbqt_pPtrFromObj( 1 ); if( q ) { if( q->type == HBQT_TYPE_QPixmap ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QPlainTextDocumentLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QPlainTextDocumentLayout.qth index b9b34c5a2a..db0e5d2291 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPlainTextDocumentLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPlainTextDocumentLayout.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QPLAINTEXTDOCUMENTLAYOUT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPlainTextDocumentLayout( hbqt_par_QTextDocument( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPlainTextEdit.qth b/harbour/contrib/hbqt/qtgui/qth/QPlainTextEdit.qth index cd21ceebd1..02557dabd5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPlainTextEdit.qth @@ -36,11 +36,11 @@ HB_FUNC( QT_QPLAINTEXTEDIT ) { __HB_RETPTRGC__( new QPlainTextEdit() ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPlainTextEdit( hbqt_par_QWidget( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QPlainTextEdit( hbqt_par_QString( 1 ), hbqt_par_QWidget( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPrintPreviewDialog.qth b/harbour/contrib/hbqt/qtgui/qth/QPrintPreviewDialog.qth index 5aa3c5e31e..ac132ba2a1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPrintPreviewDialog.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPrintPreviewDialog.qth @@ -27,7 +27,7 @@ New = pParent, nFlags */ HB_FUNC( QT_QPRINTPREVIEWDIALOG ) { - if( hb_pcount() >= 2 && HB_ISPOINTER( 2 ) ) + if( hb_pcount() >= 2 && HB_ISOBJECT( 2 ) ) __HB_RETPTRGC__( new QPrintPreviewDialog( hbqt_par_QPrinter( 1 ), hbqt_par_QWidget( 2 ), ( Qt::WindowFlags ) hb_parni( 3 ) ) ); else __HB_RETPTRGC__( new QPrintPreviewDialog( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); diff --git a/harbour/contrib/hbqt/qtgui/qth/QPrinter.qth b/harbour/contrib/hbqt/qtgui/qth/QPrinter.qth index e998152a46..0822c85563 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPrinter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPrinter.qth @@ -29,7 +29,7 @@ New = */ HB_FUNC( QT_QPRINTER ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPrinter( *hbqt_par_QPrinterInfo( 1 ), ( QPrinter::PrinterMode ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : QPrinter::ScreenResolution ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth b/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth index 8fb879834d..d1c2aed463 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPrinterInfo.qth @@ -73,11 +73,11 @@ New = */ HB_FUNC( QT_QPRINTERINFO ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinterInfo( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QPrinterInfo( *hbqt_par_QPrinter( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QRadialGradient.qth b/harbour/contrib/hbqt/qtgui/qth/QRadialGradient.qth index 4554abfd20..99bcce2811 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QRadialGradient.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QRadialGradient.qth @@ -32,15 +32,15 @@ New = */ HB_FUNC( QT_QRADIALGRADIENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QRadialGradient( *hbqt_par_QRadialGradient( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QRadialGradient( *hbqt_par_QPointF( 1 ), hb_parnd( 2 ) ) ); } - else if( hb_pcount() == 3 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) ) + else if( hb_pcount() == 3 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) && HB_ISOBJECT( 3 ) ) { __HB_RETPTRGC__( new QRadialGradient( *hbqt_par_QPointF( 1 ), hb_parnd( 2 ), *hbqt_par_QPointF( 3 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QRegExpValidator.qth b/harbour/contrib/hbqt/qtgui/qth/QRegExpValidator.qth index f7f467d64a..dbfaf6c3b3 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QRegExpValidator.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QRegExpValidator.qth @@ -29,11 +29,11 @@ Destructor = */ HB_FUNC( QT_QREGEXPVALIDATOR ) { - if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QRegExpValidator( *hbqt_par_QRegExp( 1 ), hbqt_par_QObject( 2 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QRegExpValidator( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QRegion.qth b/harbour/contrib/hbqt/qtgui/qth/QRegion.qth index 21b937106b..9dae104bcc 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QRegion.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QRegion.qth @@ -33,7 +33,7 @@ New = nX, nY, nWidth, nHeight, nType */ HB_FUNC( QT_QREGION ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QRegion( *hbqt_par_QRegion( 1 ) ) ); } @@ -41,7 +41,7 @@ HB_FUNC( QT_QREGION ) { __HB_RETPTRGC__( new QRegion( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), HB_ISNUM( 5 ) ? ( QRegion::RegionType ) hb_parni( 5 ) : QRegion::Rectangle ) ); } - else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { if( ( QString ) "QPolygon" == hbqt_par_QString( 1 ) ) { @@ -60,7 +60,7 @@ HB_FUNC( QT_QREGION ) __HB_RETPTRGC__( new QRegion() ); } } - else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QRegion( *hbqt_par_QRect( 1 ), ( QRegion::RegionType ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth index 1bb8a58412..56af47906c 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth @@ -28,7 +28,7 @@ Constructor = */ HB_FUNC( QT_QRESIZEEVENT ) { - if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { __HB_RETPTRGC__( new QResizeEvent( *hbqt_par_QSize( 1 ), *hbqt_par_QSize( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSizePolicy.qth b/harbour/contrib/hbqt/qtgui/qth/QSizePolicy.qth index 987a708cd2..09f610f4ba 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSizePolicy.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSizePolicy.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QSIZEPOLICY ) { __HB_RETPTRGC__( new QSizePolicy( ( QSizePolicy::Policy ) hb_parni( 1 ), ( QSizePolicy::Policy ) hb_parni( 2 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QSizePolicy( *hbqt_par_QSizePolicy( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSortFilterProxyModel.qth b/harbour/contrib/hbqt/qtgui/qth/QSortFilterProxyModel.qth index b86c7cd796..fed8eb3da5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSortFilterProxyModel.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSortFilterProxyModel.qth @@ -79,7 +79,7 @@ Constructor = */ HB_FUNC( QT_QSORTFILTERPROXYMODEL ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QSortFilterProxyModel( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSpacerItem.qth b/harbour/contrib/hbqt/qtgui/qth/QSpacerItem.qth index f352b6dab2..1796fdb8e1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSpacerItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSpacerItem.qth @@ -34,7 +34,7 @@ HB_FUNC( QT_QSPACERITEM ) HB_ISNUM( 3 ) ? ( QSizePolicy::Policy ) hb_parni( 3 ) : QSizePolicy::Minimum, HB_ISNUM( 4 ) ? ( QSizePolicy::Policy ) hb_parni( 4 ) : QSizePolicy::Minimum ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QSpacerItem( *hbqt_par_QSpacerItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTableWidgetItem.qth b/harbour/contrib/hbqt/qtgui/qth/QTableWidgetItem.qth index 999366fe69..2595203009 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTableWidgetItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTableWidgetItem.qth @@ -37,7 +37,7 @@ HB_FUNC( QT_QTABLEWIDGETITEM ) { __HB_RETPTRGC__( new QTableWidgetItem( hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QTableWidgetItem( *hbqt_par_QTableWidgetItem( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextBlock.qth b/harbour/contrib/hbqt/qtgui/qth/QTextBlock.qth index bd5fc70ff3..645bfee7f1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextBlock.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextBlock.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QTEXTBLOCK ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QTextBlock( *hbqt_par_QTextBlock( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextBlockFormat.qth b/harbour/contrib/hbqt/qtgui/qth/QTextBlockFormat.qth index 3f1b8ccd07..61e2d7223e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextBlockFormat.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextBlockFormat.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QTEXTBLOCKFORMAT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QTextBlockFormat( *hbqt_par_QTextBlockFormat( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextCursor.qth b/harbour/contrib/hbqt/qtgui/qth/QTextCursor.qth index 6e15606759..ad374e2dd8 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextCursor.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextCursor.qth @@ -35,11 +35,11 @@ New = */ HB_FUNC( QT_QTEXTCURSOR ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QTextCursor( *hbqt_par_QTextCursor( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) { QString object = hbqt_par_QString( 1 ); diff --git a/harbour/contrib/hbqt/qtgui/qth/QWheelEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QWheelEvent.qth index 18aa358069..4918b9ea14 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWheelEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWheelEvent.qth @@ -29,7 +29,7 @@ Constructor = */ HB_FUNC( QT_QWHEELEVENT ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QWheelEvent( *hbqt_par_QWheelEvent( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth index e28f9fb926..580d06b8bd 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth @@ -29,7 +29,7 @@ New = pParent, nFlags */ HB_FUNC( QT_QWIDGET ) { - if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QWidget( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : 0 ) ) ); } diff --git a/harbour/contrib/hbqt/qtnetwork/hbqtnetwork.hbx b/harbour/contrib/hbqt/qtnetwork/hbqtnetwork.hbx index 5438c9c35f..65c14621e6 100644 --- a/harbour/contrib/hbqt/qtnetwork/hbqtnetwork.hbx +++ b/harbour/contrib/hbqt/qtnetwork/hbqtnetwork.hbx @@ -36,21 +36,13 @@ DYNAMIC HB_QNETWORKPROXY DYNAMIC HB_QNETWORKREQUEST DYNAMIC HB_QURLINFO DYNAMIC QFTP -DYNAMIC QFTPFROMPOINTER DYNAMIC QHTTP -DYNAMIC QHTTPFROMPOINTER DYNAMIC QHTTPHEADER -DYNAMIC QHTTPHEADERFROMPOINTER DYNAMIC QHTTPREQUESTHEADER -DYNAMIC QHTTPREQUESTHEADERFROMPOINTER DYNAMIC QHTTPRESPONSEHEADER -DYNAMIC QHTTPRESPONSEHEADERFROMPOINTER DYNAMIC QNETWORKPROXY -DYNAMIC QNETWORKPROXYFROMPOINTER DYNAMIC QNETWORKREQUEST -DYNAMIC QNETWORKREQUESTFROMPOINTER DYNAMIC QURLINFO -DYNAMIC QURLINFOFROMPOINTER DYNAMIC __HBQTNETWORK #if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBQTNETWORK__REQUEST ) diff --git a/harbour/contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth b/harbour/contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth index 6ecbd6b309..78ba018d0e 100644 --- a/harbour/contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth +++ b/harbour/contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth @@ -32,7 +32,7 @@ New = */ HB_FUNC( QT_QNETWORKPROXY ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QNetworkProxy( *hbqt_par_QNetworkProxy( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtnetwork/qth/QUrlInfo.qth b/harbour/contrib/hbqt/qtnetwork/qth/QUrlInfo.qth index bb72314d3c..5127631ba6 100644 --- a/harbour/contrib/hbqt/qtnetwork/qth/QUrlInfo.qth +++ b/harbour/contrib/hbqt/qtnetwork/qth/QUrlInfo.qth @@ -34,7 +34,7 @@ New = */ HB_FUNC( QT_QURLINFO ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QUrlInfo( *hbqt_par_QUrlInfo( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtuitools/qth/QUiLoader.qth b/harbour/contrib/hbqt/qtuitools/qth/QUiLoader.qth index 8b40b2ac84..4356e471c0 100644 --- a/harbour/contrib/hbqt/qtuitools/qth/QUiLoader.qth +++ b/harbour/contrib/hbqt/qtuitools/qth/QUiLoader.qth @@ -30,7 +30,7 @@ New = */ HB_FUNC( QT_QUILOADER ) { - if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { __HB_RETPTRGC__( new QUiLoader( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 4baaf9f50b..fc57e200c5 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -784,15 +784,15 @@ static void hb_gt_wvt_Maximize( PHB_GTWVT pWVT ) else hb_gt_wvt_FitRows( pWVT ); - /* Disable "maximize" button */ - SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, _WVT_WS_MAXED ); - SetWindowPos( pWVT->hWnd, NULL, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DEFERERASE ); - ShowWindow( pWVT->hWnd, SW_HIDE ); - ShowWindow( pWVT->hWnd, SW_NORMAL ); + /* Disable "maximize" button */ + SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, _WVT_WS_MAXED ); + SetWindowPos( pWVT->hWnd, NULL, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DEFERERASE ); + ShowWindow( pWVT->hWnd, SW_HIDE ); + ShowWindow( pWVT->hWnd, SW_NORMAL ); - if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_ROWS ) - hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); + if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_ROWS ) + hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_RESIZE ); } static void hb_gt_wvt_ResetWindowSize( PHB_GTWVT pWVT, HFONT hFont ) @@ -2002,7 +2002,7 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) } else GetClientRect( GetDesktopWindow(), &rt ); - + #else GetClientRect( GetDesktopWindow(), &rt ); #endif