author | llornkcor <llornkcor> | 2004-08-17 22:43:56 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-08-17 22:43:56 (UTC) |
commit | 5e11a688c1b9f1d411322df6fb3d4d96613fd44d (patch) (unidiff) | |
tree | 123fea1b43e59c06835cd26d6fb3203a84d72357 /libopie2 | |
parent | 502c9b68e4739b6d487bb2ccd98e34535b7d4f77 (diff) | |
download | opie-5e11a688c1b9f1d411322df6fb3d4d96613fd44d.zip opie-5e11a688c1b9f1d411322df6fb3d4d96613fd44d.tar.gz opie-5e11a688c1b9f1d411322df6fb3d4d96613fd44d.tar.bz2 |
add sl-6000
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 762d3f1..cb7a83f 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,172 +1,173 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
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 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | 42 | #include <qwindowsystem_qws.h> |
43 | 43 | ||
44 | namespace Opie{ | 44 | namespace Opie{ |
45 | namespace Core{ | 45 | namespace Core{ |
46 | 46 | ||
47 | class ODeviceData; | 47 | class ODeviceData; |
48 | /** | 48 | /** |
49 | * The available devices | 49 | * The available devices |
50 | */ | 50 | */ |
51 | enum OModel { | 51 | enum OModel { |
52 | Model_Unknown, // = 0 | 52 | Model_Unknown, // = 0 |
53 | 53 | ||
54 | Model_Series_Mask = 0xff000000, | 54 | Model_Series_Mask = 0xff000000, |
55 | 55 | ||
56 | Model_iPAQ = ( 1 << 24 ), | 56 | Model_iPAQ = ( 1 << 24 ), |
57 | 57 | ||
58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
66 | 66 | ||
67 | Model_Jornada = ( 6 << 24 ), | 67 | Model_Jornada = ( 6 << 24 ), |
68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
69 | 69 | ||
70 | Model_Zaurus = ( 2 << 24 ), | 70 | Model_Zaurus = ( 2 << 24 ), |
71 | 71 | ||
72 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 72 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
73 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 73 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
74 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 74 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
75 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 75 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
76 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), | 76 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), |
77 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), | ||
77 | 78 | ||
78 | Model_SIMpad = ( 3 << 24 ), | 79 | Model_SIMpad = ( 3 << 24 ), |
79 | 80 | ||
80 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 81 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
81 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 82 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
82 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 83 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
83 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 84 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
84 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 85 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
85 | 86 | ||
86 | Model_Ramses = ( 4 << 24 ), | 87 | Model_Ramses = ( 4 << 24 ), |
87 | 88 | ||
88 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 89 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
89 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 90 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
90 | 91 | ||
91 | Model_Yopy = ( 5 << 24 ), | 92 | Model_Yopy = ( 5 << 24 ), |
92 | 93 | ||
93 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), | 94 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), |
94 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), | 95 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), |
95 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), | 96 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), |
96 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), | 97 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), |
97 | 98 | ||
98 | Model_Beagle = ( 6 << 24 ), | 99 | Model_Beagle = ( 6 << 24 ), |
99 | 100 | ||
100 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), | 101 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), |
101 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), | 102 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), |
102 | 103 | ||
103 | }; | 104 | }; |
104 | 105 | ||
105 | /** | 106 | /** |
106 | * The vendor of the device | 107 | * The vendor of the device |
107 | */ | 108 | */ |
108 | enum OVendor { | 109 | enum OVendor { |
109 | Vendor_Unknown, | 110 | Vendor_Unknown, |
110 | 111 | ||
111 | Vendor_HP, | 112 | Vendor_HP, |
112 | Vendor_Sharp, | 113 | Vendor_Sharp, |
113 | Vendor_SIEMENS, | 114 | Vendor_SIEMENS, |
114 | Vendor_MundN, | 115 | Vendor_MundN, |
115 | Vendor_GMate, | 116 | Vendor_GMate, |
116 | Vendor_MasterIA, | 117 | Vendor_MasterIA, |
117 | }; | 118 | }; |
118 | 119 | ||
119 | /** | 120 | /** |
120 | * The System used | 121 | * The System used |
121 | */ | 122 | */ |
122 | enum OSystem { | 123 | enum OSystem { |
123 | System_Unknown, | 124 | System_Unknown, |
124 | 125 | ||
125 | System_Familiar, | 126 | System_Familiar, |
126 | System_Zaurus, | 127 | System_Zaurus, |
127 | System_OpenZaurus, | 128 | System_OpenZaurus, |
128 | System_Linupy, | 129 | System_Linupy, |
129 | System_OpenEmbedded, | 130 | System_OpenEmbedded, |
130 | }; | 131 | }; |
131 | 132 | ||
132 | typedef struct { | 133 | typedef struct { |
133 | OSystem system; | 134 | OSystem system; |
134 | char* sysstr; | 135 | char* sysstr; |
135 | char* sysvfile; | 136 | char* sysvfile; |
136 | } ODistribution; | 137 | } ODistribution; |
137 | 138 | ||
138 | extern ODistribution distributions[]; | 139 | extern ODistribution distributions[]; |
139 | 140 | ||
140 | 141 | ||
141 | enum OLedState { | 142 | enum OLedState { |
142 | Led_Off, | 143 | Led_Off, |
143 | Led_On, | 144 | Led_On, |
144 | Led_BlinkSlow, | 145 | Led_BlinkSlow, |
145 | Led_BlinkFast | 146 | Led_BlinkFast |
146 | }; | 147 | }; |
147 | 148 | ||
148 | enum OLed { | 149 | enum OLed { |
149 | Led_Mail, | 150 | Led_Mail, |
150 | Led_Power, | 151 | Led_Power, |
151 | Led_BlueTooth | 152 | Led_BlueTooth |
152 | }; | 153 | }; |
153 | 154 | ||
154 | enum OHardKey { | 155 | enum OHardKey { |
155 | HardKey_Datebook = Qt::Key_F9, | 156 | HardKey_Datebook = Qt::Key_F9, |
156 | HardKey_Contacts = Qt::Key_F10, | 157 | HardKey_Contacts = Qt::Key_F10, |
157 | HardKey_Menu = Qt::Key_F11, | 158 | HardKey_Menu = Qt::Key_F11, |
158 | HardKey_Home = Qt::Key_F12, | 159 | HardKey_Home = Qt::Key_F12, |
159 | HardKey_Mail = Qt::Key_F13, | 160 | HardKey_Mail = Qt::Key_F13, |
160 | HardKey_Record = Qt::Key_F24, | 161 | HardKey_Record = Qt::Key_F24, |
161 | HardKey_Suspend = Qt::Key_F34, | 162 | HardKey_Suspend = Qt::Key_F34, |
162 | HardKey_Backlight = Qt::Key_F35, | 163 | HardKey_Backlight = Qt::Key_F35, |
163 | HardKey_Action = Qt::Key_F10, | 164 | HardKey_Action = Qt::Key_F10, |
164 | HardKey_OK = Qt::Key_F11, | 165 | HardKey_OK = Qt::Key_F11, |
165 | HardKey_End = Qt::Key_F12, | 166 | HardKey_End = Qt::Key_F12, |
166 | }; | 167 | }; |
167 | 168 | ||
168 | enum ODirection { | 169 | enum ODirection { |
169 | CW = 0, | 170 | CW = 0, |
170 | CCW = 1, | 171 | CCW = 1, |
171 | Flip = 2, | 172 | Flip = 2, |
172 | }; | 173 | }; |
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 6ac3157..47682bb 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -81,201 +81,205 @@ struct z_button z_buttons [] = { | |||
81 | 81 | ||
82 | struct z_button z_buttons_c700 [] = { | 82 | struct z_button z_buttons_c700 [] = { |
83 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 83 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
84 | "devicebuttons/z_calendar", | 84 | "devicebuttons/z_calendar", |
85 | "datebook", "nextView()", | 85 | "datebook", "nextView()", |
86 | "today", "raise()" }, | 86 | "today", "raise()" }, |
87 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 87 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
88 | "devicebuttons/z_contact", | 88 | "devicebuttons/z_contact", |
89 | "addressbook", "raise()", | 89 | "addressbook", "raise()", |
90 | "addressbook", "beamBusinessCard()" }, | 90 | "addressbook", "beamBusinessCard()" }, |
91 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 91 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
92 | "devicebuttons/z_home", | 92 | "devicebuttons/z_home", |
93 | "QPE/Launcher", "home()", | 93 | "QPE/Launcher", "home()", |
94 | "buttonsettings", "raise()" }, | 94 | "buttonsettings", "raise()" }, |
95 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 95 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
96 | "devicebuttons/z_menu", | 96 | "devicebuttons/z_menu", |
97 | "QPE/TaskBar", "toggleMenu()", | 97 | "QPE/TaskBar", "toggleMenu()", |
98 | "QPE/TaskBar", "toggleStartMenu()" }, | 98 | "QPE/TaskBar", "toggleStartMenu()" }, |
99 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), | 99 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), |
100 | "devicebuttons/z_hinge", | 100 | "devicebuttons/z_hinge", |
101 | "QPE/Rotation", "rotateDefault()", | 101 | "QPE/Rotation", "rotateDefault()", |
102 | "QPE/Dummy", "doNothing()" }, | 102 | "QPE/Dummy", "doNothing()" }, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | // FIXME This gets unnecessary complicated. We should think about splitting the Zaurus | 105 | // FIXME This gets unnecessary complicated. We should think about splitting the Zaurus |
106 | // class up into individual classes. We need three classes | 106 | // class up into individual classes. We need three classes |
107 | // | 107 | // |
108 | // Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) | 108 | // Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) |
109 | // Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) | 109 | // Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) |
110 | // Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, and C860) | 110 | // Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, and C860) |
111 | // | 111 | // |
112 | // Only question right now is: Do we really need to do it? Because as soon | 112 | // Only question right now is: Do we really need to do it? Because as soon |
113 | // as the OpenZaurus kernel is ready, there will be a unified interface for all | 113 | // as the OpenZaurus kernel is ready, there will be a unified interface for all |
114 | // Zaurus models (concerning apm, backlight, buttons, etc.) | 114 | // Zaurus models (concerning apm, backlight, buttons, etc.) |
115 | // | 115 | // |
116 | // Comments? - mickeyl. | 116 | // Comments? - mickeyl. |
117 | 117 | ||
118 | void Zaurus::init(const QString& cpu_info) | 118 | void Zaurus::init(const QString& cpu_info) |
119 | { | 119 | { |
120 | // generic distribution code already scanned /etc/issue at that point - | 120 | // generic distribution code already scanned /etc/issue at that point - |
121 | // embedix releases contain "Embedix <version> | Linux for Embedded Devices" | 121 | // embedix releases contain "Embedix <version> | Linux for Embedded Devices" |
122 | if ( d->m_sysverstr.contains( "embedix", false ) ) | 122 | if ( d->m_sysverstr.contains( "embedix", false ) ) |
123 | { | 123 | { |
124 | d->m_vendorstr = "Sharp"; | 124 | d->m_vendorstr = "Sharp"; |
125 | d->m_vendor = Vendor_Sharp; | 125 | d->m_vendor = Vendor_Sharp; |
126 | d->m_systemstr = "Zaurus"; | 126 | d->m_systemstr = "Zaurus"; |
127 | d->m_system = System_Zaurus; | 127 | d->m_system = System_Zaurus; |
128 | m_embedix = true; | 128 | m_embedix = true; |
129 | } | 129 | } |
130 | else | 130 | else |
131 | { | 131 | { |
132 | d->m_vendorstr = "OpenZaurus Team"; | 132 | d->m_vendorstr = "OpenZaurus Team"; |
133 | d->m_systemstr = "OpenZaurus"; | 133 | d->m_systemstr = "OpenZaurus"; |
134 | d->m_system = System_OpenZaurus; | 134 | d->m_system = System_OpenZaurus; |
135 | // sysver already gathered | 135 | // sysver already gathered |
136 | 136 | ||
137 | // Openzaurus sometimes uses the embedix kernel, check if this is one | 137 | // Openzaurus sometimes uses the embedix kernel, check if this is one |
138 | FILE *uname = popen("uname -r", "r"); | 138 | FILE *uname = popen("uname -r", "r"); |
139 | QFile f; | 139 | QFile f; |
140 | QString line; | 140 | QString line; |
141 | if ( f.open(IO_ReadOnly, uname) ) { | 141 | if ( f.open(IO_ReadOnly, uname) ) { |
142 | QTextStream ts ( &f ); | 142 | QTextStream ts ( &f ); |
143 | line = ts. readLine(); | 143 | line = ts. readLine(); |
144 | int loc = line. find ( "embedix" ); | 144 | int loc = line. find ( "embedix" ); |
145 | if ( loc != -1 ) | 145 | if ( loc != -1 ) |
146 | m_embedix = true; | 146 | m_embedix = true; |
147 | else | 147 | else |
148 | m_embedix = false; | 148 | m_embedix = false; |
149 | f.close(); | 149 | f.close(); |
150 | } | 150 | } |
151 | pclose(uname); | 151 | pclose(uname); |
152 | } | 152 | } |
153 | 153 | ||
154 | // check the Zaurus model | 154 | // check the Zaurus model |
155 | QString model; | 155 | QString model; |
156 | int loc = cpu_info.find( ":" ); | 156 | int loc = cpu_info.find( ":" ); |
157 | if ( loc != -1 ) | 157 | if ( loc != -1 ) |
158 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); | 158 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); |
159 | else | 159 | else |
160 | model = cpu_info; | 160 | model = cpu_info; |
161 | 161 | ||
162 | if ( model == "SHARP Corgi" ) { | 162 | if ( model == "SHARP Corgi" ) { |
163 | d->m_model = Model_Zaurus_SLC7x0; | 163 | d->m_model = Model_Zaurus_SLC7x0; |
164 | d->m_modelstr = "Zaurus SL-C700"; | 164 | d->m_modelstr = "Zaurus SL-C700"; |
165 | } else if ( model == "SHARP Shepherd" ) { | 165 | } else if ( model == "SHARP Shepherd" ) { |
166 | d->m_model = Model_Zaurus_SLC7x0; | 166 | d->m_model = Model_Zaurus_SLC7x0; |
167 | d->m_modelstr = "Zaurus SL-C750"; | 167 | d->m_modelstr = "Zaurus SL-C750"; |
168 | } else if ( model == "SHARP Husky" ) { | 168 | } else if ( model == "SHARP Husky" ) { |
169 | d->m_model = Model_Zaurus_SLC7x0; | 169 | d->m_model = Model_Zaurus_SLC7x0; |
170 | d->m_modelstr = "Zaurus SL-C760"; | 170 | d->m_modelstr = "Zaurus SL-C760"; |
171 | } else if ( model == "SHARP Poodle" ) { | 171 | } else if ( model == "SHARP Poodle" ) { |
172 | d->m_model = Model_Zaurus_SLB600; | 172 | d->m_model = Model_Zaurus_SLB600; |
173 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; | 173 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; |
174 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { | 174 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { |
175 | d->m_model = Model_Zaurus_SL5500; | 175 | d->m_model = Model_Zaurus_SL5500; |
176 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; | 176 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; |
177 | } else if ( model == "SHARP Tosa" ) { | ||
178 | d->m_model = Model_Zaurus_SL6000; | ||
179 | d->m_modelstr = "Zaurus SL-6000"; | ||
177 | } else { | 180 | } else { |
178 | d->m_model = Model_Zaurus_SL5500; | 181 | d->m_model = Model_Zaurus_SL5500; |
179 | d->m_modelstr = "Unkown Zaurus"; | 182 | d->m_modelstr = "Unkown Zaurus"; |
180 | } | 183 | } |
181 | 184 | ||
182 | // set initial rotation | 185 | // set initial rotation |
183 | 186 | ||
184 | bool flipstate = false; | 187 | bool flipstate = false; |
185 | switch ( d->m_model ) { | 188 | switch ( d->m_model ) { |
189 | case Model_Zaurus_SL6000: | ||
186 | case Model_Zaurus_SLA300: | 190 | case Model_Zaurus_SLA300: |
187 | d->m_rotation = Rot0; | 191 | d->m_rotation = Rot0; |
188 | break; | 192 | break; |
189 | case Model_Zaurus_SLC7x0: | 193 | case Model_Zaurus_SLC7x0: |
190 | d->m_rotation = rotation(); | 194 | d->m_rotation = rotation(); |
191 | d->m_direction = direction(); | 195 | d->m_direction = direction(); |
192 | break; | 196 | break; |
193 | case Model_Zaurus_SLB600: | 197 | case Model_Zaurus_SLB600: |
194 | case Model_Zaurus_SL5500: | 198 | case Model_Zaurus_SL5500: |
195 | case Model_Zaurus_SL5000: | 199 | case Model_Zaurus_SL5000: |
196 | default: | 200 | default: |
197 | d->m_rotation = Rot270; | 201 | d->m_rotation = Rot270; |
198 | break; | 202 | break; |
199 | } | 203 | } |
200 | m_leds [0] = Led_Off; | 204 | m_leds [0] = Led_Off; |
201 | } | 205 | } |
202 | 206 | ||
203 | void Zaurus::initButtons() | 207 | void Zaurus::initButtons() |
204 | { | 208 | { |
205 | if ( d->m_buttons ) | 209 | if ( d->m_buttons ) |
206 | return; | 210 | return; |
207 | 211 | ||
208 | d->m_buttons = new QValueList <ODeviceButton>; | 212 | d->m_buttons = new QValueList <ODeviceButton>; |
209 | 213 | ||
210 | struct z_button * pz_buttons; | 214 | struct z_button * pz_buttons; |
211 | int buttoncount; | 215 | int buttoncount; |
212 | switch ( d->m_model ) { | 216 | switch ( d->m_model ) { |
213 | case Model_Zaurus_SLC7x0: | 217 | case Model_Zaurus_SLC7x0: |
214 | pz_buttons = z_buttons_c700; | 218 | pz_buttons = z_buttons_c700; |
215 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 219 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
216 | break; | 220 | break; |
217 | default: | 221 | default: |
218 | pz_buttons = z_buttons; | 222 | pz_buttons = z_buttons; |
219 | buttoncount = ARRAY_SIZE(z_buttons); | 223 | buttoncount = ARRAY_SIZE(z_buttons); |
220 | break; | 224 | break; |
221 | } | 225 | } |
222 | 226 | ||
223 | for ( int i = 0; i < buttoncount; i++ ) { | 227 | for ( int i = 0; i < buttoncount; i++ ) { |
224 | struct z_button *zb = pz_buttons + i; | 228 | struct z_button *zb = pz_buttons + i; |
225 | ODeviceButton b; | 229 | ODeviceButton b; |
226 | 230 | ||
227 | b. setKeycode ( zb->code ); | 231 | b. setKeycode ( zb->code ); |
228 | b. setUserText ( QObject::tr ( "Button", zb->utext )); | 232 | b. setUserText ( QObject::tr ( "Button", zb->utext )); |
229 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); | 233 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); |
230 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), | 234 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), |
231 | zb->fpressedaction )); | 235 | zb->fpressedaction )); |
232 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), | 236 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), |
233 | zb->fheldaction )); | 237 | zb->fheldaction )); |
234 | 238 | ||
235 | d->m_buttons->append ( b ); | 239 | d->m_buttons->append ( b ); |
236 | } | 240 | } |
237 | 241 | ||
238 | reloadButtonMapping(); | 242 | reloadButtonMapping(); |
239 | 243 | ||
240 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 244 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
241 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), | 245 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), |
242 | this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 246 | this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
243 | } | 247 | } |
244 | 248 | ||
245 | #include <unistd.h> | 249 | #include <unistd.h> |
246 | #include <fcntl.h> | 250 | #include <fcntl.h> |
247 | #include <sys/ioctl.h> | 251 | #include <sys/ioctl.h> |
248 | 252 | ||
249 | //#include <asm/sharp_char.h> // including kernel headers is evil ... | 253 | //#include <asm/sharp_char.h> // including kernel headers is evil ... |
250 | 254 | ||
251 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | 255 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 |
252 | 256 | ||
253 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 257 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
254 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 258 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
255 | 259 | ||
256 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 260 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
257 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 261 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
258 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 262 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
259 | 263 | ||
260 | /* --- for SHARP_BUZZER device --- */ | 264 | /* --- for SHARP_BUZZER device --- */ |
261 | 265 | ||
262 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 266 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
263 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 267 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
264 | 268 | ||
265 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | 269 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) |
266 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | 270 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) |
267 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | 271 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) |
268 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | 272 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) |
269 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | 273 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) |
270 | 274 | ||
271 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 275 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
272 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 276 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
273 | 277 | ||
274 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ | 278 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ |
275 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ | 279 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ |
276 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ | 280 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ |
277 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ | 281 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ |
278 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ | 282 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ |
279 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ | 283 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ |
280 | //#define SHARP_PDA_APPSTART 9 /* application start */ | 284 | //#define SHARP_PDA_APPSTART 9 /* application start */ |
281 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ | 285 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ |