Diffstat (limited to 'libopie2/opiecore/device/odevice_yopy.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.cpp | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index 8f22514..f81e452 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp | |||
@@ -1,67 +1,69 @@ | |||
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 | |
4 | =. | 4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | =. |
6 | .>+-= | 6 | .=l. |
7 | _;:, .> :=|. This program is free software; you can | 7 | Â Â Â Â Â Â .>+-= |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
12 | ._= =} : or (at your option) any later version. | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
13 | .%`+i> _;_. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | Â Â .%`+i> Â Â Â _;_. |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
16 | : .. .:, . . . without even the implied warranty of | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | ..}^=.= = ; Library General Public License for more | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ++= -. .` .: details. | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
21 | : = ...= . :.=- | 21 | ++= Â -. Â Â .` Â Â .: details. |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | : Â Â = Â ...= . :.=- |
23 | -_. . . )=. = Library General Public License along with | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
25 | If not, write to the Free Software Foundation, | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
26 | Inc., 59 Temple Place - Suite 330, | 26 | If not, write to the Free Software Foundation, |
27 | Boston, MA 02111-1307, USA. | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | ||
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_yopy.h" | 31 | #include "odevice_yopy.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | #include <opie2/oresource.h> | ||
45 | |||
44 | /* STD */ | 46 | /* STD */ |
45 | #include <fcntl.h> | 47 | #include <fcntl.h> |
46 | #include <math.h> | 48 | #include <math.h> |
47 | #include <stdlib.h> | 49 | #include <stdlib.h> |
48 | #include <signal.h> | 50 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 51 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 52 | #include <sys/time.h> |
51 | #include <unistd.h> | 53 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 54 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 55 | #include <linux/soundcard.h> |
54 | #endif | 56 | #endif |
55 | 57 | ||
56 | using namespace Opie::Core; | 58 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Internal; | 59 | using namespace Opie::Core::Internal; |
58 | 60 | ||
59 | struct yopy_button yopy_buttons [] = { | 61 | struct yopy_button yopy_buttons [] = { |
60 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), | 62 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), |
61 | "devicebuttons/yopy_action", | 63 | "devicebuttons/yopy_action", |
62 | "datebook", "nextView()", | 64 | "datebook", "nextView()", |
63 | "today", "raise()" }, | 65 | "today", "raise()" }, |
64 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), | 66 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), |
65 | "devicebuttons/yopy_ok", | 67 | "devicebuttons/yopy_ok", |
66 | "addressbook", "raise()", | 68 | "addressbook", "raise()", |
67 | "addressbook", "beamBusinessCard()" }, | 69 | "addressbook", "beamBusinessCard()" }, |
@@ -79,49 +81,49 @@ void Yopy::init(const QString&) | |||
79 | d->m_model = Model_Yopy_3700; | 81 | d->m_model = Model_Yopy_3700; |
80 | d->m_rotation = Rot0; | 82 | d->m_rotation = Rot0; |
81 | d->m_systemstr = "Linupy"; | 83 | d->m_systemstr = "Linupy"; |
82 | d->m_system = System_Linupy; | 84 | d->m_system = System_Linupy; |
83 | // Distribution detection code now in the base class | 85 | // Distribution detection code now in the base class |
84 | } | 86 | } |
85 | 87 | ||
86 | 88 | ||
87 | void Yopy::initButtons() | 89 | void Yopy::initButtons() |
88 | { | 90 | { |
89 | if ( d->m_buttons ) | 91 | if ( d->m_buttons ) |
90 | return ; | 92 | return ; |
91 | 93 | ||
92 | d->m_buttons = new QValueList <ODeviceButton>; | 94 | d->m_buttons = new QValueList <ODeviceButton>; |
93 | 95 | ||
94 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) | 96 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) |
95 | { | 97 | { |
96 | 98 | ||
97 | yopy_button *ib = yopy_buttons + i; | 99 | yopy_button *ib = yopy_buttons + i; |
98 | 100 | ||
99 | ODeviceButton b; | 101 | ODeviceButton b; |
100 | 102 | ||
101 | b. setKeycode ( ib->code ); | 103 | b. setKeycode ( ib->code ); |
102 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); | 104 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); |
103 | b. setPixmap ( Resource::loadPixmap ( ib->pix ) ); | 105 | b. setPixmap ( OResource::loadPixmap ( ib->pix ) ); |
104 | b. setFactoryPresetPressedAction | 106 | b. setFactoryPresetPressedAction |
105 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); | 107 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); |
106 | b. setFactoryPresetHeldAction | 108 | b. setFactoryPresetHeldAction |
107 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); | 109 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); |
108 | 110 | ||
109 | d->m_buttons->append ( b ); | 111 | d->m_buttons->append ( b ); |
110 | } | 112 | } |
111 | reloadButtonMapping(); | 113 | reloadButtonMapping(); |
112 | } | 114 | } |
113 | 115 | ||
114 | 116 | ||
115 | bool Yopy::suspend() | 117 | bool Yopy::suspend() |
116 | { | 118 | { |
117 | /* Opie for Yopy does not implement its own power management at the | 119 | /* Opie for Yopy does not implement its own power management at the |
118 | moment. The public version runs parallel to X, and relies on the | 120 | moment. The public version runs parallel to X, and relies on the |
119 | existing power management features. */ | 121 | existing power management features. */ |
120 | return false; | 122 | return false; |
121 | } | 123 | } |
122 | 124 | ||
123 | 125 | ||
124 | bool Yopy::setDisplayBrightness( int bright ) | 126 | bool Yopy::setDisplayBrightness( int bright ) |
125 | { | 127 | { |
126 | /* The code here works, but is disabled as the current version runs | 128 | /* The code here works, but is disabled as the current version runs |
127 | parallel to X, and relies on the existing backlight demon. */ | 129 | parallel to X, and relies on the existing backlight demon. */ |