From 6f18c82253af717cbce7b726b72db86b634ae40b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 22 Feb 2010 16:24:59 +0000 Subject: [PATCH] 2010-02-22 17:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbqt_hbdbfmodel.cpp * contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp * contrib/hbqt/hbqt_hbqtableview.cpp * contrib/hbqt/hbqt_hbevents.cpp * contrib/hbqt/hbqt_destruct.cpp * contrib/hbqt/hbqt_utils.cpp * contrib/hbqt/hbqt_hbqmainwindow.cpp * contrib/hbqt/hbqt_hbqplaintextedit.cpp * contrib/hbqt/hbqt_base.cpp * contrib/hbqt/hbqt_hbslots.cpp * Cleaned header inclusion order after adding hbapi.h to hbqt.h. * config/os2/gcc.mk ! Fixed to use '-Wl,' trick proposed by Przemek, to forward obj list script filename directly to linker. This gets around the problem where gcc tries to pass expanded scripts to subprocesses (ld) via cmdline, thus imposing a 32K limit also to script files. --- harbour/ChangeLog | 24 +++++- harbour/config/os2/gcc.mk | 11 +-- harbour/contrib/hbqt/hbqt_base.cpp | 2 - harbour/contrib/hbqt/hbqt_destruct.cpp | 5 +- harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp | 5 +- harbour/contrib/hbqt/hbqt_hbevents.cpp | 5 +- harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp | 5 +- .../contrib/hbqt/hbqt_hbqplaintextedit.cpp | 75 ++++++------------- .../hbqt/hbqt_hbqsyntaxhighlighter.cpp | 2 - harbour/contrib/hbqt/hbqt_hbqtableview.cpp | 2 - harbour/contrib/hbqt/hbqt_hbslots.cpp | 5 +- harbour/contrib/hbqt/hbqt_utils.cpp | 5 +- 12 files changed, 59 insertions(+), 87 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b434c90483..00772582ae 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,26 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-22 17:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/hbqt_hbdbfmodel.cpp + * contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp + * contrib/hbqt/hbqt_hbqtableview.cpp + * contrib/hbqt/hbqt_hbevents.cpp + * contrib/hbqt/hbqt_destruct.cpp + * contrib/hbqt/hbqt_utils.cpp + * contrib/hbqt/hbqt_hbqmainwindow.cpp + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + * contrib/hbqt/hbqt_base.cpp + * contrib/hbqt/hbqt_hbslots.cpp + * Cleaned header inclusion order after adding hbapi.h to hbqt.h. + + * config/os2/gcc.mk + ! Fixed to use '-Wl,' trick proposed by Przemek, to forward obj list + script filename directly to linker. + This gets around the problem where gcc tries to pass expanded + scripts to subprocesses (ld) via cmdline, thus imposing a 32K + limit also to script files. + 2010-02-22 15:20 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * config/os2/gcc.mk + Attempt to fix direct ld usage to create Harbour .dlls. @@ -24,13 +44,13 @@ * INSTALL - Deleted TCPV4 header instructions for OS/2. (they still - works, it just got less emphasis with this) + work, it just got less emphasis with this) 2010-02-22 15:06 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbdefs.h ! Fixed to not #include unconditionally. This should be done by specific source code, if needed. INCOMPATIBLE, - if source code relied on this behavior. From now on it, + if source code relied on this behavior. From now on, it should include dos.h manually. * src/vm/thread.c diff --git a/harbour/config/os2/gcc.mk b/harbour/config/os2/gcc.mk index 9828da6405..26e58d95fe 100644 --- a/harbour/config/os2/gcc.mk +++ b/harbour/config/os2/gcc.mk @@ -107,18 +107,13 @@ else AR_RULE = $(create_library) $(ARSTRIP) & $(RM) __lib__.tmp endif -ifeq ($(HB_COMPILER),gccomf) - DY := $(HB_CCPATH)$(HB_CCPREFIX)emxomfld -else - DY := $(HB_CCPATH)$(HB_CCPREFIX)ld -endif +DY := $(CC) DFLAGS += -shared $(LIBPATHS) ifeq ($(HB_COMPILER),gccomf) DFLAGS += -Zomf endif DY_OUT := $(LD_OUT) -DLIBPATHS := $(foreach dir,$(HB_COMP_PATH_PUB)..\lib $(subst ;, ,$(LIBRARY_PATH)),-L$(dir)) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS) c_alias c_dll os2 gcc_so_d,-l$(lib)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib)) # NOTE: The empty line directly before 'endef' HAS TO exist! define dyn_object @@ -136,7 +131,7 @@ define create_dynlib @$(ECHO) $(ECHOQUOTE)DATA PRELOAD MOVEABLE MULTIPLE NONSHARED$(ECHOQUOTE) >> __dyn__.def @$(ECHO) $(ECHOQUOTE)EXPORTS$(ECHOQUOTE) >> __dyn__.def $(foreach file,$^,$(dyn_object)) - $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DLIBPATHS) $(DY_OUT)$(DYN_DIR)/$@ dll0$(OBJ_EXT) @__dyn__.tmp __dyn__.def $(DLIBS) $(DYSTRIP) + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ -Wl,@__dyn__.tmp __dyn__.def $(DLIBS) $(DYSTRIP) emximp -o $(IMP_FILE) $(DYN_DIR)/$@ endef diff --git a/harbour/contrib/hbqt/hbqt_base.cpp b/harbour/contrib/hbqt/hbqt_base.cpp index a88a335258..da95657f4d 100644 --- a/harbour/contrib/hbqt/hbqt_base.cpp +++ b/harbour/contrib/hbqt/hbqt_base.cpp @@ -52,8 +52,6 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" - #include "hbqt.h" HB_FUNC( QT_VERSION ) diff --git a/harbour/contrib/hbqt/hbqt_destruct.cpp b/harbour/contrib/hbqt/hbqt_destruct.cpp index fdc3da1a60..e431d60361 100644 --- a/harbour/contrib/hbqt/hbqt_destruct.cpp +++ b/harbour/contrib/hbqt/hbqt_destruct.cpp @@ -51,12 +51,11 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include diff --git a/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp b/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp index d7146fe787..29eab39c00 100644 --- a/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_hbdbfmodel.cpp @@ -51,12 +51,11 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include "hbqt_hbdbfmodel.h" diff --git a/harbour/contrib/hbqt/hbqt_hbevents.cpp b/harbour/contrib/hbqt/hbqt_hbevents.cpp index 8989f22e2b..f823fcfe5d 100644 --- a/harbour/contrib/hbqt/hbqt_hbevents.cpp +++ b/harbour/contrib/hbqt/hbqt_hbevents.cpp @@ -53,13 +53,12 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbstack.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include "hbqt_hbevents.h" diff --git a/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp b/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp index 8368835fd4..7670a0ac90 100644 --- a/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqmainwindow.cpp @@ -51,13 +51,12 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbthread.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include "hbqt_hbqmainwindow.h" diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 775cd049d8..3883c92348 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -7,6 +7,7 @@ * Harbour-Qt wrapper generator. * * Copyright 2010 Pritpal Bedi + * Copyright 2009 Gancov Kostya * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -51,8 +52,6 @@ */ /*----------------------------------------------------------------------*/ /* - * Copyright( C ) 2009 by Gancov Kostya < kossne@mail.ru > - * * The code below is puled from TextEdit.cpp of QWriter by Gancov Kotsya * * and adopted for Harbour's hbIDE interface. The code has been intensively @@ -66,18 +65,16 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbthread.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include "hbqt_hbqplaintextedit.h" - HBQPlainTextEdit::HBQPlainTextEdit( QWidget * parent ) : QPlainTextEdit( parent ) { spaces = 3; @@ -115,9 +112,7 @@ HBQPlainTextEdit::~HBQPlainTextEdit() void HBQPlainTextEdit::hbSetEventBlock( PHB_ITEM pBlock ) { if( pBlock ) - { block = hb_itemNew( pBlock ); - } } bool HBQPlainTextEdit::event( QEvent *event ) @@ -191,9 +186,7 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event ) painter.fillRect( r, br ); } else if( highlightCurLine == true ) - { painter.fillRect( r, QBrush( m_currentLineColor ) ); - } } this->paintColumnSelection( event ); @@ -263,9 +256,7 @@ void HBQPlainTextEdit::bookmarks( int block ) qSort( bookMark ); } else - { bookMark.remove( found ); - } found = -1; int i = 0; @@ -278,10 +269,9 @@ void HBQPlainTextEdit::bookmarks( int block ) break; } } + if( found == -1 ) - { bookMarksGoto.append( block ); - } lineNumberArea->repaint(); update(); @@ -380,16 +370,12 @@ void HBQPlainTextEdit::setSpaces( int newSpaces ) if( spaces > 0 ) { for( int i = 0; i < spaces; ++i ) - { spacesTab += " "; - } } else { if( spaces == -101 ) - { spacesTab = "\t"; - } } } @@ -410,12 +396,11 @@ int HBQPlainTextEdit::getLine( const QTextCursor &crQTextCursor ) for( b = document()->begin();b!=document()->end();b = b.next() ) { if( b==cb ) - { return line; - } + line++; } - return( line ); + return line; } void HBQPlainTextEdit::slotCursorPositionChanged() @@ -424,9 +409,7 @@ void HBQPlainTextEdit::slotCursorPositionChanged() viewport()->update(); if( styleHightlighter != "none" ) - { braceHighlight(); - } } void HBQPlainTextEdit::setStyleHightlighter( const QString &style ) @@ -458,9 +441,8 @@ void HBQPlainTextEdit::escapeQuotes() QTextCursor cursor( textCursor() ); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + QString txt = selTxt.replace( QString( "'" ), QString( "\\\'" ) ); insertPlainText( txt ); } @@ -470,9 +452,8 @@ void HBQPlainTextEdit::escapeDQuotes() QTextCursor cursor( textCursor() ); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + QString txt = selTxt.replace( QString( "\"" ), QString( "\\\"" ) ); insertPlainText( txt ); } @@ -482,9 +463,8 @@ void HBQPlainTextEdit::unescapeQuotes() QTextCursor cursor( textCursor() ); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + QString txt = selTxt.replace( QString( "\\\'" ), QString( "'" ) ); insertPlainText( txt ); } @@ -494,9 +474,8 @@ void HBQPlainTextEdit::unescapeDQuotes() QTextCursor cursor( textCursor() ); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + QString txt = selTxt.replace( QString( "\\\"" ), QString( "\"" ) ); insertPlainText( txt ); } @@ -506,9 +485,8 @@ void HBQPlainTextEdit::caseUpper() QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); int e = cursor.selectionEnd(); cursor.beginEditBlock(); @@ -526,9 +504,8 @@ void HBQPlainTextEdit::caseLower() QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); int e = cursor.selectionEnd(); cursor.beginEditBlock(); @@ -546,9 +523,8 @@ void HBQPlainTextEdit::convertQuotes() QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); int e = cursor.selectionEnd(); cursor.beginEditBlock(); @@ -566,9 +542,8 @@ void HBQPlainTextEdit::convertDQuotes() QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); int e = cursor.selectionEnd(); cursor.beginEditBlock(); @@ -586,9 +561,8 @@ void HBQPlainTextEdit::replaceSelection( const QString & txt ) QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); cursor.beginEditBlock(); @@ -605,9 +579,8 @@ void HBQPlainTextEdit::streamComment() QTextCursor cursor = textCursor(); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return; - } + int b = cursor.selectionStart(); int e = cursor.selectionEnd(); cursor.beginEditBlock(); @@ -625,17 +598,18 @@ QString HBQPlainTextEdit::getSelectedText() QTextCursor cursor( textCursor() ); QString selTxt( cursor.selectedText() ); if( selTxt.isEmpty() ) - { return ""; - } + QString txt = selTxt.replace( 0x2029, QString( "\n" ) ); return txt; } -void HBQPlainTextEdit::paintColumnSelection( QPaintEvent *event ) +void HBQPlainTextEdit::paintColumnSelection( QPaintEvent * event ) { QTextCursor c = textCursor(); + HB_SYMBOL_UNUSED( event ); + if( isColumnSelectionEnabled && c.hasSelection() ) { if( columnBegins >= 0 && columnEnds >= 0 ) @@ -905,9 +879,7 @@ void HBQPlainTextEdit::braceHighlight() brace = cursor.selectedText(); } else - { return; - } } QTextCharFormat format; @@ -960,9 +932,7 @@ void HBQPlainTextEdit::braceHighlight() cursor1 = doc->find( closeBrace, cursor1 ); cursor2 = doc->find( openBrace, cursor2 ); if( cursor2.isNull() ) - { break; - } } selection.cursor = cursor; extraSelections.append( selection ); @@ -973,7 +943,8 @@ void HBQPlainTextEdit::braceHighlight() } else { - if( brace == closeBrace ) { + if( brace == closeBrace ) + { QTextCursor cursor1 = doc->find( openBrace, cursor, QTextDocument::FindBackward ); QTextCursor cursor2 = doc->find( closeBrace, cursor, QTextDocument::FindBackward ); if( cursor2.isNull() ) @@ -991,9 +962,7 @@ void HBQPlainTextEdit::braceHighlight() cursor1 = doc->find( openBrace, cursor1, QTextDocument::FindBackward ); cursor2 = doc->find( closeBrace, cursor2, QTextDocument::FindBackward ); if( cursor2.isNull() ) - { break; - } } selection.cursor = cursor; extraSelections.append( selection ); diff --git a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp index 141f4896f0..18bc495f64 100644 --- a/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp @@ -51,8 +51,6 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" - #include "hbqt.h" #if QT_VERSION >= 0x040500 diff --git a/harbour/contrib/hbqt/hbqt_hbqtableview.cpp b/harbour/contrib/hbqt/hbqt_hbqtableview.cpp index 808a544a91..a679f265ea 100644 --- a/harbour/contrib/hbqt/hbqt_hbqtableview.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqtableview.cpp @@ -53,8 +53,6 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" - #include "hbqt.h" #if QT_VERSION >= 0x040500 diff --git a/harbour/contrib/hbqt/hbqt_hbslots.cpp b/harbour/contrib/hbqt/hbqt_hbslots.cpp index ca56fc7607..5583f743ea 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.cpp +++ b/harbour/contrib/hbqt/hbqt_hbslots.cpp @@ -53,13 +53,12 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" +#include "hbqt.h" + #include "hbapiitm.h" #include "hbstack.h" #include "hbvm.h" -#include "hbqt.h" - #if QT_VERSION >= 0x040500 #include "hbqt_hbslots.h" diff --git a/harbour/contrib/hbqt/hbqt_utils.cpp b/harbour/contrib/hbqt/hbqt_utils.cpp index 8c7419f3d3..5eecae055f 100644 --- a/harbour/contrib/hbqt/hbqt_utils.cpp +++ b/harbour/contrib/hbqt/hbqt_utils.cpp @@ -52,11 +52,10 @@ */ /*----------------------------------------------------------------------*/ -#include "hbapi.h" -#include "hbapiitm.h" - #include "hbqt.h" +#include "hbapiitm.h" + /*----------------------------------------------------------------------*/ #if QT_VERSION >= 0x040500 /*----------------------------------------------------------------------*/