summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make3
-rw-r--r--config.in4
-rw-r--r--library/library.pro6
-rw-r--r--library/qpeapplication.cpp10
-rw-r--r--library/qt_override.cpp40
5 files changed, 44 insertions, 19 deletions
diff --git a/Rules.make b/Rules.make
index 4833b11..a1e6f09 100644
--- a/Rules.make
+++ b/Rules.make
@@ -1,203 +1,206 @@
1.phony: force 1.phony: force
2force: 2force:
3 3
4$(configs) : 4$(configs) :
5 $(call makecfg,$@) 5 $(call makecfg,$@)
6 6
7$(TOPDIR)/gen.pro : $(TOPDIR)/.config 7$(TOPDIR)/gen.pro : $(TOPDIR)/.config
8 echo > $@ 8 echo > $@
9ifneq ($(CONFIG_DEBUG),) 9ifneq ($(CONFIG_DEBUG),)
10 echo CONFIG += debug >> $@ 10 echo CONFIG += debug >> $@
11 echo CONFIG -= release >> $@ 11 echo CONFIG -= release >> $@
12else 12else
13 echo CONFIG -= debug >> $@ 13 echo CONFIG -= debug >> $@
14 echo CONFIG += release >> $@ 14 echo CONFIG += release >> $@
15endif 15endif
16ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 16ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3
17 echo CONFIG -= qt3 >> $@ 17 echo CONFIG -= qt3 >> $@
18else 18else
19 echo CONFIG += qt3 >> $@ 19 echo CONFIG += qt3 >> $@
20endif 20endif
21ifeq ($(CONFIG_QUICK_LAUNCH),) 21ifeq ($(CONFIG_QUICK_LAUNCH),)
22 echo contains\( CONFIG, quick-app \) \{ >> $@ 22 echo contains\( CONFIG, quick-app \) \{ >> $@
23 echo CONFIG -= quick-app >> $@ 23 echo CONFIG -= quick-app >> $@
24 echo CONFIG += quick-app-lib >> $@ 24 echo CONFIG += quick-app-lib >> $@
25 echo \} >> $@ 25 echo \} >> $@
26else 26else
27 echo contains\( CONFIG, quick-app \) \{ >> $@ 27 echo contains\( CONFIG, quick-app \) \{ >> $@
28 echo CONFIG -= quick-app >> $@ 28 echo CONFIG -= quick-app >> $@
29 echo CONFIG += quick-app-bin >> $@ 29 echo CONFIG += quick-app-bin >> $@
30 echo \} >> $@ 30 echo \} >> $@
31 endif 31 endif
32ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y)
33 echo CONFIG += no-override >> $@
34endif
32 35
33$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages 36$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages
34 @echo Generating dependency information... 37 @echo Generating dependency information...
35# add to subdir-y, and add descend rules 38# add to subdir-y, and add descend rules
36 @cat $(TOPDIR)/packages | grep -v '^#' | \ 39 @cat $(TOPDIR)/packages | grep -v '^#' | \
37 awk '{print \ 40 awk '{print \
38 ".PHONY : " $$2 "\n" \ 41 ".PHONY : " $$2 "\n" \
39 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ 42 "subdir-$$(" $$1 ") += " $$2 "\n\n"; \
40 print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends 43 print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends
41 cat $(TOPDIR)/packages | grep -v '^#' | \ 44 cat $(TOPDIR)/packages | grep -v '^#' | \
42 perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ 45 perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \
43 >> $(TOPDIR)/.depends 46 >> $(TOPDIR)/.depends
44# interpackage dependency generation 47# interpackage dependency generation
45 @cat $(TOPDIR)/packages | \ 48 @cat $(TOPDIR)/packages | \
46 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends 49 $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends
47 50
48$(TOPDIR)/.depends.cfgs: 51$(TOPDIR)/.depends.cfgs:
49# config.in interdependencies 52# config.in interdependencies
50 @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs 53 @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs
51 @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ 54 @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@
52 @-rm -f dirs 55 @-rm -f dirs
53 56
54$(QTDIR)/stamp-headers : 57$(QTDIR)/stamp-headers :
55 @-rm -f $(QTDIR)/stamp-headers* 58 @-rm -f $(QTDIR)/stamp-headers*
56 ( cd $(QTDIR)/include; \ 59 ( cd $(QTDIR)/include; \
57 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ 60 $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \
58 qcopchannel_qws.h qwindowsystem_qws.h \ 61 qcopchannel_qws.h qwindowsystem_qws.h \
59 qfontmanager_qws.h qwsdefaultdecoration_qws.h)) 62 qfontmanager_qws.h qwsdefaultdecoration_qws.h))
60 touch $@ 63 touch $@
61 64
62$(QTDIR)/stamp-headers-x11 : 65$(QTDIR)/stamp-headers-x11 :
63 @-rm -f $(QTDIR)/stamp-headers* 66 @-rm -f $(QTDIR)/stamp-headers*
64 cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) 67 cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h)
65 touch $@ 68 touch $@
66 69
67$(OPIEDIR)/stamp-headers : 70$(OPIEDIR)/stamp-headers :
68 @-rm -f $(OPIEDIR)/stamp-headers* 71 @-rm -f $(OPIEDIR)/stamp-headers*
69 mkdir -p $(TOPDIR)/include/qpe \ 72 mkdir -p $(TOPDIR)/include/qpe \
70 $(TOPDIR)/include/qtopia \ 73 $(TOPDIR)/include/qtopia \
71 $(TOPDIR)/include/opie \ 74 $(TOPDIR)/include/opie \
72 $(TOPDIR)/include/opie2 \ 75 $(TOPDIR)/include/opie2 \
73 $(TOPDIR)/include/qtopia/private 76 $(TOPDIR)/include/qtopia/private
74 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 77 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
75 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 78 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
76 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 79 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
77 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 80 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
78 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 81 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
79 ( cd include/opie && ln -sf ../../libopie/big-screen/*.h .; ) 82 ( cd include/opie && ln -sf ../../libopie/big-screen/*.h .; )
80 ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) 83 ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; )
81 ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) 84 ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; )
82 ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) 85 ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; )
83 ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) 86 ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; )
84 #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) 87 #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; )
85 ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) 88 ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; )
86 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 89 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
87 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 90 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
88 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 91 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
89 touch $@ 92 touch $@
90 93
91$(OPIEDIR)/stamp-headers-x11 : 94$(OPIEDIR)/stamp-headers-x11 :
92 @-rm -f $(OPIEDIR)/stamp-headers* 95 @-rm -f $(OPIEDIR)/stamp-headers*
93 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ 96 mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \
94 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private 97 $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private
95 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) 98 ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; )
96 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) 99 ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; )
97 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) 100 ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; )
98 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) 101 ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; )
99 ( cd include/opie && ln -sf ../../libsql/*.h .; ) 102 ( cd include/opie && ln -sf ../../libsql/*.h .; )
100 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) 103 ( cd include/opie && ln -sf ../../libopie/pim/*.h .; )
101 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ 104 ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \
102 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) 105 ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done )
103 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h 106 ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h
104 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) 107 ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; )
105 touch $@ 108 touch $@
106 109
107$(TOPDIR)/library/custom.h : $(TOPDIR)/.config 110$(TOPDIR)/library/custom.h : $(TOPDIR)/.config
108 @-rm -f $@ 111 @-rm -f $@
109 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ 112 @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\
110 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) 113 ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@)
111 @touch $@ 114 @touch $@
112 115
113$(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: 116$(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake:
114 @$(call descend,$(shell dirname $@),$(shell basename $@)) 117 @$(call descend,$(shell dirname $@),$(shell basename $@))
115 118
116menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in 119menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in
117 $(TOPDIR)/scripts/kconfig/mconf ./config.in 120 $(TOPDIR)/scripts/kconfig/mconf ./config.in
118 @touch ./.config.stamp 121 @touch ./.config.stamp
119 122
120xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in 123xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in
121 $(TOPDIR)/scripts/kconfig/qconf ./config.in 124 $(TOPDIR)/scripts/kconfig/qconf ./config.in
122 @touch .config.stamp 125 @touch .config.stamp
123 126
124gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in 127gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in
125 $(TOPDIR)/scripts/kconfig/gconf ./config.in 128 $(TOPDIR)/scripts/kconfig/gconf ./config.in
126 @touch .config.stamp 129 @touch .config.stamp
127 130
128config: $(TOPDIR)/scripts/kconfig/conf ./config.in 131config: $(TOPDIR)/scripts/kconfig/conf ./config.in
129 $(TOPDIR)/scripts/kconfig/conf ./config.in 132 $(TOPDIR)/scripts/kconfig/conf ./config.in
130 @touch .config.stamp 133 @touch .config.stamp
131 134
132oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in 135oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in
133 $(TOPDIR)/scripts/kconfig/conf -o ./config.in 136 $(TOPDIR)/scripts/kconfig/conf -o ./config.in
134 @touch .config.stamp 137 @touch .config.stamp
135 138
136randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in 139randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in
137 $(TOPDIR)/scripts/kconfig/conf -r ./config.in 140 $(TOPDIR)/scripts/kconfig/conf -r ./config.in
138 @touch .config.stamp 141 @touch .config.stamp
139 142
140allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in 143allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in
141 $(TOPDIR)/scripts/kconfig/conf -y ./config.in 144 $(TOPDIR)/scripts/kconfig/conf -y ./config.in
142 @touch .config.stamp 145 @touch .config.stamp
143 146
144allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in 147allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in
145 $(TOPDIR)/scripts/kconfig/conf -n ./config.in 148 $(TOPDIR)/scripts/kconfig/conf -n ./config.in
146 @touch .config.stamp 149 @touch .config.stamp
147 150
148defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in 151defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in
149 $(TOPDIR)/scripts/kconfig/conf -d ./config.in 152 $(TOPDIR)/scripts/kconfig/conf -d ./config.in
150 @touch .config.stamp 153 @touch .config.stamp
151 154
152$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default 155$(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default
153 156
154$(TOPDIR)/mkspecs/default : 157$(TOPDIR)/mkspecs/default :
155 ln -sf linux-g++ $@ 158 ln -sf linux-g++ $@
156 159
157$(TOPDIR)/scripts/subst : force 160$(TOPDIR)/scripts/subst : force
158 @( \ 161 @( \
159 echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ 162 echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \
160 echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ 163 echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \
161 echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ 164 echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \
162 echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ 165 echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \
163 echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ 166 echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \
164 echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \ 167 echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \
165 echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \ 168 echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \
166 ) > $@ || ( rm -f $@; exit 1 ) 169 ) > $@ || ( rm -f $@; exit 1 )
167 170
168$(TOPDIR)/scripts/filesubst : force 171$(TOPDIR)/scripts/filesubst : force
169 @( \ 172 @( \
170 echo 's,\$$OPIEDIR/root/,/,g'; \ 173 echo 's,\$$OPIEDIR/root/,/,g'; \
171 echo 's,$(OPIEDIR)/root/,/,g'; \ 174 echo 's,$(OPIEDIR)/root/,/,g'; \
172 echo 's,\$$OPIEDIR,$(prefix),g'; \ 175 echo 's,\$$OPIEDIR,$(prefix),g'; \
173 echo 's,$(OPIEDIR),$(prefix),g'; \ 176 echo 's,$(OPIEDIR),$(prefix),g'; \
174 echo 's,\$$QTDIR,$(prefix),g'; \ 177 echo 's,\$$QTDIR,$(prefix),g'; \
175 echo 's,$(QTDIR),$(prefix),g'; \ 178 echo 's,$(QTDIR),$(prefix),g'; \
176 echo 's,^\(\./\)*root/,/,g'; \ 179 echo 's,^\(\./\)*root/,/,g'; \
177 echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \ 180 echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \
178 echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \ 181 echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \
179 echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \ 182 echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \
180 echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \ 183 echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \
181 echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \ 184 echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \
182 echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ 185 echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \
183 echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \ 186 echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \
184 echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \ 187 echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \
185 echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \ 188 echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \
186 echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ 189 echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \
187 echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \ 190 echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \
188 ) > $@ || ( rm -f $@; exit 1 ) 191 ) > $@ || ( rm -f $@; exit 1 )
189 192
190## general rules ## 193## general rules ##
191 194
192define descend 195define descend
193 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) 196 $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2)
194endef 197endef
195 198
196define makefilegen 199define makefilegen
197 cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ 200 cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \
198 head -1 | awk '{print $$3}'` 201 head -1 | awk '{print $$3}'`
199endef 202endef
200 203
201define makecfg 204define makecfg
202 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) 205 $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR)
203endef 206endef
diff --git a/config.in b/config.in
index dac9024..ddbc93b 100644
--- a/config.in
+++ b/config.in
@@ -1,180 +1,184 @@
1mainmenu "Opie Configuration" 1mainmenu "Opie Configuration"
2 2
3menu "Build Parameters" 3menu "Build Parameters"
4 4
5choice 5choice
6 prompt "Target Machine" 6 prompt "Target Machine"
7 default TARGET_X86 7 default TARGET_X86
8 help 8 help
9 Please select the architecture of the machine you will be 9 Please select the architecture of the machine you will be
10 building the OpenZaurus buildroot for. 10 building the OpenZaurus buildroot for.
11 11
12 config TARGET_X86 12 config TARGET_X86
13 boolean "Intel X86" 13 boolean "Intel X86"
14 14
15 config TARGET_SHARP 15 config TARGET_SHARP
16 boolean "Sharp Zaurus" 16 boolean "Sharp Zaurus"
17 17
18 config TARGET_IPAQ 18 config TARGET_IPAQ
19 boolean "iPAQ" 19 boolean "iPAQ"
20 20
21 config TARGET_RAMSES 21 config TARGET_RAMSES
22 boolean "Ramses" 22 boolean "Ramses"
23 23
24 config TARGET_SIMPAD 24 config TARGET_SIMPAD
25 boolean "SIMpad" 25 boolean "SIMpad"
26 26
27endchoice 27endchoice
28 28
29config OPTIMIZE 29config OPTIMIZE
30 boolean "Use optimizations" 30 boolean "Use optimizations"
31 default "y" if ! TARGET_X86 31 default "y" if ! TARGET_X86
32 32
33config DEBUG 33config DEBUG
34 boolean "Enable debug builds" 34 boolean "Enable debug builds"
35 default n 35 default n
36config RELEASE 36config RELEASE
37 bool 37 bool
38 default y 38 default y
39 depends !DEBUG 39 depends !DEBUG
40 40
41config QUICK_LAUNCH 41config QUICK_LAUNCH
42 boolean "Enable Quick Launch" 42 boolean "Enable Quick Launch"
43 default n 43 default n
44
45config OPIE_NO_OVERRIDE_QT
46 boolean "Build Opie against an unpatched version of Qt"
47 default n
44 48
45config SPECFILE 49config SPECFILE
46 string 50 string
47 default "qws/linux-generic-g++" if TARGET_X86 && (! X11) 51 default "qws/linux-generic-g++" if TARGET_X86 && (! X11)
48 default "linux-g++" if TARGET_X86 && X11 52 default "linux-g++" if TARGET_X86 && X11
49 default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) 53 default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11)
50 default "linux-g++" if TARGET_SHARP && X11 54 default "linux-g++" if TARGET_SHARP && X11
51 default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) 55 default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11)
52 default "linux-g++" if TARGET_IPAQ && X11 56 default "linux-g++" if TARGET_IPAQ && X11
53 default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) 57 default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11)
54 default "linux-g++" if TARGET_RAMSES && X11 58 default "linux-g++" if TARGET_RAMSES && X11
55 default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11) 59 default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11)
56 default "linux-g++" if TARGET_SIMPAD && X11 60 default "linux-g++" if TARGET_SIMPAD && X11
57 61
58config CUSTOMFILE 62config CUSTOMFILE
59 string 63 string
60 default "custom-ipaq.h" if TARGET_IPAQ 64 default "custom-ipaq.h" if TARGET_IPAQ
61 default "custom-sharp.h" if TARGET_SHARP 65 default "custom-sharp.h" if TARGET_SHARP
62 default "custom-ramses.h" if TARGET_RAMSES 66 default "custom-ramses.h" if TARGET_RAMSES
63 default "custom-ipaq.h" if TARGET_SIMPAD 67 default "custom-ipaq.h" if TARGET_SIMPAD
64 68
65config OPTIMIZATIONS 69config OPTIMIZATIONS
66 string "Optimization flags" 70 string "Optimization flags"
67 depends OPTIMIZE 71 depends OPTIMIZE
68 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ 72 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ
69 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP 73 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP
70 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES 74 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES
71 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD 75 default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD
72 76
73config EXPERIMENTAL 77config EXPERIMENTAL
74 bool "Prompt for development and/or incomplete items" 78 bool "Prompt for development and/or incomplete items"
75 default y 79 default y
76 80
77endmenu 81endmenu
78 82
79menu "Base" 83menu "Base"
80 choice 84 choice
81 prompt "Qpe Library Selection" 85 prompt "Qpe Library Selection"
82 default LIBQPE 86 default LIBQPE
83 source library/config.in 87 source library/config.in
84 source x11/config.in 88 source x11/config.in
85 endchoice 89 endchoice
86 source libopie/config.in 90 source libopie/config.in
87 source core/opie-login/config.in 91 source core/opie-login/config.in
88 source core/opiealarm/config.in 92 source core/opiealarm/config.in
89 source core/launcher/config.in 93 source core/launcher/config.in
90 source core/qws/config.in 94 source core/qws/config.in
91endmenu 95endmenu
92 96
93comment "" 97comment ""
94 98
95menu "Applets" 99menu "Applets"
96 source core/applets/config.in 100 source core/applets/config.in
97 source noncore/applets/config.in 101 source noncore/applets/config.in
98endmenu 102endmenu
99 103
100menu "Apps" 104menu "Apps"
101 source core/apps/config.in 105 source core/apps/config.in
102 source noncore/apps/config.in 106 source noncore/apps/config.in
103endmenu 107endmenu
104 108
105menu "Communications and Networking" 109menu "Communications and Networking"
106 source noncore/comm/config.in 110 source noncore/comm/config.in
107 source noncore/mail/config.in 111 source noncore/mail/config.in
108 source noncore/net/config.in 112 source noncore/net/config.in
109endmenu 113endmenu
110 114
111menu "Games" 115menu "Games"
112 source noncore/games/config.in 116 source noncore/games/config.in
113endmenu 117endmenu
114 118
115menu "Graphics and Multimedia" 119menu "Graphics and Multimedia"
116 source freetype/config.in 120 source freetype/config.in
117 source noncore/graphics/config.in 121 source noncore/graphics/config.in
118 source core/multimedia/config.in 122 source core/multimedia/config.in
119 source noncore/multimedia/config.in 123 source noncore/multimedia/config.in
120endmenu 124endmenu
121 125
122menu "Input methods" 126menu "Input methods"
123 source inputmethods/config.in 127 source inputmethods/config.in
124endmenu 128endmenu
125 129
126menu "Pim" 130menu "Pim"
127 source core/pim/config.in 131 source core/pim/config.in
128 menu "Today Plugins" 132 menu "Today Plugins"
129 source noncore/todayplugins/config.in 133 source noncore/todayplugins/config.in
130 source core/pim/today/plugins/config.in 134 source core/pim/today/plugins/config.in
131 endmenu 135 endmenu
132endmenu 136endmenu
133 137
134menu "Settings" 138menu "Settings"
135 source core/settings/config.in 139 source core/settings/config.in
136 source noncore/settings/config.in 140 source noncore/settings/config.in
137endmenu 141endmenu
138 142
139menu "Theming" 143menu "Theming"
140 source noncore/decorations/config.in 144 source noncore/decorations/config.in
141 source noncore/styles/config.in 145 source noncore/styles/config.in
142endmenu 146endmenu
143 147
144menu "Tools" 148menu "Tools"
145 source noncore/tools/config.in 149 source noncore/tools/config.in
146endmenu 150endmenu
147 151
148menu "Development" 152menu "Development"
149 source development/keyview/config.in 153 source development/keyview/config.in
150 #source development/debugviewer/config.in 154 #source development/debugviewer/config.in
151endmenu 155endmenu
152 156
153menu "Examples" 157menu "Examples"
154 config EXAMPLES 158 config EXAMPLES
155 boolean "Compile Example Application" 159 boolean "Compile Example Application"
156 source examples/config.in 160 source examples/config.in
157endmenu 161endmenu
158 162
159comment "" 163comment ""
160 depends on EXPERIMENTAL 164 depends on EXPERIMENTAL
161menu "Experimental" 165menu "Experimental"
162 depends on EXPERIMENTAL 166 depends on EXPERIMENTAL
163 source libopie2/config.in 167 source libopie2/config.in
164 168
165 config SQL_PIM_BACKEND 169 config SQL_PIM_BACKEND
166 bool "Add SQL-Backend support (experimental)" 170 bool "Add SQL-Backend support (experimental)"
167 default n 171 default n
168 help 172 help
169 This adds the SQL-Support, using SQLite. Which database is used 173 This adds the SQL-Support, using SQLite. Which database is used
170 by the backends is defined by the file "pimaccess.conf" in the 174 by the backends is defined by the file "pimaccess.conf" in the
171 directory "Settings". 175 directory "Settings".
172 There currently do exist to groups "[contact]" and "[todo]". You can 176 There currently do exist to groups "[contact]" and "[todo]". You can
173 select the used backend by the variable "usebackend=<type>", where 177 select the used backend by the variable "usebackend=<type>", where
174 <type> is "sql" or "xml". "xml" is the default ! 178 <type> is "sql" or "xml". "xml" is the default !
175 Important: The SQLite-library "libsqlite.so" must be installed ! 179 Important: The SQLite-library "libsqlite.so" must be installed !
176 depends ( LIBOPIE2DB ) 180 depends ( LIBOPIE2DB )
177 181
178 comment "SQL-Support needs libopie2db!" 182 comment "SQL-Support needs libopie2db!"
179 depends !( LIBOPIE2DB ) 183 depends !( LIBOPIE2DB )
180endmenu 184endmenu
diff --git a/library/library.pro b/library/library.pro
index 80a0f62..ab1f451 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -1,151 +1,157 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 #CONFIG += qt warn_on release 2 #CONFIG += qt warn_on release
3 CONFIG += qt warn_on debug 3 CONFIG += qt warn_on debug
4 HEADERS= calendar.h \ 4 HEADERS= calendar.h \
5 global.h \ 5 global.h \
6 resource.h \ 6 resource.h \
7 xmlreader.h \ 7 xmlreader.h \
8 mimetype.h \ 8 mimetype.h \
9 menubutton.h \ 9 menubutton.h \
10 network.h \ 10 network.h \
11 networkinterface.h \ 11 networkinterface.h \
12 filemanager.h \ 12 filemanager.h \
13 fontmanager.h \ 13 fontmanager.h \
14 qdawg.h \ 14 qdawg.h \
15 datebookmonth.h \ 15 datebookmonth.h \
16 fileselector.h \ 16 fileselector.h \
17 fileselector_p.h \ 17 fileselector_p.h \
18 imageedit.h \ 18 imageedit.h \
19 qcopenvelope_qws.h \ 19 qcopenvelope_qws.h \
20 qpedecoration_qws.h \ 20 qpedecoration_qws.h \
21 qpeapplication.h \ 21 qpeapplication.h \
22 qpestyle.h \ 22 qpestyle.h \
23 qpedialog.h \ 23 qpedialog.h \
24 lightstyle.h \ 24 lightstyle.h \
25 config.h \ 25 config.h \
26 applnk.h \ 26 applnk.h \
27 sound.h \ 27 sound.h \
28 tzselect.h \ 28 tzselect.h \
29 qmath.h \ 29 qmath.h \
30 datebookdb.h \ 30 datebookdb.h \
31 alarmserver.h \ 31 alarmserver.h \
32 process.h \ 32 process.h \
33 password.h \ 33 password.h \
34 timestring.h \ 34 timestring.h \
35 fontfactoryinterface.h \ 35 fontfactoryinterface.h \
36 fontdatabase.h \ 36 fontdatabase.h \
37 power.h \ 37 power.h \
38 storage.h \ 38 storage.h \
39 qpemessagebox.h \ 39 qpemessagebox.h \
40 timeconversion.h \ 40 timeconversion.h \
41 qpedebug.h \ 41 qpedebug.h \
42 qpemenubar.h \ 42 qpemenubar.h \
43 qpetoolbar.h \ 43 qpetoolbar.h \
44 backend/categories.h \ 44 backend/categories.h \
45 stringutil.h \ 45 stringutil.h \
46 backend/palmtoprecord.h \ 46 backend/palmtoprecord.h \
47 backend/task.h \ 47 backend/task.h \
48 backend/event.h \ 48 backend/event.h \
49 backend/contact.h\ 49 backend/contact.h\
50 categorymenu.h \ 50 categorymenu.h \
51 categoryedit_p.h \ 51 categoryedit_p.h \
52 categoryselect.h \ 52 categoryselect.h \
53 categorywidget.h \ 53 categorywidget.h \
54 ir.h \ 54 ir.h \
55 backend/vobject_p.h \ 55 backend/vobject_p.h \
56 findwidget_p.h \ 56 findwidget_p.h \
57 finddialog.h \ 57 finddialog.h \
58 lnkproperties.h \ 58 lnkproperties.h \
59 windowdecorationinterface.h \ 59 windowdecorationinterface.h \
60 textcodecinterface.h \ 60 textcodecinterface.h \
61 imagecodecinterface.h \ 61 imagecodecinterface.h \
62 qt_override_p.h 62 qt_override_p.h
63 63
64 SOURCES= calendar.cpp \ 64 SOURCES= calendar.cpp \
65 global.cpp \ 65 global.cpp \
66 xmlreader.cpp \ 66 xmlreader.cpp \
67 mimetype.cpp \ 67 mimetype.cpp \
68 menubutton.cpp \ 68 menubutton.cpp \
69 network.cpp \ 69 network.cpp \
70 networkinterface.cpp \ 70 networkinterface.cpp \
71 filemanager.cpp \ 71 filemanager.cpp \
72 fontmanager.cpp \ 72 fontmanager.cpp \
73 qdawg.cpp \ 73 qdawg.cpp \
74 datebookmonth.cpp \ 74 datebookmonth.cpp \
75 fileselector.cpp \ 75 fileselector.cpp \
76 imageedit.cpp \ 76 imageedit.cpp \
77 resource.cpp \ 77 resource.cpp \
78 qpedecoration_qws.cpp \ 78 qpedecoration_qws.cpp \
79 qcopenvelope_qws.cpp \ 79 qcopenvelope_qws.cpp \
80 qpeapplication.cpp \ 80 qpeapplication.cpp \
81 qpestyle.cpp \ 81 qpestyle.cpp \
82 qpedialog.cpp \ 82 qpedialog.cpp \
83 lightstyle.cpp \ 83 lightstyle.cpp \
84 config.cpp \ 84 config.cpp \
85 applnk.cpp \ 85 applnk.cpp \
86 sound.cpp \ 86 sound.cpp \
87 tzselect.cpp \ 87 tzselect.cpp \
88 qmath.c \ 88 qmath.c \
89 datebookdb.cpp \ 89 datebookdb.cpp \
90 alarmserver.cpp \ 90 alarmserver.cpp \
91 password.cpp \ 91 password.cpp \
92 process.cpp \ 92 process.cpp \
93 process_unix.cpp \ 93 process_unix.cpp \
94 timestring.cpp \ 94 timestring.cpp \
95 fontdatabase.cpp \ 95 fontdatabase.cpp \
96 power.cpp \ 96 power.cpp \
97 storage.cpp \ 97 storage.cpp \
98 qpemessagebox.cpp \ 98 qpemessagebox.cpp \
99 backend/timeconversion.cpp \ 99 backend/timeconversion.cpp \
100 qpedebug.cpp \ 100 qpedebug.cpp \
101 qpemenubar.cpp \ 101 qpemenubar.cpp \
102 qpetoolbar.cpp \ 102 qpetoolbar.cpp \
103 backend/categories.cpp \ 103 backend/categories.cpp \
104 backend/stringutil.cpp \ 104 backend/stringutil.cpp \
105 backend/palmtoprecord.cpp \ 105 backend/palmtoprecord.cpp \
106 backend/task.cpp \ 106 backend/task.cpp \
107 backend/event.cpp \ 107 backend/event.cpp \
108 backend/contact.cpp \ 108 backend/contact.cpp \
109 categorymenu.cpp \ 109 categorymenu.cpp \
110 categoryedit_p.cpp \ 110 categoryedit_p.cpp \
111 categoryselect.cpp \ 111 categoryselect.cpp \
112 categorywidget.cpp \ 112 categorywidget.cpp \
113 ir.cpp \ 113 ir.cpp \
114 backend/vcc_yacc.cpp \ 114 backend/vcc_yacc.cpp \
115 backend/vobject.cpp \ 115 backend/vobject.cpp \
116 findwidget_p.cpp \ 116 findwidget_p.cpp \
117 finddialog.cpp \ 117 finddialog.cpp \
118 lnkproperties.cpp \ 118 lnkproperties.cpp \
119 qt_override.cpp 119 qt_override.cpp
120 120
121
122
121# Qt 3 compatibility 123# Qt 3 compatibility
122HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h 124HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h
123SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp 125SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp
124INCLUDEPATH += $(OPIEDIR)/include backend 126INCLUDEPATH += $(OPIEDIR)/include backend
125 LIBS += -ldl -lcrypt -lm 127 LIBS += -ldl -lcrypt -lm
126INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui 128INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui
127 TARGET = qpe 129 TARGET = qpe
128 DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 130 DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
129 VERSION = 1.5.0.1 131 VERSION = 1.5.0.1
130 132
131TRANSLATIONS = ../i18n/de/libqpe.ts \ 133TRANSLATIONS = ../i18n/de/libqpe.ts \
132 ../i18n/nl/libqpe.ts \ 134 ../i18n/nl/libqpe.ts \
133 ../i18n/xx/libqpe.ts \ 135 ../i18n/xx/libqpe.ts \
134 ../i18n/en/libqpe.ts \ 136 ../i18n/en/libqpe.ts \
135 ../i18n/es/libqpe.ts \ 137 ../i18n/es/libqpe.ts \
136 ../i18n/fr/libqpe.ts \ 138 ../i18n/fr/libqpe.ts \
137 ../i18n/hu/libqpe.ts \ 139 ../i18n/hu/libqpe.ts \
138 ../i18n/ja/libqpe.ts \ 140 ../i18n/ja/libqpe.ts \
139 ../i18n/ko/libqpe.ts \ 141 ../i18n/ko/libqpe.ts \
140 ../i18n/no/libqpe.ts \ 142 ../i18n/no/libqpe.ts \
141 ../i18n/pl/libqpe.ts \ 143 ../i18n/pl/libqpe.ts \
142 ../i18n/pt/libqpe.ts \ 144 ../i18n/pt/libqpe.ts \
143 ../i18n/pt_BR/libqpe.ts \ 145 ../i18n/pt_BR/libqpe.ts \
144 ../i18n/sl/libqpe.ts \ 146 ../i18n/sl/libqpe.ts \
145 ../i18n/zh_CN/libqpe.ts \ 147 ../i18n/zh_CN/libqpe.ts \
146 ../i18n/it/libqpe.ts \ 148 ../i18n/it/libqpe.ts \
147 ../i18n/zh_TW/libqpe.ts \ 149 ../i18n/zh_TW/libqpe.ts \
148 ../i18n/da/libqpe.ts 150 ../i18n/da/libqpe.ts
149 151
150 152
151include ( $(OPIEDIR)/include.pro ) 153include ( $(OPIEDIR)/include.pro )
154
155contains( CONFIG, no-override ){
156 DEFINES += OPIE_NO_OVERRIDE_QT
157}
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 28fb13a..feba8b6 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -935,458 +935,464 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e )
935 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... )) 935 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... ))
936 // but we cannot access libopie function within libqpe :( 936 // but we cannot access libopie function within libqpe :(
937 937
938 QWidget * active = activeWindow ( ); 938 QWidget * active = activeWindow ( );
939 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) { 939 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) {
940 if ( d-> kbgrabbed ) { // we grabbed the keyboard 940 if ( d-> kbgrabbed ) { // we grabbed the keyboard
941 QChar ch ( ke-> simpleData.unicode ); 941 QChar ch ( ke-> simpleData.unicode );
942 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, 942 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease,
943 ke-> simpleData.keycode, 943 ke-> simpleData.keycode,
944 ch. latin1 ( ), 944 ch. latin1 ( ),
945 ke-> simpleData.modifiers, 945 ke-> simpleData.modifiers,
946 QString ( ch ), 946 QString ( ch ),
947 ke-> simpleData.is_auto_repeat, 1 ); 947 ke-> simpleData.is_auto_repeat, 1 );
948 948
949 QObject *which = QWidget::keyboardGrabber ( ); 949 QObject *which = QWidget::keyboardGrabber ( );
950 if ( !which ) 950 if ( !which )
951 which = QApplication::focusWidget ( ); 951 which = QApplication::focusWidget ( );
952 if ( !which ) 952 if ( !which )
953 which = QApplication::activeWindow ( ); 953 which = QApplication::activeWindow ( );
954 if ( !which ) 954 if ( !which )
955 which = qApp; 955 which = qApp;
956 956
957 QApplication::sendEvent ( which, &qke ); 957 QApplication::sendEvent ( which, &qke );
958 } 958 }
959 else { // we didn't grab the keyboard, so send the event to the launcher 959 else { // we didn't grab the keyboard, so send the event to the launcher
960 QCopEnvelope e ( "QPE/Launcher", "deviceButton(int,int,int)" ); 960 QCopEnvelope e ( "QPE/Launcher", "deviceButton(int,int,int)" );
961 e << int( ke-> simpleData.keycode ) << int( ke-> simpleData. is_press ) << int( ke-> simpleData.is_auto_repeat ); 961 e << int( ke-> simpleData.keycode ) << int( ke-> simpleData. is_press ) << int( ke-> simpleData.is_auto_repeat );
962 } 962 }
963 } 963 }
964 return true; 964 return true;
965 } 965 }
966 } 966 }
967 if ( e->type == QWSEvent::Focus ) { 967 if ( e->type == QWSEvent::Focus ) {
968 QWSFocusEvent * fe = ( QWSFocusEvent* ) e; 968 QWSFocusEvent * fe = ( QWSFocusEvent* ) e;
969 if ( !fe->simpleData.get_focus ) { 969 if ( !fe->simpleData.get_focus ) {
970 QWidget * active = activeWindow(); 970 QWidget * active = activeWindow();
971 while ( active && active->isPopup() ) { 971 while ( active && active->isPopup() ) {
972 active->close(); 972 active->close();
973 active = activeWindow(); 973 active = activeWindow();
974 } 974 }
975 } 975 }
976 else { 976 else {
977 // make sure our modal widget is ALWAYS on top 977 // make sure our modal widget is ALWAYS on top
978 QWidget *topm = activeModalWidget(); 978 QWidget *topm = activeModalWidget();
979 if ( topm ) { 979 if ( topm ) {
980 topm->raise(); 980 topm->raise();
981 } 981 }
982 } 982 }
983 if ( fe->simpleData.get_focus && inputMethodDict ) { 983 if ( fe->simpleData.get_focus && inputMethodDict ) {
984 InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) ); 984 InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) );
985 if ( m == AlwaysOff ) 985 if ( m == AlwaysOff )
986 Global::hideInputMethod(); 986 Global::hideInputMethod();
987 if ( m == AlwaysOn ) 987 if ( m == AlwaysOn )
988 Global::showInputMethod(); 988 Global::showInputMethod();
989 } 989 }
990 } 990 }
991 991
992 992
993 return QApplication::qwsEventFilter( e ); 993 return QApplication::qwsEventFilter( e );
994} 994}
995#endif 995#endif
996 996
997/*! 997/*!
998 Destroys the QPEApplication. 998 Destroys the QPEApplication.
999*/ 999*/
1000QPEApplication::~QPEApplication() 1000QPEApplication::~QPEApplication()
1001{ 1001{
1002 ungrabKeyboard(); 1002 ungrabKeyboard();
1003#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 1003#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
1004 // Need to delete QCopChannels early, since the display will 1004 // Need to delete QCopChannels early, since the display will
1005 // be gone by the time we get to ~QObject(). 1005 // be gone by the time we get to ~QObject().
1006 delete sysChannel; 1006 delete sysChannel;
1007 delete pidChannel; 1007 delete pidChannel;
1008#endif 1008#endif
1009 1009
1010 delete d; 1010 delete d;
1011} 1011}
1012 1012
1013/*! 1013/*!
1014 Returns <tt>$OPIEDIR/</tt>. 1014 Returns <tt>$OPIEDIR/</tt>.
1015*/ 1015*/
1016QString QPEApplication::qpeDir() 1016QString QPEApplication::qpeDir()
1017{ 1017{
1018 const char * base = getenv( "OPIEDIR" ); 1018 const char * base = getenv( "OPIEDIR" );
1019 if ( base ) 1019 if ( base )
1020 return QString( base ) + "/"; 1020 return QString( base ) + "/";
1021 1021
1022 return QString( "../" ); 1022 return QString( "../" );
1023} 1023}
1024 1024
1025/*! 1025/*!
1026 Returns the user's current Document directory. There is a trailing "/". 1026 Returns the user's current Document directory. There is a trailing "/".
1027 .. well, it does now,, and there's no trailing '/' 1027 .. well, it does now,, and there's no trailing '/'
1028*/ 1028*/
1029QString QPEApplication::documentDir() 1029QString QPEApplication::documentDir()
1030{ 1030{
1031 const char* base = getenv( "HOME"); 1031 const char* base = getenv( "HOME");
1032 if ( base ) 1032 if ( base )
1033 return QString( base ) + "/Documents"; 1033 return QString( base ) + "/Documents";
1034 1034
1035 return QString( "../Documents" ); 1035 return QString( "../Documents" );
1036} 1036}
1037 1037
1038static int deforient = -1; 1038static int deforient = -1;
1039 1039
1040/*! 1040/*!
1041 \internal 1041 \internal
1042*/ 1042*/
1043int QPEApplication::defaultRotation() 1043int QPEApplication::defaultRotation()
1044{ 1044{
1045 if ( deforient < 0 ) { 1045 if ( deforient < 0 ) {
1046 QString d = getenv( "QWS_DISPLAY" ); 1046 QString d = getenv( "QWS_DISPLAY" );
1047 if ( d.contains( "Rot90" ) ) { 1047 if ( d.contains( "Rot90" ) ) {
1048 deforient = 90; 1048 deforient = 90;
1049 } 1049 }
1050 else if ( d.contains( "Rot180" ) ) { 1050 else if ( d.contains( "Rot180" ) ) {
1051 deforient = 180; 1051 deforient = 180;
1052 } 1052 }
1053 else if ( d.contains( "Rot270" ) ) { 1053 else if ( d.contains( "Rot270" ) ) {
1054 deforient = 270; 1054 deforient = 270;
1055 } 1055 }
1056 else { 1056 else {
1057 deforient = 0; 1057 deforient = 0;
1058 } 1058 }
1059 } 1059 }
1060 return deforient; 1060 return deforient;
1061} 1061}
1062 1062
1063/*! 1063/*!
1064 \internal 1064 \internal
1065*/ 1065*/
1066void QPEApplication::setDefaultRotation( int r ) 1066void QPEApplication::setDefaultRotation( int r )
1067{ 1067{
1068 if ( qApp->type() == GuiServer ) { 1068 if ( qApp->type() == GuiServer ) {
1069 deforient = r; 1069 deforient = r;
1070 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); 1070 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
1071 Config config("qpe"); 1071 Config config("qpe");
1072 config.setGroup( "Rotation" ); 1072 config.setGroup( "Rotation" );
1073 config.writeEntry( "Rot", r ); 1073 config.writeEntry( "Rot", r );
1074 } 1074 }
1075 else { 1075 else {
1076#ifndef QT_NO_COP 1076#ifndef QT_NO_COP
1077 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); 1077 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" );
1078 e << r; 1078 e << r;
1079 } 1079 }
1080#endif 1080#endif
1081 1081
1082 } 1082 }
1083} 1083}
1084 1084
1085#include <qgfx_qws.h> 1085#include <qgfx_qws.h>
1086#include <qwindowsystem_qws.h> 1086#include <qwindowsystem_qws.h>
1087#include <qpixmapcache.h> 1087#include <qpixmapcache.h>
1088 1088
1089extern void qws_clearLoadedFonts(); 1089extern void qws_clearLoadedFonts();
1090 1090
1091void QPEApplication::setCurrentMode( int x, int y, int depth ) 1091void QPEApplication::setCurrentMode( int x, int y, int depth )
1092{ 1092{
1093 // Reset the caches 1093 // Reset the caches
1094 qws_clearLoadedFonts(); 1094 qws_clearLoadedFonts();
1095 QPixmapCache::clear(); 1095 QPixmapCache::clear();
1096 1096
1097 // Change the screen mode 1097 // Change the screen mode
1098 qt_screen->setMode(x, y, depth); 1098 qt_screen->setMode(x, y, depth);
1099 1099
1100 if ( qApp->type() == GuiServer ) { 1100 if ( qApp->type() == GuiServer ) {
1101 // Reconfigure the GuiServer 1101 // Reconfigure the GuiServer
1102 qwsServer->beginDisplayReconfigure(); 1102 qwsServer->beginDisplayReconfigure();
1103 qwsServer->endDisplayReconfigure(); 1103 qwsServer->endDisplayReconfigure();
1104 1104
1105 // Get all the running apps to reset 1105 // Get all the running apps to reset
1106 QCopEnvelope env( "QPE/System", "reset()" ); 1106 QCopEnvelope env( "QPE/System", "reset()" );
1107 } 1107 }
1108} 1108}
1109 1109
1110void QPEApplication::reset() { 1110void QPEApplication::reset() {
1111 // Reconnect to the screen 1111 // Reconnect to the screen
1112 qt_screen->disconnect(); 1112 qt_screen->disconnect();
1113 qt_screen->connect( QString::null ); 1113 qt_screen->connect( QString::null );
1114 1114
1115 // Redraw everything 1115 // Redraw everything
1116 applyStyle(); 1116 applyStyle();
1117} 1117}
1118 1118
1119/*! 1119/*!
1120 \internal 1120 \internal
1121*/ 1121*/
1122void QPEApplication::applyStyle() 1122void QPEApplication::applyStyle()
1123{ 1123{
1124 Config config( "qpe" ); 1124 Config config( "qpe" );
1125 config.setGroup( "Appearance" ); 1125 config.setGroup( "Appearance" );
1126 1126
1127 #if QT_VERSION > 233 1127#if QT_VERSION > 233
1128#if !defined(OPIE_NO_OVERRIDE_QT)
1128 // don't block ourselves ... 1129 // don't block ourselves ...
1129 Opie::force_appearance = 0; 1130 Opie::force_appearance = 0;
1130 1131
1131 static QString appname = Opie::binaryName ( ); 1132 static QString appname = Opie::binaryName ( );
1132 1133
1133 QStringList ex = config. readListEntry ( "NoStyle", ';' ); 1134 QStringList ex = config. readListEntry ( "NoStyle", ';' );
1134 int nostyle = 0; 1135 int nostyle = 0;
1135 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { 1136 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
1136 if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { 1137 if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) {
1137 nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); 1138 nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 );
1138 break; 1139 break;
1139 } 1140 }
1140 } 1141 }
1142#else
1143 int nostyle = 0;
1144#endif
1141 1145
1142 // Widget style 1146 // Widget style
1143 QString style = config.readEntry( "Style", "FlatStyle" ); 1147 QString style = config.readEntry( "Style", "FlatStyle" );
1144 1148
1145 // don't set a custom style 1149 // don't set a custom style
1146 if ( nostyle & Opie::Force_Style ) 1150 if ( nostyle & Opie::Force_Style )
1147 style = "FlatStyle"; 1151 style = "FlatStyle";
1148 1152
1149 internalSetStyle ( style ); 1153 internalSetStyle ( style );
1150 1154
1151 // Colors - from /etc/colors/Liquid.scheme 1155 // Colors - from /etc/colors/Liquid.scheme
1152 QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); 1156 QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) );
1153 QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); 1157 QColor btncolor( config.readEntry( "Button", "#96c8fa" ) );
1154 QPalette pal( btncolor, bgcolor ); 1158 QPalette pal( btncolor, bgcolor );
1155 QString color = config.readEntry( "Highlight", "#73adef" ); 1159 QString color = config.readEntry( "Highlight", "#73adef" );
1156 pal.setColor( QColorGroup::Highlight, QColor( color ) ); 1160 pal.setColor( QColorGroup::Highlight, QColor( color ) );
1157 color = config.readEntry( "HighlightedText", "#FFFFFF" ); 1161 color = config.readEntry( "HighlightedText", "#FFFFFF" );
1158 pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); 1162 pal.setColor( QColorGroup::HighlightedText, QColor( color ) );
1159 color = config.readEntry( "Text", "#000000" ); 1163 color = config.readEntry( "Text", "#000000" );
1160 pal.setColor( QColorGroup::Text, QColor( color ) ); 1164 pal.setColor( QColorGroup::Text, QColor( color ) );
1161 color = config.readEntry( "ButtonText", "#000000" ); 1165 color = config.readEntry( "ButtonText", "#000000" );
1162 pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); 1166 pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) );
1163 color = config.readEntry( "Base", "#FFFFFF" ); 1167 color = config.readEntry( "Base", "#FFFFFF" );
1164 pal.setColor( QColorGroup::Base, QColor( color ) ); 1168 pal.setColor( QColorGroup::Base, QColor( color ) );
1165 1169
1166 pal.setColor( QPalette::Disabled, QColorGroup::Text, 1170 pal.setColor( QPalette::Disabled, QColorGroup::Text,
1167 pal.color( QPalette::Active, QColorGroup::Background ).dark() ); 1171 pal.color( QPalette::Active, QColorGroup::Background ).dark() );
1168 1172
1169 setPalette( pal, TRUE ); 1173 setPalette( pal, TRUE );
1170 1174
1171 // Window Decoration 1175 // Window Decoration
1172 QString dec = config.readEntry( "Decoration", "Flat" ); 1176 QString dec = config.readEntry( "Decoration", "Flat" );
1173 1177
1174 // don't set a custom deco 1178 // don't set a custom deco
1175 if ( nostyle & Opie::Force_Decoration ) 1179 if ( nostyle & Opie::Force_Decoration )
1176 dec = ""; 1180 dec = "";
1177 1181
1178 //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); 1182 //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle);
1179 1183
1180 if ( dec != d->decorationName ) { 1184 if ( dec != d->decorationName ) {
1181 qwsSetDecoration( new QPEDecoration( dec ) ); 1185 qwsSetDecoration( new QPEDecoration( dec ) );
1182 d->decorationName = dec; 1186 d->decorationName = dec;
1183 } 1187 }
1184 1188
1185 // Font 1189 // Font
1186 QString ff = config.readEntry( "FontFamily", font().family() ); 1190 QString ff = config.readEntry( "FontFamily", font().family() );
1187 int fs = config.readNumEntry( "FontSize", font().pointSize() ); 1191 int fs = config.readNumEntry( "FontSize", font().pointSize() );
1188 1192
1189 // don't set a custom font 1193 // don't set a custom font
1190 if ( nostyle & Opie::Force_Font ) { 1194 if ( nostyle & Opie::Force_Font ) {
1191 ff = "Vera"; 1195 ff = "Vera";
1192 fs = 10; 1196 fs = 10;
1193 } 1197 }
1194 1198
1195 setFont ( QFont ( ff, fs ), true ); 1199 setFont ( QFont ( ff, fs ), true );
1196 1200
1201#if !defined(OPIE_NO_OVERRIDE_QT)
1197 // revert to global blocking policy ... 1202 // revert to global blocking policy ...
1198 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; 1203 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
1199 Opie::force_appearance &= ~nostyle; 1204 Opie::force_appearance &= ~nostyle;
1200 #endif 1205#endif
1206#endif
1201} 1207}
1202 1208
1203void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) 1209void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
1204{ 1210{
1205#ifdef Q_WS_QWS 1211#ifdef Q_WS_QWS
1206 QDataStream stream( data, IO_ReadOnly ); 1212 QDataStream stream( data, IO_ReadOnly );
1207 if ( msg == "applyStyle()" ) { 1213 if ( msg == "applyStyle()" ) {
1208 applyStyle(); 1214 applyStyle();
1209 } 1215 }
1210 else if ( msg == "toggleApplicationMenu()" ) { 1216 else if ( msg == "toggleApplicationMenu()" ) {
1211 QWidget *active = activeWindow ( ); 1217 QWidget *active = activeWindow ( );
1212 1218
1213 if ( active ) { 1219 if ( active ) {
1214 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); 1220 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( );
1215 bool oldactive = man-> isActive ( ); 1221 bool oldactive = man-> isActive ( );
1216 1222
1217 man-> setActive( !man-> isActive() ); 1223 man-> setActive( !man-> isActive() );
1218 1224
1219 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu 1225 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu
1220 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); 1226 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" );
1221 } 1227 }
1222 } 1228 }
1223 } 1229 }
1224 else if ( msg == "setDefaultRotation(int)" ) { 1230 else if ( msg == "setDefaultRotation(int)" ) {
1225 if ( type() == GuiServer ) { 1231 if ( type() == GuiServer ) {
1226 int r; 1232 int r;
1227 stream >> r; 1233 stream >> r;
1228 setDefaultRotation( r ); 1234 setDefaultRotation( r );
1229 } 1235 }
1230 } 1236 }
1231 else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> 1237 else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net>
1232 if ( type() == GuiServer ) { 1238 if ( type() == GuiServer ) {
1233 int x, y, depth; 1239 int x, y, depth;
1234 stream >> x; 1240 stream >> x;
1235 stream >> y; 1241 stream >> y;
1236 stream >> depth; 1242 stream >> depth;
1237 setCurrentMode( x, y, depth ); 1243 setCurrentMode( x, y, depth );
1238 } 1244 }
1239 } 1245 }
1240 else if ( msg == "reset()" ) { 1246 else if ( msg == "reset()" ) {
1241 if ( type() != GuiServer ) 1247 if ( type() != GuiServer )
1242 reset(); 1248 reset();
1243 } 1249 }
1244 else if ( msg == "setCurrentRotation(int)" ) { 1250 else if ( msg == "setCurrentRotation(int)" ) {
1245 int r; 1251 int r;
1246 stream >> r; 1252 stream >> r;
1247 setCurrentRotation( r ); 1253 setCurrentRotation( r );
1248 } 1254 }
1249 else if ( msg == "shutdown()" ) { 1255 else if ( msg == "shutdown()" ) {
1250 if ( type() == GuiServer ) 1256 if ( type() == GuiServer )
1251 shutdown(); 1257 shutdown();
1252 } 1258 }
1253 else if ( msg == "quit()" ) { 1259 else if ( msg == "quit()" ) {
1254 if ( type() != GuiServer ) 1260 if ( type() != GuiServer )
1255 tryQuit(); 1261 tryQuit();
1256 } 1262 }
1257 else if ( msg == "forceQuit()" ) { 1263 else if ( msg == "forceQuit()" ) {
1258 if ( type() != GuiServer ) 1264 if ( type() != GuiServer )
1259 quit(); 1265 quit();
1260 } 1266 }
1261 else if ( msg == "restart()" ) { 1267 else if ( msg == "restart()" ) {
1262 if ( type() == GuiServer ) 1268 if ( type() == GuiServer )
1263 restart(); 1269 restart();
1264 } 1270 }
1265 else if ( msg == "language(QString)" ) { 1271 else if ( msg == "language(QString)" ) {
1266 if ( type() == GuiServer ) { 1272 if ( type() == GuiServer ) {
1267 QString l; 1273 QString l;
1268 stream >> l; 1274 stream >> l;
1269 QString cl = getenv( "LANG" ); 1275 QString cl = getenv( "LANG" );
1270 if ( cl != l ) { 1276 if ( cl != l ) {
1271 if ( l.isNull() ) 1277 if ( l.isNull() )
1272 unsetenv( "LANG" ); 1278 unsetenv( "LANG" );
1273 else 1279 else
1274 setenv( "LANG", l.latin1(), 1 ); 1280 setenv( "LANG", l.latin1(), 1 );
1275 restart(); 1281 restart();
1276 } 1282 }
1277 } 1283 }
1278 } 1284 }
1279 else if ( msg == "timeChange(QString)" ) { 1285 else if ( msg == "timeChange(QString)" ) {
1280 QString t; 1286 QString t;
1281 stream >> t; 1287 stream >> t;
1282 if ( t.isNull() ) 1288 if ( t.isNull() )
1283 unsetenv( "TZ" ); 1289 unsetenv( "TZ" );
1284 else 1290 else
1285 setenv( "TZ", t.latin1(), 1 ); 1291 setenv( "TZ", t.latin1(), 1 );
1286 // emit the signal so everyone else knows... 1292 // emit the signal so everyone else knows...
1287 emit timeChanged(); 1293 emit timeChanged();
1288 } 1294 }
1289 else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) { 1295 else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) {
1290 if ( type() == GuiServer ) { 1296 if ( type() == GuiServer ) {
1291 QDateTime when; 1297 QDateTime when;
1292 QCString channel, message; 1298 QCString channel, message;
1293 int data; 1299 int data;
1294 stream >> when >> channel >> message >> data; 1300 stream >> when >> channel >> message >> data;
1295 AlarmServer::addAlarm( when, channel, message, data ); 1301 AlarmServer::addAlarm( when, channel, message, data );
1296 } 1302 }
1297 } 1303 }
1298 else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) { 1304 else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) {
1299 if ( type() == GuiServer ) { 1305 if ( type() == GuiServer ) {
1300 QDateTime when; 1306 QDateTime when;
1301 QCString channel, message; 1307 QCString channel, message;
1302 int data; 1308 int data;
1303 stream >> when >> channel >> message >> data; 1309 stream >> when >> channel >> message >> data;
1304 AlarmServer::deleteAlarm( when, channel, message, data ); 1310 AlarmServer::deleteAlarm( when, channel, message, data );
1305 } 1311 }
1306 } 1312 }
1307 else if ( msg == "clockChange(bool)" ) { 1313 else if ( msg == "clockChange(bool)" ) {
1308 int tmp; 1314 int tmp;
1309 stream >> tmp; 1315 stream >> tmp;
1310 emit clockChanged( tmp ); 1316 emit clockChanged( tmp );
1311 } 1317 }
1312 else if ( msg == "weekChange(bool)" ) { 1318 else if ( msg == "weekChange(bool)" ) {
1313 int tmp; 1319 int tmp;
1314 stream >> tmp; 1320 stream >> tmp;
1315 emit weekChanged( tmp ); 1321 emit weekChanged( tmp );
1316 } 1322 }
1317 else if ( msg == "setDateFormat(DateFormat)" ) { 1323 else if ( msg == "setDateFormat(DateFormat)" ) {
1318 DateFormat tmp; 1324 DateFormat tmp;
1319 stream >> tmp; 1325 stream >> tmp;
1320 emit dateFormatChanged( tmp ); 1326 emit dateFormatChanged( tmp );
1321 } 1327 }
1322 else if ( msg == "setVolume(int,int)" ) { 1328 else if ( msg == "setVolume(int,int)" ) {
1323 int t, v; 1329 int t, v;
1324 stream >> t >> v; 1330 stream >> t >> v;
1325 setVolume( t, v ); 1331 setVolume( t, v );
1326 emit volumeChanged( muted ); 1332 emit volumeChanged( muted );
1327 } 1333 }
1328 else if ( msg == "volumeChange(bool)" ) { 1334 else if ( msg == "volumeChange(bool)" ) {
1329 stream >> muted; 1335 stream >> muted;
1330 setVolume(); 1336 setVolume();
1331 emit volumeChanged( muted ); 1337 emit volumeChanged( muted );
1332 } 1338 }
1333 else if ( msg == "setMic(int,int)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com> 1339 else if ( msg == "setMic(int,int)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com>
1334 int t, v; 1340 int t, v;
1335 stream >> t >> v; 1341 stream >> t >> v;
1336 setMic( t, v ); 1342 setMic( t, v );
1337 emit micChanged( micMuted ); 1343 emit micChanged( micMuted );
1338 } 1344 }
1339 else if ( msg == "micChange(bool)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com> 1345 else if ( msg == "micChange(bool)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com>
1340 stream >> micMuted; 1346 stream >> micMuted;
1341 setMic(); 1347 setMic();
1342 emit micChanged( micMuted ); 1348 emit micChanged( micMuted );
1343 } 1349 }
1344 else if ( msg == "setBass(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org> 1350 else if ( msg == "setBass(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1345 int t, v; 1351 int t, v;
1346 stream >> t >> v; 1352 stream >> t >> v;
1347 setBass( t, v ); 1353 setBass( t, v );
1348 } 1354 }
1349 else if ( msg == "bassChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org> 1355 else if ( msg == "bassChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1350 setBass(); 1356 setBass();
1351 } 1357 }
1352 else if ( msg == "setTreble(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org> 1358 else if ( msg == "setTreble(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1353 int t, v; 1359 int t, v;
1354 stream >> t >> v; 1360 stream >> t >> v;
1355 setTreble( t, v ); 1361 setTreble( t, v );
1356 } 1362 }
1357 else if ( msg == "trebleChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org> 1363 else if ( msg == "trebleChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1358 setTreble(); 1364 setTreble();
1359 } else if ( msg == "getMarkedText()" ) { 1365 } else if ( msg == "getMarkedText()" ) {
1360 if ( type() == GuiServer ) { 1366 if ( type() == GuiServer ) {
1361 const ushort unicode = 'C'-'@'; 1367 const ushort unicode = 'C'-'@';
1362 const int scan = Key_C; 1368 const int scan = Key_C;
1363 qwsServer->processKeyEvent( unicode, scan, ControlButton, TRUE, FALSE ); 1369 qwsServer->processKeyEvent( unicode, scan, ControlButton, TRUE, FALSE );
1364 qwsServer->processKeyEvent( unicode, scan, ControlButton, FALSE, FALSE ); 1370 qwsServer->processKeyEvent( unicode, scan, ControlButton, FALSE, FALSE );
1365 } 1371 }
1366 } else if ( msg == "newChannel(QString)") { 1372 } else if ( msg == "newChannel(QString)") {
1367 QString myChannel = "QPE/Application/" + d->appName; 1373 QString myChannel = "QPE/Application/" + d->appName;
1368 QString channel; 1374 QString channel;
1369 stream >> channel; 1375 stream >> channel;
1370 if (channel == myChannel) { 1376 if (channel == myChannel) {
1371 processQCopFile(); 1377 processQCopFile();
1372 d->sendQCopQ(); 1378 d->sendQCopQ();
1373 } 1379 }
1374 } 1380 }
1375 1381
1376 1382
1377#endif 1383#endif
1378} 1384}
1379 1385
1380 1386
1381 1387
1382 1388
1383 1389
1384/*! 1390/*!
1385 \internal 1391 \internal
1386*/ 1392*/
1387bool QPEApplication::raiseAppropriateWindow() 1393bool QPEApplication::raiseAppropriateWindow()
1388{ 1394{
1389 bool r=FALSE; 1395 bool r=FALSE;
1390 1396
1391 // 1. Raise the main widget 1397 // 1. Raise the main widget
1392 QWidget *top = d->qpe_main_widget; 1398 QWidget *top = d->qpe_main_widget;
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index edda874..df5a419 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -1,171 +1,177 @@
1 1
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qwsdecoration_qws.h> 3#include <qwsdecoration_qws.h>
4#include <qcommonstyle.h> 4#include <qcommonstyle.h>
5#include <qfontdatabase.h> 5#include <qfontdatabase.h>
6 6
7#include <unistd.h> 7#include <unistd.h>
8#include <stdlib.h> 8#include <stdlib.h>
9#include <stdio.h> 9#include <stdio.h>
10#include <limits.h> 10#include <limits.h>
11#include <sys/param.h> // for toolchains with old libc headers 11#include <sys/param.h> // for toolchains with old libc headers
12 12
13#include "qt_override_p.h" 13#include "qt_override_p.h"
14 14
15#if QT_VERSION > 233 15#if QT_VERSION > 233
16 16
17struct color_fix_t { 17struct color_fix_t {
18 char *m_app; 18 char *m_app;
19 char *m_class; 19 char *m_class;
20 char *m_name; 20 char *m_name;
21 QColorGroup::ColorRole m_set; 21 QColorGroup::ColorRole m_set;
22 QColorGroup::ColorRole m_get; 22 QColorGroup::ColorRole m_get;
23}; 23};
24 24
25 25#ifndef OPIE_NO_OVERRIDE_QT
26 26
27static const color_fix_t apps_that_need_special_colors [] = { 27static const color_fix_t apps_that_need_special_colors [] = {
28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, 28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base },
29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, 29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base },
30 30
31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } 31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base }
32}; 32};
33 33
34static const char * const apps_that_need_pointsizes_times_10 [] = { 34static const char * const apps_that_need_pointsizes_times_10 [] = {
35 "HancomMobileWord", 35 "HancomMobileWord",
36 "hancomsheet", 36 "hancomsheet",
37 "HancomPresenterViewer", 37 "HancomPresenterViewer",
38 38
39 0 39 0
40}; 40};
41 41
42 42
43 43
44 44
45int Opie::force_appearance = 0; 45int Opie::force_appearance = 0;
46 46
47 47
48// Return the *real* name of the binary - not just a quick guess 48// Return the *real* name of the binary - not just a quick guess
49// by looking at argv [0] (which could be anything) 49// by looking at argv [0] (which could be anything)
50 50
51static void binaryNameFree ( ) 51static void binaryNameFree ( )
52{ 52{
53 ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here 53 ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here
54} 54}
55 55
56const char *Opie::binaryName ( ) 56const char *Opie::binaryName ( )
57{ 57{
58 static const char *appname = 0; 58 static const char *appname = 0;
59 59
60 if ( !appname ) { 60 if ( !appname ) {
61 char dst [PATH_MAX + 1]; 61 char dst [PATH_MAX + 1];
62 int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); 62 int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX );
63 63
64 if ( l <= 0 ) 64 if ( l <= 0 )
65 l = 0; 65 l = 0;
66 66
67 dst [l] = 0; 67 dst [l] = 0;
68 const char *b = ::strrchr ( dst, '/' ); 68 const char *b = ::strrchr ( dst, '/' );
69 appname = ::strdup ( b ? b + 1 : dst ); 69 appname = ::strdup ( b ? b + 1 : dst );
70 70
71 ::atexit ( binaryNameFree ); 71 ::atexit ( binaryNameFree );
72 } 72 }
73 return appname; 73 return appname;
74} 74}
75 75
76#else
77int Opie::force_appearance = 0;
78#endif
76 79
77// Fix for a toolchain incompatibility (binaries compiled with 80// Fix for a toolchain incompatibility (binaries compiled with
78// old tcs using shared libs compiled with newer tcs) 81// old tcs using shared libs compiled with newer tcs)
79 82
80extern "C" { 83extern "C" {
81 84
82extern void __gmon_start__ ( ) __attribute__(( weak )); 85extern void __gmon_start__ ( ) __attribute__(( weak ));
83 86
84extern void __gmon_start__ ( ) 87extern void __gmon_start__ ( )
85{ 88{
86} 89}
87 90
88} 91}
89 92
90 93
91// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles 94// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles
92// that set a background pixmap (it would be easier to fix eraseRect(), but 95// that set a background pixmap (it would be easier to fix eraseRect(), but
93// TT made it an inline ...) 96// TT made it an inline ...)
94 97
95void QPEApplication::polish ( QWidget *w ) 98void QPEApplication::polish ( QWidget *w )
96{ 99{
100#ifndef OPIE_NO_OVERRIDE_QT
97 //qDebug ( "QPEApplication::polish()" ); 101 //qDebug ( "QPEApplication::polish()" );
98 102
99 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { 103 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) {
100 if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && 104 if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) &&
101 ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && 105 ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) &&
102 ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { 106 ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) {
103 QPalette pal = w-> palette ( ); 107 QPalette pal = w-> palette ( );
104 pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); 108 pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get ));
105 w-> setPalette ( pal ); 109 w-> setPalette ( pal );
106 } 110 }
107 } 111 }
112#endif
108 QApplication::polish ( w ); 113 QApplication::polish ( w );
109} 114}
110 115
111 116
117#ifndef OPIE_NO_OVERRIDE_QT
112// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes 118// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes
113// were multiplied by 10 (which was incorrect) 119// were multiplied by 10 (which was incorrect)
114 120
115QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) 121QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset )
116{ 122{
117 //qDebug ( "QFontDatabase::pointSizes()" ); 123 //qDebug ( "QFontDatabase::pointSizes()" );
118 124
119 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); 125 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
120 126
121 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { 127 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) {
122 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { 128 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) {
123 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 129 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
124 *it *= 10; 130 *it *= 10;
125 } 131 }
126 } 132 }
127 return sl; 133 return sl;
128} 134}
129 135
130 136
131// Various style/font/color related overrides for weak symbols in Qt/E, 137// Various style/font/color related overrides for weak symbols in Qt/E,
132// which allows us to force the usage of the global Opie appearance. 138// which allows us to force the usage of the global Opie appearance.
133 139
134void QApplication::setStyle ( QStyle *style ) 140void QApplication::setStyle ( QStyle *style )
135{ 141{
136 //qDebug ( "QApplication::setStyle()" ); 142 //qDebug ( "QApplication::setStyle()" );
137 143
138 if ( Opie::force_appearance & Opie::Force_Style ) 144 if ( Opie::force_appearance & Opie::Force_Style )
139 delete style; 145 delete style;
140 else 146 else
141 QApplication::setStyle_NonWeak ( style ); 147 QApplication::setStyle_NonWeak ( style );
142} 148}
143 149
144void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) 150void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className )
145{ 151{
146 //qDebug ( "QApplication::setPalette()" ); 152 //qDebug ( "QApplication::setPalette()" );
147 153
148 if (!( Opie::force_appearance & Opie::Force_Style )) 154 if (!( Opie::force_appearance & Opie::Force_Style ))
149 QApplication::setPalette_NonWeak ( pal, informWidgets, className ); 155 QApplication::setPalette_NonWeak ( pal, informWidgets, className );
150} 156}
151 157
152void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) 158void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className )
153{ 159{
154 //qDebug ( "QApplication::setFont()" ); 160 //qDebug ( "QApplication::setFont()" );
155 161
156 if (!( Opie::force_appearance & Opie::Force_Font )) 162 if (!( Opie::force_appearance & Opie::Force_Font ))
157 QApplication::setFont_NonWeak ( fnt, informWidgets, className ); 163 QApplication::setFont_NonWeak ( fnt, informWidgets, className );
158} 164}
159 165
160 166
161void QApplication::qwsSetDecoration ( QWSDecoration *deco ) 167void QApplication::qwsSetDecoration ( QWSDecoration *deco )
162{ 168{
163 //qDebug ( "QApplication::qwsSetDecoration()" ); 169 //qDebug ( "QApplication::qwsSetDecoration()" );
164 170
165 if ( Opie::force_appearance & Opie::Force_Decoration ) 171 if ( Opie::force_appearance & Opie::Force_Decoration )
166 delete deco; 172 delete deco;
167 else 173 else
168 QApplication::qwsSetDecoration_NonWeak ( deco ); 174 QApplication::qwsSetDecoration_NonWeak ( deco );
169} 175}
170 176#endif
171#endif \ No newline at end of file 177#endif