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/jumpx | |
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)
-rw-r--r-- | inputmethods/jumpx/keyboard.cpp | 1 | ||||
-rw-r--r-- | inputmethods/jumpx/keyboard.h | 5 | ||||
-rw-r--r-- | inputmethods/jumpx/keyboardimpl.cpp | 4 | ||||
-rw-r--r-- | inputmethods/jumpx/keyboardimpl.h | 12 |
4 files changed, 18 insertions, 4 deletions
diff --git a/inputmethods/jumpx/keyboard.cpp b/inputmethods/jumpx/keyboard.cpp index 0b8fc14..0cfb4be 100644 --- a/inputmethods/jumpx/keyboard.cpp +++ b/inputmethods/jumpx/keyboard.cpp | |||
@@ -119,16 +119,17 @@ static const mapElement mod2Map[] = { | |||
119 | static const int cursorMap[][2] = { | 119 | static const int cursorMap[][2] = { |
120 | { Qt::Key_Home, Qt::Key_PageUp }, | 120 | { Qt::Key_Home, Qt::Key_PageUp }, |
121 | { Qt::Key_End, Qt::Key_PageDown }, | 121 | { Qt::Key_End, Qt::Key_PageDown }, |
122 | { Qt::Key_Up, Qt::Key_Up }, | 122 | { Qt::Key_Up, Qt::Key_Up }, |
123 | { Qt::Key_Left, Qt::Key_Right }, | 123 | { Qt::Key_Left, Qt::Key_Right }, |
124 | { Qt::Key_Down, Qt::Key_Down }, | 124 | { Qt::Key_Down, Qt::Key_Down }, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | using namespace JumpX; | ||
127 | 128 | ||
128 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : | 129 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : |
129 | QFrame(parent, name, f), | 130 | QFrame(parent, name, f), |
130 | shift(0), paren(0), ctrl(0), alt(0), | 131 | shift(0), paren(0), ctrl(0), alt(0), |
131 | pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0), | 132 | pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0), |
132 | isnoncont(false), | 133 | isnoncont(false), |
133 | slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0), | 134 | slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0), |
134 | enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL), | 135 | enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL), |
diff --git a/inputmethods/jumpx/keyboard.h b/inputmethods/jumpx/keyboard.h index 1be095d..689d95a 100644 --- a/inputmethods/jumpx/keyboard.h +++ b/inputmethods/jumpx/keyboard.h | |||
@@ -8,16 +8,19 @@ | |||
8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
10 | ** | 10 | ** |
11 | *********************************************************************************************/ | 11 | *********************************************************************************************/ |
12 | #include <qframe.h> | 12 | #include <qframe.h> |
13 | #include <qpixmap.h> | 13 | #include <qpixmap.h> |
14 | #include <qtimer.h> | 14 | #include <qtimer.h> |
15 | 15 | ||
16 | namespace JumpX | ||
17 | { | ||
18 | |||
16 | class Keyboard : public QFrame | 19 | class Keyboard : public QFrame |
17 | { | 20 | { |
18 | Q_OBJECT | 21 | Q_OBJECT |
19 | public: | 22 | public: |
20 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 23 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
21 | 24 | ||
22 | void resetState(); | 25 | void resetState(); |
23 | 26 | ||
@@ -64,8 +67,10 @@ private: | |||
64 | QPixmap offscreen; | 67 | QPixmap offscreen; |
65 | 68 | ||
66 | QPixmap *releasedPix; | 69 | QPixmap *releasedPix; |
67 | QPixmap *pressedPix; | 70 | QPixmap *pressedPix; |
68 | 71 | ||
69 | QTimer *delayTimer; | 72 | QTimer *delayTimer; |
70 | QTimer *rateTimer; | 73 | QTimer *rateTimer; |
71 | }; | 74 | }; |
75 | |||
76 | } // namespace JumpX | ||
diff --git a/inputmethods/jumpx/keyboardimpl.cpp b/inputmethods/jumpx/keyboardimpl.cpp index 92abb09..34c227f 100644 --- a/inputmethods/jumpx/keyboardimpl.cpp +++ b/inputmethods/jumpx/keyboardimpl.cpp | |||
@@ -10,17 +10,17 @@ | |||
10 | ** | 10 | ** |
11 | *********************************************************************************************/ | 11 | *********************************************************************************************/ |
12 | #include <qapplication.h> | 12 | #include <qapplication.h> |
13 | #include <qpixmap.h> | 13 | #include <qpixmap.h> |
14 | #include "keyboard.h" | 14 | #include "keyboard.h" |
15 | #include "keyboardimpl.h" | 15 | #include "keyboardimpl.h" |
16 | 16 | ||
17 | /* XPM */ | 17 | /* XPM */ |
18 | static const char * icon_xpm[] = { | 18 | static const char * const icon_xpm[] = { |
19 | "26 13 2 1", | 19 | "26 13 2 1", |
20 | " c None", | 20 | " c None", |
21 | ".c #000000", | 21 | ".c #000000", |
22 | " ... ... ... ... ... ... ", | 22 | " ... ... ... ... ... ... ", |
23 | ". . . . . . . ", | 23 | ". . . . . . . ", |
24 | ". . . . . . . ", | 24 | ". . . . . . . ", |
25 | ". . . . . . . ", | 25 | ". . . . . . . ", |
26 | " ....... ... ... ....... ", | 26 | " ....... ... ... ....... ", |
@@ -43,17 +43,17 @@ KeyboardImpl::~KeyboardImpl() | |||
43 | { | 43 | { |
44 | delete input; | 44 | delete input; |
45 | delete icn; | 45 | delete icn; |
46 | } | 46 | } |
47 | 47 | ||
48 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | 48 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) |
49 | { | 49 | { |
50 | if ( !input ) | 50 | if ( !input ) |
51 | input = new Keyboard( parent, "Keyboard", f ); | 51 | input = new JumpX::Keyboard( parent, "Keyboard", f ); |
52 | return input; | 52 | return input; |
53 | } | 53 | } |
54 | 54 | ||
55 | void KeyboardImpl::resetState() | 55 | void KeyboardImpl::resetState() |
56 | { | 56 | { |
57 | if ( input ) | 57 | if ( input ) |
58 | input->resetState(); | 58 | input->resetState(); |
59 | } | 59 | } |
diff --git a/inputmethods/jumpx/keyboardimpl.h b/inputmethods/jumpx/keyboardimpl.h index a82ec4a..087781f 100644 --- a/inputmethods/jumpx/keyboardimpl.h +++ b/inputmethods/jumpx/keyboardimpl.h | |||
@@ -9,19 +9,25 @@ | |||
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
10 | ** | 10 | ** |
11 | *********************************************************************************************/ | 11 | *********************************************************************************************/ |
12 | #ifndef KEYBOARDIMPL_H | 12 | #ifndef KEYBOARDIMPL_H |
13 | #define KEYBOARDIMPL_H | 13 | #define KEYBOARDIMPL_H |
14 | 14 | ||
15 | #include <qpe/inputmethodinterface.h> | 15 | #include <qpe/inputmethodinterface.h> |
16 | 16 | ||
17 | class Keyboard; | 17 | namespace JumpX |
18 | { | ||
19 | class Keyboard; | ||
20 | }; | ||
18 | class QPixmap; | 21 | class QPixmap; |
19 | 22 | ||
23 | namespace | ||
24 | { | ||
25 | |||
20 | class KeyboardImpl : public InputMethodInterface | 26 | class KeyboardImpl : public InputMethodInterface |
21 | { | 27 | { |
22 | public: | 28 | public: |
23 | KeyboardImpl(); | 29 | KeyboardImpl(); |
24 | virtual ~KeyboardImpl(); | 30 | virtual ~KeyboardImpl(); |
25 | 31 | ||
26 | #ifndef QT_NO_COMPONENT | 32 | #ifndef QT_NO_COMPONENT |
27 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 33 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
@@ -30,14 +36,16 @@ public: | |||
30 | 36 | ||
31 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); | 37 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); |
32 | virtual void resetState(); | 38 | virtual void resetState(); |
33 | virtual QPixmap *icon(); | 39 | virtual QPixmap *icon(); |
34 | virtual QString name(); | 40 | virtual QString name(); |
35 | virtual void onKeyPress( QObject *receiver, const char *slot ); | 41 | virtual void onKeyPress( QObject *receiver, const char *slot ); |
36 | 42 | ||
37 | private: | 43 | private: |
38 | Keyboard *input; | 44 | JumpX::Keyboard *input; |
39 | QPixmap *icn; | 45 | QPixmap *icn; |
40 | ulong ref; | 46 | ulong ref; |
41 | }; | 47 | }; |
42 | 48 | ||
49 | } // anonymous namespace | ||
50 | |||
43 | #endif | 51 | #endif |