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 | |
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/dvorak/dvorak.cpp | 2 | ||||
-rw-r--r-- | inputmethods/dvorak/dvorak.h | 4 | ||||
-rw-r--r-- | inputmethods/dvorak/dvorakimpl.cpp | 6 | ||||
-rw-r--r-- | inputmethods/dvorak/dvorakimpl.h | 13 | ||||
-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 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboard.cpp | 1 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboard.h | 5 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboardimpl.cpp | 8 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboardimpl.h | 13 | ||||
-rw-r--r-- | inputmethods/kjumpx/keyboard.cpp | 1 | ||||
-rw-r--r-- | inputmethods/kjumpx/keyboard.h | 5 | ||||
-rw-r--r-- | inputmethods/kjumpx/keyboardimpl.cpp | 4 | ||||
-rw-r--r-- | inputmethods/kjumpx/keyboardimpl.h | 12 | ||||
-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 |
20 files changed, 94 insertions, 25 deletions
diff --git a/inputmethods/dvorak/dvorak.cpp b/inputmethods/dvorak/dvorak.cpp index 29b5bd0..97afa0a 100644 --- a/inputmethods/dvorak/dvorak.cpp +++ b/inputmethods/dvorak/dvorak.cpp | |||
@@ -26,16 +26,18 @@ | |||
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | 30 | ||
31 | 31 | ||
32 | #define USE_SMALL_BACKSPACE | 32 | #define USE_SMALL_BACKSPACE |
33 | 33 | ||
34 | using namespace Dvorak; | ||
35 | |||
34 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : | 36 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : |
35 | QFrame(parent, name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), | 37 | QFrame(parent, name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), |
36 | alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), | 38 | alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), |
37 | unicode(-1), qkeycode(0), modifiers(0) | 39 | unicode(-1), qkeycode(0), modifiers(0) |
38 | { | 40 | { |
39 | // setPalette(QPalette(QColor(240,240,230))); // Beige! | 41 | // setPalette(QPalette(QColor(240,240,230))); // Beige! |
40 | // setFont( QFont( "Helvetica", 8 ) ); | 42 | // setFont( QFont( "Helvetica", 8 ) ); |
41 | // setPalette(QPalette(QColor(200,200,200))); // Gray | 43 | // setPalette(QPalette(QColor(200,200,200))); // Gray |
diff --git a/inputmethods/dvorak/dvorak.h b/inputmethods/dvorak/dvorak.h index 38ae338..216b5e5 100644 --- a/inputmethods/dvorak/dvorak.h +++ b/inputmethods/dvorak/dvorak.h | |||
@@ -18,16 +18,19 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qframe.h> | 20 | #include <qframe.h> |
21 | #include "../pickboard/pickboardcfg.h" | 21 | #include "../pickboard/pickboardcfg.h" |
22 | #include "../pickboard/pickboardpicks.h" | 22 | #include "../pickboard/pickboardpicks.h" |
23 | 23 | ||
24 | class QTimer; | 24 | class QTimer; |
25 | 25 | ||
26 | namespace Dvorak | ||
27 | { | ||
28 | |||
26 | class KeyboardConfig : public DictFilterConfig | 29 | class KeyboardConfig : public DictFilterConfig |
27 | { | 30 | { |
28 | public: | 31 | public: |
29 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } | 32 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } |
30 | virtual void generateText(const QString &s); | 33 | virtual void generateText(const QString &s); |
31 | void decBackspaces() { if (backspaces) backspaces--; } | 34 | void decBackspaces() { if (backspaces) backspaces--; } |
32 | void incBackspaces() { backspaces++; } | 35 | void incBackspaces() { backspaces++; } |
33 | void resetBackspaces() { backspaces = 0; } | 36 | void resetBackspaces() { backspaces = 0; } |
@@ -96,8 +99,9 @@ private: | |||
96 | int modifiers; | 99 | int modifiers; |
97 | 100 | ||
98 | int pressTid; | 101 | int pressTid; |
99 | bool pressed; | 102 | bool pressed; |
100 | 103 | ||
101 | QTimer *repeatTimer; | 104 | QTimer *repeatTimer; |
102 | }; | 105 | }; |
103 | 106 | ||
107 | } // namespace Dvorak | ||
diff --git a/inputmethods/dvorak/dvorakimpl.cpp b/inputmethods/dvorak/dvorakimpl.cpp index 3c83464..8050ce1 100644 --- a/inputmethods/dvorak/dvorakimpl.cpp +++ b/inputmethods/dvorak/dvorakimpl.cpp | |||
@@ -18,17 +18,17 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
22 | #include "dvorak.h" | 22 | #include "dvorak.h" |
23 | #include "dvorakimpl.h" | 23 | #include "dvorakimpl.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", |
30 | "+ c #FFF7DD", | 30 | "+ c #FFF7DD", |
31 | "@ c #D6CFBA", | 31 | "@ c #D6CFBA", |
32 | " .......................... ", | 32 | " .......................... ", |
33 | " .+++.+++.+++.+++.+++.++++. ", | 33 | " .+++.+++.+++.+++.+++.++++. ", |
34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", | 34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", |
@@ -40,17 +40,17 @@ static const char * kb_xpm[] = { | |||
40 | " .+@@@@@.+@@.+@@.+@@.+@@@@. ", | 40 | " .+@@@@@.+@@.+@@.+@@.+@@@@. ", |
41 | " .......................... ", | 41 | " .......................... ", |
42 | " .++++.++++++++++++++.++++. ", | 42 | " .++++.++++++++++++++.++++. ", |
43 | " .+@@@.+@@@@@@@@@@@@@.+@@@. ", | 43 | " .+@@@.+@@@@@@@@@@@@@.+@@@. ", |
44 | " .......................... "}; | 44 | " .......................... "}; |
45 | 45 | ||
46 | 46 | ||
47 | /* XPM */ | 47 | /* XPM */ |
48 | static char * opti_xpm[] = { | 48 | static const char * const opti_xpm[] = { |
49 | "28 13 4 1", | 49 | "28 13 4 1", |
50 | " c None", | 50 | " c None", |
51 | ". c #4C4C4C", | 51 | ". c #4C4C4C", |
52 | "+ c #FFF7DD", | 52 | "+ c #FFF7DD", |
53 | "@ c #D6CFBA", | 53 | "@ c #D6CFBA", |
54 | " ......................... ", | 54 | " ......................... ", |
55 | " .+++.+++.+++.+++.+++.+++. ", | 55 | " .+++.+++.+++.+++.+++.+++. ", |
56 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", | 56 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", |
@@ -76,17 +76,17 @@ KeyboardImpl::~KeyboardImpl() | |||
76 | { | 76 | { |
77 | delete input; | 77 | delete input; |
78 | delete icn; | 78 | delete icn; |
79 | } | 79 | } |
80 | 80 | ||
81 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | 81 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) |
82 | { | 82 | { |
83 | if ( !input ) | 83 | if ( !input ) |
84 | input = new Keyboard( parent, "Keyboard", f ); | 84 | input = new Dvorak::Keyboard( parent, "Keyboard", f ); |
85 | return input; | 85 | return input; |
86 | } | 86 | } |
87 | 87 | ||
88 | void KeyboardImpl::resetState() | 88 | void KeyboardImpl::resetState() |
89 | { | 89 | { |
90 | if ( input ) | 90 | if ( input ) |
91 | input->resetState(); | 91 | input->resetState(); |
92 | } | 92 | } |
diff --git a/inputmethods/dvorak/dvorakimpl.h b/inputmethods/dvorak/dvorakimpl.h index e756364..bd9fa88 100644 --- a/inputmethods/dvorak/dvorakimpl.h +++ b/inputmethods/dvorak/dvorakimpl.h | |||
@@ -17,19 +17,26 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef KEYBOARDIMPL_H | 20 | #ifndef KEYBOARDIMPL_H |
21 | #define KEYBOARDIMPL_H | 21 | #define KEYBOARDIMPL_H |
22 | 22 | ||
23 | #include <qpe/inputmethodinterface.h> | 23 | #include <qpe/inputmethodinterface.h> |
24 | 24 | ||
25 | class Keyboard; | 25 | namespace Dvorak |
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: |
31 | KeyboardImpl(); | 38 | KeyboardImpl(); |
32 | virtual ~KeyboardImpl(); | 39 | virtual ~KeyboardImpl(); |
33 | 40 | ||
34 | #ifndef QT_NO_COMPONENT | 41 | #ifndef QT_NO_COMPONENT |
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 42 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
@@ -38,14 +45,16 @@ public: | |||
38 | 45 | ||
39 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); | 46 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); |
40 | virtual void resetState(); | 47 | virtual void resetState(); |
41 | virtual QPixmap *icon(); | 48 | virtual QPixmap *icon(); |
42 | virtual QString name(); | 49 | virtual QString name(); |
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 | Dvorak::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 |
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 |
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp index 0f0b188..a85a7b1 100644 --- a/inputmethods/keyboard/keyboard.cpp +++ b/inputmethods/keyboard/keyboard.cpp | |||
@@ -25,16 +25,17 @@ | |||
25 | #include <qwindowsystem_qws.h> | 25 | #include <qwindowsystem_qws.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | 30 | ||
31 | #include <sys/utsname.h> | 31 | #include <sys/utsname.h> |
32 | 32 | ||
33 | using namespace KeyboardInput; | ||
33 | 34 | ||
34 | #define USE_SMALL_BACKSPACE | 35 | #define USE_SMALL_BACKSPACE |
35 | 36 | ||
36 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | 37 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : |
37 | QFrame(parent, _name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), | 38 | QFrame(parent, _name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), |
38 | alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), | 39 | alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), |
39 | unicode(-1), qkeycode(0), modifiers(0) | 40 | unicode(-1), qkeycode(0), modifiers(0) |
40 | { | 41 | { |
diff --git a/inputmethods/keyboard/keyboard.h b/inputmethods/keyboard/keyboard.h index 38ae338..cc7f3f5 100644 --- a/inputmethods/keyboard/keyboard.h +++ b/inputmethods/keyboard/keyboard.h | |||
@@ -18,16 +18,19 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qframe.h> | 20 | #include <qframe.h> |
21 | #include "../pickboard/pickboardcfg.h" | 21 | #include "../pickboard/pickboardcfg.h" |
22 | #include "../pickboard/pickboardpicks.h" | 22 | #include "../pickboard/pickboardpicks.h" |
23 | 23 | ||
24 | class QTimer; | 24 | class QTimer; |
25 | 25 | ||
26 | namespace KeyboardInput | ||
27 | { | ||
28 | |||
26 | class KeyboardConfig : public DictFilterConfig | 29 | class KeyboardConfig : public DictFilterConfig |
27 | { | 30 | { |
28 | public: | 31 | public: |
29 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } | 32 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } |
30 | virtual void generateText(const QString &s); | 33 | virtual void generateText(const QString &s); |
31 | void decBackspaces() { if (backspaces) backspaces--; } | 34 | void decBackspaces() { if (backspaces) backspaces--; } |
32 | void incBackspaces() { backspaces++; } | 35 | void incBackspaces() { backspaces++; } |
33 | void resetBackspaces() { backspaces = 0; } | 36 | void resetBackspaces() { backspaces = 0; } |
@@ -96,8 +99,10 @@ private: | |||
96 | int modifiers; | 99 | int modifiers; |
97 | 100 | ||
98 | int pressTid; | 101 | int pressTid; |
99 | bool pressed; | 102 | bool pressed; |
100 | 103 | ||
101 | QTimer *repeatTimer; | 104 | QTimer *repeatTimer; |
102 | }; | 105 | }; |
103 | 106 | ||
107 | } // namespace KeyboardInput | ||
108 | |||
diff --git a/inputmethods/keyboard/keyboardimpl.cpp b/inputmethods/keyboard/keyboardimpl.cpp index bc96402..3c77fe6 100644 --- a/inputmethods/keyboard/keyboardimpl.cpp +++ b/inputmethods/keyboard/keyboardimpl.cpp | |||
@@ -18,17 +18,17 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
22 | #include "keyboard.h" | 22 | #include "keyboard.h" |
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", |
30 | "+ c #FFF7DD", | 30 | "+ c #FFF7DD", |
31 | "@ c #D6CFBA", | 31 | "@ c #D6CFBA", |
32 | " .......................... ", | 32 | " .......................... ", |
33 | " .+++.+++.+++.+++.+++.++++. ", | 33 | " .+++.+++.+++.+++.+++.++++. ", |
34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", | 34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", |
@@ -40,17 +40,17 @@ static const char * kb_xpm[] = { | |||
40 | " .+@@@@@.+@@.+@@.+@@.+@@@@. ", | 40 | " .+@@@@@.+@@.+@@.+@@.+@@@@. ", |
41 | " .......................... ", | 41 | " .......................... ", |
42 | " .++++.++++++++++++++.++++. ", | 42 | " .++++.++++++++++++++.++++. ", |
43 | " .+@@@.+@@@@@@@@@@@@@.+@@@. ", | 43 | " .+@@@.+@@@@@@@@@@@@@.+@@@. ", |
44 | " .......................... "}; | 44 | " .......................... "}; |
45 | 45 | ||
46 | 46 | ||
47 | /* XPM */ | 47 | /* XPM */ |
48 | static char * opti_xpm[] = { | 48 | static const char * const ipti_xpm[] = { |
49 | "28 13 4 1", | 49 | "28 13 4 1", |
50 | " c None", | 50 | " c None", |
51 | ". c #4C4C4C", | 51 | ". c #4C4C4C", |
52 | "+ c #FFF7DD", | 52 | "+ c #FFF7DD", |
53 | "@ c #D6CFBA", | 53 | "@ c #D6CFBA", |
54 | " ......................... ", | 54 | " ......................... ", |
55 | " .+++.+++.+++.+++.+++.+++. ", | 55 | " .+++.+++.+++.+++.+++.+++. ", |
56 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", | 56 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", |
@@ -60,33 +60,31 @@ static char * opti_xpm[] = { | |||
60 | " ......................... ", | 60 | " ......................... ", |
61 | " .+++.+++.+++.+++.+++.+++. ", | 61 | " .+++.+++.+++.+++.+++.+++. ", |
62 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", | 62 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", |
63 | " ......................... ", | 63 | " ......................... ", |
64 | " .+++.+++.+++.+++.+++.+++. ", | 64 | " .+++.+++.+++.+++.+++.+++. ", |
65 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", | 65 | " .+@@.+@@.+@@.+@@.+@@.+@@. ", |
66 | " ......................... "}; | 66 | " ......................... "}; |
67 | 67 | ||
68 | |||
69 | |||
70 | KeyboardImpl::KeyboardImpl() | 68 | KeyboardImpl::KeyboardImpl() |
71 | : input(0), icn(0), ref(0) | 69 | : input(0), icn(0), ref(0) |
72 | { | 70 | { |
73 | } | 71 | } |
74 | 72 | ||
75 | KeyboardImpl::~KeyboardImpl() | 73 | KeyboardImpl::~KeyboardImpl() |
76 | { | 74 | { |
77 | delete input; | 75 | delete input; |
78 | delete icn; | 76 | delete icn; |
79 | } | 77 | } |
80 | 78 | ||
81 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | 79 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) |
82 | { | 80 | { |
83 | if ( !input ) | 81 | if ( !input ) |
84 | input = new Keyboard( parent, "Keyboard", f ); | 82 | input = new KeyboardInput::Keyboard( parent, "Keyboard", f ); |
85 | return input; | 83 | return input; |
86 | } | 84 | } |
87 | 85 | ||
88 | void KeyboardImpl::resetState() | 86 | void KeyboardImpl::resetState() |
89 | { | 87 | { |
90 | if ( input ) | 88 | if ( input ) |
91 | input->resetState(); | 89 | input->resetState(); |
92 | } | 90 | } |
diff --git a/inputmethods/keyboard/keyboardimpl.h b/inputmethods/keyboard/keyboardimpl.h index e756364..d33a822 100644 --- a/inputmethods/keyboard/keyboardimpl.h +++ b/inputmethods/keyboard/keyboardimpl.h | |||
@@ -17,19 +17,26 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef KEYBOARDIMPL_H | 20 | #ifndef KEYBOARDIMPL_H |
21 | #define KEYBOARDIMPL_H | 21 | #define KEYBOARDIMPL_H |
22 | 22 | ||
23 | #include <qpe/inputmethodinterface.h> | 23 | #include <qpe/inputmethodinterface.h> |
24 | 24 | ||
25 | class Keyboard; | 25 | namespace KeyboardInput |
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: |
31 | KeyboardImpl(); | 38 | KeyboardImpl(); |
32 | virtual ~KeyboardImpl(); | 39 | virtual ~KeyboardImpl(); |
33 | 40 | ||
34 | #ifndef QT_NO_COMPONENT | 41 | #ifndef QT_NO_COMPONENT |
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 42 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
@@ -38,14 +45,16 @@ public: | |||
38 | 45 | ||
39 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); | 46 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); |
40 | virtual void resetState(); | 47 | virtual void resetState(); |
41 | virtual QPixmap *icon(); | 48 | virtual QPixmap *icon(); |
42 | virtual QString name(); | 49 | virtual QString name(); |
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 | KeyboardInput::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 |
diff --git a/inputmethods/kjumpx/keyboard.cpp b/inputmethods/kjumpx/keyboard.cpp index 3af6a78..dc44805 100644 --- a/inputmethods/kjumpx/keyboard.cpp +++ b/inputmethods/kjumpx/keyboard.cpp | |||
@@ -135,16 +135,17 @@ static const mapElement mod2Map[] = { | |||
135 | static const int cursorMap[][2] = { | 135 | static const int cursorMap[][2] = { |
136 | { Qt::Key_Home, Qt::Key_PageUp }, | 136 | { Qt::Key_Home, Qt::Key_PageUp }, |
137 | { Qt::Key_End, Qt::Key_PageDown }, | 137 | { Qt::Key_End, Qt::Key_PageDown }, |
138 | { Qt::Key_Up, Qt::Key_Up }, | 138 | { Qt::Key_Up, Qt::Key_Up }, |
139 | { Qt::Key_Left, Qt::Key_Right }, | 139 | { Qt::Key_Left, Qt::Key_Right }, |
140 | { Qt::Key_Down, Qt::Key_Down }, | 140 | { Qt::Key_Down, Qt::Key_Down }, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | using namespace KJumpX; | ||
143 | 144 | ||
144 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : | 145 | Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : |
145 | QFrame(parent, name, f), | 146 | QFrame(parent, name, f), |
146 | shift(0), paren(0), ctrl(0), alt(0), lang(1), lastKey(0), | 147 | shift(0), paren(0), ctrl(0), alt(0), lang(1), lastKey(0), |
147 | pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0), | 148 | pressedKeyUnicode(0), pressedKeyQcode(0), pressedMod(0), |
148 | isnoncont(false), | 149 | isnoncont(false), |
149 | slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0), | 150 | slideKeyUnicodeH(0), slideKeyQcodeH(0), slideKeyUnicodeV(0), slideKeyQcodeV(0), |
150 | enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL), | 151 | enableMouseTracking(false), slidePix(NULL), slidePixH(NULL), slidePixV(NULL), |
diff --git a/inputmethods/kjumpx/keyboard.h b/inputmethods/kjumpx/keyboard.h index 148cb72..ca83915 100644 --- a/inputmethods/kjumpx/keyboard.h +++ b/inputmethods/kjumpx/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 KJumpX | ||
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 | ||
@@ -72,8 +75,10 @@ private: | |||
72 | QPixmap offscreen; | 75 | QPixmap offscreen; |
73 | 76 | ||
74 | QPixmap *releasedPix; | 77 | QPixmap *releasedPix; |
75 | QPixmap *pressedPix; | 78 | QPixmap *pressedPix; |
76 | 79 | ||
77 | QTimer *delayTimer; | 80 | QTimer *delayTimer; |
78 | QTimer *rateTimer; | 81 | QTimer *rateTimer; |
79 | }; | 82 | }; |
83 | |||
84 | } // namespace KJumpX | ||
diff --git a/inputmethods/kjumpx/keyboardimpl.cpp b/inputmethods/kjumpx/keyboardimpl.cpp index 5d8e0d3..976d816 100644 --- a/inputmethods/kjumpx/keyboardimpl.cpp +++ b/inputmethods/kjumpx/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 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 KJumpX::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/kjumpx/keyboardimpl.h b/inputmethods/kjumpx/keyboardimpl.h index a82ec4a..1ff1034 100644 --- a/inputmethods/kjumpx/keyboardimpl.h +++ b/inputmethods/kjumpx/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 KJumpX |
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 | KJumpX::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 |
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 | |||
@@ -32,16 +32,17 @@ | |||
32 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
33 | #include <ctype.h> | 33 | #include <ctype.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qstringlist.h> | 36 | #include <qstringlist.h> |
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) : |
43 | QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), alt(0), | 44 | QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), alt(0), |
44 | meta(0), circumflex(0), diaeresis(0), baccent(0), accent(0), | 45 | meta(0), circumflex(0), diaeresis(0), baccent(0), accent(0), |
45 | useLargeKeys(TRUE), usePicks(0), useRepeat(0), | 46 | useLargeKeys(TRUE), usePicks(0), useRepeat(0), |
46 | pressedKeyRow(-1), pressedKeyCol(-1), | 47 | pressedKeyRow(-1), pressedKeyCol(-1), |
47 | unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), | 48 | unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), |
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 | |||
@@ -20,16 +20,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; } |
@@ -180,9 +183,9 @@ private: | |||
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 | |
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 | |||
@@ -18,17 +18,17 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
22 | #include "keyboard.h" | 22 | #include "keyboard.h" |
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", |
30 | "+ c #FFF7DD", | 30 | "+ c #FFF7DD", |
31 | "@ c #D6CFBA", | 31 | "@ c #D6CFBA", |
32 | " .......................... ", | 32 | " .......................... ", |
33 | " .+++.+++.+++.+++.+++.++++. ", | 33 | " .+++.+++.+++.+++.+++.++++. ", |
34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", | 34 | " .+@@.+@@.+@@.+@@.+@@.+@@@. ", |
@@ -53,17 +53,17 @@ KeyboardImpl::~KeyboardImpl() | |||
53 | { | 53 | { |
54 | delete input; | 54 | delete input; |
55 | delete icn; | 55 | delete icn; |
56 | } | 56 | } |
57 | 57 | ||
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 | ||
65 | void KeyboardImpl::resetState() | 65 | void KeyboardImpl::resetState() |
66 | { | 66 | { |
67 | if ( input ) | 67 | if ( input ) |
68 | input->resetState(); | 68 | input->resetState(); |
69 | } | 69 | } |
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 | |||
@@ -17,19 +17,26 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef KEYBOARDIMPL_H | 20 | #ifndef KEYBOARDIMPL_H |
21 | #define KEYBOARDIMPL_H | 21 | #define KEYBOARDIMPL_H |
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: |
31 | KeyboardImpl(); | 38 | KeyboardImpl(); |
32 | virtual ~KeyboardImpl(); | 39 | virtual ~KeyboardImpl(); |
33 | 40 | ||
34 | #ifndef QT_NO_COMPONENT | 41 | #ifndef QT_NO_COMPONENT |
35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 42 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
@@ -38,14 +45,16 @@ public: | |||
38 | 45 | ||
39 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); | 46 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); |
40 | virtual void resetState(); | 47 | virtual void resetState(); |
41 | virtual QPixmap *icon(); | 48 | virtual QPixmap *icon(); |
42 | virtual QString name(); | 49 | virtual QString name(); |
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 |