author | schurig <schurig> | 2003-06-02 11:12:03 (UTC) |
---|---|---|
committer | schurig <schurig> | 2003-06-02 11:12:03 (UTC) |
commit | 2d6bec942d8b9b8b50639cb4ffe58cf24d5a255b (patch) (unidiff) | |
tree | 5b917d74d600715ad1223f174a9b672d822caf47 | |
parent | 68a88060627137e8cb424c758c1339f1ed5c6eac (diff) | |
download | opie-2d6bec942d8b9b8b50639cb4ffe58cf24d5a255b.zip opie-2d6bec942d8b9b8b50639cb4ffe58cf24d5a255b.tar.gz opie-2d6bec942d8b9b8b50639cb4ffe58cf24d5a255b.tar.bz2 |
new Ramses target
-rw-r--r-- | config.in | 9 | ||||
-rw-r--r-- | libopie/odevice.cpp | 197 | ||||
-rw-r--r-- | libopie/odevice.h | 6 |
3 files changed, 211 insertions, 1 deletions
@@ -1,102 +1,109 @@ | |||
1 | mainmenu "Opie Configuration" | 1 | mainmenu "Opie Configuration" |
2 | menu "Build Parameters" | 2 | menu "Build Parameters" |
3 | 3 | ||
4 | #choice | 4 | #choice |
5 | # prompt "Build Processor family" | 5 | # prompt "Build Processor family" |
6 | # default BUILD_X86 | 6 | # default BUILD_X86 |
7 | # help | 7 | # help |
8 | # Please select the architecture of the machine you will be | 8 | # Please select the architecture of the machine you will be |
9 | # building the OpenZaurus buildroot on. | 9 | # building the OpenZaurus buildroot on. |
10 | # | 10 | # |
11 | # config BUILD_X86 | 11 | # config BUILD_X86 |
12 | # boolean "X86 Architecture" | 12 | # boolean "X86 Architecture" |
13 | # | 13 | # |
14 | #endchoice | 14 | #endchoice |
15 | 15 | ||
16 | choice | 16 | choice |
17 | prompt "Target Machine" | 17 | prompt "Target Machine" |
18 | default TARGET_X86 | 18 | default TARGET_X86 |
19 | help | 19 | help |
20 | Please select the architecture of the machine you will be | 20 | Please select the architecture of the machine you will be |
21 | building the OpenZaurus buildroot for. | 21 | building the OpenZaurus buildroot for. |
22 | 22 | ||
23 | config TARGET_X86 | 23 | config TARGET_X86 |
24 | boolean "Intel X86" | 24 | boolean "Intel X86" |
25 | 25 | ||
26 | config TARGET_SHARP | 26 | config TARGET_SHARP |
27 | boolean "Sharp Zaurus SL-5x00 - stock" | 27 | boolean "Sharp Zaurus SL-5x00 - stock" |
28 | 28 | ||
29 | # config TARGET_OZ | 29 | # config TARGET_OZ |
30 | # boolean "Sharp Zaurus SL-5x00 - OpenZaurus" | 30 | # boolean "Sharp Zaurus SL-5x00 - OpenZaurus" |
31 | 31 | ||
32 | config TARGET_IPAQ | 32 | config TARGET_IPAQ |
33 | boolean "Ipaq" | 33 | boolean "iPAQ" |
34 | |||
35 | config TARGET_RAMSES | ||
36 | boolean "Ramses" | ||
34 | 37 | ||
35 | endchoice | 38 | endchoice |
36 | 39 | ||
37 | config OPTIMIZE | 40 | config OPTIMIZE |
38 | boolean "Use optimizations" | 41 | boolean "Use optimizations" |
39 | default "y" if ! TARGET_X86 | 42 | default "y" if ! TARGET_X86 |
40 | 43 | ||
41 | config DEBUG | 44 | config DEBUG |
42 | boolean "Enable debug builds" | 45 | boolean "Enable debug builds" |
43 | default n | 46 | default n |
44 | 47 | ||
45 | config RELEASE | 48 | config RELEASE |
46 | bool | 49 | bool |
47 | default y | 50 | default y |
48 | depends ! DEBUG | 51 | depends ! DEBUG |
49 | 52 | ||
50 | config SPECFILE | 53 | config SPECFILE |
51 | string | 54 | string |
52 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) | 55 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) |
53 | default "linux-g++" if TARGET_X86 && X11 | 56 | default "linux-g++" if TARGET_X86 && X11 |
54 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) | 57 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) |
55 | default "linux-g++" if TARGET_SHARP && X11 | 58 | default "linux-g++" if TARGET_SHARP && X11 |
56 | # default "linux-oz-g++" if TARGET_OZ | 59 | # default "linux-oz-g++" if TARGET_OZ |
57 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) | 60 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) |
58 | default "linux-g++" if TARGET_IPAQ && X11 | 61 | default "linux-g++" if TARGET_IPAQ && X11 |
62 | default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) | ||
63 | default "linux-g++" if TARGET_RAMSES && X11 | ||
59 | 64 | ||
60 | config CUSTOMFILE | 65 | config CUSTOMFILE |
61 | string | 66 | string |
62 | default "custom-ipaq.h" if TARGET_IPAQ | 67 | default "custom-ipaq.h" if TARGET_IPAQ |
63 | default "custom-sharp.h" if TARGET_SHARP | 68 | default "custom-sharp.h" if TARGET_SHARP |
69 | default "custom-ramses.h" if TARGET_RAMSES | ||
64 | 70 | ||
65 | 71 | ||
66 | config OPTIMIZATIONS | 72 | config OPTIMIZATIONS |
67 | string "Optimization flags" | 73 | string "Optimization flags" |
68 | depends OPTIMIZE | 74 | depends OPTIMIZE |
69 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ | 75 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ |
70 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP | 76 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP |
77 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES | ||
71 | 78 | ||
72 | #config CROSS | 79 | #config CROSS |
73 | # string "Crosscompilation prefix" | 80 | # string "Crosscompilation prefix" |
74 | # default "arm-linux-" | 81 | # default "arm-linux-" |
75 | # help | 82 | # help |
76 | # Crosscompilation prefix is the prefix which will be prepended | 83 | # Crosscompilation prefix is the prefix which will be prepended |
77 | # to all compilation commands. For example, a crosscompilation prefix | 84 | # to all compilation commands. For example, a crosscompilation prefix |
78 | # of arm-linux-, results in the build calling arm-linux-gcc as its CC. | 85 | # of arm-linux-, results in the build calling arm-linux-gcc as its CC. |
79 | 86 | ||
80 | config EXPERIMENTAL | 87 | config EXPERIMENTAL |
81 | bool "Prompt for development and/or incomplete items" | 88 | bool "Prompt for development and/or incomplete items" |
82 | default y | 89 | default y |
83 | 90 | ||
84 | endmenu | 91 | endmenu |
85 | 92 | ||
86 | menu "Base" | 93 | menu "Base" |
87 | choice | 94 | choice |
88 | prompt "Qpe Library Selection" | 95 | prompt "Qpe Library Selection" |
89 | default LIBQPE | 96 | default LIBQPE |
90 | 97 | ||
91 | source library/config.in | 98 | source library/config.in |
92 | source x11/config.in | 99 | source x11/config.in |
93 | endchoice | 100 | endchoice |
94 | source libopie/config.in | 101 | source libopie/config.in |
95 | source core/opie-login/config.in | 102 | source core/opie-login/config.in |
96 | source core/opiealarm/config.in | 103 | source core/opiealarm/config.in |
97 | source core/launcher/config.in | 104 | source core/launcher/config.in |
98 | source core/qws/config.in | 105 | source core/qws/config.in |
99 | endmenu | 106 | endmenu |
100 | 107 | ||
101 | comment "" | 108 | comment "" |
102 | 109 | ||
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index f0429d4..d86654e 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -132,64 +132,83 @@ protected: | |||
132 | OLedState m_leds [1]; | 132 | OLedState m_leds [1]; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { | 135 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { |
136 | protected: | 136 | protected: |
137 | virtual void init ( ); | 137 | virtual void init ( ); |
138 | virtual void initButtons ( ); | 138 | virtual void initButtons ( ); |
139 | 139 | ||
140 | public: | 140 | public: |
141 | virtual bool setSoftSuspend ( bool soft ); | 141 | virtual bool setSoftSuspend ( bool soft ); |
142 | virtual bool suspend(); | 142 | virtual bool suspend(); |
143 | 143 | ||
144 | virtual bool setDisplayStatus( bool on ); | 144 | virtual bool setDisplayStatus( bool on ); |
145 | virtual bool setDisplayBrightness ( int b ); | 145 | virtual bool setDisplayBrightness ( int b ); |
146 | virtual int displayBrightnessResolution ( ) const; | 146 | virtual int displayBrightnessResolution ( ) const; |
147 | 147 | ||
148 | virtual void alarmSound ( ); | 148 | virtual void alarmSound ( ); |
149 | 149 | ||
150 | virtual QValueList <OLed> ledList ( ) const; | 150 | virtual QValueList <OLed> ledList ( ) const; |
151 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 151 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
152 | virtual OLedState ledState ( OLed led ) const; | 152 | virtual OLedState ledState ( OLed led ) const; |
153 | virtual bool setLedState ( OLed led, OLedState st ); | 153 | virtual bool setLedState ( OLed led, OLedState st ); |
154 | 154 | ||
155 | protected: | 155 | protected: |
156 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 156 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
157 | virtual void timerEvent ( QTimerEvent *te ); | 157 | virtual void timerEvent ( QTimerEvent *te ); |
158 | 158 | ||
159 | int m_power_timer; | 159 | int m_power_timer; |
160 | 160 | ||
161 | OLedState m_leds [1]; //FIXME check if really only one | 161 | OLedState m_leds [1]; //FIXME check if really only one |
162 | }; | 162 | }; |
163 | 163 | ||
164 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { | ||
165 | protected: | ||
166 | virtual void init ( ); | ||
167 | virtual void initButtons ( ); | ||
168 | |||
169 | public: | ||
170 | virtual bool setSoftSuspend ( bool soft ); | ||
171 | |||
172 | virtual bool setDisplayStatus( bool on ); | ||
173 | virtual bool setDisplayBrightness ( int b ); | ||
174 | virtual int displayBrightnessResolution ( ) const; | ||
175 | |||
176 | protected: | ||
177 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | ||
178 | virtual void timerEvent ( QTimerEvent *te ); | ||
179 | |||
180 | int m_power_timer; | ||
181 | }; | ||
182 | |||
164 | struct i_button { | 183 | struct i_button { |
165 | uint model; | 184 | uint model; |
166 | Qt::Key code; | 185 | Qt::Key code; |
167 | char *utext; | 186 | char *utext; |
168 | char *pix; | 187 | char *pix; |
169 | char *fpressedservice; | 188 | char *fpressedservice; |
170 | char *fpressedaction; | 189 | char *fpressedaction; |
171 | char *fheldservice; | 190 | char *fheldservice; |
172 | char *fheldaction; | 191 | char *fheldaction; |
173 | } ipaq_buttons [] = { | 192 | } ipaq_buttons [] = { |
174 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, | 193 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, |
175 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 194 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
176 | "devicebuttons/ipaq_calendar", | 195 | "devicebuttons/ipaq_calendar", |
177 | "datebook", "nextView()", | 196 | "datebook", "nextView()", |
178 | "today", "raise()" }, | 197 | "today", "raise()" }, |
179 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, | 198 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, |
180 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 199 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
181 | "devicebuttons/ipaq_contact", | 200 | "devicebuttons/ipaq_contact", |
182 | "addressbook", "raise()", | 201 | "addressbook", "raise()", |
183 | "addressbook", "beamBusinessCard()" }, | 202 | "addressbook", "beamBusinessCard()" }, |
184 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, | 203 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, |
185 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 204 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
186 | "devicebuttons/ipaq_menu", | 205 | "devicebuttons/ipaq_menu", |
187 | "QPE/TaskBar", "toggleMenu()", | 206 | "QPE/TaskBar", "toggleMenu()", |
188 | "QPE/TaskBar", "toggleStartMenu()" }, | 207 | "QPE/TaskBar", "toggleStartMenu()" }, |
189 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx, | 208 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx, |
190 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 209 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
191 | "devicebuttons/ipaq_mail", | 210 | "devicebuttons/ipaq_mail", |
192 | "mail", "raise()", | 211 | "mail", "raise()", |
193 | "mail", "newMail()" }, | 212 | "mail", "newMail()" }, |
194 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, | 213 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, |
195 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 214 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
@@ -293,88 +312,112 @@ struct s_button { | |||
293 | "devicebuttons/simpad_upper_up", | 312 | "devicebuttons/simpad_upper_up", |
294 | "QPE/Launcher", "home()", | 313 | "QPE/Launcher", "home()", |
295 | "buttonsettings", "raise()" }, | 314 | "buttonsettings", "raise()" }, |
296 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 315 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
297 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), | 316 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), |
298 | "devicebuttons/simpad_upper_down", | 317 | "devicebuttons/simpad_upper_down", |
299 | "addressbook", "raise()", | 318 | "addressbook", "raise()", |
300 | "addressbook", "beamBusinessCard()" }, | 319 | "addressbook", "beamBusinessCard()" }, |
301 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 320 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
302 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 321 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
303 | "devicebuttons/simpad_upper_right", | 322 | "devicebuttons/simpad_upper_right", |
304 | "QPE/TaskBar", "toggleMenu()", | 323 | "QPE/TaskBar", "toggleMenu()", |
305 | "QPE/TaskBar", "toggleStartMenu()" }, | 324 | "QPE/TaskBar", "toggleStartMenu()" }, |
306 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 325 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
307 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 326 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), |
308 | "devicebuttons/simpad_upper_left", | 327 | "devicebuttons/simpad_upper_left", |
309 | "QPE/Rotation", "flip()", | 328 | "QPE/Rotation", "flip()", |
310 | "QPE/Rotation", "flip()" }, | 329 | "QPE/Rotation", "flip()" }, |
311 | /* | 330 | /* |
312 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 331 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
313 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 332 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
314 | "devicebuttons/simpad_lower_upper", | 333 | "devicebuttons/simpad_lower_upper", |
315 | "QPE/Launcher", "home()", | 334 | "QPE/Launcher", "home()", |
316 | "buttonsettings", "raise()" }, | 335 | "buttonsettings", "raise()" }, |
317 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 336 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
318 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 337 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
319 | "devicebuttons/simpad_upper_lower", | 338 | "devicebuttons/simpad_upper_lower", |
320 | "QPE/Launcher", "home()", | 339 | "QPE/Launcher", "home()", |
321 | "buttonsettings", "raise()" }, | 340 | "buttonsettings", "raise()" }, |
322 | */ | 341 | */ |
323 | }; | 342 | }; |
324 | 343 | ||
344 | struct r_button { | ||
345 | uint model; | ||
346 | Qt::Key code; | ||
347 | char *utext; | ||
348 | char *pix; | ||
349 | char *fpressedservice; | ||
350 | char *fpressedaction; | ||
351 | char *fheldservice; | ||
352 | char *fheldaction; | ||
353 | } ramses_buttons [] = { | ||
354 | { Model_Ramses_MNCI, | ||
355 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | ||
356 | "devicebuttons/simpad_menu", | ||
357 | "QPE/TaskBar", "toggleMenu()", | ||
358 | "QPE/TaskBar", "toggleStartMenu()" }, | ||
359 | { Model_Ramses_MNCI, | ||
360 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | ||
361 | "devicebuttons/ipaq_home", | ||
362 | "QPE/Launcher", "home()", | ||
363 | "buttonsettings", "raise()" }, | ||
364 | }; | ||
365 | |||
325 | static QCString makeChannel ( const char *str ) | 366 | static QCString makeChannel ( const char *str ) |
326 | { | 367 | { |
327 | if ( str && !::strchr ( str, '/' )) | 368 | if ( str && !::strchr ( str, '/' )) |
328 | return QCString ( "QPE/Application/" ) + str; | 369 | return QCString ( "QPE/Application/" ) + str; |
329 | else | 370 | else |
330 | return str; | 371 | return str; |
331 | } | 372 | } |
332 | 373 | ||
333 | static inline bool isQWS() | 374 | static inline bool isQWS() |
334 | { | 375 | { |
335 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; | 376 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; |
336 | } | 377 | } |
337 | 378 | ||
338 | ODevice *ODevice::inst ( ) | 379 | ODevice *ODevice::inst ( ) |
339 | { | 380 | { |
340 | static ODevice *dev = 0; | 381 | static ODevice *dev = 0; |
341 | 382 | ||
342 | if ( !dev ) { | 383 | if ( !dev ) { |
343 | if ( QFile::exists ( "/proc/hal/model" )) | 384 | if ( QFile::exists ( "/proc/hal/model" )) |
344 | dev = new iPAQ ( ); | 385 | dev = new iPAQ ( ); |
345 | else if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 386 | else if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
346 | dev = new Zaurus ( ); | 387 | dev = new Zaurus ( ); |
347 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) | 388 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) |
348 | dev = new SIMpad ( ); | 389 | dev = new SIMpad ( ); |
390 | else if ( QFile::exists ( "/proc/sys/board/name" )) | ||
391 | dev = new Ramses ( ); | ||
349 | else | 392 | else |
350 | dev = new ODevice ( ); | 393 | dev = new ODevice ( ); |
351 | 394 | ||
352 | dev-> init ( ); | 395 | dev-> init ( ); |
353 | } | 396 | } |
354 | return dev; | 397 | return dev; |
355 | } | 398 | } |
356 | 399 | ||
357 | 400 | ||
358 | /************************************************** | 401 | /************************************************** |
359 | * | 402 | * |
360 | * common | 403 | * common |
361 | * | 404 | * |
362 | **************************************************/ | 405 | **************************************************/ |
363 | 406 | ||
364 | 407 | ||
365 | ODevice::ODevice ( ) | 408 | ODevice::ODevice ( ) |
366 | { | 409 | { |
367 | d = new ODeviceData; | 410 | d = new ODeviceData; |
368 | 411 | ||
369 | d-> m_modelstr = "Unknown"; | 412 | d-> m_modelstr = "Unknown"; |
370 | d-> m_model = Model_Unknown; | 413 | d-> m_model = Model_Unknown; |
371 | d-> m_vendorstr = "Unknown"; | 414 | d-> m_vendorstr = "Unknown"; |
372 | d-> m_vendor = Vendor_Unknown; | 415 | d-> m_vendor = Vendor_Unknown; |
373 | d-> m_systemstr = "Unknown"; | 416 | d-> m_systemstr = "Unknown"; |
374 | d-> m_system = System_Unknown; | 417 | d-> m_system = System_Unknown; |
375 | d-> m_sysverstr = "0.0"; | 418 | d-> m_sysverstr = "0.0"; |
376 | d-> m_rotation = Rot0; | 419 | d-> m_rotation = Rot0; |
377 | d-> m_direction = CW; | 420 | d-> m_direction = CW; |
378 | 421 | ||
379 | d-> m_holdtime = 1000; // 1000ms | 422 | d-> m_holdtime = 1000; // 1000ms |
380 | d-> m_buttons = 0; | 423 | d-> m_buttons = 0; |
@@ -1815,32 +1858,186 @@ bool SIMpad::setDisplayBrightness ( int bright ) | |||
1815 | bright = 255; | 1858 | bright = 255; |
1816 | if ( bright < 0 ) | 1859 | if ( bright < 0 ) |
1817 | bright = 0; | 1860 | bright = 0; |
1818 | 1861 | ||
1819 | if (( fd = ::open ( SIMPAD_BACKLIGHT_CONTROL, O_WRONLY )) >= 0 ) { | 1862 | if (( fd = ::open ( SIMPAD_BACKLIGHT_CONTROL, O_WRONLY )) >= 0 ) { |
1820 | int value = 255 - bright; | 1863 | int value = 255 - bright; |
1821 | const int mask = SIMPAD_BACKLIGHT_MASK; | 1864 | const int mask = SIMPAD_BACKLIGHT_MASK; |
1822 | value = value << 8; | 1865 | value = value << 8; |
1823 | value += mask; | 1866 | value += mask; |
1824 | char writeCommand[100]; | 1867 | char writeCommand[100]; |
1825 | const int count = sprintf( writeCommand, "0x%x\n", value ); | 1868 | const int count = sprintf( writeCommand, "0x%x\n", value ); |
1826 | res = ( ::write ( fd, writeCommand, count ) != -1 ); | 1869 | res = ( ::write ( fd, writeCommand, count ) != -1 ); |
1827 | ::close ( fd ); | 1870 | ::close ( fd ); |
1828 | } | 1871 | } |
1829 | return res; | 1872 | return res; |
1830 | } | 1873 | } |
1831 | 1874 | ||
1832 | 1875 | ||
1833 | int SIMpad::displayBrightnessResolution ( ) const | 1876 | int SIMpad::displayBrightnessResolution ( ) const |
1834 | { | 1877 | { |
1835 | switch ( model ( )) { | 1878 | switch ( model ( )) { |
1836 | case Model_SIMpad_CL4: | 1879 | case Model_SIMpad_CL4: |
1837 | case Model_SIMpad_SL4: | 1880 | case Model_SIMpad_SL4: |
1838 | case Model_SIMpad_SLC: | 1881 | case Model_SIMpad_SLC: |
1839 | case Model_SIMpad_TSinus: | 1882 | case Model_SIMpad_TSinus: |
1840 | return 255; //TODO find out if this is save | 1883 | return 255; //TODO find out if this is save |
1841 | 1884 | ||
1842 | default: | 1885 | default: |
1843 | return 2; | 1886 | return 2; |
1844 | } | 1887 | } |
1845 | } | 1888 | } |
1846 | 1889 | ||
1890 | /************************************************** | ||
1891 | * | ||
1892 | * Ramses | ||
1893 | * | ||
1894 | **************************************************/ | ||
1895 | |||
1896 | void Ramses::init ( ) | ||
1897 | { | ||
1898 | d->m_vendorstr = "M und N"; | ||
1899 | d->m_vendor = Vendor_MundN; | ||
1900 | |||
1901 | QFile f( "/proc/sys/board/ramses" ); | ||
1902 | |||
1903 | d->m_modelstr = "Ramses"; | ||
1904 | d->m_model = Model_Ramses_MNCI; | ||
1905 | |||
1906 | d->m_rotation = Rot180; | ||
1907 | d->m_direction = CCW; | ||
1908 | d->m_holdtime = 1000; | ||
1909 | |||
1910 | f.setName( "/etc/oz_version" ); | ||
1911 | |||
1912 | if ( f.open( IO_ReadOnly )) { | ||
1913 | d->m_systemstr = "OpenEmbedded/Ramses"; | ||
1914 | d->m_system = System_OpenZaurus; | ||
1915 | |||
1916 | QTextStream ts ( &f ); | ||
1917 | ts.setDevice ( &f ); | ||
1918 | d->m_sysverstr = ts.readLine ( ); | ||
1919 | f.close ( ); | ||
1920 | } | ||
1921 | |||
1922 | m_power_timer = 0; | ||
1923 | |||
1924 | } | ||
1925 | |||
1926 | void Ramses::initButtons ( ) | ||
1927 | { | ||
1928 | if ( d->m_buttons ) | ||
1929 | return; | ||
1930 | |||
1931 | if ( isQWS( ) ) | ||
1932 | QWSServer::setKeyboardFilter ( this ); | ||
1933 | |||
1934 | d->m_buttons = new QValueList <ODeviceButton>; | ||
1935 | |||
1936 | for ( uint i = 0; i < ( sizeof( ramses_buttons ) / sizeof( s_button )); i++ ) { | ||
1937 | r_button *rb = ramses_buttons + i; | ||
1938 | ODeviceButton b; | ||
1939 | |||
1940 | if (( rb->model & d->m_model ) == d->m_model ) { | ||
1941 | b.setKeycode( rb->code ); | ||
1942 | b.setUserText( QObject::tr ( "Button", rb->utext )); | ||
1943 | b.setPixmap( Resource::loadPixmap ( rb->pix )); | ||
1944 | b.setFactoryPresetPressedAction( OQCopMessage ( makeChannel ( rb->fpressedservice ), rb->fpressedaction )); | ||
1945 | b.setFactoryPresetHeldAction( OQCopMessage ( makeChannel ( rb->fheldservice ), rb->fheldaction )); | ||
1946 | |||
1947 | d->m_buttons->append( b ); | ||
1948 | } | ||
1949 | } | ||
1950 | reloadButtonMapping(); | ||
1951 | |||
1952 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | ||
1953 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | ||
1954 | } | ||
1955 | |||
1956 | bool Ramses::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) | ||
1957 | { | ||
1958 | //TODO | ||
1959 | return false; | ||
1960 | } | ||
1961 | |||
1962 | void Ramses::timerEvent ( QTimerEvent * ) | ||
1963 | { | ||
1964 | killTimer ( m_power_timer ); | ||
1965 | m_power_timer = 0; | ||
1966 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false ); | ||
1967 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); | ||
1968 | } | ||
1969 | |||
1970 | |||
1971 | bool Ramses::setSoftSuspend ( bool soft ) | ||
1972 | { | ||
1973 | bool res = false; | ||
1974 | int fd; | ||
1975 | |||
1976 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || | ||
1977 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { | ||
1978 | |||
1979 | int sources = ::ioctl ( fd, APM_IOCGEVTSRC, 0 ); // get current event sources | ||
1980 | |||
1981 | if ( sources >= 0 ) { | ||
1982 | if ( soft ) | ||
1983 | sources &= ~APM_EVT_POWER_BUTTON; | ||
1984 | else | ||
1985 | sources |= APM_EVT_POWER_BUTTON; | ||
1986 | |||
1987 | if ( ::ioctl ( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources | ||
1988 | res = true; | ||
1989 | else | ||
1990 | perror ( "APM_IOCGEVTSRC" ); | ||
1991 | } | ||
1992 | else | ||
1993 | perror ( "APM_IOCGEVTSRC" ); | ||
1994 | |||
1995 | ::close ( fd ); | ||
1996 | } | ||
1997 | else | ||
1998 | perror ( "/dev/apm_bios or /dev/misc/apm_bios" ); | ||
1999 | |||
2000 | return res; | ||
2001 | } | ||
2002 | |||
2003 | /** | ||
2004 | * This sets the display on or off | ||
2005 | */ | ||
2006 | bool Ramses::setDisplayStatus ( bool on ) | ||
2007 | { | ||
2008 | bool res = false; | ||
2009 | int fd; | ||
2010 | |||
2011 | if (( fd = ::open ( "/dev/fb/0", O_RDWR )) >= 0 ) { | ||
2012 | res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 ); | ||
2013 | ::close ( fd ); | ||
2014 | } | ||
2015 | return res; | ||
2016 | } | ||
2017 | |||
2018 | |||
2019 | bool Ramses::setDisplayBrightness ( int bright ) | ||
2020 | { | ||
2021 | qDebug( "ODevice for Ramses: setDisplayBrightness( %d )", bright ); | ||
2022 | bool res = false; | ||
2023 | int fd; | ||
2024 | |||
2025 | if ( bright > 255 ) | ||
2026 | bright = 100; | ||
2027 | if ( bright < 0 ) | ||
2028 | bright = 0; | ||
2029 | |||
2030 | if (( fd = ::open ( "/proc/sys/board/pwm0", O_WRONLY )) >= 0 ) { | ||
2031 | char writeCommand[100]; | ||
2032 | const int count = sprintf( writeCommand, "%d\n", bright); | ||
2033 | res = ( ::write ( fd, writeCommand, count ) != -1 ); | ||
2034 | ::close ( fd ); | ||
2035 | } | ||
2036 | return res; | ||
2037 | } | ||
2038 | |||
2039 | |||
2040 | int Ramses::displayBrightnessResolution ( ) const | ||
2041 | { | ||
2042 | return 100; | ||
2043 | } | ||
diff --git a/libopie/odevice.h b/libopie/odevice.h index dcdd4a8..5829440 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -35,75 +35,81 @@ namespace Opie { | |||
35 | /** | 35 | /** |
36 | * The available devices | 36 | * The available devices |
37 | */ | 37 | */ |
38 | enum OModel { | 38 | enum OModel { |
39 | Model_Unknown, // = 0 | 39 | Model_Unknown, // = 0 |
40 | 40 | ||
41 | Model_Series_Mask = 0xff000000, | 41 | Model_Series_Mask = 0xff000000, |
42 | 42 | ||
43 | Model_iPAQ = ( 1 << 24 ), | 43 | Model_iPAQ = ( 1 << 24 ), |
44 | 44 | ||
45 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 45 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
46 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 46 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
47 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 47 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
48 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 48 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
49 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 49 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
50 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 50 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
51 | 51 | ||
52 | Model_Zaurus = ( 2 << 24 ), | 52 | Model_Zaurus = ( 2 << 24 ), |
53 | 53 | ||
54 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 54 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
55 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 55 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
56 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 56 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
57 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 57 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
58 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), | 58 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), |
59 | 59 | ||
60 | Model_SIMpad = ( 3 << 24 ), | 60 | Model_SIMpad = ( 3 << 24 ), |
61 | 61 | ||
62 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 62 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
63 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 63 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
64 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 64 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
65 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 65 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
66 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 66 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
67 | |||
68 | Model_Ramses = ( 4 << 24 ), | ||
69 | |||
70 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | ||
71 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | ||
67 | }; | 72 | }; |
68 | 73 | ||
69 | /** | 74 | /** |
70 | * The vendor of the device | 75 | * The vendor of the device |
71 | */ | 76 | */ |
72 | enum OVendor { | 77 | enum OVendor { |
73 | Vendor_Unknown, | 78 | Vendor_Unknown, |
74 | 79 | ||
75 | Vendor_HP, | 80 | Vendor_HP, |
76 | Vendor_Sharp, | 81 | Vendor_Sharp, |
77 | Vendor_SIEMENS, | 82 | Vendor_SIEMENS, |
83 | Vendor_MundN, | ||
78 | }; | 84 | }; |
79 | 85 | ||
80 | /** | 86 | /** |
81 | * The System used | 87 | * The System used |
82 | */ | 88 | */ |
83 | enum OSystem { | 89 | enum OSystem { |
84 | System_Unknown, | 90 | System_Unknown, |
85 | 91 | ||
86 | System_Familiar, | 92 | System_Familiar, |
87 | System_Zaurus, | 93 | System_Zaurus, |
88 | System_OpenZaurus | 94 | System_OpenZaurus |
89 | }; | 95 | }; |
90 | 96 | ||
91 | enum OLedState { | 97 | enum OLedState { |
92 | Led_Off, | 98 | Led_Off, |
93 | Led_On, | 99 | Led_On, |
94 | Led_BlinkSlow, | 100 | Led_BlinkSlow, |
95 | Led_BlinkFast | 101 | Led_BlinkFast |
96 | }; | 102 | }; |
97 | 103 | ||
98 | enum OLed { | 104 | enum OLed { |
99 | Led_Mail, | 105 | Led_Mail, |
100 | Led_Power, | 106 | Led_Power, |
101 | Led_BlueTooth | 107 | Led_BlueTooth |
102 | }; | 108 | }; |
103 | 109 | ||
104 | enum OHardKey { | 110 | enum OHardKey { |
105 | HardKey_Datebook = Qt::Key_F9, | 111 | HardKey_Datebook = Qt::Key_F9, |
106 | HardKey_Contacts = Qt::Key_F10, | 112 | HardKey_Contacts = Qt::Key_F10, |
107 | HardKey_Menu = Qt::Key_F11, | 113 | HardKey_Menu = Qt::Key_F11, |
108 | HardKey_Home = Qt::Key_F12, | 114 | HardKey_Home = Qt::Key_F12, |
109 | HardKey_Mail = Qt::Key_F13, | 115 | HardKey_Mail = Qt::Key_F13, |