summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp41
-rw-r--r--core/applets/rotateapplet/rotate.h1
-rw-r--r--libopie/odevice.cpp124
-rw-r--r--libopie/odevice.h4
-rw-r--r--qt/qt-2.3.7.patch/qte237-all.patch11
5 files changed, 162 insertions, 19 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index ac6b259..0da2f0c 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -45,93 +45,134 @@ using namespace Opie;
45RotateApplet::RotateApplet ( ) 45RotateApplet::RotateApplet ( )
46 : QObject ( 0, "RotateApplet" ), ref ( 0 ), m_flipped( false ) 46 : QObject ( 0, "RotateApplet" ), ref ( 0 ), m_flipped( false )
47{ 47{
48 48
49#if !defined(QT_NO_COP) 49#if !defined(QT_NO_COP)
50 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); 50 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this );
51 connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 51 connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
52 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 52 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
53#endif 53#endif
54 54
55} 55}
56 56
57RotateApplet::~RotateApplet ( ) 57RotateApplet::~RotateApplet ( )
58{ 58{
59} 59}
60 60
61 61
62/** 62/**
63 * Qcop receive method. 63 * Qcop receive method.
64 */ 64 */
65void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) { 65void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) {
66 QDataStream stream( data, IO_ReadOnly ); 66 QDataStream stream( data, IO_ReadOnly );
67 if ( msg == "flip()" ) { 67 if ( msg == "flip()" ) {
68 activated ( ); 68 activated ( );
69 } else if ( msg == "rotateDefault()") {
70 rotateDefault();
69 } 71 }
70} 72}
71 73
72 74
73int RotateApplet::position ( ) const 75int RotateApplet::position ( ) const
74{ 76{
75 return 3; 77 return 3;
76} 78}
77 79
78QString RotateApplet::name ( ) const 80QString RotateApplet::name ( ) const
79{ 81{
80 return tr( "Rotate shortcut" ); 82 return tr( "Rotate shortcut" );
81} 83}
82 84
83QString RotateApplet::text ( ) const 85QString RotateApplet::text ( ) const
84{ 86{
85 return tr( "Rotate" ); 87 return tr( "Rotate" );
86} 88}
87 89
88/*QString RotateApplet::tr( const char* s ) const 90/*QString RotateApplet::tr( const char* s ) const
89{ 91{
90 return qApp->translate( "RotateApplet", s, 0 ); 92 return qApp->translate( "RotateApplet", s, 0 );
91} 93}
92 94
93QString RotateApplet::tr( const char* s, const char* p ) const 95QString RotateApplet::tr( const char* s, const char* p ) const
94{ 96{
95 return qApp->translate( "RotateApplet", s, p ); 97 return qApp->translate( "RotateApplet", s, p );
96} 98}
97*/ 99*/
98 100
99QIconSet RotateApplet::icon ( ) const 101QIconSet RotateApplet::icon ( ) const
100{ 102{
101 QPixmap pix; 103 QPixmap pix;
102 QImage img = Resource::loadImage ( "Rotation" ); 104 QImage img = Resource::loadImage ( "Rotation" );
103 105
104 if ( !img. isNull ( )) 106 if ( !img. isNull ( ))
105 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 107 pix. convertFromImage ( img. smoothScale ( 14, 14 ));
106 return pix; 108 return pix;
107} 109}
108 110
109QPopupMenu *RotateApplet::popup ( QWidget * ) const 111QPopupMenu *RotateApplet::popup ( QWidget * ) const
110{ 112{
111 return 0; 113 return 0;
112} 114}
113 115
116void RotateApplet::rotateDefault ( )
117{
118
119 int rot = ODevice::inst()->rotation();
120
121 switch (rot) {
122 case Rot0:
123 rot=0;
124 break;
125 case Rot90:
126 rot=90;
127 break;
128 case Rot180:
129 rot=180;
130 break;
131 case Rot270:
132 rot=270;
133 break;
134 default:
135 rot=0;
136 break;
137 }
138 Config cfg( "qpe" );
139 cfg.setGroup( "Appearance" );
140
141 bool rotateDisabled = cfg.readBoolEntry( "rotateEnabled",false );
142
143 if (rotateDisabled == true)
144 return;
145
146 // hide inputs methods before rotation
147 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
148
149 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
150 env << rot;
151
152 m_flipped = false;
153
154}
114void RotateApplet::activated ( ) 155void RotateApplet::activated ( )
115{ 156{
116 157
117 int defaultRotation = QPEApplication::defaultRotation(); 158 int defaultRotation = QPEApplication::defaultRotation();
118 int newRotation = defaultRotation; 159 int newRotation = defaultRotation;
119 160
120 Config cfg( "qpe" ); 161 Config cfg( "qpe" );
121 cfg.setGroup( "Appearance" ); 162 cfg.setGroup( "Appearance" );
122 163
123 int rotDirection = cfg.readNumEntry( "rotatedir" ); 164 int rotDirection = cfg.readNumEntry( "rotatedir" );
124 ODirection rot = CW; 165 ODirection rot = CW;
125 166
126 if (rotDirection == -1) { 167 if (rotDirection == -1) {
127 rot = ODevice::inst ( )-> direction ( ); 168 rot = ODevice::inst ( )-> direction ( );
128 } else { 169 } else {
129 rot = (ODirection)rotDirection; 170 rot = (ODirection)rotDirection;
130 } 171 }
131 172
132 // hide inputs methods before rotation 173 // hide inputs methods before rotation
133 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 174 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
134 175
135 if ( m_flipped ) { 176 if ( m_flipped ) {
136 // if flipped, flip back to the original state, 177 // if flipped, flip back to the original state,
137 // regardless of rotation direction 178 // regardless of rotation direction
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h
index de2a707..572b82a 100644
--- a/core/applets/rotateapplet/rotate.h
+++ b/core/applets/rotateapplet/rotate.h
@@ -37,35 +37,36 @@
37#include <qobject.h> 37#include <qobject.h>
38 38
39class RotateApplet : public QObject, public MenuAppletInterface 39class RotateApplet : public QObject, public MenuAppletInterface
40{ 40{
41 41
42 Q_OBJECT 42 Q_OBJECT
43 43
44public: 44public:
45 RotateApplet ( ); 45 RotateApplet ( );
46 virtual ~RotateApplet ( ); 46 virtual ~RotateApplet ( );
47 47
48 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 48 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
49 Q_REFCOUNT 49 Q_REFCOUNT
50 50
51 virtual int position() const; 51 virtual int position() const;
52 52
53 virtual QString name ( ) const; 53 virtual QString name ( ) const;
54 virtual QIconSet icon ( ) const; 54 virtual QIconSet icon ( ) const;
55 virtual QString text ( ) const; 55 virtual QString text ( ) const;
56 /* virtual QString tr( const char* ) const; 56 /* virtual QString tr( const char* ) const;
57 virtual QString tr( const char*, const char* ) const; 57 virtual QString tr( const char*, const char* ) const;
58 */ 58 */
59 virtual QPopupMenu *popup ( QWidget *parent ) const; 59 virtual QPopupMenu *popup ( QWidget *parent ) const;
60 virtual void activated ( ); 60 virtual void activated ( );
61 virtual void rotateDefault ( );
61 62
62private slots: 63private slots:
63 void channelReceived( const QCString &msg, const QByteArray & data ); 64 void channelReceived( const QCString &msg, const QByteArray & data );
64 65
65private: 66private:
66 ulong ref; 67 ulong ref;
67 bool m_flipped; 68 bool m_flipped;
68 69
69}; 70};
70 71
71#endif 72#endif
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 9373ef9..5038cc9 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -121,48 +121,53 @@ public:
121}; 121};
122 122
123class Zaurus : public ODevice { 123class Zaurus : public ODevice {
124protected: 124protected:
125 virtual void init ( ); 125 virtual void init ( );
126 virtual void initButtons ( ); 126 virtual void initButtons ( );
127 127
128public: 128public:
129 virtual bool setSoftSuspend ( bool soft ); 129 virtual bool setSoftSuspend ( bool soft );
130 130
131 virtual bool setDisplayBrightness ( int b ); 131 virtual bool setDisplayBrightness ( int b );
132 virtual int displayBrightnessResolution ( ) const; 132 virtual int displayBrightnessResolution ( ) const;
133 133
134 virtual void alarmSound ( ); 134 virtual void alarmSound ( );
135 virtual void keySound ( ); 135 virtual void keySound ( );
136 virtual void touchSound ( ); 136 virtual void touchSound ( );
137 137
138 virtual QValueList <OLed> ledList ( ) const; 138 virtual QValueList <OLed> ledList ( ) const;
139 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 139 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
140 virtual OLedState ledState ( OLed led ) const; 140 virtual OLedState ledState ( OLed led ) const;
141 virtual bool setLedState ( OLed led, OLedState st ); 141 virtual bool setLedState ( OLed led, OLedState st );
142 142
143 static bool isZaurus(); 143 static bool isZaurus();
144 144
145 // Does this break BC?
146 virtual bool suspend ( );
147 virtual Transformation rotation ( ) const;
148 virtual ODirection direction ( ) const;
149
145protected: 150protected:
146 virtual void buzzer ( int snd ); 151 virtual void buzzer ( int snd );
147 152
148 OLedState m_leds [1]; 153 OLedState m_leds [1];
149 bool m_embedix; 154 bool m_embedix;
150}; 155};
151 156
152class SIMpad : public ODevice, public QWSServer::KeyboardFilter { 157class SIMpad : public ODevice, public QWSServer::KeyboardFilter {
153protected: 158protected:
154 virtual void init ( ); 159 virtual void init ( );
155 virtual void initButtons ( ); 160 virtual void initButtons ( );
156 161
157public: 162public:
158 virtual bool setSoftSuspend ( bool soft ); 163 virtual bool setSoftSuspend ( bool soft );
159 virtual bool suspend(); 164 virtual bool suspend();
160 165
161 virtual bool setDisplayStatus( bool on ); 166 virtual bool setDisplayStatus( bool on );
162 virtual bool setDisplayBrightness ( int b ); 167 virtual bool setDisplayBrightness ( int b );
163 virtual int displayBrightnessResolution ( ) const; 168 virtual int displayBrightnessResolution ( ) const;
164 169
165 virtual void alarmSound ( ); 170 virtual void alarmSound ( );
166 171
167 virtual QValueList <OLed> ledList ( ) const; 172 virtual QValueList <OLed> ledList ( ) const;
168 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 173 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
@@ -268,52 +273,52 @@ struct z_button {
268 "QPE/TaskBar", "toggleStartMenu()" }, 273 "QPE/TaskBar", "toggleStartMenu()" },
269 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 274 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
270 "devicebuttons/z_mail", 275 "devicebuttons/z_mail",
271 "mail", "raise()", 276 "mail", "raise()",
272 "mail", "newMail()" }, 277 "mail", "newMail()" },
273}; 278};
274 279
275struct z_button z_buttons_c700 [] = { 280struct z_button z_buttons_c700 [] = {
276 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 281 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
277 "devicebuttons/z_calendar", 282 "devicebuttons/z_calendar",
278 "datebook", "nextView()", 283 "datebook", "nextView()",
279 "today", "raise()" }, 284 "today", "raise()" },
280 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 285 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
281 "devicebuttons/z_contact", 286 "devicebuttons/z_contact",
282 "addressbook", "raise()", 287 "addressbook", "raise()",
283 "addressbook", "beamBusinessCard()" }, 288 "addressbook", "beamBusinessCard()" },
284 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 289 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
285 "devicebuttons/z_home", 290 "devicebuttons/z_home",
286 "QPE/Launcher", "home()", 291 "QPE/Launcher", "home()",
287 "buttonsettings", "raise()" }, 292 "buttonsettings", "raise()" },
288 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 293 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
289 "devicebuttons/z_menu", 294 "devicebuttons/z_menu",
290 "QPE/TaskBar", "toggleMenu()", 295 "QPE/TaskBar", "toggleMenu()",
291 "QPE/TaskBar", "toggleStartMenu()" }, 296 "QPE/TaskBar", "toggleStartMenu()" },
292 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 297 { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
293 "", 298 "",
294 "QPE/Rotation", "flip()", 299 "QPE/Rotation", "rotateDefault()",
295 "QPE/Rotation", "flip()" }, 300 "QPE/Rotation", "rotateDefault()" },
296}; 301};
297 302
298struct s_button { 303struct s_button {
299 uint model; 304 uint model;
300 Qt::Key code; 305 Qt::Key code;
301 char *utext; 306 char *utext;
302 char *pix; 307 char *pix;
303 char *fpressedservice; 308 char *fpressedservice;
304 char *fpressedaction; 309 char *fpressedaction;
305 char *fheldservice; 310 char *fheldservice;
306 char *fheldaction; 311 char *fheldaction;
307} simpad_buttons [] = { 312} simpad_buttons [] = {
308 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 313 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
309 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), 314 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"),
310 "devicebuttons/simpad_lower_up", 315 "devicebuttons/simpad_lower_up",
311 "datebook", "nextView()", 316 "datebook", "nextView()",
312 "today", "raise()" }, 317 "today", "raise()" },
313 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 318 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
314 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), 319 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"),
315 "devicebuttons/simpad_lower_down", 320 "devicebuttons/simpad_lower_down",
316 "addressbook", "raise()", 321 "addressbook", "raise()",
317 "addressbook", "beamBusinessCard()" }, 322 "addressbook", "beamBusinessCard()" },
318 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 323 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
319 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), 324 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"),
@@ -1611,62 +1616,50 @@ void Zaurus::init ( )
1611 d-> m_modelstr = "Zaurus SL-C700"; 1616 d-> m_modelstr = "Zaurus SL-C700";
1612 } else if ( model == "SHARP Shepherd" ) { 1617 } else if ( model == "SHARP Shepherd" ) {
1613 d-> m_model = Model_Zaurus_SLC7x0; 1618 d-> m_model = Model_Zaurus_SLC7x0;
1614 d-> m_modelstr = "Zaurus SL-C750"; 1619 d-> m_modelstr = "Zaurus SL-C750";
1615 } else if ( model == "SHARP Husky" ) { 1620 } else if ( model == "SHARP Husky" ) {
1616 d-> m_model = Model_Zaurus_SLC7x0; 1621 d-> m_model = Model_Zaurus_SLC7x0;
1617 d-> m_modelstr = "Zaurus SL-C760"; 1622 d-> m_modelstr = "Zaurus SL-C760";
1618 } else if ( model == "SHARP Poodle" ) { 1623 } else if ( model == "SHARP Poodle" ) {
1619 d-> m_model = Model_Zaurus_SLB600; 1624 d-> m_model = Model_Zaurus_SLB600;
1620 d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; 1625 d-> m_modelstr = "Zaurus SL-B500 or SL-5600";
1621 } else if ( model == "Sharp-Collie" || model == "Collie" ) { 1626 } else if ( model == "Sharp-Collie" || model == "Collie" ) {
1622 d-> m_model = Model_Zaurus_SL5500; 1627 d-> m_model = Model_Zaurus_SL5500;
1623 d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; 1628 d-> m_modelstr = "Zaurus SL-5500 or SL-5000d";
1624 } else { 1629 } else {
1625 d-> m_model = Model_Zaurus_SL5500; 1630 d-> m_model = Model_Zaurus_SL5500;
1626 d-> m_modelstr = "Zaurus (Model unknown)"; 1631 d-> m_modelstr = "Zaurus (Model unknown)";
1627 } 1632 }
1628 1633
1629 bool flipstate = false; 1634 bool flipstate = false;
1630 switch ( d-> m_model ) { 1635 switch ( d-> m_model ) {
1631 case Model_Zaurus_SLA300: 1636 case Model_Zaurus_SLA300:
1632 d-> m_rotation = Rot0; 1637 d-> m_rotation = Rot0;
1633 break; 1638 break;
1634 case Model_Zaurus_SLC7x0: 1639 case Model_Zaurus_SLC7x0:
1635 // Note: need to 1) set flipstate based on physical screen orientation 1640 d-> m_rotation = rotation();
1636 // and 2) check to see if the user overrode the rotation direction 1641 d-> m_direction = direction();
1637 // using appearance, and if so, remove that item from the Config to
1638 // ensure the rotate applet flips us back to the previous state.
1639 // treke said he has patches for detecting the phys. so where are they, treke? -mickeyl.
1640 if ( flipstate ) {
1641 // 480x640
1642 d-> m_rotation = Rot0;
1643 d-> m_direction = CW;
1644 } else {
1645 // 640x480
1646 d-> m_rotation = Rot270;
1647 d-> m_direction = CCW;
1648 }
1649 break; 1642 break;
1650 case Model_Zaurus_SLB600: 1643 case Model_Zaurus_SLB600:
1651 case Model_Zaurus_SL5500: 1644 case Model_Zaurus_SL5500:
1652 case Model_Zaurus_SL5000: 1645 case Model_Zaurus_SL5000:
1653 default: 1646 default:
1654 d-> m_rotation = Rot270; 1647 d-> m_rotation = Rot270;
1655 break; 1648 break;
1656 } 1649 }
1657 m_leds [0] = Led_Off; 1650 m_leds [0] = Led_Off;
1658} 1651}
1659 1652
1660void Zaurus::initButtons ( ) 1653void Zaurus::initButtons ( )
1661{ 1654{
1662 if ( d-> m_buttons ) 1655 if ( d-> m_buttons )
1663 return; 1656 return;
1664 1657
1665 d-> m_buttons = new QValueList <ODeviceButton>; 1658 d-> m_buttons = new QValueList <ODeviceButton>;
1666 1659
1667 struct z_button * pz_buttons; 1660 struct z_button * pz_buttons;
1668 int buttoncount; 1661 int buttoncount;
1669 switch ( d-> m_model ) { 1662 switch ( d-> m_model ) {
1670 case Model_Zaurus_SLC7x0: 1663 case Model_Zaurus_SLC7x0:
1671 pz_buttons = z_buttons_c700; 1664 pz_buttons = z_buttons_c700;
1672 buttoncount = ARRAY_SIZE(z_buttons_c700); 1665 buttoncount = ARRAY_SIZE(z_buttons_c700);
@@ -1725,48 +1718,50 @@ void Zaurus::initButtons ( )
1725#define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) 1718#define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4)
1726#define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) 1719#define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5)
1727 1720
1728//#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ 1721//#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */
1729//#define SHARP_BUZ_KEYSOUND 2 /* key sound */ 1722//#define SHARP_BUZ_KEYSOUND 2 /* key sound */
1730 1723
1731//#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ 1724//#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */
1732//#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ 1725//#define SHARP_PDA_WARNSOUND 4 /* warning occurred */
1733//#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ 1726//#define SHARP_PDA_ERRORSOUND 5 /* error occurred */
1734//#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ 1727//#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */
1735//#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ 1728//#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */
1736//#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ 1729//#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */
1737//#define SHARP_PDA_APPSTART 9 /* application start */ 1730//#define SHARP_PDA_APPSTART 9 /* application start */
1738//#define SHARP_PDA_APPQUIT 10 /* application ends */ 1731//#define SHARP_PDA_APPQUIT 10 /* application ends */
1739 1732
1740//#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ 1733//#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */
1741//#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ 1734//#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */
1742//#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ 1735//#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */
1743//#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ 1736//#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */
1744// 1737//
1745 1738
1746 #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 1739 #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
1747#define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) 1740#define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1)
1748 1741
1742#define SHARP_IOCTL_GET_ROTATION 0x413c
1743
1749typedef struct sharp_led_status { 1744typedef struct sharp_led_status {
1750 int which; /* select which LED status is wanted. */ 1745 int which; /* select which LED status is wanted. */
1751 int status; /* set new led status if you call SHARP_LED_SETSTATUS */ 1746 int status; /* set new led status if you call SHARP_LED_SETSTATUS */
1752} sharp_led_status; 1747} sharp_led_status;
1753 1748
1754#define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ 1749#define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */
1755 1750
1756#define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ 1751#define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */
1757#define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ 1752#define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */
1758#define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ 1753#define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */
1759 1754
1760// #include <asm/sharp_apm.h> // including kernel headers is evil ... 1755// #include <asm/sharp_apm.h> // including kernel headers is evil ...
1761 1756
1762#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) 1757#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int )
1763#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) 1758#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int )
1764#define APM_EVT_POWER_BUTTON (1 << 0) 1759#define APM_EVT_POWER_BUTTON (1 << 0)
1765 1760
1766#define FL_IOCTL_STEP_CONTRAST 100 1761#define FL_IOCTL_STEP_CONTRAST 100
1767 1762
1768 1763
1769void Zaurus::buzzer ( int sound ) 1764void Zaurus::buzzer ( int sound )
1770{ 1765{
1771#ifndef QT_NO_SOUND 1766#ifndef QT_NO_SOUND
1772 QString soundname; 1767 QString soundname;
@@ -1958,48 +1953,143 @@ bool Zaurus::setDisplayBrightness ( int bright )
1958 1953
1959 if ( bright > 255 ) 1954 if ( bright > 255 )
1960 bright = 255; 1955 bright = 255;
1961 if ( bright < 0 ) 1956 if ( bright < 0 )
1962 bright = 0; 1957 bright = 0;
1963 1958
1964 if (m_embedix) { 1959 if (m_embedix) {
1965 if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) { 1960 if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) {
1966 int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus 1961 int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus
1967 if ( bright && !bl ) 1962 if ( bright && !bl )
1968 bl = 1; 1963 bl = 1;
1969 res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 ); 1964 res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 );
1970 ::close ( fd ); 1965 ::close ( fd );
1971 } 1966 }
1972 } else { 1967 } else {
1973#define FB_BACKLIGHT_SET_BRIGHTNESS _IOW('F', 1, u_int) /* set brightness */ 1968#define FB_BACKLIGHT_SET_BRIGHTNESS _IOW('F', 1, u_int) /* set brightness */
1974 if (( fd = ::open ( "/dev/fb0", O_WRONLY )) >= 0 ) { 1969 if (( fd = ::open ( "/dev/fb0", O_WRONLY )) >= 0 ) {
1975 res = ( ::ioctl ( fd , FB_BACKLIGHT_SET_BRIGHTNESS, bright ) == 0 ); 1970 res = ( ::ioctl ( fd , FB_BACKLIGHT_SET_BRIGHTNESS, bright ) == 0 );
1976 ::close ( fd ); 1971 ::close ( fd );
1977 } 1972 }
1978 } 1973 }
1979 return res; 1974 return res;
1980} 1975}
1981 1976
1977bool Zaurus::suspend ( )
1978{
1979 qDebug("ODevice::suspend");
1980 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
1981 return false;
1982
1983 if ( d-> m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
1984 return false;
1985
1986 bool res = false;
1987
1988 struct timeval tvs, tvn;
1989 ::gettimeofday ( &tvs, 0 );
1990
1991 ::sync ( ); // flush fs caches
1992 res = ( ::system ( "apm --suspend" ) == 0 );
1993
1994 // This is needed because the iPAQ apm implementation is asynchronous and we
1995 // can not be sure when exactly the device is really suspended
1996 // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists.
1997
1998 if ( res ) {
1999 do { // Yes, wait 15 seconds. This APM bug sucks big time.
2000 ::usleep ( 200 * 1000 );
2001 ::gettimeofday ( &tvn, 0 );
2002 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
2003 }
2004
2005 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
2006 return res;
2007}
2008
2009
2010Transformation Zaurus::rotation ( ) const
2011{
2012 Transformation rot;
2013 int handle = 0;
2014 int retval = 0;
2015
2016 switch ( d-> m_model ) {
2017 case Model_Zaurus_SLC7x0:
2018 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
2019 if (handle == -1) {
2020 return Rot270;
2021 } else {
2022 retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION);
2023 ::close (handle);
2024
2025 if (retval == 2 )
2026 rot = Rot0;
2027 else
2028 rot = Rot270;
2029 }
2030 break;
2031 case Model_Zaurus_SLA300:
2032 case Model_Zaurus_SLB600:
2033 case Model_Zaurus_SL5500:
2034 case Model_Zaurus_SL5000:
2035 default:
2036 rot = d-> m_rotation;
2037 break;
2038 }
2039
2040 return rot;
2041}
2042ODirection Zaurus::direction ( ) const
2043{
2044 ODirection dir;
2045 int handle = 0;
2046 int retval = 0;
2047 switch ( d-> m_model ) {
2048 case Model_Zaurus_SLC7x0:
2049 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
2050 if (handle == -1) {
2051 dir = Rot270;
2052 } else {
2053 retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION);
2054 ::close (handle);
2055 if (retval == 2 )
2056 dir = CCW;
2057 else
2058 dir = CW;
2059 }
2060 break;
2061 case Model_Zaurus_SLA300:
2062 case Model_Zaurus_SLB600:
2063 case Model_Zaurus_SL5500:
2064 case Model_Zaurus_SL5000:
2065 default:
2066 dir = d-> m_direction;
2067 break;
2068 }
2069 return dir;
2070
2071}
1982 2072
1983int Zaurus::displayBrightnessResolution ( ) const 2073int Zaurus::displayBrightnessResolution ( ) const
1984{ 2074{
1985 if (m_embedix) 2075 if (m_embedix)
1986 return 5; 2076 return 5;
1987 else 2077 else
1988 return 256; 2078 return 256;
1989} 2079}
1990 2080
1991/************************************************** 2081/**************************************************
1992 * 2082 *
1993 * SIMpad 2083 * SIMpad
1994 * 2084 *
1995 **************************************************/ 2085 **************************************************/
1996 2086
1997void SIMpad::init ( ) 2087void SIMpad::init ( )
1998{ 2088{
1999 d-> m_vendorstr = "SIEMENS"; 2089 d-> m_vendorstr = "SIEMENS";
2000 d-> m_vendor = Vendor_SIEMENS; 2090 d-> m_vendor = Vendor_SIEMENS;
2001 2091
2002 QFile f ( "/proc/hal/model" ); 2092 QFile f ( "/proc/hal/model" );
2003 2093
2004 //TODO Implement model checking 2094 //TODO Implement model checking
2005 //FIXME For now we assume an SL4 2095 //FIXME For now we assume an SL4
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 25910b5..8273761 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -166,50 +166,50 @@ protected:
166 virtual void initButtons ( ); 166 virtual void initButtons ( );
167 167
168 ODeviceData *d; 168 ODeviceData *d;
169 169
170public: 170public:
171 // sandman do we want to allow destructions? -zecke? 171 // sandman do we want to allow destructions? -zecke?
172 virtual ~ODevice ( ); 172 virtual ~ODevice ( );
173 173
174 static ODevice *inst ( ); 174 static ODevice *inst ( );
175 175
176 // information 176 // information
177 177
178 QString modelString ( ) const; 178 QString modelString ( ) const;
179 OModel model ( ) const; 179 OModel model ( ) const;
180 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } 180 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); }
181 181
182 QString vendorString ( ) const; 182 QString vendorString ( ) const;
183 OVendor vendor ( ) const; 183 OVendor vendor ( ) const;
184 184
185 QString systemString ( ) const; 185 QString systemString ( ) const;
186 OSystem system ( ) const; 186 OSystem system ( ) const;
187 187
188 QString systemVersionString ( ) const; 188 QString systemVersionString ( ) const;
189 189
190 Transformation rotation ( ) const; 190 virtual Transformation rotation ( ) const;
191 ODirection direction ( ) const; 191 virtual ODirection direction ( ) const;
192 192
193// system 193// system
194 194
195 virtual bool setSoftSuspend ( bool on ); 195 virtual bool setSoftSuspend ( bool on );
196 virtual bool suspend ( ); 196 virtual bool suspend ( );
197 197
198 virtual bool setDisplayStatus ( bool on ); 198 virtual bool setDisplayStatus ( bool on );
199 virtual bool setDisplayBrightness ( int brightness ); 199 virtual bool setDisplayBrightness ( int brightness );
200 virtual int displayBrightnessResolution ( ) const; 200 virtual int displayBrightnessResolution ( ) const;
201 virtual bool setDisplayContrast ( int contrast ); 201 virtual bool setDisplayContrast ( int contrast );
202 virtual int displayContrastResolution ( ) const; 202 virtual int displayContrastResolution ( ) const;
203 203
204 // don't add new virtual methods, use this: 204 // don't add new virtual methods, use this:
205 ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; 205 ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
206 // and in your subclass do do overwrite 206 // and in your subclass do do overwrite
207 //protected virtual int virtual_hook(int, void *) 207 //protected virtual int virtual_hook(int, void *)
208 // which is defined below 208 // which is defined below
209 209
210// input / output 210// input / output
211 //FIXME playAlarmSound and al might be better -zecke 211 //FIXME playAlarmSound and al might be better -zecke
212 virtual void alarmSound ( ); 212 virtual void alarmSound ( );
213 virtual void keySound ( ); 213 virtual void keySound ( );
214 virtual void touchSound ( ); 214 virtual void touchSound ( );
215 215
diff --git a/qt/qt-2.3.7.patch/qte237-all.patch b/qt/qt-2.3.7.patch/qte237-all.patch
index 233996a..e6cf0a4 100644
--- a/qt/qt-2.3.7.patch/qte237-all.patch
+++ b/qt/qt-2.3.7.patch/qte237-all.patch
@@ -387,24 +387,35 @@ diff -ru qt-2.3.5_fresh/src/widgets/qtoolbutton.cpp qt-2.3.5/src/widgets/qtoolbu
387 } 387 }
388 -#endif 388 -#endif
389+#endif 389+#endif
390 } 390 }
391 391
392 392
393@@ -324,12 +324,12 @@ 393@@ -324,12 +324,12 @@
394 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Large, QIconSet::Normal); 394 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Large, QIconSet::Normal);
395 w = pm.width(); 395 w = pm.width();
396 h = pm.height(); 396 h = pm.height();
397 -if ( w < 32 ) 397 -if ( w < 32 )
398 - w = 32; 398 - w = 32;
399 -if ( h < 32 ) 399 -if ( h < 32 )
400 - h = 32; 400 - h = 32;
401 +if ( w < 24 ) 401 +if ( w < 24 )
402 + w = 24; 402 + w = 24;
403 +if ( h < 24 ) 403 +if ( h < 24 )
404 + h = 24; 404 + h = 24;
405 } else { 405 } else {
406 -w = h = 16; 406 -w = h = 16;
407 +w = h = 14; 407 +w = h = 14;
408 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Small, QIconSet::Normal); 408 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Small, QIconSet::Normal);
409 w = pm.width(); 409 w = pm.width();
410 h = pm.height(); 410 h = pm.height();
411 --- qt-2.3.7/src/kernel/qkeyboard_qws.cpp~c7xxrotate2003-07-16 18:20:25.000000000 -0700
412 +++ qt-2.3.7/src/kernel/qkeyboard_qws.cpp2003-12-07 15:54:10.000000000 -0800
413@@ -238,7 +238,7 @@
414 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 63
415 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 64
416 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 65
417 - { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 66
418+ { Qt::Key_F14, 0xffff , 0xffff , 0xffff }, // 66
419 { Qt::Key_Meta, 0xffff , 0xffff , 0xffff }, // 67
420 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 68
421 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 69