diff options
Diffstat (limited to 'kregexpeditor/qt-only')
-rwxr-xr-x | kregexpeditor/qt-only/clean | 14 | ||||
-rw-r--r-- | kregexpeditor/qt-only/compat.cpp | 115 | ||||
-rw-r--r-- | kregexpeditor/qt-only/compat.h | 85 | ||||
-rwxr-xr-x | kregexpeditor/qt-only/compile | 28 | ||||
-rw-r--r-- | kregexpeditor/qt-only/qt-only.pro | 137 | ||||
-rw-r--r-- | kregexpeditor/qt-only/win-release.bat | 7 |
6 files changed, 386 insertions, 0 deletions
diff --git a/kregexpeditor/qt-only/clean b/kregexpeditor/qt-only/clean new file mode 100755 index 0000000..57e9a6d --- /dev/null +++ b/kregexpeditor/qt-only/clean @@ -0,0 +1,14 @@ +#!/bin/sh +rm *.o +rm *.obj +rm -rf manual +rm -rf predefined +rm -rf icons +rm unistd.h +find -lname \* -maxdepth 1 | xargs rm +rm moc_* +rm images.h +rm gen_* +rm -rf kregexpeditor* +rm Makefile +rm kregexpeditor.zip diff --git a/kregexpeditor/qt-only/compat.cpp b/kregexpeditor/qt-only/compat.cpp new file mode 100644 index 0000000..7dbc7b4 --- /dev/null +++ b/kregexpeditor/qt-only/compat.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2002-2004 Jesper K. Pedersen <blackie@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#include "compat.h" + +QString i18n( const QString& a) { + return QObject::tr(a); +} + +QString i18n( const QString& a, const QString& b) { + return QObject::tr(b,a); +} + +KDialogBase::KDialogBase( int /*dialogFace*/, const QString &caption, int buttonMask, + ButtonCode defaultButton, QWidget *parent, const char *name, + bool modal ) + :QDialog( parent, name, modal ) +{ + init( buttonMask, defaultButton, caption ); +} + +KDialogBase::KDialogBase( QWidget* parent, const char* name, bool modal, + const QString& caption, int buttonMask ) + : QDialog( parent, name, modal ) +{ + init( buttonMask, Ok, caption ); +} + +void KDialogBase::init( int buttonMask, ButtonCode /*defaultButton*/, const QString& caption ) +{ + setCaption( caption ); + _layout = new QVBoxLayout( this, 6 ); + QHBoxLayout* buts = new QHBoxLayout( _layout, 6 ); + QPushButton* but; + if ( buttonMask & Help ) { + but = new QPushButton( tr("Help"), this ); + buts->addWidget( but ); + connect( but, SIGNAL( clicked() ), this, SIGNAL( helpClicked() ) ); + } + buts->addStretch(1); + if ( buttonMask & Ok ) { + but = new QPushButton( tr("OK"), this ); + buts->addWidget( but ); + connect( but, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); + } + if ( buttonMask & Cancel ) { + but = new QPushButton( tr("Cancel"), this ); + buts->addWidget( but ); + connect( but, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); + } +} + +void KDialogBase::setMainWidget( QWidget* top ) +{ + top->reparent( this, 0, QPoint(0,0) ); + _layout->insertWidget( 0, top ); +} + +QFrame* KDialogBase::plainPage() +{ + QFrame* frame = new QFrame( this ); + setMainWidget( frame ); + return frame; +} + +void KDialogBase::slotOk() +{ + accept(); + emit okClicked(); + emit finished(); +} + +void KDialogBase::slotCancel() +{ + reject(); + emit cancelClicked(); + emit finished(); +} + +int KMessageBox::warningYesNo(QWidget *parent, const QString &text, const QString &caption ) +{ + int code = warning( parent, caption, text, tr("No"), tr("Yes") ); + if ( code == 0 ) + return Yes; + else + return No; +} + +int KMessageBox::information( QWidget* parent, const QString& text, const QString& caption, + const QString& /*dontShowAgainName*/ ) +{ + return QMessageBox::information( parent, caption, text ); +} + +int KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) +{ + return QMessageBox::information( parent, caption, text ); +} + + diff --git a/kregexpeditor/qt-only/compat.h b/kregexpeditor/qt-only/compat.h new file mode 100644 index 0000000..edf9ced --- /dev/null +++ b/kregexpeditor/qt-only/compat.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2002-2004 Jesper K. Pedersen <blackie@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ + +#ifndef COMPAT_H +#define COMPAT_H +#include <qobject.h> +#include <qmessagebox.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qinputdialog.h> +#include <qframe.h> + +QString i18n( const QString& a); +QString i18n( const QString& a, const QString& b); +#define isatty(x) 0 + +#define KTextBrowser QTextBrowser +#define KListBox QListBox +#define KFileDialog QFileDialog +#define KPushButton QPushButton + +class KDialogBase :public QDialog +{ + Q_OBJECT + +public: + enum ButtonCode {Ok = 1, Cancel, Help}; + enum DialogType { Plain }; + + KDialogBase ( int dialogFace, const QString &caption, int buttonMask, + ButtonCode defaultButton, + QWidget *parent=0, const char *name=0, bool modal=true ); + + KDialogBase( QWidget* parent, const char* name = 0, bool modal = true, + const QString& caption = QString::null, + int buttonMask = 0 ); + + void init( int buttonMask, ButtonCode /*defaultButton*/, const QString& caption ); + void setMainWidget( QWidget* top ); + QFrame* plainPage(); + void setHelp( const QString&, const QString& ) {} + +public slots: + void slotOk(); + void slotCancel(); + +signals: + void okClicked(); + void cancelClicked(); + void finished(); + void helpClicked(); + +private: + QVBoxLayout* _layout; +}; + +class KMessageBox :public QMessageBox +{ + Q_OBJECT +public: + enum ButtonCode { Ok = 1, Cancel = 2, Yes = 3, No = 4, Continue = 5 }; + static int warningYesNo (QWidget *parent, const QString &text, + const QString &caption = QString::null ); + static int information( QWidget* parent, const QString& text, const QString& caption = QString::null, + const QString& /*dontShowAgainName*/ = QString::null ); + static int sorry( QWidget* parent, const QString& text, const QString& caption = QString::null ); +}; + +#endif /* COMPAT_H */ + diff --git a/kregexpeditor/qt-only/compile b/kregexpeditor/qt-only/compile new file mode 100755 index 0000000..d6fb6c6 --- /dev/null +++ b/kregexpeditor/qt-only/compile @@ -0,0 +1,28 @@ +#!/bin/bash +# On Linux do this +ln -s ../*.{cpp,h,y,l} . +ln -s ../{KMultiFormListBox,KWidgetStreamer}/*.{cpp,h} . +ln -s $KDESRC/kdelibs/interfaces/kregexpeditor/kregexpeditorinterface.h . +ln -s gen_qregexpparser.cc gen_qregexpparser.cpp +touch unistd.h +mkdir icons +cp ../picts/* icons +cp $KDEDIR/share/icons/crystalsvg/22x22/actions/{undo,redo,editcut,editcopy,editpaste,fileopen,filesave,contexthelp,1downarrow,1uparrow}.png icons +mkdir predefined +mkdir predefined/General +cp ../predefined/General/*.regexp predefined/General + +flex -Pqregexp -ogen_qregexplexer.cpp qregexpparser.l +bison -d -p qregexp -o gen_qregexpparser.cc qregexpparser.y + +mkdir manual +cd manual +meinproc $KDESRC/kdeutils/doc/KRegExpEditor/index.docbook +for x in *.html; do sed 's/<img src="help:[^>]*>//' < $x > tmp.html; mv tmp.html $x; done +cp $KDESRC/kdeutils/doc/KRegExpEditor/*.png . +cd .. +(cd icons; $QTDIR/tools/qembed/qembed --images *.png > ../images.h) + +# Now on windows do the following +qmake +make diff --git a/kregexpeditor/qt-only/qt-only.pro b/kregexpeditor/qt-only/qt-only.pro new file mode 100644 index 0000000..9af8b97 --- /dev/null +++ b/kregexpeditor/qt-only/qt-only.pro @@ -0,0 +1,137 @@ +TEMPLATE = app +INCLUDEPATH += . +DEFINES += QT_ONLY +TARGET = kregexpeditor + +win32-msvc:QMAKE_CXXFLAGS += /GX /GR +QMAKE_CLEAN+=vc60.pdb kdexecutor.dsp + + +# If this is a compile for House Of Fusion, then add the following line +DEFINES+=HOUSEOFFUSION + +# Input +HEADERS += altnregexp.h \ + altnwidget.h \ + auxbuttons.h \ + ccp.h \ + characterswidget.h \ + charselector.h \ + compoundregexp.h \ + compoundwidget.h \ + concregexp.h \ + concwidget.h \ + dcbutton.h \ + dotregexp.h \ + drag.h \ + dragaccepter.h \ + editorwindow.h \ + emacsregexpconverter.h \ + errormap.h \ + gen_qregexpparser.hh \ + indexWindow.h \ + infopage.h \ + kmultiformlistbox-multivisible.h \ + kmultiformlistbox-shower.h \ + kmultiformlistbox-windowed.h \ + kmultiformlistbox.h \ + kmultiformlistboxentry.h \ + kmultiformlistboxfactory.h \ + kregexpeditorgui.h \ + kregexpeditorprivate.h \ + kwidgetstreamer.h \ + limitedcharlineedit.h \ + lookaheadregexp.h \ + lookaheadwidget.h \ + multicontainerwidget.h \ + myfontmetrics.h \ + pair.h \ + positionregexp.h \ + qtregexpconverter.h \ + qtregexphighlighter.h \ + regexp.h \ + regexpbuttons.h \ + regexpconverter.h \ + regexphighlighter.h \ + regexpwidget.h \ + repeatregexp.h \ + repeatwidget.h \ + scrollededitorwindow.h \ + selectablelineedit.h \ + singlecontainerwidget.h \ + textrangeregexp.h \ + textregexp.h \ + textwidget.h \ + triple.h \ + userdefinedregexps.h \ + verifier.h \ + verifybuttons.h \ + widgetfactory.h \ + widgetwindow.h \ + windowlistboxitem.h \ + zerowidgets.h\ + compat.h \ + images.h + +#LEXSOURCES += qregexpparser.l +#YACCSOURCES += qregexpparser.y +YACC=bison +SOURCES += altnregexp.cpp \ + altnwidget.cpp \ + auxbuttons.cpp \ + ccp.cpp \ + characterswidget.cpp \ + charselector.cpp \ + compoundregexp.cpp \ + compoundwidget.cpp \ + concregexp.cpp \ + concwidget.cpp \ + dcbutton.cpp \ + dotregexp.cpp \ + drag.cpp \ + dragaccepter.cpp \ + editorwindow.cpp \ + emacsregexpconverter.cpp \ + errormap.cpp \ + gen_qregexplexer.cpp \ + indexWindow.cpp \ + infopage.cpp \ + kmultiformlistbox-multivisible.cpp \ + kmultiformlistbox-windowed.cpp \ + kmultiformlistbox.cpp \ + kmultiformlistboxentry.cpp \ + kmultiformlistboxfactory.cpp \ + kregexpeditorgui.cpp \ + kregexpeditorprivate.cpp \ + kwidgetstreamer.cpp \ + limitedcharlineedit.cpp \ + lookaheadregexp.cpp \ + lookaheadwidget.cpp \ + main.cpp \ + multicontainerwidget.cpp \ + myfontmetrics.cpp \ + positionregexp.cpp \ + qtregexpconverter.cpp \ + qtregexphighlighter.cpp \ + regexp.cpp \ + regexpbuttons.cpp \ + regexpconverter.cpp \ + regexphighlighter.cpp \ + regexpwidget.cpp \ + repeatregexp.cpp \ + repeatwidget.cpp \ + scrollededitorwindow.cpp \ + selectablelineedit.cpp \ + singlecontainerwidget.cpp \ + textrangeregexp.cpp \ + textregexp.cpp \ + textwidget.cpp \ + userdefinedregexps.cpp \ + verifier.cpp \ + verifybuttons.cpp \ + widgetfactory.cpp \ + widgetwindow.cpp \ + windowlistboxitem.cpp \ + zerowidgets.cpp \ + gen_qregexpparser.cpp \ + compat.cpp diff --git a/kregexpeditor/qt-only/win-release.bat b/kregexpeditor/qt-only/win-release.bat new file mode 100644 index 0000000..967afc8 --- /dev/null +++ b/kregexpeditor/qt-only/win-release.bat @@ -0,0 +1,7 @@ +md kregexpeditor +cp -r kregexpeditor.exe predefined kregexpeditor +copy q:\3.1.2-mt\lib\qt-mt312.dll kregexpeditor +copy c:\winnt\system32\MSVCRTD.DLL kregexpeditor +copy c:\winnt\system32\MSVCP60D.DLL kregexpeditor +cp -r manual kregexpeditor +c:\zip\zip -r kregexpeditor.zip kregexpeditor |