Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index bf46e43..c6de614 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -1,36 +1,36 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
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; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
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 | #include "odevice_simpad.h" | 30 | #include "odevice_simpad.h" |
31 | 31 | ||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
@@ -297,32 +297,37 @@ void SIMpad::playAlarmSound() | |||
297 | ::close ( fd ); | 297 | ::close ( fd ); |
298 | } | 298 | } |
299 | #endif | 299 | #endif |
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | bool SIMpad::suspend() // Must override because SIMpad does NOT have apm | 303 | bool SIMpad::suspend() // Must override because SIMpad does NOT have apm |
304 | { | 304 | { |
305 | qDebug( "ODevice for SIMpad: suspend()" ); | 305 | qDebug( "ODevice for SIMpad: suspend()" ); |
306 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 306 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
307 | return false; | 307 | return false; |
308 | 308 | ||
309 | bool res = false; | 309 | /* |
310 | ODevice::sendSuspendmsg(); | 310 | * we need to save the screen content |
311 | 311 | * then go to suspend using ODevice::suspend | |
312 | struct timeval tvs, tvn; | 312 | * and finally restore the screen content |
313 | ::gettimeofday ( &tvs, 0 ); | 313 | */ |
314 | (void)::system( "cat /dev/fb/0 > /tmp/.buffer" ); | ||
315 | bool res = ODevice::suspend(); | ||
314 | 316 | ||
315 | ::sync(); // flush fs caches | 317 | /* |
316 | res = ( ::system ( "cat /dev/fb/0 >/tmp/.buffer; echo > /proc/sys/pm/suspend; cat /tmp/.buffer >/dev/fb/0" ) == 0 ); //TODO make better :) | 318 | * restore |
319 | */ | ||
320 | if ( res ) | ||
321 | ::system( "cat /tmp/.buffer > /dev/fb/0" ); | ||
317 | 322 | ||
318 | return res; | 323 | return res; |
319 | } | 324 | } |
320 | 325 | ||
321 | 326 | ||
322 | bool SIMpad::setSoftSuspend ( bool soft ) | 327 | bool SIMpad::setSoftSuspend ( bool soft ) |
323 | { | 328 | { |
324 | qDebug( "ODevice for SIMpad: UNHANDLED setSoftSuspend(%s)", soft? "on" : "off" ); | 329 | qDebug( "ODevice for SIMpad: UNHANDLED setSoftSuspend(%s)", soft? "on" : "off" ); |
325 | return false; | 330 | return false; |
326 | } | 331 | } |
327 | 332 | ||
328 | 333 | ||