From b7b5f68bb0c603a72e0f269215ed92dd89498e0f Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 15 Aug 2004 13:35:35 +0000 Subject: -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 --- (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') 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,27 +1,27 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team +                 This file is part of the Opie Project +              Copyright (C) The Opie Team =. .=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_,=:_. -`: 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_,=:_.      -`: 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. @@ -306,14 +306,19 @@ bool SIMpad::suspend() // Must override because SIMpad does NOT have apm 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; } -- cgit v0.9.0.2