2009-04-11 17:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/common/hbver.c
    + Added skeleton for hb_verHostCPU()

  * source/rtl/trace.c
    ! HB_TRACESTRING() fixed potential GPF if non-string parameter 
      was passed.

  * contrib/hbqt/generator/hbqtgen.prg
    ! Fixed demo to not refer to gtgui on non-Windows systems.
    ! Fixed RTE when source file isn't found. (not verified)
    ! Change EOL handling.
    ! Fixed to use portable path seps when generating demoqt.prg.

  * contrib/hbqt/generator/qt45.qtp
    ! Fixed to use forward slashes. Didn't test if this broke non-*nix.

  * contrib/hbqt/qth/QWindowsXPStyle.qth
    ! Fixed Windows specific QT function wrapper to compile on non-Windows.

  * contrib/hbqt/qth/QPixmap.qth
    ! Deleted Windows specific HBITMAP related functions.

  * contrib/hbqt/tests/hbqt.hbp
    + Added support for darwin

  * contrib/hbqt/Makefile
  * contrib/hbqt/generator/hbqtgen.prg
    + Added support for QT for Darwin official SDK package
      I had to change the way headers are included to follow the 
      QT standard and pass each QT lib header dir on the command 
      line instead of using subdirs in #include directives.
    ; TODO: Probably this change should be applied to all .qth files, 
            but on Darwin it worked without this change for some reason.

  * contrib/hbqt/tests/demoqt.prg
  * contrib/hbqt/TQPixmap.prg
  * contrib/hbqt/hbqt_utils.cpp
  * contrib/hbqt/hbqt_qwidget.cpp
  * contrib/hbqt/hbqt.h
  * contrib/hbqt/hbqt_qwindowsxpstyle.cpp
  * contrib/hbqt/hbqt_slots.cpp
  * contrib/hbqt/hbqt_slots.h
  * contrib/hbqt/hbqt_qpixmap.cpp
    * Regenerated.
This commit is contained in:
Viktor Szakats
2009-04-11 15:34:05 +00:00
parent 84d6d15bd6
commit 806f4a9ad3
18 changed files with 147 additions and 45 deletions

View File

@@ -8,6 +8,52 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-04-11 17:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/common/hbver.c
+ Added skeleton for hb_verHostCPU()
* source/rtl/trace.c
! HB_TRACESTRING() fixed potential GPF if non-string parameter
was passed.
* contrib/hbqt/generator/hbqtgen.prg
! Fixed demo to not refer to gtgui on non-Windows systems.
! Fixed RTE when source file isn't found. (not verified)
! Change EOL handling.
! Fixed to use portable path seps when generating demoqt.prg.
* contrib/hbqt/generator/qt45.qtp
! Fixed to use forward slashes. Didn't test if this broke non-*nix.
* contrib/hbqt/qth/QWindowsXPStyle.qth
! Fixed Windows specific QT function wrapper to compile on non-Windows.
* contrib/hbqt/qth/QPixmap.qth
! Deleted Windows specific HBITMAP related functions.
* contrib/hbqt/tests/hbqt.hbp
+ Added support for darwin
* contrib/hbqt/Makefile
* contrib/hbqt/generator/hbqtgen.prg
+ Added support for QT for Darwin official SDK package
I had to change the way headers are included to follow the
QT standard and pass each QT lib header dir on the command
line instead of using subdirs in #include directives.
; TODO: Probably this change should be applied to all .qth files,
but on Darwin it worked without this change for some reason.
* contrib/hbqt/tests/demoqt.prg
* contrib/hbqt/TQPixmap.prg
* contrib/hbqt/hbqt_utils.cpp
* contrib/hbqt/hbqt_qwidget.cpp
* contrib/hbqt/hbqt.h
* contrib/hbqt/hbqt_qwindowsxpstyle.cpp
* contrib/hbqt/hbqt_slots.cpp
* contrib/hbqt/hbqt_slots.h
* contrib/hbqt/hbqt_qpixmap.cpp
* Regenerated.
2009-04-11 13:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapi.h
* include/hbver.ch

View File

@@ -43,10 +43,23 @@ endif
endif
HB_INC_QT_OK += $(foreach d, $(HB_INC_QT), $(if $(wildcard $(d)/Qt/qglobal.h),$(d),))
ifeq ($(HB_ARCHITECTURE),darwin)
ifeq ($(strip $(HB_INC_QT_OK)),)
HB_INC_QT_OK = $(if $(wildcard /Library/Frameworks/QtCore.framework/Versions/4/Headers/QtCore),spec,)
ifeq ($(HB_INC_QT_OK),spec)
HB_USER_CFLAGS += -I/Library/Frameworks/QtCore.framework/Headers
HB_USER_CFLAGS += -I/Library/Frameworks/QtGui.framework/Headers
HB_USER_CFLAGS += -I/Library/Frameworks/QtNetwork.framework/Headers
HB_USER_CFLAGS += -I/Library/Frameworks/QtWebKit.framework/Headers
endif
endif
endif
ifneq ($(strip $(HB_INC_QT_OK)),)
HB_USER_CFLAGS += $(foreach d, $(HB_INC_QT_OK), -I$(d))
ifneq ($(strip $(HB_INC_QT_OK)),spec)
HB_USER_CFLAGS += $(foreach d, $(HB_INC_QT_OK), -I$(d)/Qt -I$(d)/QtCore -I$(d)/QtGui -I$(d)/QtNetwork -I$(d)/QtWebKit)
endif
include $(TOP)$(ROOT)contrib/hbqt/Makefile_gen

View File

@@ -94,7 +94,6 @@ CREATE CLASS QPixmap INHERIT QPaintDevice
METHOD setMask( pMask ) INLINE Qt_QPixmap_setMask( ::pPtr, pMask )
METHOD size() INLINE Qt_QPixmap_size( ::pPtr )
METHOD toImage() INLINE Qt_QPixmap_toImage( ::pPtr )
METHOD toWinHBITMAP( nFormat ) INLINE Qt_QPixmap_toWinHBITMAP( ::pPtr, nFormat )
METHOD transformed( pTransform, nMode ) INLINE Qt_QPixmap_transformed( ::pPtr, pTransform, nMode )
METHOD transformed_1( pMatrix, nMode ) INLINE Qt_QPixmap_transformed_1( ::pPtr, pMatrix, nMode )
METHOD width() INLINE Qt_QPixmap_width( ::pPtr )

View File

@@ -289,20 +289,25 @@ STATIC FUNCTION GenSource( cProFile, cPathIn, cPathOut, cPathDoc )
cFile := cProFile
ENDIF
IF !file( cFile )
RETURN nil
OutStd( "Cannot find: " + cFile + s_NewLine )
RETURN { nil }
ENDIF
cQth := memoread( cFile )
IF empty( cQth )
RETURN nil
OutStd( "Cannot read: " + cFile + s_NewLine )
RETURN { nil }
ENDIF
OutStd( "Processing: " + cFile + s_NewLine )
/* Prepare to be parsed properly */
cQth := strtran( cQth, s_NewLine , _EOL )
cQth := strtran( cQth, chr( 13 )+chr( 10 ), _EOL )
cQth := strtran( cQth, chr( 13 ) , _EOL )
IF ! hb_osNewLine() == _EOL
cQth := StrTran( cQth, hb_osNewLine(), _EOL )
ENDIF
IF ! hb_osNewLine() == Chr( 13 ) + Chr( 10 )
cQth := StrTran( cQth, Chr( 13 ) + Chr( 10 ), _EOL )
ENDIF
cls_:={}
IF !empty( class_:= PullOutSection( @cQth, 'CLASS' ) )
@@ -1224,7 +1229,7 @@ STATIC FUNCTION Build_HBQT_H( cPathOut )
aadd( txt_, " " )
aadd( txt_, "#define QT_VERSION 0x040500 " )
aadd( txt_, " " )
aadd( txt_, "#include <Qt/qglobal.h> " )
aadd( txt_, "#include <qglobal.h> " )
aadd( txt_, " " )
aadd( txt_, "#if QT_VERSION >= 0x040500 " )
aadd( txt_, " " )
@@ -1413,7 +1418,7 @@ STATIC FUNCTION Build_HBQT_H( cPathOut )
aadd( txt_, "#define hbqt_ret_QAbstractItemModel( p ) ( hb_retptr( ( QAbstractItemModel* ) p ) ) " )
aadd( txt_, "#define hbqt_ret_QPrinter( p ) ( hb_retptr( ( QPrinter* ) p ) ) " )
aadd( txt_, " " )
aadd( txt_, "#include <QtGui/QWidget> " )
aadd( txt_, "#include <QWidget> " )
aadd( txt_, " " )
aadd( txt_, "void hbqt_ret_QRect( QRect ); " )
aadd( txt_, "void hbqt_ret_QSize( QSize ); " )
@@ -1455,7 +1460,7 @@ STATIC FUNCTION Build_HBQT_UTILS_CPP( cPathOut )
aadd( txt_, '#if QT_VERSION >= 0x040500 ' )
aadd( txt_, '/*----------------------------------------------------------------------*/' )
aadd( txt_, ' ' )
aadd( txt_, '#include <QtGui/QWidget> ' )
aadd( txt_, '#include <QWidget> ' )
aadd( txt_, ' ' )
aadd( txt_, '/*----------------------------------------------------------------------*/' )
aadd( txt_, ' ' )
@@ -1654,8 +1659,8 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut )
aadd( txt_, ' ' )
aadd( txt_, '#define SLOTS_H ' )
aadd( txt_, ' ' )
aadd( txt_, '#include <QtCore/QObject> ' )
aadd( txt_, '#include <QtCore/QList> ' )
aadd( txt_, '#include <QObject> ' )
aadd( txt_, '#include <QList> ' )
aadd( txt_, ' ' )
aadd( txt_, '#include "hbapi.h" ' )
aadd( txt_, '#include "hbapiitm.h" ' )
@@ -1705,9 +1710,9 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' ' )
aadd( txt_, '#include "hbqt_slots.h" ' )
aadd( txt_, ' ' )
aadd( txt_, '#include <QtGui/QWidget> ' )
aadd( txt_, '#include <QtCore/QString> ' )
aadd( txt_, '#include <QtCore/QList> ' )
aadd( txt_, '#include <QWidget> ' )
aadd( txt_, '#include <QString> ' )
aadd( txt_, '#include <QList> ' )
aadd( txt_, ' ' )
aadd( txt_, '#define HBQT_EVT_CLICKED 1 ' )
aadd( txt_, '#define HBQT_EVT_TRIGGERED 2 ' )
@@ -2165,8 +2170,8 @@ STATIC FUNCTION Build_MOC_SLOTS_CPP( cPathOut )
/*----------------------------------------------------------------------*/
STATIC FUNCTION Build_Demo()
LOCAL cFile := '..\tests\demoqt.prg'
LOCAL txt_:={}
LOCAL cFile := '..' + s_PathSep + 'tests' + s_PathSep + 'demoqt.prg'
LOCAL txt_:= {}
BuildHeader( @txt_, 2 )
@@ -2339,9 +2344,11 @@ STATIC FUNCTION Build_Demo()
aadd( txt_, ' ' )
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
aadd( txt_, ' ' )
aadd( txt_, '#ifdef __PLATFORM__WINDOWS ' )
aadd( txt_, 'PROCEDURE hb_GtSys() ' )
aadd( txt_, ' HB_GT_GUI_DEFAULT() ' )
aadd( txt_, ' RETURN ' )
aadd( txt_, '#endif ' )
aadd( txt_, ' ' )
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
aadd( txt_, '/* ' )

View File

@@ -4,11 +4,11 @@
; Pritpal Bedi <pritpal@vouchcac.com>
;
-I=..\qth
-I=../qth
-O=..
-D=..\doc
-D=../doc
QAbstractButton.qth

View File

@@ -59,7 +59,7 @@
#define QT_VERSION 0x040500
#include <Qt/qglobal.h>
#include <qglobal.h>
#if QT_VERSION >= 0x040500
@@ -248,7 +248,7 @@
#define hbqt_ret_QAbstractItemModel( p ) ( hb_retptr( ( QAbstractItemModel* ) p ) )
#define hbqt_ret_QPrinter( p ) ( hb_retptr( ( QPrinter* ) p ) )
#include <QtGui/QWidget>
#include <QWidget>
void hbqt_ret_QRect( QRect );
void hbqt_ret_QSize( QSize );

View File

@@ -325,14 +325,6 @@ HB_FUNC( QT_QPIXMAP_TOIMAGE )
hb_retptr( new QImage( hbqt_par_QPixmap( 1 )->toImage() ) );
}
/*
* HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const
*/
HB_FUNC( QT_QPIXMAP_TOWINHBITMAP )
{
hb_retptr( new HBITMAP( hbqt_par_QPixmap( 1 )->toWinHBITMAP( ( HB_ISNIL( 2 ) ? ( QPixmap::HBitmapFormat ) QPixmap::NoAlpha : ( QPixmap::HBitmapFormat ) hb_parni( 2 ) ) ) ) );
}
/*
* QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const
*/

View File

@@ -1532,7 +1532,7 @@ HB_FUNC( QT_QWIDGET_WIDTH )
*/
HB_FUNC( QT_QWIDGET_WINID )
{
hb_retptr( ( HWND ) hbqt_par_QWidget( 1 )->winId() );
hb_retptr( new WId( hbqt_par_QWidget( 1 )->winId() ) );
}
/*

View File

@@ -70,7 +70,11 @@
*/
HB_FUNC( QT_QWINDOWSXPSTYLE )
{
#if defined( HB_OS_WIN )
hb_retptr( ( QWindowsXPStyle* ) new QWindowsXPStyle() );
#else
hb_retptr( NULL );
#endif
}

View File

@@ -62,9 +62,9 @@
#include "hbqt_slots.h"
#include <QtGui/QWidget>
#include <QtCore/QString>
#include <QtCore/QList>
#include <QWidget>
#include <QString>
#include <QList>
#define HBQT_EVT_CLICKED 1
#define HBQT_EVT_TRIGGERED 2

View File

@@ -57,8 +57,8 @@
#define SLOTS_H
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QObject>
#include <QList>
#include "hbapi.h"
#include "hbapiitm.h"

View File

@@ -61,7 +61,7 @@
#if QT_VERSION >= 0x040500
/*----------------------------------------------------------------------*/
#include <QtGui/QWidget>
#include <QWidget>
/*----------------------------------------------------------------------*/

View File

@@ -135,7 +135,7 @@ QImage toImage () const
#
// CGImageRef toMacCGImageRef () const
#
HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const
//HBITMAP toWinHBITMAP ( HBitmapFormat format = NoAlpha ) const
QPixmap transformed ( const QTransform & transform, Qt::TransformationMode mode = Qt::FastTransformation ) const
QPixmap transformed ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) const
int width () const

View File

@@ -71,7 +71,11 @@ New =
*/
HB_FUNC( QT_QWINDOWSXPSTYLE )
{
#if defined( HB_OS_WIN )
hb_retptr( ( QWindowsXPStyle* ) new QWindowsXPStyle() );
#else
hb_retptr( NULL );
#endif
}
</CODE>

View File

@@ -76,6 +76,7 @@
INIT PROCEDURE Qt_Start()
qt_qapplication()
/*qt_qapplication_setstyle( QT_PTROF( QWindowsXPStyle():new() ) )*/
RETURN
EXIT PROCEDURE Qt_End()
@@ -86,23 +87,43 @@ EXIT PROCEDURE Qt_End()
PROCEDURE Main()
Local oLabel
Local oWnd
Local oMenuBar
Local oWnd, oSize
Local oMenuBar, pIcon
Local oMenuA, pAction
LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP
LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle
oWnd := QMainWindow():new()
oWnd:setWindowTitle("Testing - QMainWindow, QMenu, QMenuBar and QAction " )
oWnd:setWindowTitle( "Testing - QMainWindow, QMenu, QMenuBar and QAction " )
oWnd:setWindowIcon( "test" )
pIcon := oWnd:windowIcon()
/* The method 2 */
oWnd:resize( 640, 400 )
oWnd:Show()
#if 0
/* The method 2 */
oSize := QSize():new()
oSize:setWidth( 640 )
oSize:setHeight( 400 )
oWnd:resize_1( QT_PTROF( oSize ) )
#endif
Build_MenuBar( oWnd )
oSBar := QStatusBar():new( QT_PTROF( oWnd ) )
oWnd:setStatusBar( QT_PTROF( oSBar ) )
oSBar:showMessage( "Harbour-QT Statusbar Ready!" )
oStyle := QWindowsXPStyle()
oStyle:standardIcon( 2 )
oWnd:setStyle( QT_PTROF( oStyle ) )
oLabel := QLabel():New( QT_PTROF( oWnd ) )
oLabel:setText( "Testing Harbour + Qt" )
oLabel:move( 200,100 )
oLabel:show()
oWnd:Show()
RETURN
/*----------------------------------------------------------------------*/
@@ -200,9 +221,11 @@ STATIC FUNCTION Dialogs( cType, w, l )
/*----------------------------------------------------------------------*/
#ifdef __PLATFORM__WINDOWS
PROCEDURE hb_GtSys()
HB_GT_GUI_DEFAULT()
RETURN
#endif
/*----------------------------------------------------------------------*/
/*

View File

@@ -2,10 +2,15 @@
# $Id$
#
{mingw}libs=supc++
{mingw|gcc}libs=supc++
libs=hbqt
libs=QtCore4 QtGui4 QtNetwork4 QtWebKit4
{!darwin}libs=QtCore4 QtGui4 QtNetwork4 QtWebKit4
{darwin}libs=/Library/Frameworks/QtCore.framework/QtCore
{darwin}libs=/Library/Frameworks/QtGui.framework/QtGui
{darwin}libs=/Library/Frameworks/QtNetwork.framework/QtNetwork
{darwin}libs=/Library/Frameworks/QtWebKit.framework/QtWebKit
# static libs
#libs=QtCore QtGui QtNetwork QtWebKit
gui=yes
gt=gtnul

View File

@@ -218,6 +218,15 @@ const char * hb_verCPU( void )
return HB_CPU_STR;
}
char * hb_verHostCPU( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_verHostCPU()"));
/* TODO */
return "";
}
/* NOTE: OS() function, as a primary goal will detect the version number
of the target platform. As an extra it may also detect the host OS.
The latter is mainly an issue in DOS, where the host OS can be OS/2

View File

@@ -65,7 +65,7 @@ HB_FUNC( HB_TRACELEVEL )
HB_FUNC( HB_TRACESTRING )
{
char * szMessage = hb_parc( 1 );
char * szMessage = hb_parcx( 1 );
if( szMessage )
{
HB_TRACE(HB_TR_ALWAYS, ("%s", szMessage) );