diff --git a/harbour/ChangeLog b/harbour/ChangeLog index baa2187f75..81cacdbbc7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,51 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-02 14:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/hbmk2_plugin_qt.prg + + Activated new resource binary generator code, which + doesn't require qt headers anymore. + + * contrib/hbqt/hbqt.hbc + - Deleted qt dependency. Not needed anymore. + + * contrib/Makefile + * contrib/makefile.prg + + Some contrib libs will now be built using new hbmk2 based + method as an experiment. + + hbnetiosrv will now be built as well using hbmk2, also as + an experiment. + + * contrib/hbide/hbide.prg + + Loading resources manually using new QResource method + implemented by Bacco. + + * utils/hbmk2/hbmk2.prg + + Implemented support for #import Objective C specific + directive when detecting header dependencies. + * .m extension is now compiled with C compiler (not C++) + - Deleted 'experimental' status from plugin related options. + + ; Patches from Bacco: + + * contrib/hbqt/generator/hbqtgen.prg + * contrib/hbqt/qth/QResource.qth + * contrib/hbqt/qtcore/TQResource.prg + * contrib/hbqt/qtcore/QResource.cpp + * contrib/hbqt/doc/en/class_qresource.txt + * contrib/hbqt/hbqt.h + + Added QResource:registerResource()/QResource:unregisterResource() + * With some minor modification from me (unsigned char -> uchar, + some formatting) + + ; Patches from Tamas Tevesz: + + * src/rtl/memvarhb.prg + * src/rtl/hbcom.c + * Tweaks for prev patch: formatting and .hbv type description. + + ; Thanks to both contributors! + 2010-07-02 14:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbpp.h * harbour/src/pp/ppcore.c diff --git a/harbour/contrib/Makefile b/harbour/contrib/Makefile index 5a44bc8029..f6a8414395 100644 --- a/harbour/contrib/Makefile +++ b/harbour/contrib/Makefile @@ -7,9 +7,7 @@ ROOT := ../ # contribs _without_ external dependencies DIRS := \ gtwvg \ - hbblink \ hbbz2 \ - hbclipsm \ hbcomm \ hbct \ hbfoxpro \ @@ -28,9 +26,13 @@ DIRS := \ hbwin \ hbxpp \ hbziparc \ - rddbmcdx \ xhb \ +# under testing in makefile.prg +# hbblink \ +# hbclipsm \ +# rddbmcdx \ + # contribs _with_ external dependencies DIRS += \ gtalleg \ diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 58a76e6fe8..30912944b5 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -92,6 +92,7 @@ REQUEST DBFNTX PROCEDURE Main( ... ) LOCAL oIde + LOCAL oResource hbide_request() @@ -107,11 +108,11 @@ PROCEDURE Main( ... ) hb_setEnv( "HB_IDE_INSTALL", cBse ) #endif - SET CENTURY ON SET EPOCH TO 1970 - /* TODO: activate */ /* hbqtres_HbIde() */ + oResource := QResource():New() + oResource:registerResource_1( hbqtres_HbIde(), ":/resource" ) oIde := HbIde():new( hb_aParams() ):create() oIde:destroy() diff --git a/harbour/contrib/hbqt/doc/en/class_qresource.txt b/harbour/contrib/hbqt/doc/en/class_qresource.txt index b7e278b9e6..38a6df4916 100644 --- a/harbour/contrib/hbqt/doc/en/class_qresource.txt +++ b/harbour/contrib/hbqt/doc/en/class_qresource.txt @@ -38,8 +38,10 @@ :setLocale( pLocale ) -> NIL :size() -> nQint64 :registerResource( cRccFileName, cMapRoot ) -> lBool + :registerResource_1( pRccData, cMapRoot ) -> lBool :searchPaths() -> pQStringList :unregisterResource( cRccFileName, cMapRoot ) -> lBool + :unregisterResource_1( pRccData, cMapRoot ) -> lBool $DESCRIPTION$ diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 925b766f45..316002433d 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -998,7 +998,11 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_, lList, fB aA[ PRT_BODY ] := 'hb_parnd( ' + cHBIdx + ' )' aA[ PRT_DOC ] := 'n' + cDocNM - CASE aA[ PRT_CAST ] == 'uchar' + CASE aA[ PRT_CAST ] == 'uchar' .and. aA[ PRT_L_FAR ] .and. !( aA[ PRT_L_CONST ] ) + aA[ PRT_BODY ] := '( char * ) hb_parc( ' + cHBIdx + ' )' + aA[ PRT_DOC ] := 'c' + cDocNM + + CASE aA[ PRT_CAST ] == 'uchar' .and. !( aA[ PRT_L_FAR ] ) .and. !( aA[ PRT_L_CONST ] ) aA[ PRT_BODY ] := '( char ) hb_parni( ' + cHBIdx + ' )' aA[ PRT_DOC ] := 'n' + cDocNM @@ -1568,9 +1572,9 @@ STATIC FUNCTION DispLogo() LOCAL cHlp := '' cHlp += '' + s_NewLine - cHlp += "Harbour Source Gennerator for QT " + HBRawVersion() + s_NewLine + cHlp += "Harbour Source Generator for QT " + HBRawVersion() + s_NewLine cHlp += "Copyright (c) 2009, Pritpal Bedi " + s_NewLine - cHlp += "http://harbour-project.org/" + s_NewLine + cHlp += "http://harbour-project.org/" + s_NewLine cHlp += '' + s_NewLine OutStd( cHlp ) diff --git a/harbour/contrib/hbqt/hbmk2_plugin_qt.prg b/harbour/contrib/hbqt/hbmk2_plugin_qt.prg index 937af21c41..dd44c591b2 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_qt.prg +++ b/harbour/contrib/hbqt/hbmk2_plugin_qt.prg @@ -77,15 +77,9 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) NEXT FOR EACH cSrc IN hbmk2[ "vars" ][ "aQRC_Src" ] -#ifdef __OWN_QRC_GENERATOR__ cDst := hbmk2_FNameDirExtSet( "rcc_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".c" ) AAdd( hbmk2[ "vars" ][ "aQRC_Dst" ], cDst ) hbmk2_AddInput_C( hbmk2, cDst ) -#else - cDst := hbmk2_FNameDirExtSet( "rcc_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".cpp" ) - AAdd( hbmk2[ "vars" ][ "aQRC_Dst" ], cDst ) - hbmk2_AddInput_CPP( hbmk2, cDst ) -#endif NEXT EXIT @@ -228,7 +222,6 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) IF lBuildIt -#ifdef __OWN_QRC_GENERATOR__ FClose( hb_FTempCreateEx( @cTmp ) ) cCommand := cRCC_BIN +; @@ -265,29 +258,6 @@ FUNCTION hbmk2_plugin_qt( hbmk2 ) ENDIF ENDIF FErase( cTmp ) -#else - cCommand := cRCC_BIN +; - " " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cSrc ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) +; - " -o " + hbmk2_FNameEscape( hbmk2_PathSepToTarget( hbmk2, cDst ), hbmk2[ "nCmd_Esc" ], hbmk2[ "nCmd_FNF" ] ) - - IF hbmk2[ "lTRACE" ] - IF ! hbmk2[ "lQUIET" ] - hbmk2_OutStd( hbmk2, I_( "'rcc' command:" ) ) - ENDIF - hbmk2_OutStdRaw( cCommand ) - ENDIF - - IF ! hbmk2[ "lDONTEXEC" ] .AND. ( nError := hb_processRun( cCommand ) ) != 0 - hbmk2_OutErr( hbmk2, hb_StrFormat( I_( "Error: Running 'rcc' executable. %1$s" ), hb_ntos( nError ) ) ) - IF ! hbmk2[ "lQUIET" ] - hbmk2_OutErrRaw( cCommand ) - ENDIF - IF ! hbmk2[ "lIGNOREERROR" ] - cRetVal := "error" - EXIT - ENDIF - ENDIF -#endif ENDIF NEXT ENDIF diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index 2f59f1272a..9cb35f8876 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -402,9 +402,9 @@ extern void * hbqt_pPtrFromItem( PHB_ITEM pObj ); #define hbqt_par_HBSlots( n ) ( ( HBSlots * ) hbqt_gcpointer( n ) ) #define hbqt_par_QString( n ) ( ( QString ) hb_parcx( n ) ) +#define hbqt_par_uchar( n ) ( ( uchar * ) hb_parcx( n ) ) #define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) #define hbqt_par_Bool( n ) ( hb_parl( n ) ) #define hbqt_par_char( n ) ( hb_parcx( n ) ) #endif /* __HBQT_H */ - diff --git a/harbour/contrib/hbqt/hbqt.hbc b/harbour/contrib/hbqt/hbqt.hbc index d7a8803a1c..695acafc5a 100644 --- a/harbour/contrib/hbqt/hbqt.hbc +++ b/harbour/contrib/hbqt/hbqt.hbc @@ -22,12 +22,5 @@ libs=hbqtcore hbqtgui hbqtnetwork {win|os2}hbcppmm=yes -# Required for compilation of the .cpp files converted from .qrc -# TODO: Create .cpp to .prg converter for resources to fully get around int -depkeyhead=qt:QtCore/qglobal.h -depcontrol=qt:${HB_WITH_QT} -{!darwin}depincpath=qt:/usr/include/qt4 /usr/lib/qt4/include /usr/include -{darwin}depincpath=qt:/Developer/qt/include /Library/Frameworks - gui=yes gt=gtnul diff --git a/harbour/contrib/hbqt/qtcore/QResource.cpp b/harbour/contrib/hbqt/qtcore/QResource.cpp index 35f1274163..c9f920daee 100644 --- a/harbour/contrib/hbqt/qtcore/QResource.cpp +++ b/harbour/contrib/hbqt/qtcore/QResource.cpp @@ -276,6 +276,20 @@ HB_FUNC( QT_QRESOURCE_REGISTERRESOURCE ) } } +/* + * bool registerResource ( const uchar * rccData, const QString & mapRoot = QString() ) + */ +HB_FUNC( QT_QRESOURCE_REGISTERRESOURCE_1 ) +{ + QResource * p = hbqt_par_QResource( 1 ); + if( p ) + hb_retl( ( p )->registerResource( hbqt_par_uchar( 2 ), hbqt_par_QString( 3 ) ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QRESOURCE_REGISTERRESOURCE_1 FP=hb_retl( ( p )->registerResource( hbqt_par_uchar( 2 ), hbqt_par_QString( 3 ) ) ); p is NULL" ) ); + } +} + /* * QStringList searchPaths () */ @@ -304,6 +318,20 @@ HB_FUNC( QT_QRESOURCE_UNREGISTERRESOURCE ) } } +/* + * bool unregisterResource ( const uchar * rccData, const QString & mapRoot = QString() ) + */ +HB_FUNC( QT_QRESOURCE_UNREGISTERRESOURCE_1 ) +{ + QResource * p = hbqt_par_QResource( 1 ); + if( p ) + hb_retl( ( p )->unregisterResource( hbqt_par_uchar( 2 ), hbqt_par_QString( 3 ) ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QRESOURCE_UNREGISTERRESOURCE_1 FP=hb_retl( ( p )->unregisterResource( hbqt_par_uchar( 2 ), hbqt_par_QString( 3 ) ) ); p is NULL" ) ); + } +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtcore/TQResource.prg b/harbour/contrib/hbqt/qtcore/TQResource.prg index 709c273fde..38ef36a62a 100644 --- a/harbour/contrib/hbqt/qtcore/TQResource.prg +++ b/harbour/contrib/hbqt/qtcore/TQResource.prg @@ -77,8 +77,10 @@ CREATE CLASS QResource INHERIT HbQtObjectHandler METHOD setLocale( pLocale ) METHOD size() METHOD registerResource( cRccFileName, cMapRoot ) + METHOD registerResource_1( pRccData, cMapRoot ) METHOD searchPaths() METHOD unregisterResource( cRccFileName, cMapRoot ) + METHOD unregisterResource_1( pRccData, cMapRoot ) ENDCLASS @@ -132,6 +134,10 @@ METHOD QResource:registerResource( cRccFileName, cMapRoot ) RETURN Qt_QResource_registerResource( ::pPtr, cRccFileName, cMapRoot ) +METHOD QResource:registerResource_1( pRccData, cMapRoot ) + RETURN Qt_QResource_registerResource_1( ::pPtr, hbqt_ptr( pRccData ), cMapRoot ) + + METHOD QResource:searchPaths() RETURN Qt_QResource_searchPaths( ::pPtr ) @@ -139,3 +145,7 @@ METHOD QResource:searchPaths() METHOD QResource:unregisterResource( cRccFileName, cMapRoot ) RETURN Qt_QResource_unregisterResource( ::pPtr, cRccFileName, cMapRoot ) + +METHOD QResource:unregisterResource_1( pRccData, cMapRoot ) + RETURN Qt_QResource_unregisterResource_1( ::pPtr, hbqt_ptr( pRccData ), cMapRoot ) + diff --git a/harbour/contrib/hbqt/qth/QResource.qth b/harbour/contrib/hbqt/qth/QResource.qth index 838b158945..f885de2d4a 100644 --- a/harbour/contrib/hbqt/qth/QResource.qth +++ b/harbour/contrib/hbqt/qth/QResource.qth @@ -90,10 +90,10 @@ 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 uchar * rccData, const QString & mapRoot = QString() ) QStringList searchPaths () bool unregisterResource ( const QString & rccFileName, const QString & mapRoot = QString() ) -//bool unregisterResource ( const uchar * rccData, const QString & mapRoot = QString() ) +bool unregisterResource ( const uchar * rccData, const QString & mapRoot = QString() ) diff --git a/harbour/contrib/makefile.prg b/harbour/contrib/makefile.prg index f6c219ce0a..1552267990 100644 --- a/harbour/contrib/makefile.prg +++ b/harbour/contrib/makefile.prg @@ -152,6 +152,16 @@ PROCEDURE Main( ... ) IF s_lTest OutStd( "! New contrib make orchestrator test run." + iif( AScan( aParams, "clean" ) > 0, " CLEAN", "" ) + iif( AScan( aParams, "install" ) > 0, " INSTALL", "" ) + hb_osNewLine() ) + + /* testing with a limited set of contribs */ + aLibsPass1 := {; + "hbblink/hbblink.hbp" ,; + "hbclipsm/hbclipsm.hbp" ,; + "rddbmcdx/hbbmcdx.hbp" } + aLibsPass2 := {} + aLibsPass3 := {} + aUtils := {; + "hbnetio/utils/netiosrv.hbp" } ENDIF IF Empty( GetEnv( "HB_PLATFORM" ) ) .OR. ; @@ -278,7 +288,7 @@ STATIC FUNCTION call_hbmk2( cProject, cTargetDir, cOptions, lDyn ) /* TOFIX: Add -implib option. It collides with static lib so needs to be resolved. */ - nErrorLevel := mk_hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +; + nErrorLevel := mk_hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +; " -quiet -lang=en -width=1000 -q0" + cOptions +; " " + cProject +; iif( lDyn, " -hbdyn -nohblib- " + FN_ExtSet( cProject, ".hbc" ), "" ) +; diff --git a/harbour/src/rtl/hbcom.c b/harbour/src/rtl/hbcom.c index bbfdd8dfb6..3271a112e7 100644 --- a/harbour/src/rtl/hbcom.c +++ b/harbour/src/rtl/hbcom.c @@ -62,7 +62,7 @@ #include "hbinit.h" #include "hbdate.h" -#if defined( HB_OS_UNIX ) && !defined( __WATCOMC__) /* || defined( __DJGPP__ ) */ +#if defined( HB_OS_UNIX ) && !defined( __WATCOMC__ ) /* || defined( __DJGPP__ ) */ # if !defined( HB_HAS_TERMIOS ) # define HB_HAS_TERMIOS # endif diff --git a/harbour/src/rtl/memvarhb.prg b/harbour/src/rtl/memvarhb.prg index a0c423c7f8..e30da81c81 100644 --- a/harbour/src/rtl/memvarhb.prg +++ b/harbour/src/rtl/memvarhb.prg @@ -59,7 +59,7 @@ * 0xC0, 'H', 'B', 'V' followed two-byte version number in Little Endian order. * Corresponding magic(5) rule: * - * 0 string \xc0HBV Harbour memory file + * 0 string \xc0HBV Harbour variable dump file * >4 leshort x version %d * * Until such time that the serialized format changes, and handling of diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 6e29a7a404..94d5c9c15b 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2298,7 +2298,6 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) FN_ExtGet( cParamL ) == ".cc" .OR. ; FN_ExtGet( cParamL ) == ".cxx" .OR. ; FN_ExtGet( cParamL ) == ".cx" .OR. ; - FN_ExtGet( cParamL ) == ".m" .OR. ; _EXT_IS_UPPER( cParam, ".C" ) FOR EACH cParam IN FN_Expand( PathProc( PathSepToSelf( cParam ), aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) ) @@ -2306,7 +2305,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) DEFAULT hbmk[ _HBMK_cFIRST ] TO cParam NEXT - CASE FN_ExtGet( cParamL ) == ".c" + CASE FN_ExtGet( cParamL ) == ".c" .OR. ; + FN_ExtGet( cParamL ) == ".m" FOR EACH cParam IN FN_Expand( PathProc( PathSepToSelf( cParam ), aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) ) AAdd( hbmk[ _HBMK_aC ], cParam ) @@ -5866,8 +5866,8 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, lSystemHeader, tT http://www.pcre.org/pcre.txt */ IF s_hRegexInclude == NIL - /* TODO: Add support for #import directive of Objective C */ - s_hRegexInclude := hb_regexComp( '^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*(\".+?\"|<.+?>)', .F. /* lCaseSensitive */, .T. /* lNewLine */ ) + /* NOTE: #import is Objective C specific directive */ + s_hRegexInclude := hb_regexComp( '^[[:blank:]]*#[[:blank:]]*(include|import)[[:blank:]]*(\".+?\"|<.+?>)', .F. /* lCaseSensitive */, .T. /* lNewLine */ ) IF Empty( s_hRegexInclude ) hbmk_OutErr( hbmk, I_( "Internal Error: Regular expression engine missing or unsupported. Please check your Harbour build settings." ) ) s_hRegexInclude := {} /* To show the error only once by setting to non-NIL empty value */ @@ -5878,7 +5878,7 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, lSystemHeader, tT FOR EACH tmp IN hb_regexAll( s_hRegexInclude, cFile, NIL /* lCaseSensitive */, NIL /* lNewLine */, NIL, NIL /* nGetMatch */, .T. /* lOnlyMatch */ ) - cHeader := tmp[ 2 ] /* First match marker */ + cHeader := tmp[ 3 ] /* First match marker */ lSystemHeader := ( Left( cHeader, 1 ) == "<" ) cHeader := SubStr( cHeader, 2, Len( cHeader ) - 2 ) @@ -7452,10 +7452,10 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) FN_ExtGet( cItemL ) == ".cc" .OR. ; FN_ExtGet( cItemL ) == ".cxx" .OR. ; FN_ExtGet( cItemL ) == ".cx" .OR. ; - FN_ExtGet( cItemL ) == ".m" .OR. ; _EXT_IS_UPPER( cItem, ".C" ) AAddNew( hbmk[ _HBMK_aCPP ], cItem ) - CASE FN_ExtGet( cItemL ) == ".c" + CASE FN_ExtGet( cItemL ) == ".c" .OR. ; + FN_ExtGet( cItemL ) == ".m" AAddNew( hbmk[ _HBMK_aC ], cItem ) CASE FN_ExtGet( cItemL ) == ".d" deplst_read( hbmk, hbmk[ _HBMK_hDEPTS ], cItem ) @@ -8182,7 +8182,6 @@ STATIC FUNCTION getFirstFunc( hbmk, cFile ) Lower( cExt ) == ".cc" .OR. ; Lower( cExt ) == ".cxx" .OR. ; Lower( cExt ) == ".cx" .OR. ; - Lower( cExt ) == ".m" .OR. ; _EXT_IS_UPPER( cExt, ".C" ) /* do nothing */ ELSEIF ! Empty( cExecNM := FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "nm" ) )