author | simon <simon> | 2002-11-22 10:56:30 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-22 10:56:30 (UTC) |
commit | 480284c491e26427c630131a25e56f9ed1d129b2 (patch) (unidiff) | |
tree | 3bdd60afe34e8c466fbea92dcf89fcab381b110d /inputmethods/multikey/keyboard.h | |
parent | 772c1321e4e95a415b9de700c3474f81f98b5482 (diff) | |
download | opie-480284c491e26427c630131a25e56f9ed1d129b2.zip opie-480284c491e26427c630131a25e56f9ed1d129b2.tar.gz opie-480284c491e26427c630131a25e56f9ed1d129b2.tar.bz2 |
- properly namespace the input methods. fixes symbols clashes at run-time
with names like 'Keyboard' or 'KeyboardConfig' . the qcom interface
objects are in an anonymous namespace now and the actual keyboard
implementations are in Dvorak, JumpX, etc. namespaces.
What's left is to solve the symbol clashes of the multiply compiled
pickboard classes. I'll leave that one (as part of the patch posted
yesterday) for another day for review. This part (namespacing) sounds like
a safe bet to me though, so comitting now. (got no comments anyway)
Diffstat (limited to 'inputmethods/multikey/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/multikey/keyboard.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index bc74e71..20c5cee 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h | |||
@@ -1,75 +1,78 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qframe.h> | 20 | #include <qframe.h> |
21 | #include <qmap.h> | 21 | #include <qmap.h> |
22 | #include "../pickboard/pickboardcfg.h" | 22 | #include "../pickboard/pickboardcfg.h" |
23 | #include "../pickboard/pickboardpicks.h" | 23 | #include "../pickboard/pickboardpicks.h" |
24 | #include "configdlg.h" | 24 | #include "configdlg.h" |
25 | 25 | ||
26 | class QTimer; | 26 | class QTimer; |
27 | 27 | ||
28 | namespace MultiKey | ||
29 | { | ||
30 | |||
28 | class KeyboardConfig : public DictFilterConfig | 31 | class KeyboardConfig : public DictFilterConfig |
29 | { | 32 | { |
30 | public: | 33 | public: |
31 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } | 34 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } |
32 | virtual void generateText(const QString &s); | 35 | virtual void generateText(const QString &s); |
33 | void decBackspaces() { if (backspaces) backspaces--; } | 36 | void decBackspaces() { if (backspaces) backspaces--; } |
34 | void incBackspaces() { backspaces++; } | 37 | void incBackspaces() { backspaces++; } |
35 | void resetBackspaces() { backspaces = 0; } | 38 | void resetBackspaces() { backspaces = 0; } |
36 | private: | 39 | private: |
37 | int backspaces; | 40 | int backspaces; |
38 | }; | 41 | }; |
39 | 42 | ||
40 | 43 | ||
41 | class KeyboardPicks : public PickboardPicks | 44 | class KeyboardPicks : public PickboardPicks |
42 | { | 45 | { |
43 | Q_OBJECT | 46 | Q_OBJECT |
44 | public: | 47 | public: |
45 | KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) | 48 | KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) |
46 | : PickboardPicks(parent, name, f) { } | 49 | : PickboardPicks(parent, name, f) { } |
47 | void initialise(); | 50 | void initialise(); |
48 | virtual QSize sizeHint() const; | 51 | virtual QSize sizeHint() const; |
49 | KeyboardConfig *dc; | 52 | KeyboardConfig *dc; |
50 | }; | 53 | }; |
51 | 54 | ||
52 | 55 | ||
53 | class Keys { | 56 | class Keys { |
54 | public: | 57 | public: |
55 | 58 | ||
56 | Keys(); | 59 | Keys(); |
57 | Keys(const char * filename); | 60 | Keys(const char * filename); |
58 | ~Keys(); | 61 | ~Keys(); |
59 | int width(const int row, const int col); | 62 | int width(const int row, const int col); |
60 | int rows(); | 63 | int rows(); |
61 | ushort uni(const int row, const int col); | 64 | ushort uni(const int row, const int col); |
62 | int qcode(const int row, const int col); | 65 | int qcode(const int row, const int col); |
63 | bool pressed(const int row, const int col); | 66 | bool pressed(const int row, const int col); |
64 | bool *pressedPtr(const int row, const int col); | 67 | bool *pressedPtr(const int row, const int col); |
65 | ushort shift(const ushort); | 68 | ushort shift(const ushort); |
66 | ushort meta(const ushort); | 69 | ushort meta(const ushort); |
67 | ushort circumflex(const ushort); | 70 | ushort circumflex(const ushort); |
68 | ushort diaeresis(const ushort); | 71 | ushort diaeresis(const ushort); |
69 | ushort baccent(const ushort); | 72 | ushort baccent(const ushort); |
70 | ushort accent(const ushort); | 73 | ushort accent(const ushort); |
71 | QImage *pix(const int row, const int col); | 74 | QImage *pix(const int row, const int col); |
72 | int numKeys(const int row); | 75 | int numKeys(const int row); |
73 | void setKeysFromFile(const char *filename); | 76 | void setKeysFromFile(const char *filename); |
74 | void setKey(const int row, const int qcode, const ushort unicode, | 77 | void setKey(const int row, const int qcode, const ushort unicode, |
75 | const int width, QImage *pix); | 78 | const int width, QImage *pix); |
@@ -140,49 +143,49 @@ private: | |||
140 | bool *ctrl; | 143 | bool *ctrl; |
141 | bool *alt; | 144 | bool *alt; |
142 | bool *meta; | 145 | bool *meta; |
143 | bool *circumflex; | 146 | bool *circumflex; |
144 | bool *diaeresis; | 147 | bool *diaeresis; |
145 | bool *baccent; | 148 | bool *baccent; |
146 | bool *accent; | 149 | bool *accent; |
147 | 150 | ||
148 | uint useLargeKeys:1; | 151 | uint useLargeKeys:1; |
149 | uint usePicks:1; | 152 | uint usePicks:1; |
150 | uint useRepeat:1; | 153 | uint useRepeat:1; |
151 | 154 | ||
152 | int pressedKeyRow; | 155 | int pressedKeyRow; |
153 | int pressedKeyCol; | 156 | int pressedKeyCol; |
154 | 157 | ||
155 | KeyboardPicks *picks; | 158 | KeyboardPicks *picks; |
156 | 159 | ||
157 | int keyHeight; | 160 | int keyHeight; |
158 | int defaultKeyWidth; | 161 | int defaultKeyWidth; |
159 | int xoffs; | 162 | int xoffs; |
160 | 163 | ||
161 | int unicode; | 164 | int unicode; |
162 | int qkeycode; | 165 | int qkeycode; |
163 | int modifiers; | 166 | int modifiers; |
164 | 167 | ||
165 | int pressTid; | 168 | int pressTid; |
166 | bool pressed; | 169 | bool pressed; |
167 | 170 | ||
168 | Keys *keys; | 171 | Keys *keys; |
169 | 172 | ||
170 | /* for korean input */ | 173 | /* for korean input */ |
171 | ushort schar, mchar, echar; | 174 | ushort schar, mchar, echar; |
172 | ushort parseKoreanInput(ushort c); | 175 | ushort parseKoreanInput(ushort c); |
173 | ushort combineKoreanChars(const ushort s, const ushort m, const ushort e); | 176 | ushort combineKoreanChars(const ushort s, const ushort m, const ushort e); |
174 | ushort constoe(const ushort c); | 177 | ushort constoe(const ushort c); |
175 | 178 | ||
176 | QTimer *repeatTimer; | 179 | QTimer *repeatTimer; |
177 | 180 | ||
178 | /* colors */ | 181 | /* colors */ |
179 | void loadKeyboardColors(); | 182 | void loadKeyboardColors(); |
180 | QColor keycolor; | 183 | QColor keycolor; |
181 | QColor keycolor_pressed; | 184 | QColor keycolor_pressed; |
182 | QColor keycolor_lines; | 185 | QColor keycolor_lines; |
183 | QColor textcolor; | 186 | QColor textcolor; |
184 | 187 | ||
185 | ConfigDlg *configdlg; | 188 | ConfigDlg *configdlg; |
186 | }; | 189 | }; |
187 | 190 | ||
188 | 191 | } // namespace MultiKey | |