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 | |
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
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 44 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 61 |
2 files changed, 55 insertions, 50 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index cd3a84c..835586e 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -1,28 +1,28 @@ /* - 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. */ @@ -146,9 +146,9 @@ ODevice *ODevice::inst() else { qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); } - if ( !dev ) dev = new ODevice(); + if ( !dev ) dev = new Internal::Zaurus(); dev->init(cpu_info); } return dev; } 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,28 +1,28 @@ /* - 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. */ @@ -305,16 +305,21 @@ 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; } |