author | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
commit | e95fcb09fc069a83b3c10c19c081873daba49831 (patch) (unidiff) | |
tree | 13d13bac82d5bcf2489075e4f2962685ff3c897d /noncore/applets/zkbapplet/keyzcfg | |
parent | 7e28835e246e06e157d760a40754b6257f2ad6b3 (diff) | |
download | opie-e95fcb09fc069a83b3c10c19c081873daba49831.zip opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.gz opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.bz2 |
G++ 4.0 compiler fixes
-Remove anonymous structures and name them
-Include 'card.h' to cardpile to make 'Card' known to QList
so deleteItem will work
-cast 'enum' to char in event.cpp and opimevent.cpp
Diffstat (limited to 'noncore/applets/zkbapplet/keyzcfg') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp index b2180ba..a47bf6c 100644 --- a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp | |||
@@ -1,234 +1,240 @@ | |||
1 | #include <qmap.h> | 1 | #include <qmap.h> |
2 | 2 | ||
3 | #include "zkbnames.h" | 3 | #include "zkbnames.h" |
4 | 4 | ||
5 | QString Null_String((const char*) 0); | 5 | QString Null_String((const char*) 0); |
6 | 6 | ||
7 | // Implementation of KeyNames | 7 | // Implementation of KeyNames |
8 | static struct { | 8 | struct Key_Names_t { |
9 | int key; | 9 | int key; |
10 | char *name; | 10 | char *name; |
11 | } Key_Names[] = { | 11 | }; |
12 | |||
13 | static const Key_Names_t Key_Names[] = { | ||
12 | { 32, "Space" }, | 14 | { 32, "Space" }, |
13 | { 39, "Apostrophe" }, | 15 | { 39, "Apostrophe" }, |
14 | { 44, "Comma" }, | 16 | { 44, "Comma" }, |
15 | { 46, "Period" }, | 17 | { 46, "Period" }, |
16 | { 47, "Slash" }, | 18 | { 47, "Slash" }, |
17 | { 65, "A" }, | 19 | { 65, "A" }, |
18 | { 66, "B" }, | 20 | { 66, "B" }, |
19 | { 67, "C" }, | 21 | { 67, "C" }, |
20 | { 68, "D" }, | 22 | { 68, "D" }, |
21 | { 69, "E" }, | 23 | { 69, "E" }, |
22 | { 70, "F" }, | 24 | { 70, "F" }, |
23 | { 71, "G" }, | 25 | { 71, "G" }, |
24 | { 72, "H" }, | 26 | { 72, "H" }, |
25 | { 73, "I" }, | 27 | { 73, "I" }, |
26 | { 74, "J" }, | 28 | { 74, "J" }, |
27 | { 75, "K" }, | 29 | { 75, "K" }, |
28 | { 76, "L" }, | 30 | { 76, "L" }, |
29 | { 77, "M" }, | 31 | { 77, "M" }, |
30 | { 78, "N" }, | 32 | { 78, "N" }, |
31 | { 79, "O" }, | 33 | { 79, "O" }, |
32 | { 80, "P" }, | 34 | { 80, "P" }, |
33 | { 81, "Q" }, | 35 | { 81, "Q" }, |
34 | { 82, "R" }, | 36 | { 82, "R" }, |
35 | { 83, "S" }, | 37 | { 83, "S" }, |
36 | { 84, "T" }, | 38 | { 84, "T" }, |
37 | { 85, "U" }, | 39 | { 85, "U" }, |
38 | { 86, "V" }, | 40 | { 86, "V" }, |
39 | { 87, "W" }, | 41 | { 87, "W" }, |
40 | { 88, "X" }, | 42 | { 88, "X" }, |
41 | { 89, "Y" }, | 43 | { 89, "Y" }, |
42 | { 90, "Z" }, | 44 | { 90, "Z" }, |
43 | { 4096, "Cancel" }, | 45 | { 4096, "Cancel" }, |
44 | { 4097, "Tab" }, | 46 | { 4097, "Tab" }, |
45 | { 4099, "Backspace" }, | 47 | { 4099, "Backspace" }, |
46 | { 4100, "Enter" }, | 48 | { 4100, "Enter" }, |
47 | { 4114, "Left" }, | 49 | { 4114, "Left" }, |
48 | { 4115, "Up" }, | 50 | { 4115, "Up" }, |
49 | { 4116, "Right" }, | 51 | { 4116, "Right" }, |
50 | { 4117, "Down" }, | 52 | { 4117, "Down" }, |
51 | { 4128, "Left Shift" }, | 53 | { 4128, "Left Shift" }, |
52 | { 4130, "Right Shift" }, | 54 | { 4130, "Right Shift" }, |
53 | { 4152, "Calendar" }, | 55 | { 4152, "Calendar" }, |
54 | { 4153, "Addressbook" }, | 56 | { 4153, "Addressbook" }, |
55 | { 4154, "Menu" }, | 57 | { 4154, "Menu" }, |
56 | { 4155, "Home" }, | 58 | { 4155, "Home" }, |
57 | { 4156, "Mail" }, | 59 | { 4156, "Mail" }, |
58 | { 4165, "Fn" }, | 60 | { 4165, "Fn" }, |
59 | { 4173, "Middle" }, | 61 | { 4173, "Middle" }, |
60 | { 4176, "OK" }, | 62 | { 4176, "OK" }, |
61 | { 4177, "Off" }, | 63 | { 4177, "Off" }, |
62 | { 4178, "Light" }, | 64 | { 4178, "Light" }, |
63 | { 0, 0 } | 65 | { 0, 0 } |
64 | }; | 66 | }; |
65 | 67 | ||
66 | static QMap<QString, int> kn_map; | 68 | static QMap<QString, int> kn_map; |
67 | static QMap<int, QString> kn_rmap; | 69 | static QMap<int, QString> kn_rmap; |
68 | 70 | ||
69 | void init_kn_maps() { | 71 | void init_kn_maps() { |
70 | int i = 0; | 72 | int i = 0; |
71 | while (Key_Names[i].name != 0) { | 73 | while (Key_Names[i].name != 0) { |
72 | int key = Key_Names[i].key; | 74 | int key = Key_Names[i].key; |
73 | QString name(Key_Names[i].name); | 75 | QString name(Key_Names[i].name); |
74 | 76 | ||
75 | kn_map.insert(name, key); | 77 | kn_map.insert(name, key); |
76 | kn_rmap.insert(key, name); | 78 | kn_rmap.insert(key, name); |
77 | i++; | 79 | i++; |
78 | } | 80 | } |
79 | } | 81 | } |
80 | 82 | ||
81 | int KeyNames::find(const QString& key) { | 83 | int KeyNames::find(const QString& key) { |
82 | if (kn_map.isEmpty()) { | 84 | if (kn_map.isEmpty()) { |
83 | init_kn_maps(); | 85 | init_kn_maps(); |
84 | } | 86 | } |
85 | 87 | ||
86 | QMap<QString, int>::Iterator it = kn_map.find(key); | 88 | QMap<QString, int>::Iterator it = kn_map.find(key); |
87 | if (it == kn_map.end()) { | 89 | if (it == kn_map.end()) { |
88 | return -1; | 90 | return -1; |
89 | } else { | 91 | } else { |
90 | return it.data(); | 92 | return it.data(); |
91 | } | 93 | } |
92 | } | 94 | } |
93 | 95 | ||
94 | const QString& KeyNames::find(int k) { | 96 | const QString& KeyNames::find(int k) { |
95 | if (kn_map.isEmpty()) { | 97 | if (kn_map.isEmpty()) { |
96 | init_kn_maps(); | 98 | init_kn_maps(); |
97 | } | 99 | } |
98 | 100 | ||
99 | QMap<int, QString>::Iterator it = kn_rmap.find(k); | 101 | QMap<int, QString>::Iterator it = kn_rmap.find(k); |
100 | if (it == kn_rmap.end()) { | 102 | if (it == kn_rmap.end()) { |
101 | return Null_String; | 103 | return Null_String; |
102 | } else { | 104 | } else { |
103 | return it.data(); | 105 | return it.data(); |
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
107 | // Implementation of ModifierNames | 109 | // Implementation of ModifierNames |
108 | struct { | 110 | struct Modifier_Names_t { |
109 | int value; | 111 | int value; |
110 | char* name; | 112 | char* name; |
111 | } Modifier_Names[] = { | 113 | }; |
114 | |||
115 | static const Modifier_Names_t Modifier_Names[] = { | ||
112 | { 8, "Shift" }, | 116 | { 8, "Shift" }, |
113 | { 16, "Control" }, | 117 | { 16, "Control" }, |
114 | { 32, "Alt" }, | 118 | { 32, "Alt" }, |
115 | { 0x4000, "Keypad" }, | 119 | { 0x4000, "Keypad" }, |
116 | { 0, 0 } | 120 | { 0, 0 } |
117 | }; | 121 | }; |
118 | 122 | ||
119 | static QMap<QString, int> mn_map; | 123 | static QMap<QString, int> mn_map; |
120 | static QMap<int, QString> mn_rmap; | 124 | static QMap<int, QString> mn_rmap; |
121 | 125 | ||
122 | void init_mn_maps() { | 126 | void init_mn_maps() { |
123 | int i = 0; | 127 | int i = 0; |
124 | while (Modifier_Names[i].name != 0) { | 128 | while (Modifier_Names[i].name != 0) { |
125 | int value = Modifier_Names[i].value; | 129 | int value = Modifier_Names[i].value; |
126 | QString name(Modifier_Names[i].name); | 130 | QString name(Modifier_Names[i].name); |
127 | 131 | ||
128 | mn_map.insert(name, value); | 132 | mn_map.insert(name, value); |
129 | mn_rmap.insert(value, name); | 133 | mn_rmap.insert(value, name); |
130 | i++; | 134 | i++; |
131 | } | 135 | } |
132 | } | 136 | } |
133 | 137 | ||
134 | int ModifierNames::find(const QString& key) { | 138 | int ModifierNames::find(const QString& key) { |
135 | if (mn_map.isEmpty()) { | 139 | if (mn_map.isEmpty()) { |
136 | init_mn_maps(); | 140 | init_mn_maps(); |
137 | } | 141 | } |
138 | 142 | ||
139 | QMap<QString, int>::Iterator it = mn_map.find(key); | 143 | QMap<QString, int>::Iterator it = mn_map.find(key); |
140 | if (it == mn_map.end()) { | 144 | if (it == mn_map.end()) { |
141 | return -1; | 145 | return -1; |
142 | } else { | 146 | } else { |
143 | return it.data(); | 147 | return it.data(); |
144 | } | 148 | } |
145 | } | 149 | } |
146 | 150 | ||
147 | const QString& ModifierNames::find(int k) { | 151 | const QString& ModifierNames::find(int k) { |
148 | if (mn_map.isEmpty()) { | 152 | if (mn_map.isEmpty()) { |
149 | init_mn_maps(); | 153 | init_mn_maps(); |
150 | } | 154 | } |
151 | 155 | ||
152 | QMap<int, QString>::Iterator it = mn_rmap.find(k); | 156 | QMap<int, QString>::Iterator it = mn_rmap.find(k); |
153 | if (it == mn_rmap.end()) { | 157 | if (it == mn_rmap.end()) { |
154 | return Null_String; | 158 | return Null_String; |
155 | } else { | 159 | } else { |
156 | return it.data(); | 160 | return it.data(); |
157 | } | 161 | } |
158 | } | 162 | } |
159 | 163 | ||
160 | // Implementation of KeycodeNames | 164 | // Implementation of KeycodeNames |
161 | 165 | ||
162 | struct { | 166 | struct Keycode_Names_t { |
163 | char* name; | 167 | char* name; |
164 | int keycode; | 168 | int keycode; |
165 | } Keycode_Names[] = { | 169 | }; |
170 | |||
171 | static const Keycode_Names_t Keycode_Names[] = { | ||
166 | { "Escape", 0x1000 }, | 172 | { "Escape", 0x1000 }, |
167 | { "Tab", 0x1001 }, | 173 | { "Tab", 0x1001 }, |
168 | { "Backtab", 0x1002 }, | 174 | { "Backtab", 0x1002 }, |
169 | { "Backspace", 0x1003 }, | 175 | { "Backspace", 0x1003 }, |
170 | { "BackSpace", 0x1003 }, | 176 | { "BackSpace", 0x1003 }, |
171 | { "Return", 0x1004 }, | 177 | { "Return", 0x1004 }, |
172 | { "Enter", 0x1005 }, | 178 | { "Enter", 0x1005 }, |
173 | { "Insert", 0x1006 }, | 179 | { "Insert", 0x1006 }, |
174 | { "Delete", 0x1007 }, | 180 | { "Delete", 0x1007 }, |
175 | { "Pause", 0x1008 }, | 181 | { "Pause", 0x1008 }, |
176 | { "Print", 0x1009 }, | 182 | { "Print", 0x1009 }, |
177 | { "SysReq", 0x100a }, | 183 | { "SysReq", 0x100a }, |
178 | { "Home", 0x1010 }, | 184 | { "Home", 0x1010 }, |
179 | { "End", 0x1011 }, | 185 | { "End", 0x1011 }, |
180 | { "Left", 0x1012 }, | 186 | { "Left", 0x1012 }, |
181 | { "Up", 0x1013 }, | 187 | { "Up", 0x1013 }, |
182 | { "Right", 0x1014 }, | 188 | { "Right", 0x1014 }, |
183 | { "Down", 0x1015 }, | 189 | { "Down", 0x1015 }, |
184 | { "Prior", 0x1016 }, | 190 | { "Prior", 0x1016 }, |
185 | { "PageUp", 0x1016 }, | 191 | { "PageUp", 0x1016 }, |
186 | { "Next", 0x1017 }, | 192 | { "Next", 0x1017 }, |
187 | { "PageDown", 0x1017 }, | 193 | { "PageDown", 0x1017 }, |
188 | { "Shift", 0x1020 }, | 194 | { "Shift", 0x1020 }, |
189 | { "Control", 0x1021 }, | 195 | { "Control", 0x1021 }, |
190 | { "Meta", 0x1022 }, | 196 | { "Meta", 0x1022 }, |
191 | { "Alt", 0x1023 }, | 197 | { "Alt", 0x1023 }, |
192 | { "CapsLock", 0x1024 }, | 198 | { "CapsLock", 0x1024 }, |
193 | { "NumLock", 0x1025 }, | 199 | { "NumLock", 0x1025 }, |
194 | { "ScrollLock", 0x1026 }, | 200 | { "ScrollLock", 0x1026 }, |
195 | { "F1", 0x1030 }, | 201 | { "F1", 0x1030 }, |
196 | { "F2", 0x1031 }, | 202 | { "F2", 0x1031 }, |
197 | { "F3", 0x1032 }, | 203 | { "F3", 0x1032 }, |
198 | { "F4", 0x1033 }, | 204 | { "F4", 0x1033 }, |
199 | { "F5", 0x1034 }, | 205 | { "F5", 0x1034 }, |
200 | { "F6", 0x1035 }, | 206 | { "F6", 0x1035 }, |
201 | { "F7", 0x1036 }, | 207 | { "F7", 0x1036 }, |
202 | { "F8", 0x1037 }, | 208 | { "F8", 0x1037 }, |
203 | { "F9", 0x1038 }, | 209 | { "F9", 0x1038 }, |
204 | { "F10", 0x1039 }, | 210 | { "F10", 0x1039 }, |
205 | { "F11", 0x103a }, | 211 | { "F11", 0x103a }, |
206 | { "F12", 0x103b }, | 212 | { "F12", 0x103b }, |
207 | { "F13", 0x103c }, | 213 | { "F13", 0x103c }, |
208 | { "F14", 0x103d }, | 214 | { "F14", 0x103d }, |
209 | { "F15", 0x103e }, | 215 | { "F15", 0x103e }, |
210 | { "F16", 0x103f }, | 216 | { "F16", 0x103f }, |
211 | { "F17", 0x1040 }, | 217 | { "F17", 0x1040 }, |
212 | { "F18", 0x1041 }, | 218 | { "F18", 0x1041 }, |
213 | { "F19", 0x1042 }, | 219 | { "F19", 0x1042 }, |
214 | { "F20", 0x1043 }, | 220 | { "F20", 0x1043 }, |
215 | { "F21", 0x1044 }, | 221 | { "F21", 0x1044 }, |
216 | { "F22", 0x1045 }, | 222 | { "F22", 0x1045 }, |
217 | { "F23", 0x1046 }, | 223 | { "F23", 0x1046 }, |
218 | { "F24", 0x1047 }, | 224 | { "F24", 0x1047 }, |
219 | { "F25", 0x1048 }, | 225 | { "F25", 0x1048 }, |
220 | { "F26", 0x1049 }, | 226 | { "F26", 0x1049 }, |
221 | { "F27", 0x104a }, | 227 | { "F27", 0x104a }, |
222 | { "F28", 0x104b }, | 228 | { "F28", 0x104b }, |
223 | { "F29", 0x104c }, | 229 | { "F29", 0x104c }, |
224 | { "F30", 0x104d }, | 230 | { "F30", 0x104d }, |
225 | { "F31", 0x104e }, | 231 | { "F31", 0x104e }, |
226 | { "F32", 0x104f }, | 232 | { "F32", 0x104f }, |
227 | { "F33", 0x1050 }, | 233 | { "F33", 0x1050 }, |
228 | { "F34", 0x1051 }, | 234 | { "F34", 0x1051 }, |
229 | { "F35", 0x1052 }, | 235 | { "F35", 0x1052 }, |
230 | { "Super_L", 0x1053 }, | 236 | { "Super_L", 0x1053 }, |
231 | { "Super_R", 0x1054 }, | 237 | { "Super_R", 0x1054 }, |
232 | { "Menu", 0x1055 }, | 238 | { "Menu", 0x1055 }, |
233 | { "Hyper_L", 0x1056 }, | 239 | { "Hyper_L", 0x1056 }, |
234 | { "Hyper_R", 0x1057 }, | 240 | { "Hyper_R", 0x1057 }, |