Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 6193ddc..9e01a0c 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -144,99 +144,96 @@ void iPAQ::init(const QString& model) | |||
144 | case Model_iPAQ_H38xx: | 144 | case Model_iPAQ_H38xx: |
145 | d->m_rotation = Rot90; | 145 | d->m_rotation = Rot90; |
146 | break; | 146 | break; |
147 | case Model_iPAQ_H5xxx: | 147 | case Model_iPAQ_H5xxx: |
148 | case Model_iPAQ_H22xx: | 148 | case Model_iPAQ_H22xx: |
149 | d->m_rotation = Rot0; | 149 | d->m_rotation = Rot0; |
150 | break; | 150 | break; |
151 | case Model_iPAQ_H36xx: | 151 | case Model_iPAQ_H36xx: |
152 | case Model_iPAQ_H37xx: | 152 | case Model_iPAQ_H37xx: |
153 | case Model_iPAQ_H39xx: | 153 | case Model_iPAQ_H39xx: |
154 | default: | 154 | default: |
155 | d->m_rotation = Rot270; | 155 | d->m_rotation = Rot270; |
156 | break; | 156 | break; |
157 | 157 | ||
158 | } | 158 | } |
159 | 159 | ||
160 | m_leds [0] = m_leds [1] = Led_Off; | 160 | m_leds [0] = m_leds [1] = Led_Off; |
161 | 161 | ||
162 | m_power_timer = 0; | 162 | m_power_timer = 0; |
163 | 163 | ||
164 | } | 164 | } |
165 | 165 | ||
166 | void iPAQ::initButtons() | 166 | void iPAQ::initButtons() |
167 | { | 167 | { |
168 | if ( d->m_buttons ) | 168 | if ( d->m_buttons ) |
169 | return; | 169 | return; |
170 | 170 | ||
171 | if ( isQWS( ) ) { | 171 | if ( isQWS( ) ) { |
172 | addPreHandler(this); | 172 | addPreHandler(this); |
173 | } | 173 | } |
174 | 174 | ||
175 | d->m_buttons = new QValueList <ODeviceButton>; | 175 | d->m_buttons = new QValueList <ODeviceButton>; |
176 | 176 | ||
177 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { | 177 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { |
178 | i_button *ib = ipaq_buttons + i; | 178 | i_button *ib = ipaq_buttons + i; |
179 | ODeviceButton b; | 179 | ODeviceButton b; |
180 | 180 | ||
181 | if (( ib->model & d->m_model ) == d->m_model ) { | 181 | if (( ib->model & d->m_model ) == d->m_model ) { |
182 | b. setKeycode ( ib->code ); | 182 | b. setKeycode ( ib->code ); |
183 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 183 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
184 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 184 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); |
185 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 185 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
186 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 186 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
187 | 187 | ||
188 | d->m_buttons->append ( b ); | 188 | d->m_buttons->append ( b ); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | reloadButtonMapping(); | 191 | reloadButtonMapping(); |
192 | |||
193 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | ||
194 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | ||
195 | } | 192 | } |
196 | 193 | ||
197 | QValueList <OLed> iPAQ::ledList() const | 194 | QValueList <OLed> iPAQ::ledList() const |
198 | { | 195 | { |
199 | QValueList <OLed> vl; | 196 | QValueList <OLed> vl; |
200 | vl << Led_Power; | 197 | vl << Led_Power; |
201 | 198 | ||
202 | if ( d->m_model == Model_iPAQ_H38xx ) | 199 | if ( d->m_model == Model_iPAQ_H38xx ) |
203 | vl << Led_BlueTooth; | 200 | vl << Led_BlueTooth; |
204 | return vl; | 201 | return vl; |
205 | } | 202 | } |
206 | 203 | ||
207 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const | 204 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const |
208 | { | 205 | { |
209 | QValueList <OLedState> vl; | 206 | QValueList <OLedState> vl; |
210 | 207 | ||
211 | if ( l == Led_Power ) | 208 | if ( l == Led_Power ) |
212 | vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast; | 209 | vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast; |
213 | else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx ) | 210 | else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx ) |
214 | vl << Led_Off; // << Led_On << ??? | 211 | vl << Led_Off; // << Led_On << ??? |
215 | 212 | ||
216 | return vl; | 213 | return vl; |
217 | } | 214 | } |
218 | 215 | ||
219 | OLedState iPAQ::ledState ( OLed l ) const | 216 | OLedState iPAQ::ledState ( OLed l ) const |
220 | { | 217 | { |
221 | switch ( l ) { | 218 | switch ( l ) { |
222 | case Led_Power: | 219 | case Led_Power: |
223 | return m_leds [0]; | 220 | return m_leds [0]; |
224 | case Led_BlueTooth: | 221 | case Led_BlueTooth: |
225 | return m_leds [1]; | 222 | return m_leds [1]; |
226 | default: | 223 | default: |
227 | return Led_Off; | 224 | return Led_Off; |
228 | } | 225 | } |
229 | } | 226 | } |
230 | 227 | ||
231 | bool iPAQ::setLedState ( OLed l, OLedState st ) | 228 | bool iPAQ::setLedState ( OLed l, OLedState st ) |
232 | { | 229 | { |
233 | static int fd = ::open ( "/dev/touchscreen/0", O_RDWR | O_NONBLOCK ); | 230 | static int fd = ::open ( "/dev/touchscreen/0", O_RDWR | O_NONBLOCK ); |
234 | 231 | ||
235 | if ( l == Led_Power ) { | 232 | if ( l == Led_Power ) { |
236 | if ( fd >= 0 ) { | 233 | if ( fd >= 0 ) { |
237 | LED_IN leds; | 234 | LED_IN leds; |
238 | ::memset ( &leds, 0, sizeof( leds )); | 235 | ::memset ( &leds, 0, sizeof( leds )); |
239 | leds. TotalTime = 0; | 236 | leds. TotalTime = 0; |
240 | leds. OnTime = 0; | 237 | leds. OnTime = 0; |
241 | leds. OffTime = 1; | 238 | leds. OffTime = 1; |
242 | leds. OffOnBlink = 2; | 239 | leds. OffOnBlink = 2; |