author | mickeyl <mickeyl> | 2004-01-13 18:32:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-13 18:32:19 (UTC) |
commit | 061ccf5b9d384b1f24d203e96f1f04ccf1dcf133 (patch) (unidiff) | |
tree | ec1fc064f001edba92e58116cdc35fc909b5cdd6 /libopie2/opiecore/device/odevice_simpad.cpp | |
parent | 59f7fa0a480bf921a67ad42fc1fe018b1be44192 (diff) | |
download | opie-061ccf5b9d384b1f24d203e96f1f04ccf1dcf133.zip opie-061ccf5b9d384b1f24d203e96f1f04ccf1dcf133.tar.gz opie-061ccf5b9d384b1f24d203e96f1f04ccf1dcf133.tar.bz2 |
- rewrite device detection
- cleanup
- split odevice stuff into header and cpp files
- Note for next buildsystem: Don't link all header files but distinguish
between public and private headers, e.g. odevice.h is public while
odevice_ipaq.h is private.
Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 82dce10..a2cd419 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -29,3 +29,3 @@ | |||
29 | 29 | ||
30 | #include "odevice.h" | 30 | #include "odevice_simpad.h" |
31 | 31 | ||
@@ -55,57 +55,5 @@ | |||
55 | 55 | ||
56 | #ifndef ARRAY_SIZE | ||
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 )) | ||
63 | |||
64 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | ||
65 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | ||
66 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | ||
67 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | ||
68 | |||
69 | using namespace Opie; | 56 | using namespace Opie; |
70 | 57 | ||
71 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter | 58 | struct s_button simpad_buttons [] = { |
72 | { | ||
73 | protected: | ||
74 | virtual void init(); | ||
75 | virtual void initButtons(); | ||
76 | |||
77 | public: | ||
78 | virtual bool setSoftSuspend( bool soft ); | ||
79 | virtual bool suspend(); | ||
80 | |||
81 | virtual bool setDisplayStatus( bool on ); | ||
82 | virtual bool setDisplayBrightness( int b ); | ||
83 | virtual int displayBrightnessResolution() const; | ||
84 | |||
85 | virtual void alarmSound(); | ||
86 | |||
87 | virtual QValueList <OLed> ledList() const; | ||
88 | virtual QValueList <OLedState> ledStateList( OLed led ) const; | ||
89 | virtual OLedState ledState( OLed led ) const; | ||
90 | virtual bool setLedState( OLed led, OLedState st ); | ||
91 | |||
92 | protected: | ||
93 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | ||
94 | virtual void timerEvent( QTimerEvent *te ); | ||
95 | |||
96 | int m_power_timer; | ||
97 | |||
98 | OLedState m_leds [1]; | ||
99 | }; | ||
100 | |||
101 | struct s_button { | ||
102 | uint model; | ||
103 | Qt::Key code; | ||
104 | char *utext; | ||
105 | char *pix; | ||
106 | char *fpressedservice; | ||
107 | char *fpressedaction; | ||
108 | char *fheldservice; | ||
109 | char *fheldaction; | ||
110 | } simpad_buttons [] = { | ||
111 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 59 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |