author | schurig <schurig> | 2003-06-06 07:43:08 (UTC) |
---|---|---|
committer | schurig <schurig> | 2003-06-06 07:43:08 (UTC) |
commit | e7d5436f3379f45d9c165a2826b1f4ae5adaeea4 (patch) (side-by-side diff) | |
tree | c05f10f573167fd2a0289715a6e7272cfa45fad4 | |
parent | 4f987e0199430d04a4ac86007f0a79c631c2e611 (diff) | |
download | opie-e7d5436f3379f45d9c165a2826b1f4ae5adaeea4.zip opie-e7d5436f3379f45d9c165a2826b1f4ae5adaeea4.tar.gz opie-e7d5436f3379f45d9c165a2826b1f4ae5adaeea4.tar.bz2 |
ramses stuff
better doc-strings setDisplayBrightness(), setDisplayContrast() and their
...Resolution() friends
-rw-r--r-- | libopie/odevice.cpp | 12 | ||||
-rw-r--r-- | libopie/odevice.h | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 160568b..f808960 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -535,66 +535,70 @@ bool ODevice::suspend ( ) #define VESA_POWERDOWN 3 /** * This sets the display on or off */ bool ODevice::setDisplayStatus ( bool on ) { qDebug("ODevice::setDisplayStatus(%d)", on); if ( d-> m_model == Model_Unknown ) return false; bool res = false; int fd; if (( fd = ::open ( "/dev/fb0", O_RDWR )) >= 0 ) { res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 ); ::close ( fd ); } return res; } /** * This sets the display brightness + * + * @param p The brightness to be set on a scale from 0 to 255 * @return success or failure */ bool ODevice::setDisplayBrightness ( int p) { Q_UNUSED( p ) return false; } /** - * @return return the max value for the brightness settings slider + * @return returns the number of steppings on the brightness slider + * in the Light-'n-Power settings. */ int ODevice::displayBrightnessResolution ( ) const { return 16; } /** * This sets the display contrast + * @param p The contrast to be set on a scale from 0 to 255 * @return success or failure */ bool ODevice::setDisplayContrast ( int p) { Q_UNUSED( p ) return false; } /** * @return return the max value for the brightness settings slider * or 0 if the device doesn't support setting of a contrast */ int ODevice::displayContrastResolution ( ) const { return 0; } /** * This returns the vendor as string * @return Vendor as QString */ QString ODevice::vendorString ( ) const { return d-> m_vendorstr; @@ -2049,50 +2053,50 @@ bool Ramses::setDisplayBrightness(int bright) if ((fd = ::open("/proc/sys/board/pwm1", O_WRONLY)) >= 0) { qDebug(" %d -> pwm1", bright); char writeCommand[100]; const int count = sprintf(writeCommand, "%d\n", bright); res = (::write(fd, writeCommand, count) != -1); ::close(fd); } else { qWarning("no write"); } return res; } int Ramses::displayBrightnessResolution() const { return 32; } bool Ramses::setDisplayContrast(int contr) { qDebug("Ramses::setDisplayContrast(%d)", contr); bool res = false; int fd; - // pwm0 contrast: 35 steps 65..100 (dunkel->hell) + // pwm0 contrast: 20 steps 79..90 (dunkel->hell) if (contr > 255 ) contr = 255; if (contr < 0) contr = 0; - contr = 65 + (contr * 350 / 255); + contr = 90 - (contr * 20 / 255); if ((fd = ::open("/proc/sys/board/pwm0", O_WRONLY)) >= 0) { qDebug(" %d -> pwm0", contr); char writeCommand[100]; const int count = sprintf(writeCommand, "%d\n", contr); res = (::write(fd, writeCommand, count) != -1); res = true; ::close(fd); } else { qWarning("no write"); } return res; } int Ramses::displayContrastResolution() const { - return 32; + return 20; } diff --git a/libopie/odevice.h b/libopie/odevice.h index 6c4830e..0974e8d 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h @@ -108,49 +108,48 @@ enum OLed { }; enum OHardKey { HardKey_Datebook = Qt::Key_F9, HardKey_Contacts = Qt::Key_F10, HardKey_Menu = Qt::Key_F11, HardKey_Home = Qt::Key_F12, HardKey_Mail = Qt::Key_F13, HardKey_Record = Qt::Key_F24, HardKey_Suspend = Qt::Key_F34, HardKey_Backlight = Qt::Key_F35, }; enum ODirection { CW = 0, CCW = 1, Flip = 2, }; /** * A singleton which gives informations about device specefic option * like the Hardware used, LEDs, the Base Distribution and * hardware key mappings. * - * * @short A small class for device specefic options * @see QObject * @author Robert Griebl * @version 1.0 */ class ODevice : public QObject { Q_OBJECT private: /* disable copy */ ODevice ( const ODevice & ); protected: ODevice ( ); virtual void init ( ); virtual void initButtons ( ); ODeviceData *d; public: // sandman do we want to allow destructions? -zecke? virtual ~ODevice ( ); |