author | eilers <eilers> | 2003-11-17 17:32:06 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-11-17 17:32:06 (UTC) |
commit | d46685864bb18ffa82d5dac4fcfb1ae96471e89a (patch) (side-by-side diff) | |
tree | ab5e53d5d777aea2b8baf62eeca8cd9d5605bbcf | |
parent | e8bba52dc9443d3aadcc2c221fa62ba37ea5c712 (diff) | |
download | opie-d46685864bb18ffa82d5dac4fcfb1ae96471e89a.zip opie-d46685864bb18ffa82d5dac4fcfb1ae96471e89a.tar.gz opie-d46685864bb18ffa82d5dac4fcfb1ae96471e89a.tar.bz2 |
Shit .. missed a wrong ")".. Odevice compiles now.. !
-rw-r--r-- | libopie/odevice.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 58254a7..71ed9e4 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -1398,257 +1398,257 @@ bool iPAQ::setSoftSuspend ( bool soft ) int fd; if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) { if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 ) res = true; else ::perror ( "write to /proc/sys/ts/suspend_button_mode" ); ::close ( fd ); } else ::perror ( "/proc/sys/ts/suspend_button_mode" ); return res; } bool iPAQ::setDisplayBrightness ( int bright ) { bool res = false; int fd; if ( bright > 255 ) bright = 255; if ( bright < 0 ) bright = 0; if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { FLITE_IN bl; bl. mode = 1; bl. pwr = bright ? 1 : 0; bl. brightness = ( bright * ( displayBrightnessResolution ( ) - 1 ) + 127 ) / 255; res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 ); ::close ( fd ); } return res; } int iPAQ::displayBrightnessResolution ( ) const { switch ( model ( )) { case Model_iPAQ_H31xx: case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: return 128; // really 256, but >128 could damage the LCD case Model_iPAQ_H38xx: case Model_iPAQ_H39xx: return 64; case Model_iPAQ_H5xxx: return 255; default: return 2; } } bool iPAQ::hasLightSensor ( ) const { return true; } int iPAQ::readLightSensor ( ) { int fd; int val = -1; if (( fd = ::open ( "/proc/hal/light_sensor", O_RDONLY )) >= 0 ) { char buffer [8]; if ( ::read ( fd, buffer, 5 ) == 5 ) { char *endptr; buffer [4] = 0; val = ::strtol ( buffer + 2, &endptr, 16 ); if ( *endptr != 0 ) val = -1; } ::close ( fd ); } return val; } int iPAQ::lightSensorResolution ( ) const { return 256; } /************************************************** * * Zaurus * **************************************************/ // Check whether this device is the sharp zaurus.. bool Zaurus::isZaurus() { // If the special devices by embedix exist, it is quite simple: it is a Zaurus ! if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){ return true; } // On non-embedix kernels, we have to look closer. bool is_zaurus = false; QFile f ( "/proc/cpuinfo" ); if ( f. open ( IO_ReadOnly ) ) { QString model; QFile f ( "/proc/cpuinfo" ); QTextStream ts ( &f ); QString line; while( line = ts. readLine ( ) ) { if ( line. left ( 8 ) == "Hardware" ) break; } int loc = line. find ( ":" ); if ( loc != -1 ) model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); if ( model == "Sharp-Collie" || model == "Collie" || model == "SHARP Corgi" || model == "SHARP Shepherd" || model == "SHARP Poodle" - || model == "SHARP Husky" ) + || model == "SHARP Husky" ) is_zaurus = true; } return is_zaurus; } void Zaurus::init ( ) { d-> m_vendorstr = "Sharp"; d-> m_vendor = Vendor_Sharp; m_embedix = true; // Not openzaurus means: It has an embedix kernel ! // QFile f ( "/proc/filesystems" ); QString model; // It isn't a good idea to check the system configuration to // detect the distribution ! // Otherwise it may happen that any other distribution is detected as openzaurus, just // because it uses a jffs2 filesystem.. // (eilers) // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { QFile f ("/etc/oz_version"); if ( f.exists() ){ d-> m_vendorstr = "OpenZaurus Team"; d-> m_systemstr = "OpenZaurus"; d-> m_system = System_OpenZaurus; if ( f. open ( IO_ReadOnly )) { QTextStream ts ( &f ); d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); f. close ( ); } // Openzaurus sometimes uses the embedix kernel! // => Check whether this is an embedix kernel FILE *uname = popen("uname -r", "r"); QString line; if ( f.open(IO_ReadOnly, uname) ) { QTextStream ts ( &f ); line = ts. readLine ( ); int loc = line. find ( "embedix" ); if ( loc != -1 ) m_embedix = true; else m_embedix = false; f. close ( ); } pclose(uname); } else { d-> m_systemstr = "Zaurus"; d-> m_system = System_Zaurus; } f. setName ( "/proc/cpuinfo" ); if ( f. open ( IO_ReadOnly ) ) { QTextStream ts ( &f ); QString line; while( line = ts. readLine ( ) ) { if ( line. left ( 8 ) == "Hardware" ) break; } int loc = line. find ( ":" ); if ( loc != -1 ) model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); } if ( model == "SHARP Corgi" ) { d-> m_model = Model_Zaurus_SLC7x0; d-> m_modelstr = "Zaurus SL-C700"; } else if ( model == "SHARP Shepherd" ) { d-> m_model = Model_Zaurus_SLC7x0; d-> m_modelstr = "Zaurus SL-C750"; } else if ( model == "SHARP Husky" ) { d-> m_model = Model_Zaurus_SLC7x0; d-> m_modelstr = "Zaurus SL-C760"; } else if ( model == "SHARP Poodle" ) { d-> m_model = Model_Zaurus_SLB600; d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; } else if ( model == "Sharp-Collie" || model == "Collie" ) { d-> m_model = Model_Zaurus_SL5500; d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; } else { d-> m_model = Model_Zaurus_SL5500; d-> m_modelstr = "Zaurus (Model unknown)"; } bool flipstate = false; switch ( d-> m_model ) { case Model_Zaurus_SLA300: d-> m_rotation = Rot0; break; case Model_Zaurus_SLC7x0: // Note: need to 1) set flipstate based on physical screen orientation // and 2) check to see if the user overrode the rotation direction // using appearance, and if so, remove that item from the Config to // ensure the rotate applet flips us back to the previous state. if ( flipstate ) { // 480x640 d-> m_rotation = Rot0; d-> m_direction = CW; } else { // 640x480 d-> m_rotation = Rot270; d-> m_direction = CCW; } break; case Model_Zaurus_SLB600: case Model_Zaurus_SL5500: case Model_Zaurus_SL5000: default: d-> m_rotation = Rot270; break; } m_leds [0] = Led_Off; } void Zaurus::initButtons ( ) { if ( d-> m_buttons ) return; d-> m_buttons = new QValueList <ODeviceButton>; struct z_button * pz_buttons; int buttoncount; |