-rw-r--r-- | libopie/odevice.cpp | 12 | ||||
-rw-r--r-- | libopie/odevice.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 9f64fc0..4c49c4f 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -81,16 +81,17 @@ public: | |||
81 | 81 | ||
82 | virtual QValueList <OLed> ledList ( ) const; | 82 | virtual QValueList <OLed> ledList ( ) const; |
83 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 83 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
84 | virtual OLedState ledState ( OLed led ) const; | 84 | virtual OLedState ledState ( OLed led ) const; |
85 | virtual bool setLedState ( OLed led, OLedState st ); | 85 | virtual bool setLedState ( OLed led, OLedState st ); |
86 | 86 | ||
87 | virtual bool hasLightSensor ( ) const; | 87 | virtual bool hasLightSensor ( ) const; |
88 | virtual int readLightSensor ( ); | 88 | virtual int readLightSensor ( ); |
89 | virtual int lightSensorResolution ( ) const; | ||
89 | 90 | ||
90 | //virtual QValueList <int> keyList ( ) const; | 91 | //virtual QValueList <int> keyList ( ) const; |
91 | 92 | ||
92 | protected: | 93 | protected: |
93 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 94 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
94 | virtual void timerEvent ( QTimerEvent *te ); | 95 | virtual void timerEvent ( QTimerEvent *te ); |
95 | 96 | ||
96 | int m_power_timer; | 97 | int m_power_timer; |
@@ -364,16 +365,20 @@ bool ODevice::hasLightSensor ( ) const | |||
364 | return false; | 365 | return false; |
365 | } | 366 | } |
366 | 367 | ||
367 | int ODevice::readLightSensor ( ) | 368 | int ODevice::readLightSensor ( ) |
368 | { | 369 | { |
369 | return -1; | 370 | return -1; |
370 | } | 371 | } |
371 | 372 | ||
373 | int ODevice::lightSensorResolution ( ) const | ||
374 | { | ||
375 | return 0; | ||
376 | } | ||
372 | 377 | ||
373 | //QValueList <int> ODevice::keyList ( ) const | 378 | //QValueList <int> ODevice::keyList ( ) const |
374 | //{ | 379 | //{ |
375 | //return QValueList <int> ( ); | 380 | //return QValueList <int> ( ); |
376 | //} | 381 | //} |
377 | 382 | ||
378 | 383 | ||
379 | 384 | ||
@@ -677,18 +682,17 @@ int iPAQ::displayBrightnessResolution ( ) const | |||
677 | return 256; // really 128, but logarithmic control is smoother this way | 682 | return 256; // really 128, but logarithmic control is smoother this way |
678 | } | 683 | } |
679 | 684 | ||
680 | 685 | ||
681 | bool iPAQ::hasLightSensor ( ) const | 686 | bool iPAQ::hasLightSensor ( ) const |
682 | { | 687 | { |
683 | return true; | 688 | return true; |
684 | } | 689 | } |
685 | #include <errno.h> | 690 | |
686 | #include <string.h> | ||
687 | int iPAQ::readLightSensor ( ) | 691 | int iPAQ::readLightSensor ( ) |
688 | { | 692 | { |
689 | int fd; | 693 | int fd; |
690 | int val = -1; | 694 | int val = -1; |
691 | 695 | ||
692 | if (( fd = ::open ( "/proc/hal/light_sensor", O_RDONLY )) >= 0 ) { | 696 | if (( fd = ::open ( "/proc/hal/light_sensor", O_RDONLY )) >= 0 ) { |
693 | char buffer [8]; | 697 | char buffer [8]; |
694 | 698 | ||
@@ -702,16 +706,20 @@ int iPAQ::readLightSensor ( ) | |||
702 | val = -1; | 706 | val = -1; |
703 | } | 707 | } |
704 | ::close ( fd ); | 708 | ::close ( fd ); |
705 | } | 709 | } |
706 | 710 | ||
707 | return val; | 711 | return val; |
708 | } | 712 | } |
709 | 713 | ||
714 | int iPAQ::lightSensorResolution ( ) const | ||
715 | { | ||
716 | return 256; | ||
717 | } | ||
710 | 718 | ||
711 | /************************************************** | 719 | /************************************************** |
712 | * | 720 | * |
713 | * Zaurus | 721 | * Zaurus |
714 | * | 722 | * |
715 | **************************************************/ | 723 | **************************************************/ |
716 | 724 | ||
717 | 725 | ||
diff --git a/libopie/odevice.h b/libopie/odevice.h index be2a9c7..e07b91c 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -130,16 +130,17 @@ public: | |||
130 | 130 | ||
131 | virtual QValueList <OLed> ledList ( ) const; | 131 | virtual QValueList <OLed> ledList ( ) const; |
132 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 132 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
133 | virtual OLedState ledState ( OLed led ) const; | 133 | virtual OLedState ledState ( OLed led ) const; |
134 | virtual bool setLedState ( OLed led, OLedState st ); | 134 | virtual bool setLedState ( OLed led, OLedState st ); |
135 | 135 | ||
136 | virtual bool hasLightSensor ( ) const; | 136 | virtual bool hasLightSensor ( ) const; |
137 | virtual int readLightSensor ( ); | 137 | virtual int readLightSensor ( ); |
138 | virtual int lightSensorResolution ( ) const; | ||
138 | 139 | ||
139 | //virtual QValueList <int> keyList ( ) const; | 140 | //virtual QValueList <int> keyList ( ) const; |
140 | }; | 141 | }; |
141 | 142 | ||
142 | } | 143 | } |
143 | 144 | ||
144 | #endif | 145 | #endif |
145 | 146 | ||