summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 2c5190c..ed705a6 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -233,78 +233,64 @@ void ODevice::initButtons()
233 qDebug ( "init Buttons" ); 233 qDebug ( "init Buttons" );
234 d->m_buttons = new QValueList <ODeviceButton>; 234 d->m_buttons = new QValueList <ODeviceButton>;
235 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { 235 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) {
236 default_button *db = default_buttons + i; 236 default_button *db = default_buttons + i;
237 ODeviceButton b; 237 ODeviceButton b;
238 b. setKeycode ( db->code ); 238 b. setKeycode ( db->code );
239 b. setUserText ( QObject::tr ( "Button", db->utext )); 239 b. setUserText ( QObject::tr ( "Button", db->utext ));
240 b. setPixmap ( Resource::loadPixmap ( db->pix )); 240 b. setPixmap ( Resource::loadPixmap ( db->pix ));
241 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); 241 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction ));
242 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); 242 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction ));
243 d->m_buttons->append ( b ); 243 d->m_buttons->append ( b );
244 } 244 }
245 245
246 reloadButtonMapping(); 246 reloadButtonMapping();
247} 247}
248 248
249ODevice::~ODevice() 249ODevice::~ODevice()
250{ 250{
251// we leak m_devicebuttons and m_cpu_frequency 251// we leak m_devicebuttons and m_cpu_frequency
252// but it's a singleton and it is not so importantant 252// but it's a singleton and it is not so importantant
253// -zecke 253// -zecke
254 delete d; 254 delete d;
255} 255}
256 256
257//#include <linux/apm_bios.h>
258
259#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
260
261/** 257/**
262* This method will try to suspend the device 258* This method will try to suspend the device
263* It only works if the user is the QWS Server and the apm application 259* It only works if the user is the QWS Server and the apm application
264* is installed. 260* is installed.
265* It tries to suspend and then waits some time cause some distributions 261* It tries to suspend and then waits some time cause some distributions
266* do have asynchronus apm implementations. 262* do have asynchronus apm implementations.
267* This method will either fail and return false or it'll suspend the 263* This method will either fail and return false or it'll suspend the
268* device and return once the device got woken up 264* device and return once the device got woken up
269* 265*
270* @return if the device got suspended 266* @return if the device got suspended
271*/ 267*/
272bool ODevice::suspend() 268bool ODevice::suspend()
273{ 269{
274 return false; // default implementation == unknown device or qvfb 270 return false; // default implementation == unknown device or qvfb
275} 271}
276 272
277//#include <linux/fb.h> better not rely on kernel headers in userspace ...
278
279#define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611
280
281/* VESA Blanking Levels */
282#define VESA_NO_BLANKING 0
283#define VESA_VSYNC_SUSPEND 1
284#define VESA_HSYNC_SUSPEND 2
285#define VESA_POWERDOWN 3
286
287/** 273/**
288* This sets the display on or off 274* This sets the display on or off
289*/ 275*/
290bool ODevice::setDisplayStatus( bool on ) 276bool ODevice::setDisplayStatus( bool on )
291{ 277{
292 qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); 278 qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on );
293 return false; // don't do anything for unknown models 279 return false; // don't do anything for unknown models
294} 280}
295 281
296/** 282/**
297* This sets the display brightness 283* This sets the display brightness
298* 284*
299* @param b The brightness to be set on a scale from 0 to 255 285* @param b The brightness to be set on a scale from 0 to 255
300* @return success or failure 286* @return success or failure
301*/ 287*/
302bool ODevice::setDisplayBrightness( int b ) 288bool ODevice::setDisplayBrightness( int b )
303{ 289{
304 qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); 290 qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b );
305 return false; 291 return false;
306} 292}
307 293
308/** 294/**
309 * 295 *
310 * @returns the number of steppings on the brightness slider 296 * @returns the number of steppings on the brightness slider