Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index bf30bc6..8a66f9c 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -4,148 +4,151 @@ | |||
4 | =. Copyright (C) 2002-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> | 4 | =. Copyright (C) 2002-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; version 2 of the License. | 11 | - . .-<_> .<> Foundation; version 2 of the License. |
12 | ._= =} : | 12 | ._= =} : |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_ZAURUS | 30 | #ifndef ODEVICE_ZAURUS |
31 | #define ODEVICE_ZAURUS | 31 | #define ODEVICE_ZAURUS |
32 | 32 | ||
33 | #include "odevice_abstractmobiledevice.h" | 33 | #include "odevice_abstractmobiledevice.h" |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qfile.h> | 36 | #include <qfile.h> |
37 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | 38 | ||
39 | #ifndef ARRAY_SIZE | 39 | #ifndef ARRAY_SIZE |
40 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 40 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | // _IO and friends are only defined in kernel headers ... | 43 | // _IO and friends are only defined in kernel headers ... |
44 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 44 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
45 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 45 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
46 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 46 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
47 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 47 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
48 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 48 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
49 | 49 | ||
50 | // Audio | 50 | // Audio |
51 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | 51 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 |
52 | 52 | ||
53 | #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 53 | #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
54 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 54 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
55 | 55 | ||
56 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 56 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
57 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 57 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
58 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 58 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
59 | 59 | ||
60 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | 60 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) |
61 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | 61 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) |
62 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | 62 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) |
63 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | 63 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) |
64 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | 64 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) |
65 | 65 | ||
66 | // LED | 66 | // LED |
67 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 67 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
68 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 68 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
69 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ | 69 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ |
70 | 70 | ||
71 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ | 71 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ |
72 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ | 72 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ |
73 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ | 73 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ |
74 | 74 | ||
75 | // Rotation and Power Management | 75 | // Rotation and Power Management |
76 | #define SHARP_IOCTL_GET_ROTATION 0x413c | 76 | #define SHARP_IOCTL_GET_ROTATION 0x413c |
77 | 77 | ||
78 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) | 78 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) |
79 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) | 79 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) |
80 | #define APM_EVT_POWER_BUTTON (1 << 0) | 80 | #define APM_EVT_POWER_BUTTON (1 << 0) |
81 | 81 | ||
82 | // Brightness Embedix | 82 | // Brightness Embedix |
83 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" | 83 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" |
84 | #define SHARP_FL_IOCTL_ON 1 | 84 | #define SHARP_FL_IOCTL_ON 1 |
85 | #define SHARP_FL_IOCTL_OFF 2 | 85 | #define SHARP_FL_IOCTL_OFF 2 |
86 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 | 86 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 |
87 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 | 87 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 |
88 | #define SHARP_FL_IOCTL_GET_STEP 102 | 88 | #define SHARP_FL_IOCTL_GET_STEP 102 |
89 | 89 | ||
90 | // Vesa Standard | 90 | // Vesa Standard |
91 | #define FB_BLANK_UNBLANK 0 | 91 | #define FB_BLANK_UNBLANK 0 |
92 | #define FB_BLANK_POWERDOWN 4 | 92 | #define FB_BLANK_POWERDOWN 4 |
93 | 93 | ||
94 | namespace Opie { | 94 | namespace Opie { |
95 | namespace Core { | 95 | namespace Core { |
96 | namespace Internal { | 96 | namespace Internal { |
97 | 97 | ||
98 | class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter | 98 | class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter |
99 | { | 99 | { |
100 | Q_OBJECT | ||
101 | |||
100 | protected: | 102 | protected: |
101 | virtual void init(const QString&); | 103 | virtual void init(const QString&); |
102 | virtual void initButtons(); | 104 | virtual void initButtons(); |
103 | void initHingeSensor(); | 105 | void initHingeSensor(); |
104 | 106 | ||
105 | protected slots: | 107 | protected slots: |
106 | void hingeSensorTriggered(); | 108 | void hingeSensorTriggered(); |
109 | void systemMessage( const QCString &msg, const QByteArray & ); | ||
107 | 110 | ||
108 | public: | 111 | public: |
109 | virtual bool setDisplayBrightness( int b ); | 112 | virtual bool setDisplayBrightness( int b ); |
110 | virtual bool setDisplayStatus( bool on ); | 113 | virtual bool setDisplayStatus( bool on ); |
111 | virtual int displayBrightnessResolution() const; | 114 | virtual int displayBrightnessResolution() const; |
112 | 115 | ||
113 | virtual void playAlarmSound(); | 116 | virtual void playAlarmSound(); |
114 | virtual void playKeySound(); | 117 | virtual void playKeySound(); |
115 | virtual void playTouchSound(); | 118 | virtual void playTouchSound(); |
116 | 119 | ||
117 | virtual QValueList <OLed> ledList() const; | 120 | virtual QValueList <OLed> ledList() const; |
118 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 121 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
119 | virtual OLedState ledState( OLed led ) const; | 122 | virtual OLedState ledState( OLed led ) const; |
120 | virtual bool setLedState( OLed led, OLedState st ); | 123 | virtual bool setLedState( OLed led, OLedState st ); |
121 | 124 | ||
122 | virtual bool hasHingeSensor() const; | 125 | virtual bool hasHingeSensor() const; |
123 | virtual OHingeStatus readHingeSensor() const; | 126 | virtual OHingeStatus readHingeSensor() const; |
124 | 127 | ||
125 | virtual Transformation rotation() const; | 128 | virtual Transformation rotation() const; |
126 | virtual ODirection direction() const; | 129 | virtual ODirection direction() const; |
127 | virtual bool suspend(); | 130 | virtual bool suspend(); |
128 | 131 | ||
129 | protected: | 132 | protected: |
130 | virtual void buzzer( int snd ); | 133 | virtual void buzzer( int snd ); |
131 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 134 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
132 | 135 | ||
133 | QString m_backlightdev; | 136 | QString m_backlightdev; |
134 | OLedState m_leds[1]; | 137 | OLedState m_leds[1]; |
135 | bool m_embedix; | 138 | bool m_embedix; |
136 | QFile m_hinge; | 139 | QFile m_hinge; |
137 | }; | 140 | }; |
138 | 141 | ||
139 | struct z_button { | 142 | struct z_button { |
140 | Qt::Key code; | 143 | Qt::Key code; |
141 | char *utext; | 144 | char *utext; |
142 | char *pix; | 145 | char *pix; |
143 | char *fpressedservice; | 146 | char *fpressedservice; |
144 | char *fpressedaction; | 147 | char *fpressedaction; |
145 | char *fheldservice; | 148 | char *fheldservice; |
146 | char *fheldaction; | 149 | char *fheldaction; |
147 | }; | 150 | }; |
148 | } | 151 | } |
149 | } | 152 | } |
150 | } | 153 | } |
151 | #endif | 154 | #endif |