2010-06-29 09:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* INSTALL
    + Added HB_QT_RCC_BIN
    ; TODO: Change these envvars to HB_QTPOSTFIX and HB_QTPATH.

  * contrib/hbqt/hbqt.hbc
  - contrib/hbqt/hbmk2_plugin_ui.prg
  + contrib/hbqt/hbmk2_plugin_qt.prg
    * Renamed. This plugin now handles .qrc files too.
    + Added support to compile .qrc files into final executables.
      This uses 'rcc' QT tool and since this one generates a .cpp
      file, the build process will require QT headers.
    ; TODO: If possible, create QRC .cpp to .prg converter to
            remove this dependency. Pritpal, do you think it's 
            possible?

  + contrib/hbide/hbide.qrc
    + Added QRC file with all the .png files in resources dir.

  * contrib/hbide/hbide.hbp
    + Added QT detection. I'm not so secrectly hoping someone will
      create a qrc .cpp to .prg converter so we can drop this
      dependency.

  * contrib/hbide/idemisc.prg
  * contrib/hbide/ideactions.prg
  * contrib/hbide/hbide.prg
    * Changed to pick resource .png files from internal resource
      except external files. This means that /resources dir doesn't
      need to be distributed along hbide executable, IOW hbide
      executable is now self-contained (except a few exceptions like
      hbide.env, plus the fact the internal html pages make references
      to these external files, too.)
    - Deleted some unnecessary trash from source.
    ; TOFIX: hbide.env should reside in same place as hbide.ini.
             Pritpal could you check it?
    ; TOFIX: hbide internal html pages make reference to .png files
             on disk.
This commit is contained in:
Viktor Szakats
2010-06-29 07:53:24 +00:00
parent 796a93512c
commit 8b4144be74
9 changed files with 356 additions and 27 deletions

View File

@@ -16,6 +16,45 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-29 09:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
+ Added HB_QT_RCC_BIN
; TODO: Change these envvars to HB_QTPOSTFIX and HB_QTPATH.
* contrib/hbqt/hbqt.hbc
- contrib/hbqt/hbmk2_plugin_ui.prg
+ contrib/hbqt/hbmk2_plugin_qt.prg
* Renamed. This plugin now handles .qrc files too.
+ Added support to compile .qrc files into final executables.
This uses 'rcc' QT tool and since this one generates a .cpp
file, the build process will require QT headers.
; TODO: If possible, create QRC .cpp to .prg converter to
remove this dependency. Pritpal, do you think it's
possible?
+ contrib/hbide/hbide.qrc
+ Added QRC file with all the .png files in resources dir.
* contrib/hbide/hbide.hbp
+ Added QT detection. I'm not so secrectly hoping someone will
create a qrc .cpp to .prg converter so we can drop this
dependency.
* contrib/hbide/idemisc.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/hbide.prg
* Changed to pick resource .png files from internal resource
except external files. This means that /resources dir doesn't
need to be distributed along hbide executable, IOW hbide
executable is now self-contained (except a few exceptions like
hbide.env, plus the fact the internal html pages make references
to these external files, too.)
- Deleted some unnecessary trash from source.
; TOFIX: hbide.env should reside in same place as hbide.ini.
Pritpal could you check it?
; TOFIX: hbide internal html pages make reference to .png files
on disk.
2010-06-29 08:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
+ Added HB_QT_UIC_BIN.

View File

@@ -337,8 +337,9 @@ HARBOUR
with 3rd party components:
HB_QT_STATIC=yes (only meaningful on Windows platform)
You can override automatic detection of QT 'moc' and 'uic' tools, f.e.:
You can override automatic detection of QT 'moc', 'rcc' and 'uic' tools, f.e.:
HB_QT_MOC_BIN=/opt/qt46/bin/moc
HB_QT_RCC_BIN=/opt/qt46/bin/rcc
HB_QT_UIC_BIN=/opt/qt46/bin/uic
NOTES: - You need to use native path format to your shell/OS.

View File

@@ -73,3 +73,16 @@ idebrowse.prg
-pi=themesex.ui
-pi=toolsutilities.ui
-pi=updown.ui
-pi=hbide.qrc
# Required for compilation of the .cpp files converted from .qrc
# TOFIX: Move this to hbqt.hbc
# 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
{!darwin}-depincpath=qt:/usr/lib/qt4/include
{!darwin}-depincpath=qt:/usr/include
{darwin}-depincpath=qt:/Developer/qt/include
{darwin}-depincpath=qt:/Library/Frameworks

View File

@@ -88,9 +88,6 @@ REQUEST HB_QT
REQUEST DBFCDX
REQUEST DBFNTX
STATIC s_resPath
STATIC s_pathSep
/*----------------------------------------------------------------------*/
PROCEDURE Main( ... )
@@ -114,9 +111,6 @@ PROCEDURE Main( ... )
SET CENTURY ON
SET EPOCH TO 1970
s_resPath := hb_DirBase() + "resources" + hb_OsPathSeparator()
s_pathSep := hb_OsPathSeparator()
oIde := HbIde():new( hb_aParams() ):create()
oIde:destroy()
@@ -273,7 +267,7 @@ CLASS HbIde
DATA cPathSkltns INIT ""
DATA cSaveTo INIT ""
DATA oOpenedSources
DATA resPath INIT hb_DirBase() + "resources" + hb_OsPathSeparator()
DATA resPath INIT ":/resources" + hb_OsPathSeparator()
DATA pathSep INIT hb_OsPathSeparator()
DATA cLastFileOpenPath INIT hb_DirBase() + "projects"
DATA cProcessInfo
@@ -367,7 +361,7 @@ METHOD HbIde:create( aParams )
::nModeUI := UI_MODE_UI
#endif
qPixmap := QPixmap():new( hb_dirBase() + "resources" + hb_osPathSeparator() + "hbidesplash.png" )
qPixmap := QPixmap():new( ":/resources" + hb_osPathSeparator() + "hbidesplash.png" )
qSplash := QSplashScreen():new()
* qSplash:setWindowFlags( hb_bitOr( Qt_WindowStaysOnTopHint, qSplash:windowFlags() ) )
qSplash:setPixmap( qPixmap )
@@ -1435,4 +1429,3 @@ METHOD HbIde:testPainter( qPainter )
RETURN NIL
/*----------------------------------------------------------------------*/

View File

@@ -0,0 +1,191 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>resources/arguments.png</file>
<file>resources/blockcomment.png</file>
<file>resources/blockindentl.png</file>
<file>resources/blockindentr.png</file>
<file>resources/build.png</file>
<file>resources/builderror.png</file>
<file>resources/buildlaunch.png</file>
<file>resources/buildrun.png</file>
<file>resources/buildsource.png</file>
<file>resources/check.png</file>
<file>resources/clean.png</file>
<file>resources/cleanrun.png</file>
<file>resources/close.png</file>
<file>resources/closeall.png</file>
<file>resources/closeexcept.png</file>
<file>resources/closetab.png</file>
<file>resources/codeskeletons.png</file>
<file>resources/column.png</file>
<file>resources/compile.png</file>
<file>resources/copy-filname.png</file>
<file>resources/copy.png</file>
<file>resources/curlinehilight.png</file>
<file>resources/cut.png</file>
<file>resources/cutb16.png</file>
<file>resources/dbl2sglquote.png</file>
<file>resources/dc_delete.png</file>
<file>resources/dc_down.png</file>
<file>resources/dc_folder.png</file>
<file>resources/dc_function.png</file>
<file>resources/dc_home.png</file>
<file>resources/dc_left.png</file>
<file>resources/dc_pdffile.png</file>
<file>resources/dc_plus.png</file>
<file>resources/dc_print.png</file>
<file>resources/dc_quit.png</file>
<file>resources/dc_refresh.png</file>
<file>resources/dc_right.png</file>
<file>resources/dc_textdoc.png</file>
<file>resources/dc_textdocument.png</file>
<file>resources/dc_up.png</file>
<file>resources/debug.png</file>
<file>resources/decreaseindent.png</file>
<file>resources/deleteline.png</file>
<file>resources/description.png</file>
<file>resources/docwriter.png</file>
<file>resources/down.png</file>
<file>resources/down16.png</file>
<file>resources/duplicateline.png</file>
<file>resources/editstree.png</file>
<file>resources/envconfig.png</file>
<file>resources/example.png</file>
<file>resources/exit.png</file>
<file>resources/exporthtml.png</file>
<file>resources/ffn.png</file>
<file>resources/filec.png</file>
<file>resources/fileprg.png</file>
<file>resources/find.png</file>
<file>resources/fl_c.png</file>
<file>resources/fl_dll.png</file>
<file>resources/fl_exe.png</file>
<file>resources/fl_ini.png</file>
<file>resources/fl_lib.png</file>
<file>resources/fl_prg.png</file>
<file>resources/fl_res.png</file>
<file>resources/fl_txt.png</file>
<file>resources/folder.png</file>
<file>resources/font.png</file>
<file>resources/fullscreen.png</file>
<file>resources/go-bottom.png</file>
<file>resources/go-down.png</file>
<file>resources/go-first.png</file>
<file>resources/go-jump.png</file>
<file>resources/go-last.png</file>
<file>resources/go-next.png</file>
<file>resources/go-prev.png</file>
<file>resources/go-top.png</file>
<file>resources/go-up.png</file>
<file>resources/gotoline.png</file>
<file>resources/gotomark.png</file>
<file>resources/harbour.png</file>
<file>resources/harbourhelp.png</file>
<file>resources/hb-16x16.png</file>
<file>resources/hb-32x32.png</file>
<file>resources/hbide.png</file>
<file>resources/hbidesplash.png</file>
<file>resources/hbidesplashwatermark.png</file>
<file>resources/help.png</file>
<file>resources/helpdoc.png</file>
<file>resources/hilight-all.png</file>
<file>resources/horzruler.png</file>
<file>resources/idepreferences.png</file>
<file>resources/increaseindent.png</file>
<file>resources/info.png</file>
<file>resources/insert-datetime.png</file>
<file>resources/insert-external-file.png</file>
<file>resources/insert-procname.png</file>
<file>resources/insert-separator.png</file>
<file>resources/invertcase.png</file>
<file>resources/keyboardmappings.png</file>
<file>resources/launch.png</file>
<file>resources/lense.png</file>
<file>resources/list-developers.png</file>
<file>resources/list-users.png</file>
<file>resources/load_1.png</file>
<file>resources/load_2.png</file>
<file>resources/load_3.png</file>
<file>resources/Lookup.png</file>
<file>resources/matchobj.png</file>
<file>resources/minus.png</file>
<file>resources/modulelist.png</file>
<file>resources/movelinedown.png</file>
<file>resources/movelineup.png</file>
<file>resources/new.png</file>
<file>resources/new2.png</file>
<file>resources/next.png</file>
<file>resources/notepad.png</file>
<file>resources/open.png</file>
<file>resources/panel_1.png</file>
<file>resources/panel_2.png</file>
<file>resources/panel_3.png</file>
<file>resources/panel_4.png</file>
<file>resources/panel_5.png</file>
<file>resources/panel_6.png</file>
<file>resources/panel_7.png</file>
<file>resources/panel_8.png</file>
<file>resources/paste.png</file>
<file>resources/placeremovemark.png</file>
<file>resources/ppo.png</file>
<file>resources/previous.png</file>
<file>resources/print.png</file>
<file>resources/project.png</file>
<file>resources/projectadd.png</file>
<file>resources/projectdel.png</file>
<file>resources/projectstree.png</file>
<file>resources/projtree.png</file>
<file>resources/properties.png</file>
<file>resources/readonly.png</file>
<file>resources/rebuild.png</file>
<file>resources/rebuildlaunch.png</file>
<file>resources/redo.png</file>
<file>resources/richtext.png</file>
<file>resources/run.png</file>
<file>resources/runnodebug.png</file>
<file>resources/save.png</file>
<file>resources/saveall.png</file>
<file>resources/saveas.png</file>
<file>resources/search.png</file>
<file>resources/selectall.png</file>
<file>resources/selectionline.png</file>
<file>resources/setmain.png</file>
<file>resources/sgl2dblquote.png</file>
<file>resources/sort.png</file>
<file>resources/sortdescend.png</file>
<file>resources/source_c.png</file>
<file>resources/source_cpp.png</file>
<file>resources/source_h.png</file>
<file>resources/source_o.png</file>
<file>resources/source_prg.png</file>
<file>resources/source_res.png</file>
<file>resources/source_txt.png</file>
<file>resources/source_unknown.png</file>
<file>resources/spacestotabs.png</file>
<file>resources/stream.png</file>
<file>resources/streamcomment.png</file>
<file>resources/syntaxhiliter.png</file>
<file>resources/tabcmodified.png</file>
<file>resources/tabmodified.png</file>
<file>resources/tabreadonly.png</file>
<file>resources/tabs.png</file>
<file>resources/tabstospaces.png</file>
<file>resources/tabunmodified.png</file>
<file>resources/tests.png</file>
<file>resources/text.png</file>
<file>resources/togglelinenumber.png</file>
<file>resources/tolower.png</file>
<file>resources/tools.png</file>
<file>resources/toupper.png</file>
<file>resources/trashpage.png</file>
<file>resources/undo.png</file>
<file>resources/unload_1.png</file>
<file>resources/up.png</file>
<file>resources/up16.png</file>
<file>resources/vr-16x16.png</file>
<file>resources/vr.png</file>
<file>resources/xmate.png</file>
<file>resources/zoomin.png</file>
<file>resources/zoomout.png</file>
</qresource>
</RCC>

View File

@@ -726,13 +726,12 @@ STATIC FUNCTION mnuNormalizeItem( cCaption )
cCaption := Substr( cCaption, 1, p - 1 )
cCaption := Alltrim( cCaption )
* cIco := s_resPath + Alltrim( cIco ) ---> "s_resPath" is need here!
IF !Empty( cIco )
cIco := StrTran( cIco, '/', hb_OsPathSeparator() )
cIco := StrTran( cIco, '\', hb_OsPathSeparator() )
IF !( hb_OsPathSeparator() $ cIco )
cIco := hb_DirBase() + "resources" + hb_OsPathSeparator() + cIco + "|"
cIco := ":/resources" + hb_OsPathSeparator() + cIco + "|"
ELSE
cIco := cIco + "|"
Endif

View File

@@ -1573,7 +1573,7 @@ FUNCTION hbide_fetchSubPaths( aPaths, cRootPath, lSubs )
FUNCTION hbide_image( cName )
DEFAULT cName TO ""
RETURN hbide_pathToOsPath( hb_DirBase() + "resources" + "/" + cName + ".png" )
RETURN hbide_pathToOsPath( ":/resources" + "/" + cName + ".png" )
/*----------------------------------------------------------------------*/

View File

@@ -12,13 +12,11 @@
#define I_( x ) hb_i18n_gettext( x )
FUNCTION hbmk2_plugin_ui( hbmk2 )
FUNCTION hbmk2_plugin_qt( hbmk2 )
LOCAL cRetVal := ""
LOCAL cUIC_BIN
LOCAL aUI
LOCAL aUI_Dst
LOCAL cRCC_BIN
LOCAL cSrc
LOCAL cDst
@@ -36,21 +34,29 @@ FUNCTION hbmk2_plugin_ui( hbmk2 )
/* Gather input parameters */
aUI := {}
aUI_Dst := {}
hbmk2[ "vars" ][ "aUI" ] := {}
hbmk2[ "vars" ][ "aUI_Dst" ] := {}
hbmk2[ "vars" ][ "aQRC" ] := {}
hbmk2[ "vars" ][ "aQRC_Dst" ] := {}
FOR EACH cSrc IN hbmk2[ "params" ]
IF Lower( hbmk2_FNameExtGet( cSrc ) ) == ".ui"
SWITCH Lower( hbmk2_FNameExtGet( cSrc ) )
CASE ".ui"
cDst := hbmk2_FNameDirExtSet( "ui_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".prg" )
AAdd( aUI, cSrc )
AAdd( aUI_Dst, cDst )
AAdd( hbmk2[ "vars" ][ "aUI" ], cSrc )
AAdd( hbmk2[ "vars" ][ "aUI_Dst" ], cDst )
hbmk2_AddInput_PRG( hbmk2, cDst )
ENDIF
EXIT
CASE ".qrc"
cDst := hbmk2_FNameDirExtSet( "qrc_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".cpp" )
AAdd( hbmk2[ "vars" ][ "aQRC" ], cSrc )
AAdd( hbmk2[ "vars" ][ "aQRC_Dst" ], cDst )
hbmk2_AddInput_CPP( hbmk2, cDst )
EXIT
ENDSWITCH
NEXT
hbmk2[ "vars" ][ "aUI" ] := aUI
hbmk2[ "vars" ][ "aUI_Dst" ] := aUI_Dst
EXIT
CASE "pre_prg"
@@ -153,10 +159,97 @@ FUNCTION hbmk2_plugin_ui( hbmk2 )
EXIT
CASE "pre_c"
IF ! Empty( hbmk2[ "vars" ][ "aQRC" ] )
/* Detect 'rcc' tool location */
cRCC_BIN := GetEnv( "RCC_BIN" )
IF Empty( cRCC_BIN )
IF Empty( GetEnv( "HB_QT_RCC_BIN" ) )
IF hbmk2[ "cPLAT" ] == "win"
IF GetEnv( "HB_WITH_QT" ) == "no"
RETURN NIL
ELSE
cRCC_BIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\rcc.exe"
IF ! hb_FileExists( cRCC_BIN )
hbmk2_OutErr( hbmk2, "HB_WITH_QT points to incomplete QT installation. 'rcc' executable not found." )
RETURN NIL
ENDIF
ENDIF
ELSE
cRCC_BIN := hbmk2_FindInPath( "rcc", GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" )
IF Empty( cRCC_BIN )
cRCC_BIN := hbmk2_FindInPath( "rcc-qt4", GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" )
IF Empty( cRCC_BIN )
hbmk2_OutErr( hbmk2, "HB_QT_RCC_BIN not set, could not autodetect" )
RETURN NIL
ENDIF
ENDIF
ENDIF
IF hbmk2[ "lINFO" ]
hbmk2_OutStd( hbmk2, hb_StrFormat( "Using QT 'rcc' executable: %1$s (autodetected)", cRCC_BIN ) )
ENDIF
ELSE
IF hb_FileExists( GetEnv( "HB_QT_RCC_BIN" ) )
cRCC_BIN := GetEnv( "HB_QT_RCC_BIN" )
IF hbmk2[ "lINFO" ]
hbmk2_OutStd( hbmk2, hb_StrFormat( "Using QT 'rcc' executable: %1$s", cRCC_BIN ) )
ENDIF
ELSE
hbmk2_OutErr( hbmk2, "HB_QT_RCC_BIN points to non-existent file. Make sure to set it to full path and filename of 'rcc' executable." )
RETURN NIL
ENDIF
ENDIF
ENDIF
/* Execute 'rcc' commands on input files */
FOR EACH cSrc, cDst IN hbmk2[ "vars" ][ "aQRC" ], hbmk2[ "vars" ][ "aQRC_Dst" ]
IF hbmk2[ "lINC" ] .AND. ! hbmk2[ "lREBUILD" ]
lBuildIt := ! hb_FGetDateTime( cDst, @tDst ) .OR. ;
! hb_FGetDateTime( cSrc, @tSrc ) .OR. ;
tSrc > tDst
ELSE
lBuildIt := .T.
ENDIF
IF lBuildIt
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
NEXT
ENDIF
EXIT
CASE "post_all"
IF ! hbmk2[ "lINC" ] .OR. hbmk2[ "lCLEAN" ]
AEval( hbmk2[ "vars" ][ "aUI_Dst" ], {| tmp | FErase( tmp ) } )
AEval( hbmk2[ "vars" ][ "aQRC_Dst" ], {| tmp | FErase( tmp ) } )
ENDIF
EXIT

View File

@@ -4,7 +4,7 @@
incpaths=.
plugins=hbmk2_plugin_ui.prg
plugins=hbmk2_plugin_qt.prg
{allwin|os2}libpaths=${HB_WITH_QT}\..\lib