From 9bcca67b731d0cf3c10092ec31234d5d03cef5cd Mon Sep 17 00:00:00 2001 From: tille Date: Wed, 03 Sep 2003 15:49:02 +0000 Subject: more compatibility stuff --- (limited to 'libopie2') 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 @@ -92,6 +92,11 @@ class OApplication : public OpieApplication */ virtual void setTitle( const QString& title = QString::null ) const; + /** + * see qpeDir() + */ + static QString opieDir() {return qpeDir();}; + protected: void init(); 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 @@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */ +#include #include "opieapplication.h" @@ -42,7 +43,28 @@ OpieApplication::OpieApplication( int& argc, char** argv) #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 @@ -49,6 +49,8 @@ class OpieApplication #ifndef QWS void showMainWidget( QWidget* widget, bool nomax=false ); + void showMainDocumentWidget( QWidget* widget, bool nomax=false ); + static QString qpeDir(); #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 @@ -55,7 +55,8 @@ class OpieConfig #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 /** 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 + =. + .=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_,=:_.      -`: 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::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 + =. + .=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_,=:_.      -`: 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 + =. + .=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_,=:_.      -`: 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 +#else +#include +#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 + =. + .=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_,=:_.      -`: 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 + =. + .=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_,=:_.      -`: 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 +#else +#include +#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 @@ -15,6 +15,11 @@ HEADERS = ocompletionbox.h \ oversatileviewitem.h \ #ojanuswidget.h \ odialog.h \ + omenubar.h \ + opiemenubar.h \ + omessagebox.h \ + oresource.h \ + otoolbar.h \ oseparator.h # otaskbarapplet.h @@ -32,6 +37,10 @@ SOURCES = ocompletionbox.cpp \ oversatileviewitem.cpp \ #ojanuswidget.cpp \ odialog.cpp \ + omenubar.cpp \ + opiemenubar.cpp \ + oresource.cpp \ + otoolbar.cpp \ oseparator.cpp #\ # otaskbarapplet.cpp 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 + =. + .=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_,=:_.      -`: 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 +#include + +#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 +              Copyright (C) 2003 Patrick S. Vogt + =. + .=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_,=:_.      -`: 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 +#else +#include + +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 + =. + .=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_,=:_.      -`: 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 + =. + .=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_,=:_.      -`: 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 +#else +#include +#endif + + + +class OToolBar +#ifdef QWS +: public QPEToolBar +#else +: public QToolBar +#endif +{ + public: + OToolBar( QMainWindow *parent=0, const char* name = 0); +}; + +#endif // OAPPLICATION_H -- cgit v0.9.0.2