summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ipaq.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp55
1 files changed, 3 insertions, 52 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index d928806..d68bce1 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -27,7 +27,7 @@
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include "odevice.h" 30#include "odevice_ipaq.h"
31 31
32/* QT */ 32/* QT */
33#include <qapplication.h> 33#include <qapplication.h>
@@ -53,12 +53,7 @@
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56#ifndef ARRAY_SIZE 56/* KERNEL */
57#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
58#endif
59
60// _IO and friends are only defined in kernel headers ...
61
62#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 57#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
63 58
64#define OD_IO(type,number) OD_IOC(0,type,number,0) 59#define OD_IO(type,number) OD_IOC(0,type,number,0)
@@ -82,51 +77,7 @@ typedef struct {
82#define LED_ON OD_IOW( 'f', 5, LED_IN ) 77#define LED_ON OD_IOW( 'f', 5, LED_IN )
83#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
84 79
85using namespace Opie; 80struct i_button ipaq_buttons [] = {
86
87class iPAQ : public ODevice, public QWSServer::KeyboardFilter
88{
89
90 protected:
91 virtual void init();
92 virtual void initButtons();
93
94 public:
95 virtual bool setSoftSuspend( bool soft );
96
97 virtual bool setDisplayBrightness( int b );
98 virtual int displayBrightnessResolution() const;
99
100 virtual void alarmSound();
101
102 virtual QValueList <OLed> ledList() const;
103 virtual QValueList <OLedState> ledStateList( OLed led ) const;
104 virtual OLedState ledState( OLed led ) const;
105 virtual bool setLedState( OLed led, OLedState st );
106
107 virtual bool hasLightSensor() const;
108 virtual int readLightSensor();
109 virtual int lightSensorResolution() const;
110
111 protected:
112 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
113 virtual void timerEvent( QTimerEvent *te );
114
115 int m_power_timer;
116
117 OLedState m_leds [2];
118};
119
120struct i_button {
121 uint model;
122 Qt::Key code;
123 char *utext;
124 char *pix;
125 char *fpressedservice;
126 char *fpressedaction;
127 char *fheldservice;
128 char *fheldaction;
129} ipaq_buttons [] = {
130 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 81 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
131 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 82 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
132 "devicebuttons/ipaq_calendar", 83 "devicebuttons/ipaq_calendar",