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 | |
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/multikey/keyboard.cpp | 1 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 5 | ||||
-rw-r--r-- | inputmethods/multikey/keyboardimpl.cpp | 4 | ||||
-rw-r--r-- | inputmethods/multikey/keyboardimpl.h | 13 |
4 files changed, 18 insertions, 5 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 84c0c74..c22fbb1 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -37,6 +37,7 @@ | |||
37 | 37 | ||
38 | #include <sys/utsname.h> | 38 | #include <sys/utsname.h> |
39 | 39 | ||
40 | using namespace MultiKey; | ||
40 | 41 | ||
41 | /* Keyboard::Keyboard {{{1 */ | 42 | /* Keyboard::Keyboard {{{1 */ |
42 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | 43 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : |
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 | |||
@@ -25,6 +25,9 @@ | |||
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: |
@@ -185,4 +188,4 @@ private: | |||
185 | ConfigDlg *configdlg; | 188 | ConfigDlg *configdlg; |
186 | }; | 189 | }; |
187 | 190 | ||
188 | 191 | } // namespace MultiKey | |
diff --git a/inputmethods/multikey/keyboardimpl.cpp b/inputmethods/multikey/keyboardimpl.cpp index cebd43d..4cfbcd5 100644 --- a/inputmethods/multikey/keyboardimpl.cpp +++ b/inputmethods/multikey/keyboardimpl.cpp | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "keyboardimpl.h" | 23 | #include "keyboardimpl.h" |
24 | 24 | ||
25 | /* XPM */ | 25 | /* XPM */ |
26 | static const char * kb_xpm[] = { | 26 | static const char * const kb_xpm[] = { |
27 | "28 13 4 1", | 27 | "28 13 4 1", |
28 | " c None", | 28 | " c None", |
29 | ". c #4C4C4C", | 29 | ". c #4C4C4C", |
@@ -58,7 +58,7 @@ KeyboardImpl::~KeyboardImpl() | |||
58 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | 58 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) |
59 | { | 59 | { |
60 | if ( !input ) | 60 | if ( !input ) |
61 | input = new Keyboard( parent, "Keyboard", f ); | 61 | input = new MultiKey::Keyboard( parent, "Keyboard", f ); |
62 | return input; | 62 | return input; |
63 | } | 63 | } |
64 | 64 | ||
diff --git a/inputmethods/multikey/keyboardimpl.h b/inputmethods/multikey/keyboardimpl.h index e756364..76a2955 100644 --- a/inputmethods/multikey/keyboardimpl.h +++ b/inputmethods/multikey/keyboardimpl.h | |||
@@ -22,9 +22,16 @@ | |||
22 | 22 | ||
23 | #include <qpe/inputmethodinterface.h> | 23 | #include <qpe/inputmethodinterface.h> |
24 | 24 | ||
25 | class Keyboard; | 25 | namespace MultiKey |
26 | { | ||
27 | class Keyboard; | ||
28 | } | ||
29 | |||
26 | class QPixmap; | 30 | class QPixmap; |
27 | 31 | ||
32 | namespace | ||
33 | { | ||
34 | |||
28 | class KeyboardImpl : public InputMethodInterface | 35 | class KeyboardImpl : public InputMethodInterface |
29 | { | 36 | { |
30 | public: | 37 | public: |
@@ -43,9 +50,11 @@ public: | |||
43 | virtual void onKeyPress( QObject *receiver, const char *slot ); | 50 | virtual void onKeyPress( QObject *receiver, const char *slot ); |
44 | 51 | ||
45 | private: | 52 | private: |
46 | Keyboard *input; | 53 | MultiKey::Keyboard *input; |
47 | QPixmap *icn; | 54 | QPixmap *icn; |
48 | ulong ref; | 55 | ulong ref; |
49 | }; | 56 | }; |
50 | 57 | ||
58 | } // anonymous namespace | ||
59 | |||
51 | #endif | 60 | #endif |