diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b64cc23df0..1e4fa8475d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,48 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-10 20:35 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/Makefile + + Added generic support to MOC compile headers. + ; If this works out well, it makes it possible to use granular + (non-monolythic) headers for 'Q_OBJECT' classes. + It's also possible to move this logic into sub-libs. + This may also mean that some hacks which were currently + employed can be solved cleanly. + Please test/review. + + * contrib/hbqt/hbqt_slots.h + + contrib/hbqt/hbqt_hbqtableview.h + * contrib/hbqt/hbqt_hbqtableview.cpp + * contrib/hbqt/qth/QTableView.qth + * contrib/hbqt/hbqt_hbdbfmodel.cpp + * contrib/hbqt/qth/QAbstractItemModel.qth + + contrib/hbqt/hbqt_hbdrawingarea.h + * contrib/hbqt/hbqt_hbdrawingarea.cpp + + contrib/hbqt/hbqt_hbqmainwindow.h + * contrib/hbqt/hbqt_hbqmainwindow.cpp + + contrib/hbqt/hbqt_hbqsyntaxhighlighter.h + * contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp + * contrib/hbqt/qth/QSyntaxHighlighter.qth + + contrib/hbqt/hbqt_events.h + * contrib/hbqt/hbqt_events.cpp + * Split monolithic hbqt_slots.h header to distinct + class headers. + + * contrib/hbqt/generator/hbqtgen.prg + - contrib/hbqt/filelist.mk + * contrib/hbqt/Makefile + * Changed to not generate central filelist.mk. + (no dynamic files in central lib) + + * config/rules.mk + - Deleted .l reference. + + * contrib/hbqt/qtgui/QSyntaxHighlighter.cpp + * contrib/hbqt/qtgui/QTableView.cpp + * contrib/hbqt/qtcore/QAbstractItemModel.cpp + * Regenerated. + 2009-12-10 16:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/Makefile * contrib/hbqt/generator/hbqtgen.prg diff --git a/harbour/config/rules.mk b/harbour/config/rules.mk index 7aa09e2e17..79b8b23d5c 100644 --- a/harbour/config/rules.mk +++ b/harbour/config/rules.mk @@ -65,8 +65,6 @@ endif # Eliminate these rules. %.c : %.y -%.c : %.l - # Rule to generate an object file from a C source file in the parent. %$(OBJ_EXT) : $(GRANDP)%.c $(CC_RULE) diff --git a/harbour/contrib/hbqt/Makefile b/harbour/contrib/hbqt/Makefile index 00bf55d9a0..4eeb505f5c 100644 --- a/harbour/contrib/hbqt/Makefile +++ b/harbour/contrib/hbqt/Makefile @@ -15,13 +15,16 @@ include $(TOP)$(ROOT)contrib/hbqt/detect.mk ifneq ($(HB_HAS_QT),) -moc_slots.cpp : $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h - $(MOC_BIN) $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h > moc_slots.cpp - - include $(TOP)$(ROOT)contrib/hbqt/filelist.mk - - CPP_SOURCES += \ - moc_slots.cpp \ + MOC_HEADERS := \ + hbqt_events.h \ + hbqt_hbdbfmodel.h \ + hbqt_hbdrawingarea.h \ + hbqt_hbqmainwindow.h \ + hbqt_hbqsyntaxhighlighter.h \ + hbqt_hbqtableview.h \ + hbqt_slots.h \ + + CPP_SOURCES := \ hbqt_base.cpp \ hbqt_utils.cpp \ hbqt_slots.cpp \ @@ -33,6 +36,15 @@ moc_slots.cpp : $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h hbqt_hbqsyntaxhighlighter.cpp \ hbqt_hbqtableview.cpp \ +MOC_CPP_SOURCES := $(foreach dir,$(MOC_HEADERS),moc_$(dir:.h=.cpp)) + +$(MOC_CPP_SOURCES) : moc_%.cpp : $(GRANDP)%.h + +moc_%.cpp : $(GRANDP)%.h + $(MOC_BIN) $? -o $@ + + CPP_SOURCES += $(MOC_CPP_SOURCES) + include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbqt/filelist.mk b/harbour/contrib/hbqt/filelist.mk deleted file mode 100644 index 2665442367..0000000000 --- a/harbour/contrib/hbqt/filelist.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# - -# -------------------------------------------------------------------- -# WARNING: Automatically generated source file. DO NOT EDIT! -# Instead, edit corresponding .qth file, -# or the generator tool itself, and run regenarate. -# -------------------------------------------------------------------- - -CPP_SOURCES := \ - moc_slots.cpp \ - hbqt_base.cpp \ - hbqt_utils.cpp \ - hbqt_slots.cpp \ - hbqt_destruct.cpp \ - -# Don't delete this comment, it's here to ensure empty -# line above is kept intact. diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 8642704260..24c8be1190 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -1656,35 +1656,6 @@ STATIC FUNCTION Build_MakeFile( cpp_, prg_, cPathOut ) aadd( hdr_, "# --------------------------------------------------------------------" ) aadd( hdr_, "" ) - /* Insert .cpp sources */ - txt_:= {} - aeval( hdr_, {|e| aadd( txt_, e ) } ) - aadd( txt_, "CPP_SOURCES := \" ) - // - // We will strip lines below once subs proto is running - #if 0 - FOR EACH s IN cpp_ - aadd( txt_, " " + s + ".cpp \" ) - NEXT - aadd( txt_, "" ) - aadd( txt_, "" ) - aadd( txt_, "" ) - IF !empty( prg_ ) - aadd( txt_, "PRG_SOURCES := \" ) - FOR EACH s IN prg_ - aadd( txt_, " " + "T" + s + ".prg \" ) - NEXT - ENDIF - #endif - // ------------------------------------------------------ - aadd( txt_, "" ) - aadd( txt_, "# Don't delete this comment, it's here to ensure empty" ) - aadd( txt_, "# line above is kept intact." ) - // - cFile := cPathOut + s_PathSep + "filelist.mk" - CreateTarget( cFile, txt_ ) - - /* Sub Libraries */ aadd( aSubs, { "qtwebkit" , aWebkit } ) aadd( aSubs, { "qtnetwork", aNetwork } ) diff --git a/harbour/contrib/hbqt/hbqt_events.cpp b/harbour/contrib/hbqt/hbqt_events.cpp index e813b546b4..677cd17637 100644 --- a/harbour/contrib/hbqt/hbqt_events.cpp +++ b/harbour/contrib/hbqt/hbqt_events.cpp @@ -62,7 +62,9 @@ #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_events.h" + +#include /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/hbqt_events.h b/harbour/contrib/hbqt/hbqt_events.h new file mode 100644 index 0000000000..312274d942 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_events.h @@ -0,0 +1,84 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HBQT_EVENTS_H +#define HBQT_EVENTS_H + +#include "hbapi.h" + +/*----------------------------------------------------------------------*/ + +#include +#include +#include + +class Events: public QObject +{ + Q_OBJECT + +public: + Events( QObject *parent = 0 ); + ~Events(); + QList listBlock; + QList listActv; + QList listObj; + +protected: + bool eventFilter( QObject * obj, QEvent * event ); + +}; + +/*----------------------------------------------------------------------*/ + +#endif diff --git a/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp b/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp index 9011b2648b..560bebee8e 100644 --- a/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp @@ -54,13 +54,17 @@ /*----------------------------------------------------------------------*/ #include "hbapi.h" +#include "hbapiitm.h" #include "hbvm.h" #include "hbqt.h" #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_hbdbfmodel.h" + +#include +#include #define HBQT_BRW_CELLVALUE 1001 diff --git a/harbour/contrib/hbqt/hbqt_hbdrawingarea.cpp b/harbour/contrib/hbqt/hbqt_hbdrawingarea.cpp index 9c725e8691..26f570b5e4 100644 --- a/harbour/contrib/hbqt/hbqt_hbdrawingarea.cpp +++ b/harbour/contrib/hbqt/hbqt_hbdrawingarea.cpp @@ -59,7 +59,7 @@ #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_hbdrawingarea.h" HBDrawingArea::HBDrawingArea(QWidget *parent) : QWidget(parent) { diff --git a/harbour/contrib/hbqt/hbqt_hbdrawingarea.h b/harbour/contrib/hbqt/hbqt_hbdrawingarea.h new file mode 100644 index 0000000000..ad9dd0ad6d --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_hbdrawingarea.h @@ -0,0 +1,80 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HBQT_HBDRAWINGAREA_H +#define HBQT_HBDRAWINGAREA_H + +/*----------------------------------------------------------------------*/ + +#include + +class HBDrawingArea : public QWidget +{ + Q_OBJECT + +public: + HBDrawingArea( QWidget *parent = 0 ); + virtual ~HBDrawingArea( void ); + + void keyPressEvent( QKeyEvent * event ); + void mouseMoveEvent( QMouseEvent * event ); + +signals: + void sg_mouseMoveEvent( QMouseEvent * event ); + void sg_keyPressEvent( QKeyEvent * event ); +}; + +/*----------------------------------------------------------------------*/ + +#endif diff --git a/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp b/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp index 1644c5c0bb..04f5638630 100644 --- a/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp @@ -62,7 +62,7 @@ #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_hbqmainwindow.h" static PHB_ITEM s_mutex = NULL; diff --git a/harbour/contrib/hbqt/hbqt_hbqmainwindow.h b/harbour/contrib/hbqt/hbqt_hbqmainwindow.h new file mode 100644 index 0000000000..27988ad346 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_hbqmainwindow.h @@ -0,0 +1,92 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HBQT_HBQMAINWINDOW_H +#define HBQT_HBQMAINWINDOW_H + +#include "hbapiitm.h" + +/*----------------------------------------------------------------------*/ + +#include +#include + +class HBQMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + HBQMainWindow( PHB_ITEM pBlock, int iThreadID ); + virtual ~HBQMainWindow(); + + bool event( QEvent * event ); + void keyPressEvent( QKeyEvent * event ); + void mouseDoubleClickEvent( QMouseEvent * event ); + void mouseMoveEvent( QMouseEvent * event ); + void mousePressEvent( QMouseEvent * event ); + void mouseReleaseEvent( QMouseEvent * event ); + void wheelEvent( QWheelEvent * event ); + void resizeEvent( QResizeEvent * event ); + void paintEvent( QPaintEvent * event ); + void focusInEvent( QFocusEvent * event ); + void focusOutEvent( QFocusEvent * event ); + void closeEvent( QCloseEvent * event ); + + PHB_ITEM block; + int threadID; +}; + +/*----------------------------------------------------------------------*/ + +#endif diff --git a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp index d3e208f33b..7e0604d069 100644 --- a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp @@ -59,7 +59,10 @@ #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_hbqsyntaxhighlighter.h" + +#include +#include HBQSyntaxHighlighter::HBQSyntaxHighlighter( QTextDocument *parent ) : QSyntaxHighlighter( parent ) diff --git a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h new file mode 100644 index 0000000000..c2ec7a01a3 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h @@ -0,0 +1,95 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HBQSYNTAXHIGHLIGHTER_H +#define HBQSYNTAXHIGHLIGHTER_H + +/*----------------------------------------------------------------------*/ + +#include + +class QTextDocument; + +class HBQSyntaxHighlighter : public QSyntaxHighlighter +{ + Q_OBJECT + +public: + HBQSyntaxHighlighter( QTextDocument *parent = 0 ); + +protected: + void highlightBlock( const QString &text ); + +private: + struct HighlightingRule + { + QRegExp pattern; + QTextCharFormat format; + }; + QVector highlightingRules; + + QRegExp commentStartExpression; + QRegExp commentEndExpression; + + QTextCharFormat keywordFormat; + QTextCharFormat classFormat; + QTextCharFormat singleLineCommentFormat; + QTextCharFormat multiLineCommentFormat; + QTextCharFormat quotationFormat; + QTextCharFormat functionFormat; +}; + +/*----------------------------------------------------------------------*/ + +#endif diff --git a/harbour/contrib/hbqt/hbqt_hbqtableview.cpp b/harbour/contrib/hbqt/hbqt_hbqtableview.cpp index 1df708760e..8608f6d730 100644 --- a/harbour/contrib/hbqt/hbqt_hbqtableview.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqtableview.cpp @@ -59,7 +59,7 @@ #if QT_VERSION >= 0x040500 -#include "hbqt_slots.h" +#include "hbqt_hbqtableview.h" HBQTableView::HBQTableView( QWidget * parent ) : QTableView( parent ) { diff --git a/harbour/contrib/hbqt/hbqt_hbqtableview.h b/harbour/contrib/hbqt/hbqt_hbqtableview.h new file mode 100644 index 0000000000..5e2642b5d3 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_hbqtableview.h @@ -0,0 +1,97 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#ifndef HBQT_HBQTABLEVIEW_H +#define HBQT_HBQTABLEVIEW_H + +#include + +/*----------------------------------------------------------------------*/ +class HBQTableView : public QTableView +{ + Q_OBJECT + +public: + HBQTableView( QWidget * parent = 0 ); + virtual ~HBQTableView(); + + void keyPressEvent( QKeyEvent * event ); + void mouseDoubleClickEvent( QMouseEvent * event ); + void mouseMoveEvent( QMouseEvent * event ); + void mousePressEvent( QMouseEvent * event ); + void mouseReleaseEvent( QMouseEvent * event ); + void wheelEvent( QWheelEvent * event ); + void resizeEvent( QResizeEvent * event ); + void scrollContentsBy( int x, int y ); + void scrollTo( const QModelIndex & index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible ); + + QModelIndex navigate( int cursorAction ); + + QModelIndex moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers ); + +signals: + void sg_keyPressEvent( QKeyEvent * event ); + void sg_mouseMoveEvent( QMouseEvent * event ); + void sg_mouseDoubleClickEvent( QMouseEvent * event ); + void sg_mousePressEvent( QMouseEvent * event ); + void sg_mouseReleaseEvent( QMouseEvent * event ); + void sg_wheelEvent( QWheelEvent * event ); + void sg_resizeEvent( QResizeEvent * event ); + void sg_moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers ); + void sg_scrollContentsBy( int x, int y ); +}; + +/*----------------------------------------------------------------------*/ + +#endif diff --git a/harbour/contrib/hbqt/hbqt_slots.h b/harbour/contrib/hbqt/hbqt_slots.h index 68c933a454..8401e4a036 100644 --- a/harbour/contrib/hbqt/hbqt_slots.h +++ b/harbour/contrib/hbqt/hbqt_slots.h @@ -51,12 +51,14 @@ * If you do not wish that, delete this exception notice. * */ -/*----------------------------------------------------------------------*/ +#ifndef HBQT_SLOTS_H +#define HBQT_SLOTS_H -#ifndef SLOTS_H +#include "hbapiitm.h" -#define SLOTS_H +#include "hbqt_hbdrawingarea.h" +#include "hbqt_hbqtableview.h" #include #include @@ -77,116 +79,6 @@ #include #include -#include "hbapi.h" -#include "hbapiitm.h" - -/*----------------------------------------------------------------------*/ - -class HBQMainWindow : public QMainWindow -{ - Q_OBJECT - -public: - HBQMainWindow( PHB_ITEM pBlock, int iThreadID ); - virtual ~HBQMainWindow(); - - bool event( QEvent * event ); - void keyPressEvent( QKeyEvent * event ); - void mouseDoubleClickEvent( QMouseEvent * event ); - void mouseMoveEvent( QMouseEvent * event ); - void mousePressEvent( QMouseEvent * event ); - void mouseReleaseEvent( QMouseEvent * event ); - void wheelEvent( QWheelEvent * event ); - void resizeEvent( QResizeEvent * event ); - void paintEvent( QPaintEvent * event ); - void focusInEvent( QFocusEvent * event ); - void focusOutEvent( QFocusEvent * event ); - void closeEvent( QCloseEvent * event ); - - PHB_ITEM block; - int threadID; -}; - -/*----------------------------------------------------------------------*/ - -class HBDrawingArea : public QWidget -{ - Q_OBJECT - -public: - HBDrawingArea( QWidget *parent = 0 ); - virtual ~HBDrawingArea( void ); - - void keyPressEvent( QKeyEvent * event ); - void mouseMoveEvent( QMouseEvent * event ); - -signals: - void sg_mouseMoveEvent( QMouseEvent * event ); - void sg_keyPressEvent( QKeyEvent * event ); -}; - -/*----------------------------------------------------------------------*/ - -class HBDbfModel : public QAbstractItemModel -{ - Q_OBJECT - -public: - HBDbfModel( PHB_ITEM pBlock ); - virtual ~HBDbfModel( void ); - - PHB_ITEM block; - int iRows; - int iCols; - - void hbSetRowColumns( int rows, int cols ); - - Qt::ItemFlags flags( const QModelIndex & index ) const; - QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const; - QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; - int rowCount( const QModelIndex & parent = QModelIndex() ) const; - int columnCount( const QModelIndex & parent = QModelIndex() ) const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - void reset(); -}; - -/*----------------------------------------------------------------------*/ - -class HBQTableView : public QTableView -{ - Q_OBJECT - -public: - HBQTableView( QWidget * parent = 0 ); - virtual ~HBQTableView(); - - void keyPressEvent( QKeyEvent * event ); - void mouseDoubleClickEvent( QMouseEvent * event ); - void mouseMoveEvent( QMouseEvent * event ); - void mousePressEvent( QMouseEvent * event ); - void mouseReleaseEvent( QMouseEvent * event ); - void wheelEvent( QWheelEvent * event ); - void resizeEvent( QResizeEvent * event ); - void scrollContentsBy( int x, int y ); - void scrollTo( const QModelIndex & index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible ); - - QModelIndex navigate( int cursorAction ); - - QModelIndex moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers ); - -signals: - void sg_keyPressEvent( QKeyEvent * event ); - void sg_mouseMoveEvent( QMouseEvent * event ); - void sg_mouseDoubleClickEvent( QMouseEvent * event ); - void sg_mousePressEvent( QMouseEvent * event ); - void sg_mouseReleaseEvent( QMouseEvent * event ); - void sg_wheelEvent( QWheelEvent * event ); - void sg_resizeEvent( QResizeEvent * event ); - void sg_moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers ); - void sg_scrollContentsBy( int x, int y ); -}; - /*----------------------------------------------------------------------*/ class Slots: public QObject @@ -340,58 +232,6 @@ public slots: /* */ }; -class Events: public QObject -{ - Q_OBJECT - -public: - Events( QObject *parent = 0 ); - ~Events(); - QList listBlock; - QList listObj; - -protected: - bool eventFilter( QObject * obj, QEvent * event ); - -}; - -/*----------------------------------------------------------------------*/ - -#include -#include -#include - -class QTextDocument; - -class HBQSyntaxHighlighter : public QSyntaxHighlighter -{ - Q_OBJECT - -public: - HBQSyntaxHighlighter( QTextDocument *parent = 0 ); - -protected: - void highlightBlock( const QString &text ); - -private: - struct HighlightingRule - { - QRegExp pattern; - QTextCharFormat format; - }; - QVector highlightingRules; - - QRegExp commentStartExpression; - QRegExp commentEndExpression; - - QTextCharFormat keywordFormat; - QTextCharFormat classFormat; - QTextCharFormat singleLineCommentFormat; - QTextCharFormat multiLineCommentFormat; - QTextCharFormat quotationFormat; - QTextCharFormat functionFormat; -}; - /*----------------------------------------------------------------------*/ #endif diff --git a/harbour/contrib/hbqt/qtcore/QAbstractItemModel.cpp b/harbour/contrib/hbqt/qtcore/QAbstractItemModel.cpp index 165c952f7c..9b9712b35a 100644 --- a/harbour/contrib/hbqt/qtcore/QAbstractItemModel.cpp +++ b/harbour/contrib/hbqt/qtcore/QAbstractItemModel.cpp @@ -87,7 +87,7 @@ #include #include -#include "../hbqt_slots.h" +#include "../hbqt_hbdbfmodel.h" /* * QAbstractItemModel ( QObject * parent = 0 ) diff --git a/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp b/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp index aca83b1fd2..82cd7919df 100644 --- a/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp +++ b/harbour/contrib/hbqt/qtgui/QSyntaxHighlighter.cpp @@ -69,7 +69,7 @@ #include #include -#include "../hbqt_slots.h" +#include "../hbqt_hbqsyntaxhighlighter.h" /* * QSyntaxHighlighter ( QObject * parent ) diff --git a/harbour/contrib/hbqt/qtgui/QTableView.cpp b/harbour/contrib/hbqt/qtgui/QTableView.cpp index 4cf088b880..ff3ba1b93e 100644 --- a/harbour/contrib/hbqt/qtgui/QTableView.cpp +++ b/harbour/contrib/hbqt/qtgui/QTableView.cpp @@ -70,7 +70,7 @@ #include -#include "../hbqt_slots.h" +#include "../hbqt_hbqtableview.h" /* * QTableView ( QWidget * parent = 0 ) diff --git a/harbour/contrib/hbqt/qth/QAbstractItemModel.qth b/harbour/contrib/hbqt/qth/QAbstractItemModel.qth index 7eb6ddd1fb..60b5c208c9 100644 --- a/harbour/contrib/hbqt/qth/QAbstractItemModel.qth +++ b/harbour/contrib/hbqt/qth/QAbstractItemModel.qth @@ -94,7 +94,7 @@ METHOD HBDbfModel:destroy() #include #include -#include "../hbqt_slots.h" +#include "../hbqt_hbdbfmodel.h" /* * QAbstractItemModel ( QObject * parent = 0 ) diff --git a/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth b/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth index 23ec9e835e..b4be24f5cf 100644 --- a/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth +++ b/harbour/contrib/hbqt/qth/QSyntaxHighlighter.qth @@ -72,7 +72,7 @@ oSynHiliter := QSyntaxHighlighter():new( "QTextEdit", pQTextEdit ) #include -#include "../hbqt_slots.h" +#include "../hbqt_hbqsyntaxhighlighter.h" /* * QSyntaxHighlighter ( QObject * parent ) diff --git a/harbour/contrib/hbqt/qth/QTableView.qth b/harbour/contrib/hbqt/qth/QTableView.qth index 3b3b9ddda5..818d0e9e84 100644 --- a/harbour/contrib/hbqt/qth/QTableView.qth +++ b/harbour/contrib/hbqt/qth/QTableView.qth @@ -83,7 +83,7 @@ METHOD HBQTableView:destroy() #include -#include "../hbqt_slots.h" +#include "../hbqt_hbqtableview.h" /* * QTableView ( QWidget * parent = 0 )