author | mickeyl <mickeyl> | 2004-06-25 12:49:30 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-06-25 12:49:30 (UTC) |
commit | d3276bd5098fa4418efae6e3f87521f56653872f (patch) (unidiff) | |
tree | 906ff0338c780924e035822ce0629948d8ff2413 | |
parent | 09451308ca73f7b58a8ec0766df01bcb188f4b3f (diff) | |
download | opie-d3276bd5098fa4418efae6e3f87521f56653872f.zip opie-d3276bd5098fa4418efae6e3f87521f56653872f.tar.gz opie-d3276bd5098fa4418efae6e3f87521f56653872f.tar.bz2 |
- get rid of HIGH_RES_LOW_PHYS to allow shipping one libqpe for all devices
- honor FontFamily and FontSize as set in qpe/Appearance
- NOTE to packagers: Remember to ship appropriate qpe.conf files for the different devices!
-rw-r--r-- | Rules.make | 3 | ||||
-rw-r--r-- | config.in | 5 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 55 |
3 files changed, 25 insertions, 38 deletions
@@ -60,27 +60,24 @@ endif | |||
60 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) | 60 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) |
61 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ | 61 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ |
62 | endif | 62 | endif |
63 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) | 63 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) |
64 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ | 64 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ |
65 | endif | 65 | endif |
66 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) | 66 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) |
67 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ | 67 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ |
68 | endif | 68 | endif |
69 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) | 69 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) |
70 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ | 70 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ |
71 | endif | 71 | endif |
72 | ifeq ($(CONFIG_OPIE_HIGH_RES_SMALL_PHY),y) | ||
73 | echo DEFINES += OPIE_HIGH_RES_SMALL_PHY >> $@ | ||
74 | endif | ||
75 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) | 72 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) |
76 | echo DEFINES += OPIE_NEW_MALLOC >> $@ | 73 | echo DEFINES += OPIE_NEW_MALLOC >> $@ |
77 | endif | 74 | endif |
78 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) | 75 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) |
79 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ | 76 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ |
80 | endif | 77 | endif |
81 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ | 78 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ |
82 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) | 79 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) |
83 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ | 80 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ |
84 | endif | 81 | endif |
85 | # Write LIB dirs and INC dirs... | 82 | # Write LIB dirs and INC dirs... |
86 | ifeq ($(CONFIG_LIBETPAN_DEP),y) | 83 | ifeq ($(CONFIG_LIBETPAN_DEP),y) |
@@ -129,29 +129,24 @@ config OPIE_SOUND_FRAGMENT_SHIFT | |||
129 | default "16" if ! TARGET_IPAQ | 129 | default "16" if ! TARGET_IPAQ |
130 | 130 | ||
131 | config USE_REALTIME_AUDIO_THREAD | 131 | config USE_REALTIME_AUDIO_THREAD |
132 | boolean "Use a realtime thread in Opie Player I" | 132 | boolean "Use a realtime thread in Opie Player I" |
133 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP | 133 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP |
134 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 134 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
135 | 135 | ||
136 | config QT_QWS_ALLOW_OVERCLOCK | 136 | config QT_QWS_ALLOW_OVERCLOCK |
137 | boolean "Allow the user to overclock the device" | 137 | boolean "Allow the user to overclock the device" |
138 | depends TARGET_RAMSES | 138 | depends TARGET_RAMSES |
139 | default n | 139 | default n |
140 | 140 | ||
141 | config OPIE_HIGH_RES_SMALL_PHY | ||
142 | boolean "Resolution is bigger than physical screen" | ||
143 | default y if TARGET_C700 | ||
144 | default n if ! TARGET_C700 | ||
145 | |||
146 | config USE_FILE_NOTIFICATION | 141 | config USE_FILE_NOTIFICATION |
147 | boolean "Substitute (some) polling interfaces with OFileNotifier" | 142 | boolean "Substitute (some) polling interfaces with OFileNotifier" |
148 | default y | 143 | default y |
149 | 144 | ||
150 | config OPIE_NEW_ALLOC | 145 | config OPIE_NEW_ALLOC |
151 | boolean "Use malloc and free for the implementation" | 146 | boolean "Use malloc and free for the implementation" |
152 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP | 147 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP |
153 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 148 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
154 | 149 | ||
155 | config OPIE_NO_SOUND_PCM_READ_BITS | 150 | config OPIE_NO_SOUND_PCM_READ_BITS |
156 | boolean "There is not a pcm_read_bits io control" | 151 | boolean "There is not a pcm_read_bits io control" |
157 | default y if TARGET_SHARP | 152 | default y if TARGET_SHARP |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 26e310a..4bc0c5f 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -87,57 +87,72 @@ | |||
87 | #include "qpemenubar.h" | 87 | #include "qpemenubar.h" |
88 | #include "textcodecinterface.h" | 88 | #include "textcodecinterface.h" |
89 | #include "imagecodecinterface.h" | 89 | #include "imagecodecinterface.h" |
90 | 90 | ||
91 | #include <unistd.h> | 91 | #include <unistd.h> |
92 | #include <sys/file.h> | 92 | #include <sys/file.h> |
93 | #include <sys/ioctl.h> | 93 | #include <sys/ioctl.h> |
94 | #ifndef QT_NO_SOUND | 94 | #ifndef QT_NO_SOUND |
95 | #include <sys/soundcard.h> | 95 | #include <sys/soundcard.h> |
96 | #endif | 96 | #endif |
97 | #include "qt_override_p.h" | 97 | #include "qt_override_p.h" |
98 | 98 | ||
99 | static bool useBigPixmaps = 0; | ||
100 | |||
99 | class HackWidget : public QWidget | 101 | class HackWidget : public QWidget |
100 | { | 102 | { |
101 | public: | 103 | public: |
102 | bool needsOk() | 104 | bool needsOk() |
103 | { return (getWState() & WState_Reserved1 ); } | 105 | { return (getWState() & WState_Reserved1 ); } |
104 | 106 | ||
105 | QRect normalGeometry() | 107 | QRect normalGeometry() |
106 | { return topData()->normalGeometry; }; | 108 | { return topData()->normalGeometry; }; |
107 | }; | 109 | }; |
108 | 110 | ||
109 | class QPEApplicationData | 111 | class QPEApplicationData |
110 | { | 112 | { |
111 | public: | 113 | public: |
112 | QPEApplicationData ( ) | 114 | QPEApplicationData ( ) |
113 | : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), | 115 | : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), |
114 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), | 116 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), |
115 | keep_running( true ), qcopQok( false ), qpe_main_widget( 0 ) | 117 | keep_running( true ), qcopQok( false ), |
116 | 118 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), | |
117 | {} | 119 | bigIconSize( 32 ), qpe_main_widget( 0 ) |
120 | { | ||
121 | Config cfg( "qpe" ); | ||
122 | cfg.setGroup( "Appearance" ); | ||
123 | useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false ); | ||
124 | fontFamily = cfg.readEntry( "FontFamily", "Vera" ); | ||
125 | fontSize = cfg.readNumEntry( "FontSize", 10 ); | ||
126 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); | ||
127 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); | ||
128 | } | ||
118 | 129 | ||
119 | int presstimer; | 130 | int presstimer; |
120 | QWidget* presswidget; | 131 | QWidget* presswidget; |
121 | QPoint presspos; | 132 | QPoint presspos; |
122 | 133 | ||
123 | bool rightpressed : 1; | 134 | bool rightpressed : 1; |
124 | bool kbgrabbed : 1; | 135 | bool kbgrabbed : 1; |
125 | bool notbusysent : 1; | 136 | bool notbusysent : 1; |
126 | bool preloaded : 1; | 137 | bool preloaded : 1; |
127 | bool forceshow : 1; | 138 | bool forceshow : 1; |
128 | bool nomaximize : 1; | 139 | bool nomaximize : 1; |
129 | bool keep_running : 1; | 140 | bool keep_running : 1; |
130 | bool qcopQok : 1; | 141 | bool qcopQok : 1; |
131 | 142 | ||
143 | QCString fontFamily; | ||
144 | int fontSize; | ||
145 | int smallIconSize; | ||
146 | int bigIconSize; | ||
132 | 147 | ||
133 | QStringList langs; | 148 | QStringList langs; |
134 | QString appName; | 149 | QString appName; |
135 | struct QCopRec | 150 | struct QCopRec |
136 | { | 151 | { |
137 | QCopRec( const QCString &ch, const QCString &msg, | 152 | QCopRec( const QCString &ch, const QCString &msg, |
138 | const QByteArray &d ) : | 153 | const QByteArray &d ) : |
139 | channel( ch ), message( msg ), data( d ) | 154 | channel( ch ), message( msg ), data( d ) |
140 | { } | 155 | { } |
141 | 156 | ||
142 | QCString channel; | 157 | QCString channel; |
143 | QCString message; | 158 | QCString message; |
@@ -164,36 +179,30 @@ public: | |||
164 | while((r=qcopq.dequeue())) { | 179 | while((r=qcopq.dequeue())) { |
165 | // remove from queue before sending... | 180 | // remove from queue before sending... |
166 | // event loop can come around again before getting | 181 | // event loop can come around again before getting |
167 | // back from sendLocally | 182 | // back from sendLocally |
168 | #ifndef QT_NO_COP | 183 | #ifndef QT_NO_COP |
169 | QCopChannel::sendLocally( r->channel, r->message, r->data ); | 184 | QCopChannel::sendLocally( r->channel, r->message, r->data ); |
170 | #endif | 185 | #endif |
171 | 186 | ||
172 | delete r; | 187 | delete r; |
173 | } | 188 | } |
174 | } | 189 | } |
175 | 190 | ||
176 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName/* = QString::null */) | 191 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName) |
192 | { | ||
193 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) | ||
177 | { | 194 | { |
178 | // ugly hack, remove that later after finding a sane solution | 195 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); |
179 | // Addendum: Only Sharp currently has models with high resolution but (physically) small displays, | ||
180 | // so this is only useful if QT_QWS_SIMPAD is NOT defined. E.g. SIMpad has 800x600 but has | ||
181 | // a (physically) large enough display to use the small icons | ||
182 | #if defined(OPIE_HIGH_RES_SMALL_PHY) | ||
183 | if ( QPEApplication::desktop() ->width() >= 600 && ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) ) { | ||
184 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( true ); | ||
185 | } | 196 | } |
186 | #endif | ||
187 | |||
188 | QPoint p; | 197 | QPoint p; |
189 | QSize s; | 198 | QSize s; |
190 | bool max; | 199 | bool max; |
191 | if ( mw->isVisible() ) { | 200 | if ( mw->isVisible() ) { |
192 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 201 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
193 | mw->resize(s); | 202 | mw->resize(s); |
194 | mw->move(p); | 203 | mw->move(p); |
195 | } | 204 | } |
196 | mw->raise(); | 205 | mw->raise(); |
197 | } else { | 206 | } else { |
198 | 207 | ||
199 | if ( mw->layout() && mw->inherits("QDialog") ) { | 208 | if ( mw->layout() && mw->inherits("QDialog") ) { |
@@ -787,41 +796,27 @@ void QPEApplication::processQCopFile() | |||
787 | the Qtopia server passes GuiServer. | 796 | the Qtopia server passes GuiServer. |
788 | */ | 797 | */ |
789 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 798 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
790 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) | 799 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) |
791 | { | 800 | { |
792 | QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. | 801 | QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. |
793 | 802 | ||
794 | d = new QPEApplicationData; | 803 | d = new QPEApplicationData; |
795 | d->loadTextCodecs(); | 804 | d->loadTextCodecs(); |
796 | d->loadImageCodecs(); | 805 | d->loadImageCodecs(); |
797 | int dw = desktop() ->width(); | 806 | int dw = desktop() ->width(); |
798 | 807 | ||
799 | if ( dw < 200 ) { | 808 | setFont( QFont( d->fontFamily, d->fontSize ) ); |
800 | setFont( QFont( "vera", 8 ) ); | 809 | AppLnk::setSmallIconSize( d->smallIconSize ); |
801 | AppLnk::setSmallIconSize( 10 ); | 810 | AppLnk::setBigIconSize( d->bigIconSize ); |
802 | AppLnk::setBigIconSize( 28 ); | ||
803 | } | ||
804 | #if defined(OPIE_HIGH_RES_SMALL_PHY) | ||
805 | else if ( dw > 600 ) { | ||
806 | setFont( QFont( "vera", 16 ) ); | ||
807 | AppLnk::setSmallIconSize( 24 ); | ||
808 | AppLnk::setBigIconSize( 48 ); | ||
809 | } | ||
810 | #endif | ||
811 | else if ( dw > 200 ) { | ||
812 | setFont( QFont( "vera", 10 ) ); | ||
813 | AppLnk::setSmallIconSize( 14 ); | ||
814 | AppLnk::setBigIconSize( 32 ); | ||
815 | } | ||
816 | 811 | ||
817 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); | 812 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); |
818 | 813 | ||
819 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); | 814 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); |
820 | 815 | ||
821 | 816 | ||
822 | sysChannel = new QCopChannel( "QPE/System", this ); | 817 | sysChannel = new QCopChannel( "QPE/System", this ); |
823 | connect( sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 818 | connect( sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
824 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 819 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
825 | 820 | ||
826 | /* COde now in initapp */ | 821 | /* COde now in initapp */ |
827 | #if 0 | 822 | #if 0 |