summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_htc.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device/odevice_htc.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_htc.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp
index a6ade11..44b33c0 100644
--- a/libopie2/opiecore/device/odevice_htc.cpp
+++ b/libopie2/opiecore/device/odevice_htc.cpp
@@ -86,55 +86,55 @@ struct htc_button htc_buttons [] = {
struct htc_button htc_buttons_universal [] = {
{ Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
"devicebuttons/z_calendar",
"datebook", "nextView()",
"today", "raise()" },
{ Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
"devicebuttons/z_contact",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
{ Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
"devicebuttons/z_home",
"QPE/Launcher", "home()",
"buttonsettings", "raise()" },
{ Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
"devicebuttons/z_menu",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
"devicebuttons/z_mail",
"opiemail", "raise()",
"opiemail", "newMail()" },
{ Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"),
"devicebuttons/z_hinge1",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"),
"devicebuttons/z_hinge2",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"),
"devicebuttons/z_hinge3",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
};
//
// HTC-Universal (PXA-model w/ 480x640 3.6" lcd)
// HTC-Alpine (PXA-model w/ 240x320 3.5" lcd)
// HTC-Apache (PXA-model w/ 240x320 2.8" lcd)
// HTC-Beetles (PXA-model w/ 240x240 3.0" lcd)
// HTC-Blueangel (PXA-model w/ 240x320 3.5" lcd)
// HTC-Himalaya (PXA-model w/ 240x320 3.5" lcd)
// HTC-Magician (PXA-model w/ 240x320 2.8" lcd)
void HTC::init(const QString& cpu_info)
{
qDebug( "HTC::init()" );
// Set the time to wait until the system is really suspended
// the delta between apm --suspend and sleeping
setAPMTimeOut( 15000 );
d->m_vendorstr = "Xanadux Team";
d->m_systemstr = "Familiar";
d->m_system = System_Familiar;
// check the HTC model
@@ -334,49 +334,49 @@ void HTC::playKeySound()
QValueList <OLed> HTC::ledList() const
{
QValueList <OLed> vl;
vl << Led_Mail;
return vl;
}
QValueList <OLedState> HTC::ledStateList( OLed l ) const
{
QValueList <OLedState> vl;
if ( l == Led_Mail )
vl << Led_Off << Led_On << Led_BlinkSlow;
return vl;
}
OLedState HTC::ledState( OLed which ) const
{
if ( which == Led_Mail )
return m_leds [0];
else
return Led_Off;
}
-bool HTC::setLedState( OLed which, OLedState st )
+bool HTC::setLedState( OLed, OLedState )
{
qDebug( "HTC::setLedState: ODevice handling not yet implemented" );
return false;
}
int HTC::displayBrightnessResolution() const
{
int res = 1;
int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK );
if ( fd )
{
char buf[100];
if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res );
::close( fd );
}
return res;
}
bool HTC::setDisplayBrightness( int bright )
{
@@ -410,48 +410,50 @@ bool HTC::setDisplayStatus( bool on )
{
char buf[10];
buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
buf[1] = '\0';
res = ( ::write( fd, &buf[0], 2 ) == 0 );
::close( fd );
}
return res;
}
Transformation HTC::rotation() const
{
qDebug( "HTC::rotation()" );
Transformation rot = Rot270;
switch ( d->m_model ) {
case Model_HTC_Universal:
{
OHingeStatus hs = readHingeSensor();
qDebug( "HTC::rotation() - hinge sensor = %d", (int) hs );
if ( hs == CASE_PORTRAIT ) rot = Rot0;
else if ( hs == CASE_UNKNOWN ) rot = Rot270;
}
break;
+ default:
+ break;
}
qDebug( "HTC::rotation() - returning '%d'", rot );
return rot;
}
ODirection HTC::direction() const
{
ODirection dir;
switch ( d->m_model ) {
case Model_HTC_Universal: {
OHingeStatus hs = readHingeSensor();
if ( hs == CASE_PORTRAIT ) dir = CCW;
else if ( hs == CASE_UNKNOWN ) dir = CCW;
else dir = CW;
}
break;
default: dir = d->m_direction;
break;
}
return dir;
}