summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ramses.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ramses.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp50
1 files changed, 2 insertions, 48 deletions
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp
index a90c3a0..5bcf6a9 100644
--- a/libopie2/opiecore/device/odevice_ramses.cpp
+++ b/libopie2/opiecore/device/odevice_ramses.cpp
@@ -18,25 +18,25 @@
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include "odevice.h" 30#include "odevice_ramses.h"
31 31
32/* QT */ 32/* QT */
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
@@ -44,71 +44,25 @@
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56#ifndef ARRAY_SIZE 56struct r_button ramses_buttons [] = {
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
69using namespace Opie;
70
71class Ramses : public ODevice, public QWSServer::KeyboardFilter
72{
73 protected:
74 virtual void init();
75
76 public:
77 virtual bool setSoftSuspend( bool soft );
78 virtual bool suspend();
79
80 virtual bool setDisplayStatus( bool on );
81 virtual bool setDisplayBrightness( int b );
82 virtual int displayBrightnessResolution() const;
83 virtual bool setDisplayContrast( int b );
84 virtual int displayContrastResolution() const;
85
86 protected:
87 virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
88 virtual void timerEvent ( QTimerEvent *te );
89
90 int m_power_timer;
91};
92
93struct r_button {
94 uint model;
95 Qt::Key code;
96 char *utext;
97 char *pix;
98 char *fpressedservice;
99 char *fpressedaction;
100 char *fheldservice;
101 char *fheldaction;
102} ramses_buttons [] = {
103 { Model_Ramses_MNCI, 57 { Model_Ramses_MNCI,
104 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 58 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
105 "devicebuttons/z_menu", 59 "devicebuttons/z_menu",
106 "QPE/TaskBar", "toggleMenu()", 60 "QPE/TaskBar", "toggleMenu()",
107 "QPE/TaskBar", "toggleStartMenu()" }, 61 "QPE/TaskBar", "toggleStartMenu()" },
108 { Model_Ramses_MNCI, 62 { Model_Ramses_MNCI,
109 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 63 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
110 "devicebuttons/ipaq_home", 64 "devicebuttons/ipaq_home",
111 "QPE/Launcher", "home()", 65 "QPE/Launcher", "home()",
112 "buttonsettings", "raise()" }, 66 "buttonsettings", "raise()" },
113}; 67};
114 68