-rw-r--r-- | include.pro | 14 | ||||
-rw-r--r-- | libopie2/opiecore/opiecore.pro | 3 | ||||
-rw-r--r-- | library/qlibrary_unix.cpp | 2 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/include.pro b/include.pro index f32786a..dd388f2 100644 --- a/include.pro +++ b/include.pro | |||
@@ -1,136 +1,136 @@ | |||
1 | include( $(OPIEDIR)/gen.pro ) | 1 | include( $(OPIEDIR)/gen.pro ) |
2 | 2 | ||
3 | # base opie install path | 3 | # base opie install path |
4 | # prefix = /opt/QtPalmtop ??? Why here (eilers) ??? | 4 | # prefix = /opt/QtPalmtop ??? Why here (eilers) ??? |
5 | prefix = $(OPIEDIR) | 5 | prefix = $(OPIEDIR) |
6 | 6 | ||
7 | contains( CONFIG, quick-app-lib ) { | 7 | contains( CONFIG, quick-app-lib ) { |
8 | TEMPLATE = lib | 8 | TEMPLATE = lib |
9 | CONFIG += plugin # "plugin" will be removed automatically later if not MacOSX ! (eilers) | 9 | CONFIG += plugin # "plugin" will be removed automatically later if not MacOSX ! (eilers) |
10 | DESTDIR = $(OPIEDIR)/plugins/application | 10 | DESTDIR = $(OPIEDIR)/plugins/application |
11 | DEFINES += OPIE_APP_INTERFACE | 11 | DEFINES += OPIE_APP_INTERFACE |
12 | DEFINES += QUICKAPP_NAME="\"$${TARGET}\"" | 12 | DEFINES += QUICKAPP_NAME="\"$${TARGET}\"" |
13 | 13 | ||
14 | !contains( TARGET, launcher ) { | 14 | !contains( TARGET, launcher ) { |
15 | message( Linking $$TARGET to quicklauncher ) | 15 | message( Linking $$TARGET to quicklauncher ) |
16 | system( rm -f $$(OPIEDIR)/bin/$$TARGET ) | 16 | system( rm -f $$(OPIEDIR)/bin/$$TARGET ) |
17 | system( ln -sf $$QUICKLAUNCH_PATH $$(OPIEDIR)/bin/$$TARGET ) | 17 | system( ln -sf $$QUICKLAUNCH_PATH $$(OPIEDIR)/bin/$$TARGET ) |
18 | } | 18 | } |
19 | } | 19 | } |
20 | 20 | ||
21 | contains ( CONFIG, quick-app-bin ) { | 21 | contains ( CONFIG, quick-app-bin ) { |
22 | TEMPLATE = app | 22 | TEMPLATE = app |
23 | DESTDIR = $(OPIEDIR)/bin | 23 | DESTDIR = $(OPIEDIR)/bin |
24 | DEFINES -= OPIE_APP_INTERFACE | 24 | DEFINES -= OPIE_APP_INTERFACE |
25 | DEFINES += QUICKAPP_NAME="\"$${TARGET}\"" | 25 | DEFINES += QUICKAPP_NAME="\"$${TARGET}\"" |
26 | message( Touching plugins/application/lib$${TARGET}.so.0 ) | 26 | message( Touching plugins/application/lib$${TARGET}.so.0 ) |
27 | system( touch $$(OPIEDIR)/plugins/application/lib$${TARGET}.so.0 ) | 27 | system( touch $$(OPIEDIR)/plugins/application/lib$${TARGET}.so.0 ) |
28 | } | 28 | } |
29 | 29 | ||
30 | 30 | ||
31 | contains( TEMPLATE, lib ) { | 31 | contains( TEMPLATE, lib ) { |
32 | target.path = $$prefix/lib | 32 | target.path = $$prefix/lib |
33 | } | 33 | } |
34 | !contains( TEMPLATE, lib ) { | 34 | !contains( TEMPLATE, lib ) { |
35 | target.path = $$prefix/bin | 35 | target.path = $$prefix/bin |
36 | } | 36 | } |
37 | INSTALLS += target | 37 | INSTALLS += target |
38 | 38 | ||
39 | # ipkg control files | 39 | # ipkg control files |
40 | control.path = /CONTROL | 40 | control.path = /CONTROL |
41 | control.files = control postinst prerm postrm preinst conffiles | 41 | control.files = control postinst prerm postrm preinst conffiles |
42 | INSTALLS += control | 42 | INSTALLS += control |
43 | 43 | ||
44 | # images, default is $$prefix/pics/$$TARGET | 44 | # images, default is $$prefix/pics/$$TARGET |
45 | pics.path = $$prefix/pics/$$TARGET | 45 | pics.path = $$prefix/pics/$$TARGET |
46 | pics.files = pics/* | 46 | pics.files = pics/* |
47 | INSTALLS += pics | 47 | INSTALLS += pics |
48 | 48 | ||
49 | # sounds, default path is $$prefix/sounds/$$TARGET | 49 | # sounds, default path is $$prefix/sounds/$$TARGET |
50 | sounds.path = $$prefix/sounds/$$TARGET | 50 | sounds.path = $$prefix/sounds/$$TARGET |
51 | sounds.files = sounds/* | 51 | sounds.files = sounds/* |
52 | INSTALLS += sounds | 52 | INSTALLS += sounds |
53 | 53 | ||
54 | # init scripts, default path is /etc/init.d | 54 | # init scripts, default path is /etc/init.d |
55 | init.path = /etc/init.d | 55 | init.path = /etc/init.d |
56 | init.files = init.d/* | 56 | init.files = init.d/* |
57 | INSTALLS += init | 57 | INSTALLS += init |
58 | 58 | ||
59 | # data, default path is /usr/share/$$TARGET | 59 | # data, default path is /usr/share/$$TARGET |
60 | data.path = /usr/share/$$TARGET | 60 | data.path = /usr/share/$$TARGET |
61 | data.files = share/* | 61 | data.files = share/* |
62 | INSTALLS += data | 62 | INSTALLS += data |
63 | 63 | ||
64 | etc.path = $$prefix/etc/ | 64 | etc.path = $$prefix/etc/ |
65 | etc.files = etc/* | 65 | etc.files = etc/* |
66 | INSTALLS += etc | 66 | INSTALLS += etc |
67 | 67 | ||
68 | apps.path = $$prefix/apps/ | 68 | apps.path = $$prefix/apps/ |
69 | apps.files = apps/* | 69 | apps.files = apps/* |
70 | INSTALLS += apps | 70 | INSTALLS += apps |
71 | 71 | ||
72 | # sounds, default path is $$prefix/sounds/$$TARGET | 72 | # sounds, default path is $$prefix/sounds/$$TARGET |
73 | sounds.path = $$prefix/sounds/$$TARGET | 73 | sounds.path = $$prefix/sounds/$$TARGET |
74 | sounds.files = sounds/* | 74 | sounds.files = sounds/* |
75 | INSTALLS += sounds | 75 | INSTALLS += sounds |
76 | 76 | ||
77 | # anything in nonstandard paths | 77 | # anything in nonstandard paths |
78 | root.path = / | 78 | root.path = / |
79 | root.files = root/* | 79 | root.files = root/* |
80 | INSTALLS += root | 80 | INSTALLS += root |
81 | 81 | ||
82 | # new targets | 82 | # new targets |
83 | opie-lupdate.target = opie-lupdate | 83 | opie-lupdate.target = opie-lupdate |
84 | opie-lupdate.commands = opie-lupdate $(PRO) | 84 | opie-lupdate.commands = opie-lupdate $(PRO) |
85 | 85 | ||
86 | opie-lrelease.target = opie-lrelease | 86 | opie-lrelease.target = opie-lrelease |
87 | opie-lrelease.commands = opie-lrelease $(PRO) | 87 | opie-lrelease.commands = opie-lrelease $(PRO) |
88 | 88 | ||
89 | lupdate.target = lupdate | 89 | lupdate.target = lupdate |
90 | lupdate.commands = lupdate -noobsolete $(PRO) | 90 | lupdate.commands = lupdate -noobsolete $(PRO) |
91 | 91 | ||
92 | lrelease.target = lrelease | 92 | lrelease.target = lrelease |
93 | lrelease.commands = lrelease $(PRO) | 93 | lrelease.commands = lrelease $(PRO) |
94 | 94 | ||
95 | # new message target to get all strings from the apps with and without tr | 95 | # new message target to get all strings from the apps with and without tr |
96 | messages.target = messages | 96 | messages.target = messages |
97 | messages.commands = xgettext -C -n -ktr -kQT_TRANSLATE_NOOP $$HEADERS $$SOURCES -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a $$HEADERS $$SOURCES -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' | 97 | messages.commands = xgettext -C -n -ktr -kQT_TRANSLATE_NOOP $$HEADERS $$SOURCES -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a $$HEADERS $$SOURCES -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po' |
98 | 98 | ||
99 | ipk.target = ipk | 99 | ipk.target = ipk |
100 | ipk.commands = tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="$$$$tmp" install && ipkg-build $$$$tmp; rm -rf $$$$tmp; ) | 100 | ipk.commands = tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="$$$$tmp" install && ipkg-build $$$$tmp; rm -rf $$$$tmp; ) |
101 | 101 | ||
102 | QMAKE_EXTRA_UNIX_TARGETS += lupdate lrelease ipk opie-lupdate opie-lrelease messages | 102 | QMAKE_EXTRA_UNIX_TARGETS += lupdate lrelease ipk opie-lupdate opie-lrelease messages |
103 | 103 | ||
104 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) | 104 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) |
105 | contains( CONFTEST, y ){ | 105 | contains( CONFTEST, y ){ |
106 | QMAKE_LFLAGS += -Wl | 106 | QMAKE_LFLAGS += -Wl |
107 | LIBS -= -ldl | 107 | LIBS -= -ldl |
108 | LIBS -= -lcrypt | 108 | LIBS -= -lcrypt |
109 | LIBS -= -lm | 109 | LIBS -= -lm |
110 | 110 | ||
111 | # Manual including indirect referenced libraries which are not loaded | 111 | # Manual including indirect referenced libraries which are not loaded |
112 | # by the mac-linker automatically | 112 | # by the mac-linker automatically |
113 | # IF YOU COMPILE FOR THE FIRST TIME, COMMENT OUT ONE OF THE FOLLOWING | 113 | # IF YOU COMPILE FOR THE FIRST TIME, COMMENT OUT ONE OF THE FOLLOWING |
114 | # (regarding whether you activate SQL) and the last one (-lopiecore2) | 114 | # (regarding whether you activate SQL) and the last one (-lopiecore2) |
115 | CONFTEST = $$system( echo $CONFIG_SQL_PIM_BACKEND ) | 115 | #CONFTEST = $$system( echo $CONFIG_SQL_PIM_BACKEND ) |
116 | contains( CONFTEST, y ){ | 116 | #contains( CONFTEST, y ){ |
117 | LIBS += -lopiedb2 -lqpe | 117 | # LIBS += -lopiedb2 -lqpe |
118 | } else { | 118 | #} else { |
119 | LIBS += -lqpe | 119 | # LIBS += -lqpe |
120 | } | 120 | #} |
121 | LIBS += -lopiecore2 | 121 | #LIBS += -lopiecore2 |
122 | } | 122 | } |
123 | else { | 123 | else { |
124 | 124 | ||
125 | QMAKE_LFLAGS += -Wl,-rpath-link,$$prefix/lib | 125 | QMAKE_LFLAGS += -Wl,-rpath-link,$$prefix/lib |
126 | # I am not sure whether it is a good idea to change the way plugins is build | 126 | # I am not sure whether it is a good idea to change the way plugins is build |
127 | # on linux. Therefore I remove the "plugin" term, which is needed by MacOS-X | 127 | # on linux. Therefore I remove the "plugin" term, which is needed by MacOS-X |
128 | CONFIG -= plugin | 128 | CONFIG -= plugin |
129 | } | 129 | } |
130 | LIBS += -L$(OPIEDIR)/lib | 130 | LIBS += -L$(OPIEDIR)/lib |
131 | 131 | ||
132 | MOC_DIR=.moc/$(PLATFORM) | 132 | MOC_DIR=.moc/$(PLATFORM) |
133 | OBJECTS_DIR=.obj/$(PLATFORM) | 133 | OBJECTS_DIR=.obj/$(PLATFORM) |
134 | 134 | ||
135 | #was here now at thetop | 135 | #was here now at thetop |
136 | #include( $(OPIEDIR)/gen.pro ) | 136 | #include( $(OPIEDIR)/gen.pro ) |
diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro index cbb7e04..3406b8f 100644 --- a/libopie2/opiecore/opiecore.pro +++ b/libopie2/opiecore/opiecore.pro | |||
@@ -1,59 +1,60 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = oapplication.h \ | 4 | HEADERS = oapplication.h \ |
5 | oconfig.h \ | 5 | oconfig.h \ |
6 | odebug.h \ | 6 | odebug.h \ |
7 | oglobal.h \ | 7 | oglobal.h \ |
8 | oglobalsettings.h \ | 8 | oglobalsettings.h \ |
9 | okeyconfigmanager.h \ | 9 | okeyconfigmanager.h \ |
10 | okeyfilter.h \ | 10 | okeyfilter.h \ |
11 | opluginloader.h \ | 11 | opluginloader.h \ |
12 | oprocess.h \ | 12 | oprocess.h \ |
13 | oprocctrl.h \ | 13 | oprocctrl.h \ |
14 | oresource.h \ | 14 | oresource.h \ |
15 | osharedpointer.h \ | 15 | osharedpointer.h \ |
16 | osmartpointer.h \ | 16 | osmartpointer.h \ |
17 | ostorageinfo.h \ | 17 | ostorageinfo.h \ |
18 | xmltree.h | 18 | xmltree.h |
19 | 19 | ||
20 | SOURCES = oapplication.cpp \ | 20 | SOURCES = oapplication.cpp \ |
21 | oconfig.cpp \ | 21 | oconfig.cpp \ |
22 | odebug.cpp \ | 22 | odebug.cpp \ |
23 | oglobal.cpp \ | 23 | oglobal.cpp \ |
24 | oglobalsettings.cpp \ | 24 | oglobalsettings.cpp \ |
25 | okeyconfigmanager.cpp \ | 25 | okeyconfigmanager.cpp \ |
26 | okeyfilter.cpp \ | 26 | okeyfilter.cpp \ |
27 | opluginloader.cpp \ | 27 | opluginloader.cpp \ |
28 | oprocess.cpp \ | 28 | oprocess.cpp \ |
29 | oprocctrl.cpp \ | 29 | oprocctrl.cpp \ |
30 | oresource.cpp \ | 30 | oresource.cpp \ |
31 | osmartpointer.cpp \ | 31 | osmartpointer.cpp \ |
32 | ostorageinfo.cpp \ | 32 | ostorageinfo.cpp \ |
33 | xmltree.cpp | 33 | xmltree.cpp |
34 | 34 | ||
35 | 35 | ||
36 | # Disable Linux-only subsystems for MAC build | 36 | # Disable Linux-only subsystems for MAC build |
37 | !contains( CONFIG_TARGET_MACOSX, y ) { | 37 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) |
38 | !contains( CONFTEST, y ) { | ||
38 | include ( linux/linux.pro ) | 39 | include ( linux/linux.pro ) |
39 | } else { | 40 | } else { |
40 | message( "disabling linux-only subsystems for MAC build" ) | 41 | message( "disabling linux-only subsystems for MAC build" ) |
41 | } | 42 | } |
42 | 43 | ||
43 | include( device/device.pro ) | 44 | include( device/device.pro ) |
44 | 45 | ||
45 | INTERFACES = | 46 | INTERFACES = |
46 | TARGET = opiecore2 | 47 | TARGET = opiecore2 |
47 | VERSION = 1.9.4 | 48 | VERSION = 1.9.4 |
48 | INCLUDEPATH += $(OPIEDIR)/include | 49 | INCLUDEPATH += $(OPIEDIR)/include |
49 | DEPENDPATH += $(OPIEDIR)/include | 50 | DEPENDPATH += $(OPIEDIR)/include |
50 | 51 | ||
51 | !contains( platform, x11 ) { | 52 | !contains( platform, x11 ) { |
52 | LIBS = -lqpe | 53 | LIBS = -lqpe |
53 | include( $(OPIEDIR)/include.pro ) | 54 | include( $(OPIEDIR)/include.pro ) |
54 | } | 55 | } |
55 | 56 | ||
56 | contains( platform, x11 ) { | 57 | contains( platform, x11 ) { |
57 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 58 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
58 | } | 59 | } |
59 | 60 | ||
diff --git a/library/qlibrary_unix.cpp b/library/qlibrary_unix.cpp index 2181153..fee73c2 100644 --- a/library/qlibrary_unix.cpp +++ b/library/qlibrary_unix.cpp | |||
@@ -1,243 +1,243 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qlibrary_p.h" | 21 | #include "qlibrary_p.h" |
22 | 22 | ||
23 | #ifndef QT_NO_COMPONENT | 23 | #ifndef QT_NO_COMPONENT |
24 | 24 | ||
25 | /* | 25 | /* |
26 | The platform dependent implementations of | 26 | The platform dependent implementations of |
27 | - loadLibrary | 27 | - loadLibrary |
28 | - freeLibrary | 28 | - freeLibrary |
29 | - resolveSymbol | 29 | - resolveSymbol |
30 | 30 | ||
31 | It's not too hard to guess what the functions do. | 31 | It's not too hard to guess what the functions do. |
32 | */ | 32 | */ |
33 | #if defined(Q_OS_HPUX) | 33 | #if defined(Q_OS_HPUX) |
34 | // for HP-UX < 11.x and 32 bit | 34 | // for HP-UX < 11.x and 32 bit |
35 | #include <dl.h> | 35 | #include <dl.h> |
36 | 36 | ||
37 | bool QLibraryPrivate::loadLibrary() | 37 | bool QLibraryPrivate::loadLibrary() |
38 | { | 38 | { |
39 | if ( pHnd ) | 39 | if ( pHnd ) |
40 | return TRUE; | 40 | return TRUE; |
41 | 41 | ||
42 | QString filename = library->library(); | 42 | QString filename = library->library(); |
43 | 43 | ||
44 | pHnd = (void*)shl_load( filename.latin1(), BIND_DEFERRED | BIND_NONFATAL | DYNAMIC_PATH, 0 ); | 44 | pHnd = (void*)shl_load( filename.latin1(), BIND_DEFERRED | BIND_NONFATAL | DYNAMIC_PATH, 0 ); |
45 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 45 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
46 | if ( !pHnd ) | 46 | if ( !pHnd ) |
47 | qDebug( "Failed to load library %s!", filename.latin1() ); | 47 | qDebug( "Failed to load library %s!", filename.latin1() ); |
48 | #endif | 48 | #endif |
49 | return pHnd != 0; | 49 | return pHnd != 0; |
50 | } | 50 | } |
51 | 51 | ||
52 | bool QLibraryPrivate::freeLibrary() | 52 | bool QLibraryPrivate::freeLibrary() |
53 | { | 53 | { |
54 | if ( !pHnd ) | 54 | if ( !pHnd ) |
55 | return TRUE; | 55 | return TRUE; |
56 | 56 | ||
57 | if ( !shl_unload( (shl_t)pHnd ) ) { | 57 | if ( !shl_unload( (shl_t)pHnd ) ) { |
58 | pHnd = 0; | 58 | pHnd = 0; |
59 | return TRUE; | 59 | return TRUE; |
60 | } | 60 | } |
61 | return FALSE; | 61 | return FALSE; |
62 | } | 62 | } |
63 | 63 | ||
64 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) | 64 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) |
65 | { | 65 | { |
66 | if ( !pHnd ) | 66 | if ( !pHnd ) |
67 | return 0; | 67 | return 0; |
68 | 68 | ||
69 | void* address = 0; | 69 | void* address = 0; |
70 | if ( shl_findsym( (shl_t*)&pHnd, symbol, TYPE_UNDEFINED, address ) < 0 ) { | 70 | if ( shl_findsym( (shl_t*)&pHnd, symbol, TYPE_UNDEFINED, address ) < 0 ) { |
71 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 71 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
72 | qDebug( "Couldn't resolve symbol \"%s\"", symbol ); | 72 | qDebug( "Couldn't resolve symbol \"%s\"", symbol ); |
73 | #endif | 73 | #endif |
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | return address; | 76 | return address; |
77 | } | 77 | } |
78 | 78 | ||
79 | #elif defined(_NULL_LIB_) | 79 | #elif defined(_NULL_LIB_) |
80 | 80 | ||
81 | bool QLibraryPrivate::loadLibrary() | 81 | bool QLibraryPrivate::loadLibrary() |
82 | { | 82 | { |
83 | //qDebug("QLibraryPrivate::loadLibrary\n"); | 83 | //qDebug("QLibraryPrivate::loadLibrary\n"); |
84 | return FALSE; | 84 | return FALSE; |
85 | } | 85 | } |
86 | bool QLibraryPrivate::freeLibrary() | 86 | bool QLibraryPrivate::freeLibrary() |
87 | { | 87 | { |
88 | //qDebug("QLibraryPrivate::freeLibrary\n"); | 88 | //qDebug("QLibraryPrivate::freeLibrary\n"); |
89 | return FALSE; | 89 | return FALSE; |
90 | } | 90 | } |
91 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) | 91 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) |
92 | { | 92 | { |
93 | //qDebug("QLibraryPrivate::resolveSymbol\n"); | 93 | //qDebug("QLibraryPrivate::resolveSymbol\n"); |
94 | return FALSE; | 94 | return FALSE; |
95 | } | 95 | } |
96 | 96 | ||
97 | #elif defined(Q_OS_MACX) | 97 | #elif defined(Q_OS_MACX) |
98 | 98 | ||
99 | #define ENUM_DYLD_BOOL | 99 | #define ENUM_DYLD_BOOL |
100 | enum DYLD_BOOL { | 100 | enum DYLD_BOOL { |
101 | DYLD_FALSE, | 101 | DYLD_FALSE, |
102 | DYLD_TRUE | 102 | DYLD_TRUE |
103 | }; | 103 | }; |
104 | #include <mach-o/dyld.h> | 104 | #include <mach-o/dyld.h> |
105 | typedef struct { | 105 | typedef struct { |
106 | NSObjectFileImage img; | 106 | NSObjectFileImage img; |
107 | NSModule mod; | 107 | NSModule mod; |
108 | } DyldLibDesc; | 108 | } DyldLibDesc; |
109 | 109 | ||
110 | bool QLibraryPrivate::loadLibrary() | 110 | bool QLibraryPrivate::loadLibrary() |
111 | { | 111 | { |
112 | // qDebug("QLibraryPrivate::loadLibrary\n"); | 112 | // qDebug("QLibraryPrivate::loadLibrary\n"); |
113 | // return FALSE; | 113 | // return FALSE; |
114 | if ( pHnd ) | 114 | if ( pHnd ) |
115 | return TRUE; | 115 | return TRUE; |
116 | 116 | ||
117 | QString filename = library->library(); | 117 | QString filename = library->library(); |
118 | 118 | ||
119 | NSObjectFileImage img = 0; | 119 | NSObjectFileImage img = 0; |
120 | NSModule mod = 0; | 120 | NSModule mod = 0; |
121 | NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile( filename.latin1() , &img ); | 121 | NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile( filename.latin1() , &img ); |
122 | if ( ret != NSObjectFileImageSuccess ) { | 122 | if ( ret != NSObjectFileImageSuccess ) { |
123 | qWarning( "Error in NSCreateObjectFileImageFromFile(): %d; Filename: %s", ret, filename.latin1() ); | 123 | qWarning( "Error in NSCreateObjectFileImageFromFile(): %d; Filename: %s", ret, filename.latin1() ); |
124 | if (ret == NSObjectFileImageAccess) { | 124 | if (ret == NSObjectFileImageAccess) { |
125 | qWarning ("(NSObjectFileImageAccess)" ); | 125 | qWarning ("(NSObjectFileImageAccess)" ); |
126 | } | 126 | } |
127 | } else { | 127 | } else { |
128 | mod = NSLinkModule(img, filename.latin1(), NSLINKMODULE_OPTION_BINDNOW | | 128 | mod = NSLinkModule(img, filename.latin1(), NSLINKMODULE_OPTION_BINDNOW | |
129 | NSLINKMODULE_OPTION_PRIVATE | | 129 | NSLINKMODULE_OPTION_PRIVATE | |
130 | NSLINKMODULE_OPTION_RETURN_ON_ERROR); | 130 | NSLINKMODULE_OPTION_RETURN_ON_ERROR); |
131 | if (mod == 0) { | 131 | if (mod == 0) { |
132 | qWarning( "Error in NSLinkModule()" ); | 132 | qWarning( "Error in NSLinkModule()" ); |
133 | NSDestroyObjectFileImage(img); | 133 | NSDestroyObjectFileImage(img); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | DyldLibDesc* desc = 0; | 136 | DyldLibDesc* desc = 0; |
137 | if (img != 0 && mod != 0) { | 137 | if (img != 0 && mod != 0) { |
138 | desc = new DyldLibDesc; | 138 | desc = new DyldLibDesc; |
139 | desc->img = img; | 139 | desc->img = img; |
140 | desc->mod = mod; | 140 | desc->mod = mod; |
141 | } | 141 | } |
142 | pHnd = desc; | 142 | pHnd = desc; |
143 | return pHnd != 0; | 143 | return pHnd != 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool QLibraryPrivate::freeLibrary() | 146 | bool QLibraryPrivate::freeLibrary() |
147 | { | 147 | { |
148 | //qDebug("QLibraryPrivate::freeLibrary\n"); | 148 | //qDebug("QLibraryPrivate::freeLibrary\n"); |
149 | //return FALSE; | 149 | //return FALSE; |
150 | if ( !pHnd ) | 150 | if ( !pHnd ) |
151 | return TRUE; | 151 | return TRUE; |
152 | 152 | ||
153 | DyldLibDesc* desc = (DyldLibDesc*) pHnd; | 153 | DyldLibDesc* desc = (DyldLibDesc*) pHnd; |
154 | NSModule mod = desc->mod; | 154 | NSModule mod = desc->mod; |
155 | NSObjectFileImage img = desc->img; | 155 | NSObjectFileImage img = desc->img; |
156 | DYLD_BOOL success = NSUnLinkModule(mod, NSUNLINKMODULE_OPTION_NONE); | 156 | bool success = NSUnLinkModule(mod, NSUNLINKMODULE_OPTION_NONE); |
157 | if ( success ) { | 157 | if ( success ) { |
158 | NSDestroyObjectFileImage(img); | 158 | NSDestroyObjectFileImage(img); |
159 | delete desc; | 159 | delete desc; |
160 | pHnd = 0; | 160 | pHnd = 0; |
161 | } | 161 | } |
162 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 162 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
163 | else { | 163 | else { |
164 | qWarning( "Error in NSUnLinkModule()" ); | 164 | qWarning( "Error in NSUnLinkModule()" ); |
165 | } | 165 | } |
166 | #endif | 166 | #endif |
167 | return pHnd == 0; | 167 | return pHnd == 0; |
168 | } | 168 | } |
169 | 169 | ||
170 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) | 170 | void* QLibraryPrivate::resolveSymbol( const char* symbol ) |
171 | { | 171 | { |
172 | //qDebug("QLibraryPrivate::resolveSymbol\n"); | 172 | //qDebug("QLibraryPrivate::resolveSymbol\n"); |
173 | //return FALSE; | 173 | //return FALSE; |
174 | if ( !pHnd ) | 174 | if ( !pHnd ) |
175 | return 0; | 175 | return 0; |
176 | 176 | ||
177 | DyldLibDesc* desc = (DyldLibDesc*) pHnd; | 177 | DyldLibDesc* desc = (DyldLibDesc*) pHnd; |
178 | NSSymbol sym = NSLookupSymbolInModule(desc->mod, symbol); | 178 | NSSymbol sym = NSLookupSymbolInModule(desc->mod, symbol); |
179 | void* address = 0; | 179 | void* address = 0; |
180 | if (sym != 0) { | 180 | if (sym != 0) { |
181 | address = NSAddressOfSymbol(sym); | 181 | address = NSAddressOfSymbol(sym); |
182 | } | 182 | } |
183 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 183 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
184 | if ( address == 0 ) | 184 | if ( address == 0 ) |
185 | qWarning( "Cannot find symbol: %s", symbol ); | 185 | qWarning( "Cannot find symbol: %s", symbol ); |
186 | #endif | 186 | #endif |
187 | return address; | 187 | return address; |
188 | } | 188 | } |
189 | 189 | ||
190 | #else | 190 | #else |
191 | // Something else, assuming POSIX | 191 | // Something else, assuming POSIX |
192 | #include <dlfcn.h> | 192 | #include <dlfcn.h> |
193 | 193 | ||
194 | bool QLibraryPrivate::loadLibrary() | 194 | bool QLibraryPrivate::loadLibrary() |
195 | { | 195 | { |
196 | if ( pHnd ) | 196 | if ( pHnd ) |
197 | return TRUE; | 197 | return TRUE; |
198 | 198 | ||
199 | QString filename = library->library(); | 199 | QString filename = library->library(); |
200 | 200 | ||
201 | pHnd = dlopen( filename.latin1() , RTLD_LAZY ); | 201 | pHnd = dlopen( filename.latin1() , RTLD_LAZY ); |
202 | // #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 202 | // #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
203 | if ( !pHnd ) | 203 | if ( !pHnd ) |
204 | qWarning( "%s", dlerror() ); | 204 | qWarning( "%s", dlerror() ); |
205 | // #endif | 205 | // #endif |
206 | return pHnd != 0; | 206 | return pHnd != 0; |
207 | } | 207 | } |
208 | 208 | ||
209 | bool QLibraryPrivate::freeLibrary() | 209 | bool QLibraryPrivate::freeLibrary() |
210 | { | 210 | { |
211 | if ( !pHnd ) | 211 | if ( !pHnd ) |
212 | return TRUE; | 212 | return TRUE; |
213 | 213 | ||
214 | int ec = dlclose( pHnd ); | 214 | int ec = dlclose( pHnd ); |
215 | if ( !ec ) | 215 | if ( !ec ) |
216 | pHnd = 0; | 216 | pHnd = 0; |
217 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 217 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
218 | else { | 218 | else { |
219 | const char* error = dlerror(); | 219 | const char* error = dlerror(); |
220 | if ( error ) | 220 | if ( error ) |
221 | qWarning( "%s", error ); | 221 | qWarning( "%s", error ); |
222 | } | 222 | } |
223 | #endif | 223 | #endif |
224 | return pHnd == 0; | 224 | return pHnd == 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | void* QLibraryPrivate::resolveSymbol( const char* f ) | 227 | void* QLibraryPrivate::resolveSymbol( const char* f ) |
228 | { | 228 | { |
229 | if ( !pHnd ) | 229 | if ( !pHnd ) |
230 | return 0; | 230 | return 0; |
231 | 231 | ||
232 | void* address = dlsym( pHnd, f ); | 232 | void* address = dlsym( pHnd, f ); |
233 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) | 233 | #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT) |
234 | const char* error = dlerror(); | 234 | const char* error = dlerror(); |
235 | if ( error ) | 235 | if ( error ) |
236 | qWarning( "%s", error ); | 236 | qWarning( "%s", error ); |
237 | #endif | 237 | #endif |
238 | return address; | 238 | return address; |
239 | } | 239 | } |
240 | 240 | ||
241 | #endif // POSIX | 241 | #endif // POSIX |
242 | 242 | ||
243 | #endif // QT_NO_COMPONENT | 243 | #endif // QT_NO_COMPONENT |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 19e99f2..dcc1001 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1698,593 +1698,593 @@ void QPEApplication::pidMessage( const QCString& msg, const QByteArray& data) | |||
1698 | e << d->appName; | 1698 | e << d->appName; |
1699 | } | 1699 | } |
1700 | else if ( msg == "flush()" ) { | 1700 | else if ( msg == "flush()" ) { |
1701 | emit flush(); | 1701 | emit flush(); |
1702 | // we need to tell the desktop | 1702 | // we need to tell the desktop |
1703 | QCopEnvelope e( "QPE/Desktop", "flushDone(QString)" ); | 1703 | QCopEnvelope e( "QPE/Desktop", "flushDone(QString)" ); |
1704 | e << d->appName; | 1704 | e << d->appName; |
1705 | } | 1705 | } |
1706 | else if ( msg == "reload()" ) { | 1706 | else if ( msg == "reload()" ) { |
1707 | emit reload(); | 1707 | emit reload(); |
1708 | } | 1708 | } |
1709 | else if ( msg == "setDocument(QString)" ) { | 1709 | else if ( msg == "setDocument(QString)" ) { |
1710 | d->keep_running = TRUE; | 1710 | d->keep_running = TRUE; |
1711 | QDataStream stream( data, IO_ReadOnly ); | 1711 | QDataStream stream( data, IO_ReadOnly ); |
1712 | QString doc; | 1712 | QString doc; |
1713 | stream >> doc; | 1713 | stream >> doc; |
1714 | QWidget *mw = mainWidget(); | 1714 | QWidget *mw = mainWidget(); |
1715 | if ( !mw ) | 1715 | if ( !mw ) |
1716 | mw = d->qpe_main_widget; | 1716 | mw = d->qpe_main_widget; |
1717 | if ( mw ) | 1717 | if ( mw ) |
1718 | Global::setDocument( mw, doc ); | 1718 | Global::setDocument( mw, doc ); |
1719 | 1719 | ||
1720 | } else if ( msg == "QPEProcessQCop()" ) { | 1720 | } else if ( msg == "QPEProcessQCop()" ) { |
1721 | processQCopFile(); | 1721 | processQCopFile(); |
1722 | d->sendQCopQ(); | 1722 | d->sendQCopQ(); |
1723 | }else | 1723 | }else |
1724 | { | 1724 | { |
1725 | bool p = d->keep_running; | 1725 | bool p = d->keep_running; |
1726 | d->keep_running = FALSE; | 1726 | d->keep_running = FALSE; |
1727 | emit appMessage( msg, data); | 1727 | emit appMessage( msg, data); |
1728 | if ( d->keep_running ) { | 1728 | if ( d->keep_running ) { |
1729 | d->notbusysent = FALSE; | 1729 | d->notbusysent = FALSE; |
1730 | raiseAppropriateWindow(); | 1730 | raiseAppropriateWindow(); |
1731 | if ( !p ) { | 1731 | if ( !p ) { |
1732 | // Tell the system we're still chugging along... | 1732 | // Tell the system we're still chugging along... |
1733 | #ifndef QT_NO_COP | 1733 | #ifndef QT_NO_COP |
1734 | QCopEnvelope e("QPE/System", "appRaised(QString)"); | 1734 | QCopEnvelope e("QPE/System", "appRaised(QString)"); |
1735 | e << d->appName; | 1735 | e << d->appName; |
1736 | #endif | 1736 | #endif |
1737 | } | 1737 | } |
1738 | } | 1738 | } |
1739 | if ( p ) | 1739 | if ( p ) |
1740 | d->keep_running = p; | 1740 | d->keep_running = p; |
1741 | } | 1741 | } |
1742 | #endif | 1742 | #endif |
1743 | } | 1743 | } |
1744 | 1744 | ||
1745 | 1745 | ||
1746 | /*! | 1746 | /*! |
1747 | Sets widget \a mw as the mainWidget() and shows it. For small windows, | 1747 | Sets widget \a mw as the mainWidget() and shows it. For small windows, |
1748 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1748 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1749 | 1749 | ||
1750 | \sa showMainDocumentWidget() | 1750 | \sa showMainDocumentWidget() |
1751 | */ | 1751 | */ |
1752 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) | 1752 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) |
1753 | { | 1753 | { |
1754 | // setMainWidget(mw); this breaks FastLoading because lastWindowClose() would quit | 1754 | // setMainWidget(mw); this breaks FastLoading because lastWindowClose() would quit |
1755 | d->show(mw, nomaximize ); | 1755 | d->show(mw, nomaximize ); |
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | /*! | 1758 | /*! |
1759 | Sets widget \a mw as the mainWidget() and shows it. For small windows, | 1759 | Sets widget \a mw as the mainWidget() and shows it. For small windows, |
1760 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1760 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1761 | 1761 | ||
1762 | This calls designates the application as | 1762 | This calls designates the application as |
1763 | a \link docwidget.html document-oriented\endlink application. | 1763 | a \link docwidget.html document-oriented\endlink application. |
1764 | 1764 | ||
1765 | The \a mw widget \e must have this slot: setDocument(const QString&). | 1765 | The \a mw widget \e must have this slot: setDocument(const QString&). |
1766 | 1766 | ||
1767 | \sa showMainWidget() | 1767 | \sa showMainWidget() |
1768 | */ | 1768 | */ |
1769 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) | 1769 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) |
1770 | { | 1770 | { |
1771 | if ( mw && argc() == 2 ) | 1771 | if ( mw && argc() == 2 ) |
1772 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); | 1772 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); |
1773 | 1773 | ||
1774 | 1774 | ||
1775 | // setMainWidget(mw); see above | 1775 | // setMainWidget(mw); see above |
1776 | d->show(mw, nomaximize ); | 1776 | d->show(mw, nomaximize ); |
1777 | } | 1777 | } |
1778 | 1778 | ||
1779 | 1779 | ||
1780 | /*! | 1780 | /*! |
1781 | If an application is started via a \link qcop.html QCop\endlink | 1781 | If an application is started via a \link qcop.html QCop\endlink |
1782 | message, the application will process the \link qcop.html | 1782 | message, the application will process the \link qcop.html |
1783 | QCop\endlink message and then quit. If the application calls this | 1783 | QCop\endlink message and then quit. If the application calls this |
1784 | function while processing a \link qcop.html QCop\endlink message, | 1784 | function while processing a \link qcop.html QCop\endlink message, |
1785 | after processing its outstanding \link qcop.html QCop\endlink | 1785 | after processing its outstanding \link qcop.html QCop\endlink |
1786 | messages the application will start 'properly' and show itself. | 1786 | messages the application will start 'properly' and show itself. |
1787 | 1787 | ||
1788 | \sa keepRunning() | 1788 | \sa keepRunning() |
1789 | */ | 1789 | */ |
1790 | void QPEApplication::setKeepRunning() | 1790 | void QPEApplication::setKeepRunning() |
1791 | { | 1791 | { |
1792 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { | 1792 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { |
1793 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; | 1793 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; |
1794 | qpeApp->d->keep_running = TRUE; | 1794 | qpeApp->d->keep_running = TRUE; |
1795 | } | 1795 | } |
1796 | } | 1796 | } |
1797 | 1797 | ||
1798 | /*! | 1798 | /*! |
1799 | Returns TRUE if the application will quit after processing the | 1799 | Returns TRUE if the application will quit after processing the |
1800 | current list of qcop messages; otherwise returns FALSE. | 1800 | current list of qcop messages; otherwise returns FALSE. |
1801 | 1801 | ||
1802 | \sa setKeepRunning() | 1802 | \sa setKeepRunning() |
1803 | */ | 1803 | */ |
1804 | bool QPEApplication::keepRunning() const | 1804 | bool QPEApplication::keepRunning() const |
1805 | { | 1805 | { |
1806 | return d->keep_running; | 1806 | return d->keep_running; |
1807 | } | 1807 | } |
1808 | 1808 | ||
1809 | /*! | 1809 | /*! |
1810 | \internal | 1810 | \internal |
1811 | */ | 1811 | */ |
1812 | void QPEApplication::internalSetStyle( const QString &style ) | 1812 | void QPEApplication::internalSetStyle( const QString &style ) |
1813 | { | 1813 | { |
1814 | #if QT_VERSION >= 0x030000 | 1814 | #if QT_VERSION >= 0x030000 |
1815 | if ( style == "QPE" ) { | 1815 | if ( style == "QPE" ) { |
1816 | setStyle( new QPEStyle ); | 1816 | setStyle( new QPEStyle ); |
1817 | } | 1817 | } |
1818 | else { | 1818 | else { |
1819 | QStyle *s = QStyleFactory::create( style ); | 1819 | QStyle *s = QStyleFactory::create( style ); |
1820 | if ( s ) | 1820 | if ( s ) |
1821 | setStyle( s ); | 1821 | setStyle( s ); |
1822 | } | 1822 | } |
1823 | #else | 1823 | #else |
1824 | if ( style == "Windows" ) { | 1824 | if ( style == "Windows" ) { |
1825 | setStyle( new QWindowsStyle ); | 1825 | setStyle( new QWindowsStyle ); |
1826 | } | 1826 | } |
1827 | else if ( style == "QPE" ) { | 1827 | else if ( style == "QPE" ) { |
1828 | setStyle( new QPEStyle ); | 1828 | setStyle( new QPEStyle ); |
1829 | } | 1829 | } |
1830 | else if ( style == "Light" ) { | 1830 | else if ( style == "Light" ) { |
1831 | setStyle( new LightStyle ); | 1831 | setStyle( new LightStyle ); |
1832 | } | 1832 | } |
1833 | #ifndef QT_NO_STYLE_PLATINUM | 1833 | #ifndef QT_NO_STYLE_PLATINUM |
1834 | else if ( style == "Platinum" ) { | 1834 | else if ( style == "Platinum" ) { |
1835 | setStyle( new QPlatinumStyle ); | 1835 | setStyle( new QPlatinumStyle ); |
1836 | } | 1836 | } |
1837 | #endif | 1837 | #endif |
1838 | #ifndef QT_NO_STYLE_MOTIF | 1838 | #ifndef QT_NO_STYLE_MOTIF |
1839 | else if ( style == "Motif" ) { | 1839 | else if ( style == "Motif" ) { |
1840 | setStyle( new QMotifStyle ); | 1840 | setStyle( new QMotifStyle ); |
1841 | } | 1841 | } |
1842 | #endif | 1842 | #endif |
1843 | #ifndef QT_NO_STYLE_MOTIFPLUS | 1843 | #ifndef QT_NO_STYLE_MOTIFPLUS |
1844 | else if ( style == "MotifPlus" ) { | 1844 | else if ( style == "MotifPlus" ) { |
1845 | setStyle( new QMotifPlusStyle ); | 1845 | setStyle( new QMotifPlusStyle ); |
1846 | } | 1846 | } |
1847 | #endif | 1847 | #endif |
1848 | 1848 | ||
1849 | else { | 1849 | else { |
1850 | QStyle *sty = 0; | 1850 | QStyle *sty = 0; |
1851 | QString path = QPEApplication::qpeDir ( ) + "plugins/styles/"; | 1851 | QString path = QPEApplication::qpeDir ( ) + "plugins/styles/"; |
1852 | 1852 | ||
1853 | #ifdef Q_OS_MACX | 1853 | #ifdef Q_OS_MACX |
1854 | if ( style. find ( ".dylib" ) > 0 ) | 1854 | if ( style. find ( ".dylib" ) > 0 ) |
1855 | path += style; | 1855 | path += style; |
1856 | else | 1856 | else |
1857 | path = path + "lib" + style. lower ( ) + ".dylib"; // compatibility | 1857 | path = path + "lib" + style. lower ( ) + ".dylib"; // compatibility |
1858 | #else | 1858 | #else |
1859 | if ( style. find ( ".so" ) > 0 ) | 1859 | if ( style. find ( ".so" ) > 0 ) |
1860 | path += style; | 1860 | path += style; |
1861 | else | 1861 | else |
1862 | path = path + "lib" + style. lower ( ) + ".so"; // compatibility | 1862 | path = path + "lib" + style. lower ( ) + ".so"; // compatibility |
1863 | #endif | 1863 | #endif |
1864 | static QLibrary *lastlib = 0; | 1864 | static QLibrary *lastlib = 0; |
1865 | static StyleInterface *lastiface = 0; | 1865 | static StyleInterface *lastiface = 0; |
1866 | 1866 | ||
1867 | QLibrary *lib = new QLibrary ( path ); | 1867 | QLibrary *lib = new QLibrary ( path ); |
1868 | StyleInterface *iface = 0; | 1868 | StyleInterface *iface = 0; |
1869 | 1869 | ||
1870 | if (( lib-> queryInterface ( IID_Style, ( QUnknownInterface ** ) &iface ) == QS_OK ) && iface ) | 1870 | if (( lib-> queryInterface ( IID_Style, ( QUnknownInterface ** ) &iface ) == QS_OK ) && iface ) |
1871 | sty = iface-> style ( ); | 1871 | sty = iface-> style ( ); |
1872 | 1872 | ||
1873 | if ( sty ) { | 1873 | if ( sty ) { |
1874 | setStyle ( sty ); | 1874 | setStyle ( sty ); |
1875 | 1875 | ||
1876 | if ( lastiface ) | 1876 | if ( lastiface ) |
1877 | lastiface-> release ( ); | 1877 | lastiface-> release ( ); |
1878 | lastiface = iface; | 1878 | lastiface = iface; |
1879 | 1879 | ||
1880 | if ( lastlib ) { | 1880 | if ( lastlib ) { |
1881 | lastlib-> unload ( ); | 1881 | lastlib-> unload ( ); |
1882 | delete lastlib; | 1882 | delete lastlib; |
1883 | } | 1883 | } |
1884 | lastlib = lib; | 1884 | lastlib = lib; |
1885 | } | 1885 | } |
1886 | else { | 1886 | else { |
1887 | if ( iface ) | 1887 | if ( iface ) |
1888 | iface-> release ( ); | 1888 | iface-> release ( ); |
1889 | delete lib; | 1889 | delete lib; |
1890 | 1890 | ||
1891 | setStyle ( new LightStyle ( )); | 1891 | setStyle ( new LightStyle ( )); |
1892 | } | 1892 | } |
1893 | } | 1893 | } |
1894 | #endif | 1894 | #endif |
1895 | } | 1895 | } |
1896 | 1896 | ||
1897 | /*! | 1897 | /*! |
1898 | \internal | 1898 | \internal |
1899 | */ | 1899 | */ |
1900 | void QPEApplication::prepareForTermination( bool willrestart ) | 1900 | void QPEApplication::prepareForTermination( bool willrestart ) |
1901 | { | 1901 | { |
1902 | if ( willrestart ) { | 1902 | if ( willrestart ) { |
1903 | QLabel *lblWait = new QLabel( tr( "Please wait..." ), 0, "wait hack", QWidget::WStyle_Customize | | 1903 | QLabel *lblWait = new QLabel( tr( "Please wait..." ), 0, "wait hack", QWidget::WStyle_Customize | |
1904 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); | 1904 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); |
1905 | lblWait->setAlignment( QWidget::AlignCenter ); | 1905 | lblWait->setAlignment( QWidget::AlignCenter ); |
1906 | lblWait->show(); | 1906 | lblWait->show(); |
1907 | lblWait->showMaximized(); | 1907 | lblWait->showMaximized(); |
1908 | } | 1908 | } |
1909 | { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); | 1909 | { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); |
1910 | } | 1910 | } |
1911 | processEvents(); // ensure the message goes out. | 1911 | processEvents(); // ensure the message goes out. |
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | /*! | 1914 | /*! |
1915 | \internal | 1915 | \internal |
1916 | */ | 1916 | */ |
1917 | void QPEApplication::shutdown() | 1917 | void QPEApplication::shutdown() |
1918 | { | 1918 | { |
1919 | // Implement in server's QPEApplication subclass | 1919 | // Implement in server's QPEApplication subclass |
1920 | } | 1920 | } |
1921 | 1921 | ||
1922 | /*! | 1922 | /*! |
1923 | \internal | 1923 | \internal |
1924 | */ | 1924 | */ |
1925 | void QPEApplication::restart() | 1925 | void QPEApplication::restart() |
1926 | { | 1926 | { |
1927 | // Implement in server's QPEApplication subclass | 1927 | // Implement in server's QPEApplication subclass |
1928 | } | 1928 | } |
1929 | 1929 | ||
1930 | static QPtrDict<void>* stylusDict = 0; | 1930 | static QPtrDict<void>* stylusDict = 0; |
1931 | static void createDict() | 1931 | static void createDict() |
1932 | { | 1932 | { |
1933 | if ( !stylusDict ) | 1933 | if ( !stylusDict ) |
1934 | stylusDict = new QPtrDict<void>; | 1934 | stylusDict = new QPtrDict<void>; |
1935 | } | 1935 | } |
1936 | 1936 | ||
1937 | /*! | 1937 | /*! |
1938 | Returns the current StylusMode for widget \a w. | 1938 | Returns the current StylusMode for widget \a w. |
1939 | 1939 | ||
1940 | \sa setStylusOperation() StylusMode | 1940 | \sa setStylusOperation() StylusMode |
1941 | */ | 1941 | */ |
1942 | QPEApplication::StylusMode QPEApplication::stylusOperation( QWidget* w ) | 1942 | QPEApplication::StylusMode QPEApplication::stylusOperation( QWidget* w ) |
1943 | { | 1943 | { |
1944 | if ( stylusDict ) | 1944 | if ( stylusDict ) |
1945 | return ( StylusMode ) ( int ) stylusDict->find( w ); | 1945 | return ( StylusMode ) ( int ) stylusDict->find( w ); |
1946 | return LeftOnly; | 1946 | return LeftOnly; |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | /*! | 1949 | /*! |
1950 | \enum QPEApplication::StylusMode | 1950 | \enum QPEApplication::StylusMode |
1951 | 1951 | ||
1952 | \value LeftOnly the stylus only generates LeftButton | 1952 | \value LeftOnly the stylus only generates LeftButton |
1953 | events (the default). | 1953 | events (the default). |
1954 | \value RightOnHold the stylus generates RightButton events | 1954 | \value RightOnHold the stylus generates RightButton events |
1955 | if the user uses the press-and-hold gesture. | 1955 | if the user uses the press-and-hold gesture. |
1956 | 1956 | ||
1957 | \sa setStylusOperation() stylusOperation() | 1957 | \sa setStylusOperation() stylusOperation() |
1958 | */ | 1958 | */ |
1959 | 1959 | ||
1960 | /*! | 1960 | /*! |
1961 | Causes widget \a w to receive mouse events according to the stylus | 1961 | Causes widget \a w to receive mouse events according to the stylus |
1962 | \a mode. | 1962 | \a mode. |
1963 | 1963 | ||
1964 | \sa stylusOperation() StylusMode | 1964 | \sa stylusOperation() StylusMode |
1965 | */ | 1965 | */ |
1966 | void QPEApplication::setStylusOperation( QWidget * w, StylusMode mode ) | 1966 | void QPEApplication::setStylusOperation( QWidget * w, StylusMode mode ) |
1967 | { | 1967 | { |
1968 | createDict(); | 1968 | createDict(); |
1969 | if ( mode == LeftOnly ) { | 1969 | if ( mode == LeftOnly ) { |
1970 | stylusDict->remove | 1970 | stylusDict->remove |
1971 | ( w ); | 1971 | ( w ); |
1972 | w->removeEventFilter( qApp ); | 1972 | w->removeEventFilter( qApp ); |
1973 | } | 1973 | } |
1974 | else { | 1974 | else { |
1975 | stylusDict->insert( w, ( void* ) mode ); | 1975 | stylusDict->insert( w, ( void* ) mode ); |
1976 | connect( w, SIGNAL( destroyed() ), qApp, SLOT( removeSenderFromStylusDict() ) ); | 1976 | connect( w, SIGNAL( destroyed() ), qApp, SLOT( removeSenderFromStylusDict() ) ); |
1977 | w->installEventFilter( qApp ); | 1977 | w->installEventFilter( qApp ); |
1978 | } | 1978 | } |
1979 | } | 1979 | } |
1980 | 1980 | ||
1981 | 1981 | ||
1982 | /*! | 1982 | /*! |
1983 | \reimp | 1983 | \reimp |
1984 | */ | 1984 | */ |
1985 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | 1985 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) |
1986 | { | 1986 | { |
1987 | if ( !o->isWidgetType() ) | 1987 | if ( !o->isWidgetType() ) |
1988 | return FALSE; | 1988 | return FALSE; |
1989 | 1989 | ||
1990 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { | 1990 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { |
1991 | QMouseEvent * me = ( QMouseEvent* ) e; | 1991 | QMouseEvent * me = ( QMouseEvent* ) e; |
1992 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); | 1992 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); |
1993 | switch (mode) { | 1993 | switch (mode) { |
1994 | case RightOnHold: | 1994 | case RightOnHold: |
1995 | switch ( me->type() ) { | 1995 | switch ( me->type() ) { |
1996 | case QEvent::MouseButtonPress: | 1996 | case QEvent::MouseButtonPress: |
1997 | if ( me->button() == LeftButton ) { | 1997 | if ( me->button() == LeftButton ) { |
1998 | static long Pref = 500; // #### pref. | 1998 | static long Pref = 500; // #### pref. |
1999 | d->presswidget = (QWidget*)o; | 1999 | d->presswidget = (QWidget*)o; |
2000 | d->presspos = me->pos(); | 2000 | d->presspos = me->pos(); |
2001 | d->rightpressed = FALSE; | 2001 | d->rightpressed = FALSE; |
2002 | #ifdef OPIE_WITHROHFEEDBACK | 2002 | #ifdef OPIE_WITHROHFEEDBACK |
2003 | if( ! d->RoH ) | 2003 | if( ! d->RoH ) |
2004 | d->RoH = new Opie::Internal::RoHFeedback; | 2004 | d->RoH = new Opie::Internal::RoHFeedback; |
2005 | 2005 | ||
2006 | d->RoH->init( me->globalPos(), d->presswidget ); | 2006 | d->RoH->init( me->globalPos(), d->presswidget ); |
2007 | Pref = d->RoH->delay(); | 2007 | Pref = d->RoH->delay(); |
2008 | 2008 | ||
2009 | #endif | 2009 | #endif |
2010 | if (!d->presstimer ) | 2010 | if (!d->presstimer ) |
2011 | d->presstimer = startTimer( Pref ); // #### pref. | 2011 | d->presstimer = startTimer( Pref ); // #### pref. |
2012 | 2012 | ||
2013 | } | 2013 | } |
2014 | break; | 2014 | break; |
2015 | case QEvent::MouseMove: | 2015 | case QEvent::MouseMove: |
2016 | if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) { | 2016 | if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) { |
2017 | killTimer(d->presstimer); | 2017 | killTimer(d->presstimer); |
2018 | #ifdef OPIE_WITHROHFEEDBACK | 2018 | #ifdef OPIE_WITHROHFEEDBACK |
2019 | d->RoH->stop(); | 2019 | d->RoH->stop(); |
2020 | #endif | 2020 | #endif |
2021 | d->presstimer = 0; | 2021 | d->presstimer = 0; |
2022 | } | 2022 | } |
2023 | break; | 2023 | break; |
2024 | case QEvent::MouseButtonRelease: | 2024 | case QEvent::MouseButtonRelease: |
2025 | if ( me->button() == LeftButton ) { | 2025 | if ( me->button() == LeftButton ) { |
2026 | if ( d->presstimer ) { | 2026 | if ( d->presstimer ) { |
2027 | killTimer(d->presstimer); | 2027 | killTimer(d->presstimer); |
2028 | #ifdef OPIE_WITHROHFEEDBACK | 2028 | #ifdef OPIE_WITHROHFEEDBACK |
2029 | d->RoH->stop( ); | 2029 | d->RoH->stop( ); |
2030 | #endif | 2030 | #endif |
2031 | d->presstimer = 0; | 2031 | d->presstimer = 0; |
2032 | } | 2032 | } |
2033 | if ( d->rightpressed && d->presswidget ) { | 2033 | if ( d->rightpressed && d->presswidget ) { |
2034 | printf( "Send ButtonRelease\n" ); | 2034 | printf( "Send ButtonRelease\n" ); |
2035 | // Right released | 2035 | // Right released |
2036 | postEvent( d->presswidget, | 2036 | postEvent( d->presswidget, |
2037 | new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), | 2037 | new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), |
2038 | RightButton, LeftButton + RightButton ) ); | 2038 | RightButton, LeftButton + RightButton ) ); |
2039 | // Left released, off-widget | 2039 | // Left released, off-widget |
2040 | postEvent( d->presswidget, | 2040 | postEvent( d->presswidget, |
2041 | new QMouseEvent( QEvent::MouseMove, QPoint( -1, -1), | 2041 | new QMouseEvent( QEvent::MouseMove, QPoint( -1, -1), |
2042 | LeftButton, LeftButton ) ); | 2042 | LeftButton, LeftButton ) ); |
2043 | postEvent( d->presswidget, | 2043 | postEvent( d->presswidget, |
2044 | new QMouseEvent( QEvent::MouseButtonRelease, QPoint( -1, -1), | 2044 | new QMouseEvent( QEvent::MouseButtonRelease, QPoint( -1, -1), |
2045 | LeftButton, LeftButton ) ); | 2045 | LeftButton, LeftButton ) ); |
2046 | d->rightpressed = FALSE; | 2046 | d->rightpressed = FALSE; |
2047 | return TRUE; // don't send the real Left release | 2047 | return TRUE; // don't send the real Left release |
2048 | } | 2048 | } |
2049 | } | 2049 | } |
2050 | break; | 2050 | break; |
2051 | default: | 2051 | default: |
2052 | break; | 2052 | break; |
2053 | } | 2053 | } |
2054 | break; | 2054 | break; |
2055 | default: | 2055 | default: |
2056 | ; | 2056 | ; |
2057 | } | 2057 | } |
2058 | } | 2058 | } |
2059 | else if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 2059 | else if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
2060 | QKeyEvent *ke = (QKeyEvent *)e; | 2060 | QKeyEvent *ke = (QKeyEvent *)e; |
2061 | if ( ke->key() == Key_Enter ) { | 2061 | if ( ke->key() == Key_Enter ) { |
2062 | if ( o->isA( "QRadioButton" ) || o->isA( "QCheckBox" ) ) { | 2062 | if ( o->isA( "QRadioButton" ) || o->isA( "QCheckBox" ) ) { |
2063 | postEvent( o, new QKeyEvent( e->type(), Key_Space, ' ', | 2063 | postEvent( o, new QKeyEvent( e->type(), Key_Space, ' ', |
2064 | ke->state(), " ", ke->isAutoRepeat(), ke->count() ) ); | 2064 | ke->state(), " ", ke->isAutoRepeat(), ke->count() ) ); |
2065 | return TRUE; | 2065 | return TRUE; |
2066 | } | 2066 | } |
2067 | } | 2067 | } |
2068 | } | 2068 | } |
2069 | return FALSE; | 2069 | return FALSE; |
2070 | } | 2070 | } |
2071 | 2071 | ||
2072 | /*! | 2072 | /*! |
2073 | \reimp | 2073 | \reimp |
2074 | */ | 2074 | */ |
2075 | void QPEApplication::timerEvent( QTimerEvent *e ) | 2075 | void QPEApplication::timerEvent( QTimerEvent *e ) |
2076 | { | 2076 | { |
2077 | if ( e->timerId() == d->presstimer && d->presswidget ) { | 2077 | if ( e->timerId() == d->presstimer && d->presswidget ) { |
2078 | 2078 | ||
2079 | // Right pressed | 2079 | // Right pressed |
2080 | postEvent( d->presswidget, | 2080 | postEvent( d->presswidget, |
2081 | new QMouseEvent( QEvent::MouseButtonPress, d->presspos, | 2081 | new QMouseEvent( QEvent::MouseButtonPress, d->presspos, |
2082 | RightButton, LeftButton ) ); | 2082 | RightButton, LeftButton ) ); |
2083 | killTimer( d->presstimer ); | 2083 | killTimer( d->presstimer ); |
2084 | d->presstimer = 0; | 2084 | d->presstimer = 0; |
2085 | d->rightpressed = TRUE; | 2085 | d->rightpressed = TRUE; |
2086 | #ifdef OPIE_WITHROHFEEDBACK | 2086 | #ifdef OPIE_WITHROHFEEDBACK |
2087 | d->RoH->stop(); | 2087 | d->RoH->stop(); |
2088 | #endif | 2088 | #endif |
2089 | } | 2089 | } |
2090 | } | 2090 | } |
2091 | 2091 | ||
2092 | void QPEApplication::removeSenderFromStylusDict() | 2092 | void QPEApplication::removeSenderFromStylusDict() |
2093 | { | 2093 | { |
2094 | stylusDict->remove | 2094 | stylusDict->remove |
2095 | ( ( void* ) sender() ); | 2095 | ( ( void* ) sender() ); |
2096 | if ( d->presswidget == sender() ) | 2096 | if ( d->presswidget == sender() ) |
2097 | d->presswidget = 0; | 2097 | d->presswidget = 0; |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | /*! | 2100 | /*! |
2101 | \internal | 2101 | \internal |
2102 | */ | 2102 | */ |
2103 | bool QPEApplication::keyboardGrabbed() const | 2103 | bool QPEApplication::keyboardGrabbed() const |
2104 | { | 2104 | { |
2105 | return d->kbgrabbed; | 2105 | return d->kbgrabbed; |
2106 | } | 2106 | } |
2107 | 2107 | ||
2108 | 2108 | ||
2109 | /*! | 2109 | /*! |
2110 | Reverses the effect of grabKeyboard(). This is called automatically | 2110 | Reverses the effect of grabKeyboard(). This is called automatically |
2111 | on program exit. | 2111 | on program exit. |
2112 | */ | 2112 | */ |
2113 | void QPEApplication::ungrabKeyboard() | 2113 | void QPEApplication::ungrabKeyboard() |
2114 | { | 2114 | { |
2115 | ((QPEApplication *) qApp )-> d-> kbgrabbed = false; | 2115 | ((QPEApplication *) qApp )-> d-> kbgrabbed = false; |
2116 | } | 2116 | } |
2117 | 2117 | ||
2118 | /*! | 2118 | /*! |
2119 | Grabs the physical keyboard keys, e.g. the application's launching | 2119 | Grabs the physical keyboard keys, e.g. the application's launching |
2120 | keys. Instead of launching applications when these keys are pressed | 2120 | keys. Instead of launching applications when these keys are pressed |
2121 | the signals emitted are sent to this application instead. Some games | 2121 | the signals emitted are sent to this application instead. Some games |
2122 | programs take over the launch keys in this way to make interaction | 2122 | programs take over the launch keys in this way to make interaction |
2123 | easier. | 2123 | easier. |
2124 | 2124 | ||
2125 | \sa ungrabKeyboard() | 2125 | \sa ungrabKeyboard() |
2126 | */ | 2126 | */ |
2127 | void QPEApplication::grabKeyboard() | 2127 | void QPEApplication::grabKeyboard() |
2128 | { | 2128 | { |
2129 | ((QPEApplication *) qApp )-> d-> kbgrabbed = true; | 2129 | ((QPEApplication *) qApp )-> d-> kbgrabbed = true; |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | /*! | 2132 | /*! |
2133 | \reimp | 2133 | \reimp |
2134 | */ | 2134 | */ |
2135 | int QPEApplication::exec() | 2135 | int QPEApplication::exec() |
2136 | { | 2136 | { |
2137 | d->qcopQok = true; | 2137 | d->qcopQok = true; |
2138 | #ifndef QT_NO_COP | 2138 | #ifndef QT_NO_COP |
2139 | d->sendQCopQ(); | 2139 | d->sendQCopQ(); |
2140 | if ( !d->keep_running ) | 2140 | if ( !d->keep_running ) |
2141 | processEvents(); // we may have received QCop messages in the meantime. | 2141 | processEvents(); // we may have received QCop messages in the meantime. |
2142 | #endif | 2142 | #endif |
2143 | 2143 | ||
2144 | if ( d->keep_running ) | 2144 | if ( d->keep_running ) |
2145 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) | 2145 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) |
2146 | return QApplication::exec(); | 2146 | return QApplication::exec(); |
2147 | 2147 | ||
2148 | #ifndef QT_NO_COP | 2148 | #ifndef QT_NO_COP |
2149 | 2149 | ||
2150 | { | 2150 | { |
2151 | QCopEnvelope e( "QPE/System", "closing(QString)" ); | 2151 | QCopEnvelope e( "QPE/System", "closing(QString)" ); |
2152 | e << d->appName; | 2152 | e << d->appName; |
2153 | } | 2153 | } |
2154 | #endif | 2154 | #endif |
2155 | processEvents(); | 2155 | processEvents(); |
2156 | return 0; | 2156 | return 0; |
2157 | } | 2157 | } |
2158 | 2158 | ||
2159 | /*! | 2159 | /*! |
2160 | \internal | 2160 | \internal |
2161 | External request for application to quit. Quits if possible without | 2161 | External request for application to quit. Quits if possible without |
2162 | loosing state. | 2162 | loosing state. |
2163 | */ | 2163 | */ |
2164 | void QPEApplication::tryQuit() | 2164 | void QPEApplication::tryQuit() |
2165 | { | 2165 | { |
2166 | if ( activeModalWidget() ) | 2166 | if ( activeModalWidget() ) |
2167 | return ; // Inside modal loop or konsole. Too hard to save state. | 2167 | return ; // Inside modal loop or konsole. Too hard to save state. |
2168 | #ifndef QT_NO_COP | 2168 | #ifndef QT_NO_COP |
2169 | 2169 | ||
2170 | { | 2170 | { |
2171 | QCopEnvelope e( "QPE/System", "closing(QString)" ); | 2171 | QCopEnvelope e( "QPE/System", "closing(QString)" ); |
2172 | e << d->appName; | 2172 | e << d->appName; |
2173 | } | 2173 | } |
2174 | #endif | 2174 | #endif |
2175 | if ( d->keep_running ) | 2175 | if ( d->keep_running ) |
2176 | d->store_widget_rect(d->qpe_main_widget, d->appName); | 2176 | d->store_widget_rect(d->qpe_main_widget, d->appName); |
2177 | processEvents(); | 2177 | processEvents(); |
2178 | 2178 | ||
2179 | quit(); | 2179 | quit(); |
2180 | } | 2180 | } |
2181 | 2181 | ||
2182 | 2182 | ||
2183 | /*! | 2183 | /*! |
2184 | \internal | 2184 | \internal |
2185 | User initiated quit. Makes the window 'Go Away'. If preloaded this means | 2185 | User initiated quit. Makes the window 'Go Away'. If preloaded this means |
2186 | hiding the window. If not it means quitting the application. | 2186 | hiding the window. If not it means quitting the application. |
2187 | As this is user initiated we don't need to check state. | 2187 | As this is user initiated we don't need to check state. |
2188 | */ | 2188 | */ |
2189 | void QPEApplication::hideOrQuit() | 2189 | void QPEApplication::hideOrQuit() |
2190 | { | 2190 | { |
2191 | if ( d->keep_running ) | 2191 | if ( d->keep_running ) |
2192 | d->store_widget_rect(d->qpe_main_widget, d->appName); | 2192 | d->store_widget_rect(d->qpe_main_widget, d->appName); |
2193 | processEvents(); | 2193 | processEvents(); |
2194 | 2194 | ||
2195 | // If we are a preloaded application we don't actually quit, so emit | 2195 | // If we are a preloaded application we don't actually quit, so emit |
2196 | // a System message indicating we're quasi-closing. | 2196 | // a System message indicating we're quasi-closing. |
2197 | if ( d->preloaded && d->qpe_main_widget ) | 2197 | if ( d->preloaded && d->qpe_main_widget ) |
2198 | #ifndef QT_NO_COP | 2198 | #ifndef QT_NO_COP |
2199 | 2199 | ||
2200 | { | 2200 | { |
2201 | QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); | 2201 | QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); |
2202 | e << d->appName; | 2202 | e << d->appName; |
2203 | d->qpe_main_widget->hide(); | 2203 | d->qpe_main_widget->hide(); |
2204 | } | 2204 | } |
2205 | #endif | 2205 | #endif |
2206 | else | 2206 | else |
2207 | quit(); | 2207 | quit(); |
2208 | } | 2208 | } |
2209 | 2209 | ||
2210 | #if (__GNUC__ > 2 ) | 2210 | #if (__GNUC__ > 2 ) && !defined(_OS_MACX_) |
2211 | extern "C" void __cxa_pure_virtual(); | 2211 | extern "C" void __cxa_pure_virtual(); |
2212 | 2212 | ||
2213 | void __cxa_pure_virtual() | 2213 | void __cxa_pure_virtual() |
2214 | { | 2214 | { |
2215 | fprintf( stderr, "Pure virtual called\n"); | 2215 | fprintf( stderr, "Pure virtual called\n"); |
2216 | abort(); | 2216 | abort(); |
2217 | 2217 | ||
2218 | } | 2218 | } |
2219 | 2219 | ||
2220 | #endif | 2220 | #endif |
2221 | 2221 | ||
2222 | 2222 | ||
2223 | #if defined(OPIE_NEW_MALLOC) | 2223 | #if defined(OPIE_NEW_MALLOC) |
2224 | 2224 | ||
2225 | // The libraries with the skiff package (and possibly others) have | 2225 | // The libraries with the skiff package (and possibly others) have |
2226 | // completely useless implementations of builtin new and delete that | 2226 | // completely useless implementations of builtin new and delete that |
2227 | // use about 50% of your CPU. Here we revert to the simple libc | 2227 | // use about 50% of your CPU. Here we revert to the simple libc |
2228 | // functions. | 2228 | // functions. |
2229 | 2229 | ||
2230 | void* operator new[]( size_t size ) | 2230 | void* operator new[]( size_t size ) |
2231 | { | 2231 | { |
2232 | return malloc( size ); | 2232 | return malloc( size ); |
2233 | } | 2233 | } |
2234 | 2234 | ||
2235 | void* operator new( size_t size ) | 2235 | void* operator new( size_t size ) |
2236 | { | 2236 | { |
2237 | return malloc( size ); | 2237 | return malloc( size ); |
2238 | } | 2238 | } |
2239 | 2239 | ||
2240 | void operator delete[]( void* p ) | 2240 | void operator delete[]( void* p ) |
2241 | { | 2241 | { |
2242 | if ( p ) | 2242 | if ( p ) |
2243 | free( p ); | 2243 | free( p ); |
2244 | } | 2244 | } |
2245 | 2245 | ||
2246 | void operator delete[]( void* p, size_t /*size*/ ) | 2246 | void operator delete[]( void* p, size_t /*size*/ ) |
2247 | { | 2247 | { |
2248 | if ( p ) | 2248 | if ( p ) |
2249 | free( p ); | 2249 | free( p ); |
2250 | } | 2250 | } |
2251 | 2251 | ||
2252 | 2252 | ||
2253 | void operator delete( void* p ) | 2253 | void operator delete( void* p ) |
2254 | { | 2254 | { |
2255 | if ( p ) | 2255 | if ( p ) |
2256 | free( p ); | 2256 | free( p ); |
2257 | } | 2257 | } |
2258 | 2258 | ||
2259 | void operator delete( void* p, size_t /*size*/ ) | 2259 | void operator delete( void* p, size_t /*size*/ ) |
2260 | { | 2260 | { |
2261 | if ( p ) | 2261 | if ( p ) |
2262 | free( p ); | 2262 | free( p ); |
2263 | } | 2263 | } |
2264 | 2264 | ||
2265 | #endif | 2265 | #endif |
2266 | 2266 | ||
2267 | #if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) | 2267 | #if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) |
2268 | #include <qwidgetlist.h> | 2268 | #include <qwidgetlist.h> |
2269 | #ifdef QWS | 2269 | #ifdef QWS |
2270 | #include <qgfx_qws.h> | 2270 | #include <qgfx_qws.h> |
2271 | extern QRect qt_maxWindowRect; | 2271 | extern QRect qt_maxWindowRect; |
2272 | void qt_setMaxWindowRect(const QRect& r ) | 2272 | void qt_setMaxWindowRect(const QRect& r ) |
2273 | { | 2273 | { |
2274 | qt_maxWindowRect = qt_screen->mapFromDevice( r, | 2274 | qt_maxWindowRect = qt_screen->mapFromDevice( r, |
2275 | qt_screen->mapToDevice( QSize( qt_screen->width(), qt_screen->height() ) ) ); | 2275 | qt_screen->mapToDevice( QSize( qt_screen->width(), qt_screen->height() ) ) ); |
2276 | // Re-resize any maximized windows | 2276 | // Re-resize any maximized windows |
2277 | QWidgetList* l = QApplication::topLevelWidgets(); | 2277 | QWidgetList* l = QApplication::topLevelWidgets(); |
2278 | if ( l ) { | 2278 | if ( l ) { |
2279 | QWidget * w = l->first(); | 2279 | QWidget * w = l->first(); |
2280 | while ( w ) { | 2280 | while ( w ) { |
2281 | if ( w->isVisible() && w->isMaximized() ) { | 2281 | if ( w->isVisible() && w->isMaximized() ) { |
2282 | w->showMaximized(); | 2282 | w->showMaximized(); |
2283 | } | 2283 | } |
2284 | w = l->next(); | 2284 | w = l->next(); |
2285 | } | 2285 | } |
2286 | delete l; | 2286 | delete l; |
2287 | } | 2287 | } |
2288 | } | 2288 | } |
2289 | #endif | 2289 | #endif |
2290 | #endif | 2290 | #endif |