summaryrefslogtreecommitdiff
authortille <tille>2003-09-03 15:49:02 (UTC)
committer tille <tille>2003-09-03 15:49:02 (UTC)
commit9bcca67b731d0cf3c10092ec31234d5d03cef5cd (patch) (unidiff)
tree5f19d096cf0def032215201f725594f46436a850
parentfa6baf2326a520cde75f1178bab51c9fc3f6cec3 (diff)
downloadopie-9bcca67b731d0cf3c10092ec31234d5d03cef5cd.zip
opie-9bcca67b731d0cf3c10092ec31234d5d03cef5cd.tar.gz
opie-9bcca67b731d0cf3c10092ec31234d5d03cef5cd.tar.bz2
more compatibility stuff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oapplication.h5
-rw-r--r--libopie2/opiecore/opieapplication.cpp22
-rw-r--r--libopie2/opiecore/opieapplication.h2
-rw-r--r--libopie2/opiecore/opieconfig.h1
-rw-r--r--libopie2/opieui/omenubar.cpp36
-rw-r--r--libopie2/opieui/omenubar.h49
-rw-r--r--libopie2/opieui/omessagebox.h53
-rw-r--r--libopie2/opieui/opiemenubar.cpp43
-rw-r--r--libopie2/opieui/opiemenubar.h52
-rw-r--r--libopie2/opieui/opieui.pro9
-rw-r--r--libopie2/opieui/oresource.cpp58
-rw-r--r--libopie2/opieui/oresource.h49
-rw-r--r--libopie2/opieui/otoolbar.cpp41
-rw-r--r--libopie2/opieui/otoolbar.h55
14 files changed, 475 insertions, 0 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
@@ -94,2 +94,7 @@ class OApplication : public OpieApplication
94 94
95 /**
96 * see qpeDir()
97 */
98 static QString opieDir() {return qpeDir();};
99
95 protected: 100 protected:
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
@@ -30,2 +30,3 @@
30 30
31#include <opie2/odebug.h>
31 32
@@ -44,2 +45,3 @@ void OpieApplication::showMainWidget( QWidget* widget, bool nomax )
44{ 45{
46 if (nomax) odebug << "ignoring nomax";
45 setMainWidget( widget ); 47 setMainWidget( widget );
@@ -48 +50,21 @@ void OpieApplication::showMainWidget( QWidget* widget, bool nomax )
48#endif 50#endif
51
52#ifndef QWS
53QString OpieApplication::qpeDir()
54{
55 const char * base = getenv( "OPIEDIR" );
56 if ( base )
57 return QString( base ) + "/";
58
59 return QString( "../" );
60}
61#endif
62
63
64#ifndef QWS
65void OpieApplication::showMainDocumentWidget( QWidget* widget, bool nomax)
66{
67 showMainWidget(widget,nomax);
68}
69#endif
70
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
@@ -51,2 +51,4 @@ class OpieApplication
51 void showMainWidget( QWidget* widget, bool nomax=false ); 51 void showMainWidget( QWidget* widget, bool nomax=false );
52 void showMainDocumentWidget( QWidget* widget, bool nomax=false );
53 static QString qpeDir();
52#endif 54#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
@@ -58,2 +58,3 @@ class OpieConfig
58 bool hasKey ( const QString & key ) const; 58 bool hasKey ( const QString & key ) const;
59 void write() {}; // FIXME: did not find the docu... what shall I do here?
59#endif 60#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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#include <omenubar.h>
32
33OMenuBar::OMenuBar(QWidget* parent, const char* name)
34:OpieMenuBar(parent, name)
35{
36}
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OMENUBAR_H
32#define OMENUBAR_H
33
34
35
36
37#include "opiemenubar.h"
38
39
40
41class OMenuBar : public OpieMenuBar
42{
43 Q_OBJECT
44
45 public:
46 OMenuBar(QWidget* parent = 0, const char* name = 0 );
47};
48
49#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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OMESSAGEBOX_H
32#define OMESSAGEBOX_H
33
34
35
36#ifdef QWS
37#include <qpe/qpemessagebox.h>
38#else
39#include <qmessagebox.h>
40#endif
41
42
43
44class OMessageBox
45#ifdef QWS
46: public QPEMessageBox
47#else
48: public QMessageBox
49#endif
50{
51};
52
53#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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31
32#include "opiemenubar.h"
33
34OpieMenuBar::OpieMenuBar(QWidget* parent, const char* name )
35#ifdef QWS
36 : QPEMenuBar(parent,name)
37#else
38 : QMenuBar(parent,name)
39#endif
40{
41}
42
43
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OPIE_MENUBAR_H
32#define OPIE_MENUBAR_H
33
34#ifdef QWS
35#include <qpe/qpemenubar.h>
36#else
37#include <qmenubar.h>
38#endif
39
40class OpieMenuBar
41#ifdef QWS
42: public QPEMenuBar
43#else
44: public QMenuBar
45#endif
46{
47 public:
48 OpieMenuBar(QWidget* parent = 0, const char* name = 0);
49};
50#endif
51
52
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
@@ -17,2 +17,7 @@ HEADERS = ocompletionbox.h \
17 odialog.h \ 17 odialog.h \
18 omenubar.h \
19 opiemenubar.h \
20 omessagebox.h \
21 oresource.h \
22 otoolbar.h \
18 oseparator.h 23 oseparator.h
@@ -34,2 +39,6 @@ SOURCES = ocompletionbox.cpp \
34 odialog.cpp \ 39 odialog.cpp \
40 omenubar.cpp \
41 opiemenubar.cpp \
42 oresource.cpp \
43 otoolbar.cpp \
35 oseparator.cpp #\ 44 oseparator.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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#include <opie2/oapplication.h>
32#include <opie2/odebug.h>
33
34#include "oresource.h"
35
36
37#ifdef QWS
38namespace Resource
39{
40
41QPixmap loadPixmap( const QString& pix )
42{
43 QString filename;
44 filename.sprintf( "%s/%s.png", (const char*) oApp->opieDir(), (const char*) pix );
45 QPixmap pixmap( filename );
46 if ( pixmap.isNull() )
47 {
48 odebug << "libopie2 resource: can't find pixmap " << filename << oendl;;
49 }
50 return pixmap;
51};
52
53};
54
55#endif
56
57
58
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
5              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
6 =.
7 .=l.
8           .>+-=
9 _;:,     .>    :=|. This program is free software; you can
10.> <`_,   >  .   <= redistribute it and/or modify it under
11:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
12.="- .-=="i,     .._ License as published by the Free Software
13 - .   .-<_>     .<> Foundation; either version 2 of the License,
14     ._= =}       : or (at your option) any later version.
15    .%`+i>       _;_.
16    .i_,=:_.      -<s. This program is distributed in the hope that
17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18    : ..    .:,     . . . without even the implied warranty of
19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21..}^=.=       =       ; Library General Public License for more
22++=   -.     .`     .: details.
23 :     =  ...= . :.=-
24 -.   .:....=;==+<; You should have received a copy of the GNU
25  -_. . .   )=.  = Library General Public License along with
26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA.
30*/
31
32#ifndef ORESOURCE_H
33#define ORESOURCE_H
34
35#ifdef QWS
36#include <qpe/resource.h>
37#else
38#include <qpixmap.h>
39
40namespace Resource
41{
42 QPixmap loadPixmap( const QString& );
43}
44
45#endif
46
47#endif
48
49
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#include "otoolbar.h"
32
33OToolBar::OToolBar( QMainWindow *parent, const char* name)
34#ifdef QWS
35 : QPEToolBar(parent, name)
36#else
37 : QToolBar(parent, name)
38#endif
39{
40
41}
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OTOOLBAR_H
32#define OTOOLBAR_H
33
34
35
36#ifdef QWS
37#include <qpe/qpetoolbar.h>
38#else
39#include <qtoolbar.h>
40#endif
41
42
43
44class OToolBar
45#ifdef QWS
46: public QPEToolBar
47#else
48: public QToolBar
49#endif
50{
51 public:
52 OToolBar( QMainWindow *parent=0, const char* name = 0);
53};
54
55#endif // OAPPLICATION_H