author | zecke <zecke> | 2004-08-15 13:35:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-15 13:35:35 (UTC) |
commit | b7b5f68bb0c603a72e0f269215ed92dd89498e0f (patch) (side-by-side diff) | |
tree | e5de7a15ff5e5dd9a19e9d0fd3b3878ac43e1c75 /libopie2/opiecore/device/odevice_simpad.cpp | |
parent | 2fa72eb5697fef6a58b3ff8cec8489d0b870883d (diff) | |
download | opie-b7b5f68bb0c603a72e0f269215ed92dd89498e0f.zip opie-b7b5f68bb0c603a72e0f269215ed92dd89498e0f.tar.gz opie-b7b5f68bb0c603a72e0f269215ed92dd89498e0f.tar.bz2 |
-Use APM for the SIMpad now that it got the APM biosless patch
applied as well
- We save the screen content, call the ODevice implementation
and on wake up we restore the content
Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (show 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 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> + This file is part of the Opie Project + Copyright (C) The Opie Team <opie-devel@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "odevice_simpad.h" /* QT */ #include <qapplication.h> #include <qfile.h> #include <qtextstream.h> #include <qwindowsystem_qws.h> @@ -297,32 +297,37 @@ void SIMpad::playAlarmSound() ::close ( fd ); } #endif } bool SIMpad::suspend() // Must override because SIMpad does NOT have apm { qDebug( "ODevice for SIMpad: suspend()" ); if ( !isQWS( ) ) // only qwsserver is allowed to suspend return false; - bool res = false; - ODevice::sendSuspendmsg(); - - struct timeval tvs, tvn; - ::gettimeofday ( &tvs, 0 ); + /* + * we need to save the screen content + * then go to suspend using ODevice::suspend + * and finally restore the screen content + */ + (void)::system( "cat /dev/fb/0 > /tmp/.buffer" ); + bool res = ODevice::suspend(); - ::sync(); // flush fs caches - res = ( ::system ( "cat /dev/fb/0 >/tmp/.buffer; echo > /proc/sys/pm/suspend; cat /tmp/.buffer >/dev/fb/0" ) == 0 ); //TODO make better :) + /* + * restore + */ + if ( res ) + ::system( "cat /tmp/.buffer > /dev/fb/0" ); return res; } bool SIMpad::setSoftSuspend ( bool soft ) { qDebug( "ODevice for SIMpad: UNHANDLED setSoftSuspend(%s)", soft? "on" : "off" ); return false; } |