summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Unidiff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index c0b6efa..4258d60 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -519,33 +519,33 @@ void ODevice::initButtons ( )
519 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { 519 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
520 i_button *ib = ipaq_buttons + i; 520 i_button *ib = ipaq_buttons + i;
521 ODeviceButton b; 521 ODeviceButton b;
522 522
523 if (( ib-> model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) { 523 if (( ib-> model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) {
524 b. setKeycode ( ib-> code ); 524 b. setKeycode ( ib-> code );
525 b. setUserText ( QObject::tr ( "Button", ib-> utext )); 525 b. setUserText ( QObject::tr ( "Button", ib-> utext ));
526 b. setPixmap ( Resource::loadPixmap ( ib-> pix )); 526 b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
527 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); 527 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction ));
528 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); 528 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction ));
529 d-> m_buttons-> append ( b ); 529 d-> m_buttons-> append ( b );
530 } 530 }
531 } 531 }
532 reloadButtonMapping ( ); 532 reloadButtonMapping ( );
533 533
534 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 534 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
535 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); 535 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
536} 536}
537 537
538ODevice::~ODevice ( ) 538ODevice::~ODevice ( )
539{ 539{
540// we leak m_devicebuttons and m_cpu_frequency 540// we leak m_devicebuttons and m_cpu_frequency
541// but it's a singleton and it is not so importantant 541// but it's a singleton and it is not so importantant
542// -zecke 542// -zecke
543 delete d; 543 delete d;
544} 544}
545 545
546bool ODevice::setSoftSuspend ( bool /*soft*/ ) 546bool ODevice::setSoftSuspend ( bool /*soft*/ )
547{ 547{
548 return false; 548 return false;
549} 549}
550 550
551//#include <linux/apm_bios.h> 551//#include <linux/apm_bios.h>
@@ -1099,34 +1099,34 @@ void Yopy::initButtons ( )
1099 1099
1100 ODeviceButton b; 1100 ODeviceButton b;
1101 1101
1102 b. setKeycode ( ib-> code ); 1102 b. setKeycode ( ib-> code );
1103 b. setUserText ( QObject::tr ( "Button", ib-> utext )); 1103 b. setUserText ( QObject::tr ( "Button", ib-> utext ));
1104 b. setPixmap ( Resource::loadPixmap ( ib-> pix )); 1104 b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
1105 b. setFactoryPresetPressedAction 1105 b. setFactoryPresetPressedAction
1106 (OQCopMessage(makeChannel(ib->fpressedservice), ib->fpressedaction)); 1106 (OQCopMessage(makeChannel(ib->fpressedservice), ib->fpressedaction));
1107 b. setFactoryPresetHeldAction 1107 b. setFactoryPresetHeldAction
1108 (OQCopMessage(makeChannel(ib->fheldservice), ib->fheldaction)); 1108 (OQCopMessage(makeChannel(ib->fheldservice), ib->fheldaction));
1109 1109
1110 d-> m_buttons-> append ( b ); 1110 d-> m_buttons-> append ( b );
1111 } 1111 }
1112 reloadButtonMapping ( ); 1112 reloadButtonMapping ( );
1113 1113
1114 QCopChannel *sysch = new QCopChannel("QPE/System", this); 1114 QCopChannel *sysch = new QCopChannel("QPE/System", this);
1115 connect(sysch, SIGNAL(received(const QCString &, const QByteArray & )), 1115 connect(sysch, SIGNAL(received(const QCString&,const QByteArray&)),
1116 this, SLOT(systemMessage(const QCString &, const QByteArray & ))); 1116 this, SLOT(systemMessage(const QCString&,const QByteArray&)));
1117} 1117}
1118 1118
1119bool Yopy::suspend() 1119bool Yopy::suspend()
1120{ 1120{
1121 /* Opie for Yopy does not implement its own power management at the 1121 /* Opie for Yopy does not implement its own power management at the
1122 moment. The public version runs parallel to X, and relies on the 1122 moment. The public version runs parallel to X, and relies on the
1123 existing power management features. */ 1123 existing power management features. */
1124 return false; 1124 return false;
1125} 1125}
1126 1126
1127bool Yopy::setDisplayBrightness(int bright) 1127bool Yopy::setDisplayBrightness(int bright)
1128{ 1128{
1129 /* The code here works, but is disabled as the current version runs 1129 /* The code here works, but is disabled as the current version runs
1130 parallel to X, and relies on the existing backlight demon. */ 1130 parallel to X, and relies on the existing backlight demon. */
1131#if 0 1131#if 0
1132 if ( QFile::exists("/proc/sys/pm/light") ) { 1132 if ( QFile::exists("/proc/sys/pm/light") ) {
@@ -1248,33 +1248,33 @@ void iPAQ::initButtons ( )
1248 i_button *ib = ipaq_buttons + i; 1248 i_button *ib = ipaq_buttons + i;
1249 ODeviceButton b; 1249 ODeviceButton b;
1250 1250
1251 if (( ib-> model & d-> m_model ) == d-> m_model ) { 1251 if (( ib-> model & d-> m_model ) == d-> m_model ) {
1252 b. setKeycode ( ib-> code ); 1252 b. setKeycode ( ib-> code );
1253 b. setUserText ( QObject::tr ( "Button", ib-> utext )); 1253 b. setUserText ( QObject::tr ( "Button", ib-> utext ));
1254 b. setPixmap ( Resource::loadPixmap ( ib-> pix )); 1254 b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
1255 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); 1255 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction ));
1256 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); 1256 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction ));
1257 1257
1258 d-> m_buttons-> append ( b ); 1258 d-> m_buttons-> append ( b );
1259 } 1259 }
1260 } 1260 }
1261 reloadButtonMapping ( ); 1261 reloadButtonMapping ( );
1262 1262
1263 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 1263 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
1264 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); 1264 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
1265} 1265}
1266 1266
1267 1267
1268//#include <linux/h3600_ts.h> // including kernel headers is evil ... 1268//#include <linux/h3600_ts.h> // including kernel headers is evil ...
1269 1269
1270typedef struct { 1270typedef struct {
1271 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 1271 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
1272 unsigned char TotalTime; /* Units of 5 seconds */ 1272 unsigned char TotalTime; /* Units of 5 seconds */
1273 unsigned char OnTime; /* units of 100m/s */ 1273 unsigned char OnTime; /* units of 100m/s */
1274 unsigned char OffTime; /* units of 100m/s */ 1274 unsigned char OffTime; /* units of 100m/s */
1275} LED_IN; 1275} LED_IN;
1276 1276
1277typedef struct { 1277typedef struct {
1278 unsigned char mode; 1278 unsigned char mode;
1279 unsigned char pwr; 1279 unsigned char pwr;
1280 unsigned char brightness; 1280 unsigned char brightness;
@@ -1734,34 +1734,34 @@ void Zaurus::initButtons ( )
1734 ODeviceButton b; 1734 ODeviceButton b;
1735 1735
1736 b. setKeycode ( zb-> code ); 1736 b. setKeycode ( zb-> code );
1737 b. setUserText ( QObject::tr ( "Button", zb-> utext )); 1737 b. setUserText ( QObject::tr ( "Button", zb-> utext ));
1738 b. setPixmap ( Resource::loadPixmap ( zb-> pix )); 1738 b. setPixmap ( Resource::loadPixmap ( zb-> pix ));
1739 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ), 1739 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ),
1740 zb-> fpressedaction )); 1740 zb-> fpressedaction ));
1741 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ), 1741 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ),
1742 zb-> fheldaction )); 1742 zb-> fheldaction ));
1743 1743
1744 d-> m_buttons-> append ( b ); 1744 d-> m_buttons-> append ( b );
1745 } 1745 }
1746 1746
1747 reloadButtonMapping ( ); 1747 reloadButtonMapping ( );
1748 1748
1749 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 1749 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
1750 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), 1750 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)),
1751 this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); 1751 this, SLOT( systemMessage(const QCString&,const QByteArray&)));
1752} 1752}
1753 1753
1754#include <unistd.h> 1754#include <unistd.h>
1755#include <fcntl.h> 1755#include <fcntl.h>
1756#include <sys/ioctl.h> 1756#include <sys/ioctl.h>
1757 1757
1758//#include <asm/sharp_char.h> // including kernel headers is evil ... 1758//#include <asm/sharp_char.h> // including kernel headers is evil ...
1759 1759
1760#define SHARP_DEV_IOCTL_COMMAND_START 0x5680 1760#define SHARP_DEV_IOCTL_COMMAND_START 0x5680
1761 1761
1762 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 1762 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
1763#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 1763#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
1764 1764
1765#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ 1765#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */
1766#define SHARP_BUZ_KEYSOUND 2 /* key sound */ 1766#define SHARP_BUZ_KEYSOUND 2 /* key sound */
1767#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ 1767#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */
@@ -2285,33 +2285,33 @@ void SIMpad::initButtons ( )
2285 s_button *sb = simpad_buttons + i; 2285 s_button *sb = simpad_buttons + i;
2286 ODeviceButton b; 2286 ODeviceButton b;
2287 2287
2288 if (( sb-> model & d-> m_model ) == d-> m_model ) { 2288 if (( sb-> model & d-> m_model ) == d-> m_model ) {
2289 b. setKeycode ( sb-> code ); 2289 b. setKeycode ( sb-> code );
2290 b. setUserText ( QObject::tr ( "Button", sb-> utext )); 2290 b. setUserText ( QObject::tr ( "Button", sb-> utext ));
2291 b. setPixmap ( Resource::loadPixmap ( sb-> pix )); 2291 b. setPixmap ( Resource::loadPixmap ( sb-> pix ));
2292 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb-> fpressedservice ), sb-> fpressedaction )); 2292 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb-> fpressedservice ), sb-> fpressedaction ));
2293 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb-> fheldservice ), sb-> fheldaction )); 2293 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb-> fheldservice ), sb-> fheldaction ));
2294 2294
2295 d-> m_buttons-> append ( b ); 2295 d-> m_buttons-> append ( b );
2296 } 2296 }
2297 } 2297 }
2298 reloadButtonMapping ( ); 2298 reloadButtonMapping ( );
2299 2299
2300 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 2300 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
2301 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); 2301 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
2302} 2302}
2303 2303
2304// SIMpad boardcontrol register CS3 2304// SIMpad boardcontrol register CS3
2305#define SIMPAD_BOARDCONTROL "/proc/cs3" 2305#define SIMPAD_BOARDCONTROL "/proc/cs3"
2306#define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA 2306#define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA
2307#define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA 2307#define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA
2308#define SIMPAD_EN1 0x0004 // This is only for EPROM's 2308#define SIMPAD_EN1 0x0004 // This is only for EPROM's
2309#define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V 2309#define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V
2310#define SIMPAD_DISPLAY_ON 0x0010 2310#define SIMPAD_DISPLAY_ON 0x0010
2311#define SIMPAD_PCMCIA_BUFF_DIS 0x0020 2311#define SIMPAD_PCMCIA_BUFF_DIS 0x0020
2312#define SIMPAD_MQ_RESET 0x0040 2312#define SIMPAD_MQ_RESET 0x0040
2313#define SIMPAD_PCMCIA_RESET 0x0080 2313#define SIMPAD_PCMCIA_RESET 0x0080
2314#define SIMPAD_DECT_POWER_ON 0x0100 2314#define SIMPAD_DECT_POWER_ON 0x0100
2315#define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave 2315#define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave
2316#define SIMPAD_RS232_ON 0x0400 2316#define SIMPAD_RS232_ON 0x0400
2317#define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave 2317#define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave
@@ -2785,33 +2785,33 @@ void Jornada::initButtons ( )
2785 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { 2785 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
2786 i_button *ib = ipaq_buttons + i; 2786 i_button *ib = ipaq_buttons + i;
2787 ODeviceButton b; 2787 ODeviceButton b;
2788 2788
2789 if (( ib-> model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) { 2789 if (( ib-> model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) {
2790 b. setKeycode ( ib-> code ); 2790 b. setKeycode ( ib-> code );
2791 b. setUserText ( QObject::tr ( "Button", ib-> utext )); 2791 b. setUserText ( QObject::tr ( "Button", ib-> utext ));
2792 b. setPixmap ( Resource::loadPixmap ( ib-> pix )); 2792 b. setPixmap ( Resource::loadPixmap ( ib-> pix ));
2793 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); 2793 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction ));
2794 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); 2794 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction ));
2795 d-> m_buttons-> append ( b ); 2795 d-> m_buttons-> append ( b );
2796 } 2796 }
2797 } 2797 }
2798 reloadButtonMapping ( ); 2798 reloadButtonMapping ( );
2799 2799
2800 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 2800 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
2801 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); 2801 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
2802} 2802}
2803#endif 2803#endif
2804int Jornada::displayBrightnessResolution ( ) const 2804int Jornada::displayBrightnessResolution ( ) const
2805{ 2805{
2806} 2806}
2807 2807
2808bool Jornada::setDisplayBrightness ( int bright ) 2808bool Jornada::setDisplayBrightness ( int bright )
2809{ 2809{
2810 bool res = false; 2810 bool res = false;
2811 int fd; 2811 int fd;
2812 2812
2813 if ( bright > 255 ) 2813 if ( bright > 255 )
2814 bright = 255; 2814 bright = 255;
2815 if ( bright < 0 ) 2815 if ( bright < 0 )
2816 bright = 0; 2816 bright = 0;
2817 2817