-rw-r--r-- | libopie2/opiecore/oapplication.h | 5 | ||||
-rw-r--r-- | libopie2/opiecore/opieapplication.cpp | 22 | ||||
-rw-r--r-- | libopie2/opiecore/opieapplication.h | 2 | ||||
-rw-r--r-- | libopie2/opiecore/opieconfig.h | 3 | ||||
-rw-r--r-- | libopie2/opieui/omenubar.cpp | 36 | ||||
-rw-r--r-- | libopie2/opieui/omenubar.h | 49 | ||||
-rw-r--r-- | libopie2/opieui/omessagebox.h | 53 | ||||
-rw-r--r-- | libopie2/opieui/opiemenubar.cpp | 43 | ||||
-rw-r--r-- | libopie2/opieui/opiemenubar.h | 52 | ||||
-rw-r--r-- | libopie2/opieui/opieui.pro | 9 | ||||
-rw-r--r-- | libopie2/opieui/oresource.cpp | 58 | ||||
-rw-r--r-- | libopie2/opieui/oresource.h | 49 | ||||
-rw-r--r-- | libopie2/opieui/otoolbar.cpp | 41 | ||||
-rw-r--r-- | libopie2/opieui/otoolbar.h | 55 |
14 files changed, 476 insertions, 1 deletions
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index da5b905..a3f2201 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h @@ -87,16 +87,21 @@ class OApplication : public OpieApplication /** * Set the application title. The application title will be concatenated * to the application name given in the constructor. * * @param title the title. If not given, resets caption to appname */ virtual void setTitle( const QString& title = QString::null ) const; + /** + * see qpeDir() + */ + static QString opieDir() {return qpeDir();}; + protected: void init(); private: const QCString _appname; static OApplication* _instance; OConfig* _config; OApplicationPrivate* d; diff --git a/libopie2/opiecore/opieapplication.cpp b/libopie2/opiecore/opieapplication.cpp index 7ff7b44..ae27b25 100644 --- a/libopie2/opiecore/opieapplication.cpp +++ b/libopie2/opiecore/opieapplication.cpp @@ -23,26 +23,48 @@ -. .:....=;==+<; 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <opie2/odebug.h> #include "opieapplication.h" OpieApplication::OpieApplication( int& argc, char** argv) #ifdef QWS : QPEApplication(argc,argv) #else : QApplication(argc,argv) #endif {}; #ifndef QWS void OpieApplication::showMainWidget( QWidget* widget, bool nomax ) { + if (nomax) odebug << "ignoring nomax"; setMainWidget( widget ); widget->show(); }; #endif + +#ifndef QWS +QString OpieApplication::qpeDir() +{ + const char * base = getenv( "OPIEDIR" ); + if ( base ) + return QString( base ) + "/"; + + return QString( "../" ); +} +#endif + + +#ifndef QWS +void OpieApplication::showMainDocumentWidget( QWidget* widget, bool nomax) +{ + showMainWidget(widget,nomax); +} +#endif + diff --git a/libopie2/opiecore/opieapplication.h b/libopie2/opiecore/opieapplication.h index a864ee9..29e2e9d 100644 --- a/libopie2/opiecore/opieapplication.h +++ b/libopie2/opiecore/opieapplication.h @@ -44,15 +44,17 @@ class OpieApplication : public QApplication #endif { public: OpieApplication( int& argc, char** argv ); #ifndef QWS void showMainWidget( QWidget* widget, bool nomax=false ); + void showMainDocumentWidget( QWidget* widget, bool nomax=false ); + static QString qpeDir(); #endif }; #endif diff --git a/libopie2/opiecore/opieconfig.h b/libopie2/opiecore/opieconfig.h index 011ac86..e3eaec0 100644 --- a/libopie2/opiecore/opieconfig.h +++ b/libopie2/opiecore/opieconfig.h @@ -50,17 +50,18 @@ class OpieConfig #ifndef QWS enum Domain { File, User }; #endif OpieConfig( const QString&, Domain ); #ifndef QWS void setGroup( const QString& key); - bool hasKey ( const QString & key ) const; + bool hasKey ( const QString & key ) const; + void write() {}; // FIXME: did not find the docu... what shall I do here? #endif /** * @returns the name of the current group. * The current group is used for searching keys and accessing entries. */ const QString& group() #ifdef QWS diff --git a/libopie2/opieui/omenubar.cpp b/libopie2/opieui/omenubar.cpp new file mode 100644 index 0000000..bee2815 --- a/dev/null +++ b/libopie2/opieui/omenubar.cpp @@ -0,0 +1,36 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include <omenubar.h> + +OMenuBar::OMenuBar(QWidget* parent, const char* name) +:OpieMenuBar(parent, name) +{ +} diff --git a/libopie2/opieui/omenubar.h b/libopie2/opieui/omenubar.h new file mode 100644 index 0000000..234885f --- a/dev/null +++ b/libopie2/opieui/omenubar.h @@ -0,0 +1,49 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OMENUBAR_H +#define OMENUBAR_H + + + + +#include "opiemenubar.h" + + + +class OMenuBar : public OpieMenuBar +{ + Q_OBJECT + + public: + OMenuBar(QWidget* parent = 0, const char* name = 0 ); +}; + +#endif // OAPPLICATION_H diff --git a/libopie2/opieui/omessagebox.h b/libopie2/opieui/omessagebox.h new file mode 100644 index 0000000..1a0f554 --- a/dev/null +++ b/libopie2/opieui/omessagebox.h @@ -0,0 +1,53 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OMESSAGEBOX_H +#define OMESSAGEBOX_H + + + +#ifdef QWS +#include <qpe/qpemessagebox.h> +#else +#include <qmessagebox.h> +#endif + + + +class OMessageBox +#ifdef QWS +: public QPEMessageBox +#else +: public QMessageBox +#endif +{ +}; + +#endif // OAPPLICATION_H diff --git a/libopie2/opieui/opiemenubar.cpp b/libopie2/opieui/opiemenubar.cpp new file mode 100644 index 0000000..98715d7 --- a/dev/null +++ b/libopie2/opieui/opiemenubar.cpp @@ -0,0 +1,43 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + + +#include "opiemenubar.h" + +OpieMenuBar::OpieMenuBar(QWidget* parent, const char* name ) +#ifdef QWS + : QPEMenuBar(parent,name) +#else + : QMenuBar(parent,name) +#endif +{ +} + + diff --git a/libopie2/opieui/opiemenubar.h b/libopie2/opieui/opiemenubar.h new file mode 100644 index 0000000..ccd72cc --- a/dev/null +++ b/libopie2/opieui/opiemenubar.h @@ -0,0 +1,52 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OPIE_MENUBAR_H +#define OPIE_MENUBAR_H + +#ifdef QWS +#include <qpe/qpemenubar.h> +#else +#include <qmenubar.h> +#endif + +class OpieMenuBar +#ifdef QWS +: public QPEMenuBar +#else +: public QMenuBar +#endif +{ + public: + OpieMenuBar(QWidget* parent = 0, const char* name = 0); +}; +#endif + + diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 1b6ecdf..68a5c5f 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro @@ -10,16 +10,21 @@ HEADERS = ocompletionbox.h \ opixmapeffect.h \ opopupmenu.h \ opixmapprovider.h \ oselector.h \ oversatileview.h \ oversatileviewitem.h \ #ojanuswidget.h \ odialog.h \ + omenubar.h \ + opiemenubar.h \ + omessagebox.h \ + oresource.h \ + otoolbar.h \ oseparator.h # otaskbarapplet.h SOURCES = ocompletionbox.cpp \ ocombobox.cpp \ oeditlistbox.cpp \ olineedit.cpp \ olistview.cpp \ @@ -27,16 +32,20 @@ SOURCES = ocompletionbox.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ opixmapprovider.cpp \ oselector.cpp \ oversatileview.cpp \ oversatileviewitem.cpp \ #ojanuswidget.cpp \ odialog.cpp \ + omenubar.cpp \ + opiemenubar.cpp \ + oresource.cpp \ + otoolbar.cpp \ oseparator.cpp #\ # otaskbarapplet.cpp INTERFACES = TARGET = opieui2 VERSION = 1.8.1 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include diff --git a/libopie2/opieui/oresource.cpp b/libopie2/opieui/oresource.cpp new file mode 100644 index 0000000..d97307f --- a/dev/null +++ b/libopie2/opieui/oresource.cpp @@ -0,0 +1,58 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include <opie2/oapplication.h> +#include <opie2/odebug.h> + +#include "oresource.h" + + +#ifdef QWS +namespace Resource +{ + +QPixmap loadPixmap( const QString& pix ) +{ + QString filename; + filename.sprintf( "%s/%s.png", (const char*) oApp->opieDir(), (const char*) pix ); + QPixmap pixmap( filename ); + if ( pixmap.isNull() ) + { + odebug << "libopie2 resource: can't find pixmap " << filename << oendl;; + } + return pixmap; +}; + +}; + +#endif + + + diff --git a/libopie2/opieui/oresource.h b/libopie2/opieui/oresource.h new file mode 100644 index 0000000..499d255 --- a/dev/null +++ b/libopie2/opieui/oresource.h @@ -0,0 +1,49 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef ORESOURCE_H +#define ORESOURCE_H + +#ifdef QWS +#include <qpe/resource.h> +#else +#include <qpixmap.h> + +namespace Resource +{ + QPixmap loadPixmap( const QString& ); +} + +#endif + +#endif + + diff --git a/libopie2/opieui/otoolbar.cpp b/libopie2/opieui/otoolbar.cpp new file mode 100644 index 0000000..c7f2727 --- a/dev/null +++ b/libopie2/opieui/otoolbar.cpp @@ -0,0 +1,41 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include "otoolbar.h" + +OToolBar::OToolBar( QMainWindow *parent, const char* name) +#ifdef QWS + : QPEToolBar(parent, name) +#else + : QToolBar(parent, name) +#endif +{ + +} diff --git a/libopie2/opieui/otoolbar.h b/libopie2/opieui/otoolbar.h new file mode 100644 index 0000000..e16d8df --- a/dev/null +++ b/libopie2/opieui/otoolbar.h @@ -0,0 +1,55 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OTOOLBAR_H +#define OTOOLBAR_H + + + +#ifdef QWS +#include <qpe/qpetoolbar.h> +#else +#include <qtoolbar.h> +#endif + + + +class OToolBar +#ifdef QWS +: public QPEToolBar +#else +: public QToolBar +#endif +{ + public: + OToolBar( QMainWindow *parent=0, const char* name = 0); +}; + +#endif // OAPPLICATION_H |