Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 8f5be8b..e4233eb 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -1,342 +1,344 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | =. (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> | 3 | =. (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> |
4 | .=l. | 4 | .=l. |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This program is free software; you can | 6 | _;:, .> :=|. This program is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; version 2 of the License. | 10 | - . .-<_> .<> Foundation; version 2 of the License. |
11 | ._= =} : | 11 | ._= =} : |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This program is distributed in the hope that | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | 30 | ||
31 | #include "odevice_beagle.h" | 31 | #include "odevice_beagle.h" |
32 | #include "odevice_ipaq.h" | 32 | #include "odevice_ipaq.h" |
33 | #include "odevice_mypal.h" | 33 | #include "odevice_mypal.h" |
34 | #include "odevice_jornada.h" | 34 | #include "odevice_jornada.h" |
35 | #include "odevice_ramses.h" | 35 | #include "odevice_ramses.h" |
36 | #include "odevice_simpad.h" | 36 | #include "odevice_simpad.h" |
37 | #include "odevice_yopy.h" | 37 | #include "odevice_yopy.h" |
38 | #include "odevice_zaurus.h" | 38 | #include "odevice_zaurus.h" |
39 | #include "odevice_genuineintel.h" | 39 | #include "odevice_genuineintel.h" |
40 | #include "odevice_htc.h" | 40 | #include "odevice_htc.h" |
41 | #include "odevice_motorola_ezx.h" | 41 | #include "odevice_motorola_ezx.h" |
42 | #include "odevice_palm.h" | ||
42 | 43 | ||
43 | /* QT */ | 44 | /* QT */ |
44 | #include <qapplication.h> | 45 | #include <qapplication.h> |
45 | #include <qfile.h> | 46 | #include <qfile.h> |
46 | #include <qtextstream.h> | 47 | #include <qtextstream.h> |
47 | #include <qwindowsystem_qws.h> | 48 | #include <qwindowsystem_qws.h> |
48 | 49 | ||
49 | /* OPIE */ | 50 | /* OPIE */ |
50 | #include <qpe/config.h> | 51 | #include <qpe/config.h> |
51 | #include <qpe/sound.h> | 52 | #include <qpe/sound.h> |
52 | #include <qpe/qcopenvelope_qws.h> | 53 | #include <qpe/qcopenvelope_qws.h> |
53 | #include <qpe/sound.h> | 54 | #include <qpe/sound.h> |
54 | 55 | ||
55 | #include <opie2/okeyfilter.h> | 56 | #include <opie2/okeyfilter.h> |
56 | #include <opie2/oresource.h> | 57 | #include <opie2/oresource.h> |
57 | 58 | ||
58 | /* STD */ | 59 | /* STD */ |
59 | #include <fcntl.h> | 60 | #include <fcntl.h> |
60 | #include <math.h> | 61 | #include <math.h> |
61 | #include <stdlib.h> | 62 | #include <stdlib.h> |
62 | #include <signal.h> | 63 | #include <signal.h> |
63 | #include <sys/ioctl.h> | 64 | #include <sys/ioctl.h> |
64 | #include <sys/time.h> | 65 | #include <sys/time.h> |
65 | #include <unistd.h> | 66 | #include <unistd.h> |
66 | #ifndef QT_NO_SOUND | 67 | #ifndef QT_NO_SOUND |
67 | #include <linux/soundcard.h> | 68 | #include <linux/soundcard.h> |
68 | #endif | 69 | #endif |
69 | 70 | ||
70 | namespace Opie { | 71 | namespace Opie { |
71 | namespace Core { | 72 | namespace Core { |
72 | 73 | ||
73 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 74 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
74 | 75 | ||
75 | 76 | ||
76 | /* STATIC and common implementation */ | 77 | /* STATIC and common implementation */ |
77 | /* EXPORT */ ODistribution distributions[] = { | 78 | /* EXPORT */ ODistribution distributions[] = { |
78 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, | 79 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, |
79 | { System_OpenZaurus, "OpenZaurus", "/etc/openzaurus-version" }, | 80 | { System_OpenZaurus, "OpenZaurus", "/etc/openzaurus-version" }, |
80 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, | 81 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, |
81 | { System_Unknown, "Linux", "/etc/issue" }, | 82 | { System_Unknown, "Linux", "/etc/issue" }, |
82 | }; | 83 | }; |
83 | 84 | ||
84 | 85 | ||
85 | /* EXPORT */ bool isQWS(){ | 86 | /* EXPORT */ bool isQWS(){ |
86 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; | 87 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; |
87 | } | 88 | } |
88 | 89 | ||
89 | /* EXPORT */ QCString makeChannel ( const char *str ){ | 90 | /* EXPORT */ QCString makeChannel ( const char *str ){ |
90 | if ( str && !::strchr ( str, '/' )) | 91 | if ( str && !::strchr ( str, '/' )) |
91 | return QCString ( "QPE/Application/" ) + str; | 92 | return QCString ( "QPE/Application/" ) + str; |
92 | else | 93 | else |
93 | return str; | 94 | return str; |
94 | } | 95 | } |
95 | 96 | ||
96 | 97 | ||
97 | 98 | ||
98 | /* Now the default implementation of ODevice */ | 99 | /* Now the default implementation of ODevice */ |
99 | 100 | ||
100 | struct default_button default_buttons [] = { | 101 | struct default_button default_buttons [] = { |
101 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 102 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
102 | "devicebuttons/z_calendar", | 103 | "devicebuttons/z_calendar", |
103 | "datebook", "nextView()", | 104 | "datebook", "nextView()", |
104 | "today", "raise()" }, | 105 | "today", "raise()" }, |
105 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 106 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
106 | "devicebuttons/z_contact", | 107 | "devicebuttons/z_contact", |
107 | "addressbook", "raise()", | 108 | "addressbook", "raise()", |
108 | "addressbook", "beamBusinessCard()" }, | 109 | "addressbook", "beamBusinessCard()" }, |
109 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 110 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
110 | "devicebuttons/z_home", | 111 | "devicebuttons/z_home", |
111 | "QPE/Launcher", "home()", | 112 | "QPE/Launcher", "home()", |
112 | "buttonsettings", "raise()" }, | 113 | "buttonsettings", "raise()" }, |
113 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 114 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
114 | "devicebuttons/z_menu", | 115 | "devicebuttons/z_menu", |
115 | "QPE/TaskBar", "toggleMenu()", | 116 | "QPE/TaskBar", "toggleMenu()", |
116 | "QPE/TaskBar", "toggleStartMenu()" }, | 117 | "QPE/TaskBar", "toggleStartMenu()" }, |
117 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 118 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
118 | "devicebuttons/z_mail", | 119 | "devicebuttons/z_mail", |
119 | "opiemail", "raise()", | 120 | "opiemail", "raise()", |
120 | "opiemail", "newMail()" }, | 121 | "opiemail", "newMail()" }, |
121 | }; | 122 | }; |
122 | 123 | ||
123 | ODevice *ODevice::inst() | 124 | ODevice *ODevice::inst() |
124 | { | 125 | { |
125 | static ODevice *dev = 0; | 126 | static ODevice *dev = 0; |
126 | QString cpu_info; | 127 | QString cpu_info; |
127 | 128 | ||
128 | if ( !dev ) | 129 | if ( !dev ) |
129 | { | 130 | { |
130 | QFile f( PATH_PROC_CPUINFO ); | 131 | QFile f( PATH_PROC_CPUINFO ); |
131 | if ( f.open( IO_ReadOnly ) ) | 132 | if ( f.open( IO_ReadOnly ) ) |
132 | { | 133 | { |
133 | QTextStream s( &f ); | 134 | QTextStream s( &f ); |
134 | while ( !s.atEnd() ) | 135 | while ( !s.atEnd() ) |
135 | { | 136 | { |
136 | QString line; | 137 | QString line; |
137 | line = s.readLine(); | 138 | line = s.readLine(); |
138 | if ( line.startsWith( "Hardware" ) ) | 139 | if ( line.startsWith( "Hardware" ) ) |
139 | { | 140 | { |
140 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 141 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
141 | cpu_info = line; | 142 | cpu_info = line; |
142 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); | 143 | if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); |
143 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); | 144 | else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); |
144 | else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal(); | 145 | else if ( line.contains( "mypal", false ) ) dev = new Internal::MyPal(); |
145 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); | 146 | else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); |
146 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); | 147 | else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); |
147 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); | 148 | else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); |
148 | else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); | 149 | else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); |
149 | else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC(); | 150 | else if ( line.contains( "HTC", false ) ) dev = new Internal::HTC(); |
150 | else if ( line.contains( "Motorola", false ) ) dev = new Internal::Motorola_EZX(); | 151 | else if ( line.contains( "Motorola", false ) ) dev = new Internal::Motorola_EZX(); |
152 | else if ( line.contains( "Palm", false ) ) dev = new Internal::Palm(); | ||
151 | 153 | ||
152 | else qWarning( "ODevice() - unknown hardware - using default." ); | 154 | else qWarning( "ODevice() - unknown hardware - using default." ); |
153 | break; | 155 | break; |
154 | } else if ( line.startsWith( "vendor_id" ) ) { | 156 | } else if ( line.startsWith( "vendor_id" ) ) { |
155 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 157 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
156 | cpu_info = line; | 158 | cpu_info = line; |
157 | if( line.contains( "genuineintel", false ) ) { | 159 | if( line.contains( "genuineintel", false ) ) { |
158 | dev = new Internal::GenuineIntel(); | 160 | dev = new Internal::GenuineIntel(); |
159 | break; | 161 | break; |
160 | } | 162 | } |
161 | } | 163 | } |
162 | } | 164 | } |
163 | } | 165 | } |
164 | else | 166 | else |
165 | { | 167 | { |
166 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); | 168 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); |
167 | } | 169 | } |
168 | if ( !dev ) dev = new ODevice(); | 170 | if ( !dev ) dev = new ODevice(); |
169 | dev->init(cpu_info); | 171 | dev->init(cpu_info); |
170 | } | 172 | } |
171 | return dev; | 173 | return dev; |
172 | } | 174 | } |
173 | 175 | ||
174 | ODevice::ODevice() | 176 | ODevice::ODevice() |
175 | { | 177 | { |
176 | d = new ODeviceData; | 178 | d = new ODeviceData; |
177 | 179 | ||
178 | d->m_modelstr = "Unknown"; | 180 | d->m_modelstr = "Unknown"; |
179 | d->m_model = Model_Unknown; | 181 | d->m_model = Model_Unknown; |
180 | d->m_vendorstr = "Unknown"; | 182 | d->m_vendorstr = "Unknown"; |
181 | d->m_vendor = Vendor_Unknown; | 183 | d->m_vendor = Vendor_Unknown; |
182 | d->m_systemstr = "Unknown"; | 184 | d->m_systemstr = "Unknown"; |
183 | d->m_system = System_Unknown; | 185 | d->m_system = System_Unknown; |
184 | d->m_sysverstr = "0.0"; | 186 | d->m_sysverstr = "0.0"; |
185 | d->m_rotation = Rot0; | 187 | d->m_rotation = Rot0; |
186 | d->m_direction = CW; | 188 | d->m_direction = CW; |
187 | d->m_qteDriver = "Transformed"; | 189 | d->m_qteDriver = "Transformed"; |
188 | 190 | ||
189 | d->m_holdtime = 1000; // 1000ms | 191 | d->m_holdtime = 1000; // 1000ms |
190 | d->m_buttons = 0; | 192 | d->m_buttons = 0; |
191 | d->m_cpu_frequencies = new QStrList; | 193 | d->m_cpu_frequencies = new QStrList; |
192 | 194 | ||
193 | 195 | ||
194 | /* mixer */ | 196 | /* mixer */ |
195 | d->m_sound = d->m_vol = d->m_mixer = -1; | 197 | d->m_sound = d->m_vol = d->m_mixer = -1; |
196 | 198 | ||
197 | /* System QCopChannel created */ | 199 | /* System QCopChannel created */ |
198 | d->m_initializedButtonQcop = false; | 200 | d->m_initializedButtonQcop = false; |
199 | 201 | ||
200 | // New distribution detection code first checks for legacy distributions, | 202 | // New distribution detection code first checks for legacy distributions, |
201 | // identified by /etc/familiar-version or /etc/oz_version. | 203 | // identified by /etc/familiar-version or /etc/oz_version. |
202 | // Then check for OpenEmbedded and lastly, read /etc/issue | 204 | // Then check for OpenEmbedded and lastly, read /etc/issue |
203 | 205 | ||
204 | for ( unsigned int i = 0; i < sizeof(distributions)/sizeof(ODistribution); ++i ) | 206 | for ( unsigned int i = 0; i < sizeof(distributions)/sizeof(ODistribution); ++i ) |
205 | { | 207 | { |
206 | if ( QFile::exists( distributions[i].sysvfile ) ) | 208 | if ( QFile::exists( distributions[i].sysvfile ) ) |
207 | { | 209 | { |
208 | d->m_systemstr = distributions[i].sysstr; | 210 | d->m_systemstr = distributions[i].sysstr; |
209 | d->m_system = distributions[i].system; | 211 | d->m_system = distributions[i].system; |
210 | d->m_sysverstr = "<Unknown>"; | 212 | d->m_sysverstr = "<Unknown>"; |
211 | QFile f( distributions[i].sysvfile ); | 213 | QFile f( distributions[i].sysvfile ); |
212 | if ( f.open( IO_ReadOnly ) ) | 214 | if ( f.open( IO_ReadOnly ) ) |
213 | { | 215 | { |
214 | QTextStream ts( &f ); | 216 | QTextStream ts( &f ); |
215 | d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" ); | 217 | d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" ); |
216 | } | 218 | } |
217 | break; | 219 | break; |
218 | } | 220 | } |
219 | } | 221 | } |
220 | } | 222 | } |
221 | 223 | ||
222 | void ODevice::systemMessage( const QCString &msg, const QByteArray & ) | 224 | void ODevice::systemMessage( const QCString &msg, const QByteArray & ) |
223 | { | 225 | { |
224 | if ( msg == "deviceButtonMappingChanged()" ) { | 226 | if ( msg == "deviceButtonMappingChanged()" ) { |
225 | reloadButtonMapping(); | 227 | reloadButtonMapping(); |
226 | } | 228 | } |
227 | } | 229 | } |
228 | 230 | ||
229 | void ODevice::init(const QString&) | 231 | void ODevice::init(const QString&) |
230 | { | 232 | { |
231 | } | 233 | } |
232 | 234 | ||
233 | /** | 235 | /** |
234 | * This method initialises the button mapping | 236 | * This method initialises the button mapping |
235 | */ | 237 | */ |
236 | void ODevice::initButtons() | 238 | void ODevice::initButtons() |
237 | { | 239 | { |
238 | if ( d->m_buttons ) | 240 | if ( d->m_buttons ) |
239 | return; | 241 | return; |
240 | 242 | ||
241 | qDebug ( "init Buttons" ); | 243 | qDebug ( "init Buttons" ); |
242 | d->m_buttons = new QValueList <ODeviceButton>; | 244 | d->m_buttons = new QValueList <ODeviceButton>; |
243 | for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { | 245 | for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { |
244 | default_button *db = default_buttons + i; | 246 | default_button *db = default_buttons + i; |
245 | ODeviceButton b; | 247 | ODeviceButton b; |
246 | b. setKeycode ( db->code ); | 248 | b. setKeycode ( db->code ); |
247 | b. setUserText ( QObject::tr ( "Button", db->utext )); | 249 | b. setUserText ( QObject::tr ( "Button", db->utext )); |
248 | b. setPixmap ( OResource::loadPixmap ( db->pix )); | 250 | b. setPixmap ( OResource::loadPixmap ( db->pix )); |
249 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); | 251 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); |
250 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); | 252 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); |
251 | d->m_buttons->append ( b ); | 253 | d->m_buttons->append ( b ); |
252 | } | 254 | } |
253 | 255 | ||
254 | reloadButtonMapping(); | 256 | reloadButtonMapping(); |
255 | } | 257 | } |
256 | 258 | ||
257 | ODevice::~ODevice() | 259 | ODevice::~ODevice() |
258 | { | 260 | { |
259 | // we leak m_devicebuttons and m_cpu_frequency | 261 | // we leak m_devicebuttons and m_cpu_frequency |
260 | // but it's a singleton and it is not so importantant | 262 | // but it's a singleton and it is not so importantant |
261 | // -zecke | 263 | // -zecke |
262 | delete d; | 264 | delete d; |
263 | } | 265 | } |
264 | 266 | ||
265 | /** | 267 | /** |
266 | * This method will try to suspend the device | 268 | * This method will try to suspend the device |
267 | * It only works if the user is the QWS Server and the apm application | 269 | * It only works if the user is the QWS Server and the apm application |
268 | * is installed. | 270 | * is installed. |
269 | * It tries to suspend and then waits some time cause some distributions | 271 | * It tries to suspend and then waits some time cause some distributions |
270 | * do have asynchronus apm implementations. | 272 | * do have asynchronus apm implementations. |
271 | * This method will either fail and return false or it'll suspend the | 273 | * This method will either fail and return false or it'll suspend the |
272 | * device and return once the device got woken up | 274 | * device and return once the device got woken up |
273 | * | 275 | * |
274 | * @return if the device got suspended | 276 | * @return if the device got suspended |
275 | */ | 277 | */ |
276 | bool ODevice::suspend() | 278 | bool ODevice::suspend() |
277 | { | 279 | { |
278 | return false; // default implementation == unknown device or qvfb | 280 | return false; // default implementation == unknown device or qvfb |
279 | } | 281 | } |
280 | 282 | ||
281 | /** | 283 | /** |
282 | * This sets the display on or off | 284 | * This sets the display on or off |
283 | */ | 285 | */ |
284 | bool ODevice::setDisplayStatus( bool on ) | 286 | bool ODevice::setDisplayStatus( bool on ) |
285 | { | 287 | { |
286 | qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); | 288 | qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); |
287 | return false; // don't do anything for unknown models | 289 | return false; // don't do anything for unknown models |
288 | } | 290 | } |
289 | 291 | ||
290 | /** | 292 | /** |
291 | * This sets the display brightness | 293 | * This sets the display brightness |
292 | * | 294 | * |
293 | * @param b The brightness to be set on a scale from 0 to 255 | 295 | * @param b The brightness to be set on a scale from 0 to 255 |
294 | * @return success or failure | 296 | * @return success or failure |
295 | */ | 297 | */ |
296 | bool ODevice::setDisplayBrightness( int b ) | 298 | bool ODevice::setDisplayBrightness( int b ) |
297 | { | 299 | { |
298 | qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); | 300 | qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); |
299 | return false; | 301 | return false; |
300 | } | 302 | } |
301 | 303 | ||
302 | /** | 304 | /** |
303 | * | 305 | * |
304 | * @returns the number of steppings on the brightness slider | 306 | * @returns the number of steppings on the brightness slider |
305 | * in the Light-'n-Power settings. Values smaller than zero and bigger | 307 | * in the Light-'n-Power settings. Values smaller than zero and bigger |
306 | * than 255 do not make sense. | 308 | * than 255 do not make sense. |
307 | * | 309 | * |
308 | * \sa QSlider::setLineStep | 310 | * \sa QSlider::setLineStep |
309 | * \sa QSlider::setPageStep | 311 | * \sa QSlider::setPageStep |
310 | */ | 312 | */ |
311 | int ODevice::displayBrightnessResolution() const | 313 | int ODevice::displayBrightnessResolution() const |
312 | { | 314 | { |
313 | qDebug( "ODevice::displayBrightnessResolution() - please override me." ); | 315 | qDebug( "ODevice::displayBrightnessResolution() - please override me." ); |
314 | return 16; | 316 | return 16; |
315 | } | 317 | } |
316 | 318 | ||
317 | /** | 319 | /** |
318 | * This sets the display contrast | 320 | * This sets the display contrast |
319 | * @param p The contrast to be set on a scale from 0 to 255 | 321 | * @param p The contrast to be set on a scale from 0 to 255 |
320 | * @returns success or failure | 322 | * @returns success or failure |
321 | */ | 323 | */ |
322 | bool ODevice::setDisplayContrast( int p ) | 324 | bool ODevice::setDisplayContrast( int p ) |
323 | { | 325 | { |
324 | qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p ); | 326 | qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p ); |
325 | return false; | 327 | return false; |
326 | } | 328 | } |
327 | 329 | ||
328 | /** | 330 | /** |
329 | * @returns the maximum value for the contrast settings slider | 331 | * @returns the maximum value for the contrast settings slider |
330 | * or 0 if the device doesn't support setting of a contrast | 332 | * or 0 if the device doesn't support setting of a contrast |
331 | */ | 333 | */ |
332 | int ODevice::displayContrastResolution() const | 334 | int ODevice::displayContrastResolution() const |
333 | { | 335 | { |
334 | qDebug( "ODevice::displayBrightnessResolution() - please override me." ); | 336 | qDebug( "ODevice::displayBrightnessResolution() - please override me." ); |
335 | return 0; | 337 | return 0; |
336 | } | 338 | } |
337 | 339 | ||
338 | /** | 340 | /** |
339 | * This returns the vendor as string | 341 | * This returns the vendor as string |
340 | * @return Vendor as QString | 342 | * @return Vendor as QString |
341 | */ | 343 | */ |
342 | QString ODevice::vendorString() const | 344 | QString ODevice::vendorString() const |