summaryrefslogtreecommitdiff
path: root/inputmethods/multikey
Unidiff
Diffstat (limited to 'inputmethods/multikey') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp1
-rw-r--r--inputmethods/multikey/keyboard.h5
-rw-r--r--inputmethods/multikey/keyboardimpl.cpp4
-rw-r--r--inputmethods/multikey/keyboardimpl.h11
4 files changed, 17 insertions, 4 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
@@ -28,24 +28,25 @@
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qfontmetrics.h> 29#include <qfontmetrics.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
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
40using namespace MultiKey;
40 41
41/* Keyboard::Keyboard {{{1 */ 42/* Keyboard::Keyboard {{{1 */
42Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : 43Keyboard::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),
48 configdlg(0) 49 configdlg(0)
49 50
50{ 51{
51 52
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
@@ -16,24 +16,27 @@
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
26class QTimer; 26class QTimer;
27 27
28namespace MultiKey
29{
30
28class KeyboardConfig : public DictFilterConfig 31class KeyboardConfig : public DictFilterConfig
29{ 32{
30public: 33public:
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; }
36private: 39private:
37 int backspaces; 40 int backspaces;
38}; 41};
39 42
@@ -176,13 +179,13 @@ private:
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
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
@@ -14,25 +14,25 @@
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 <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 */
26static const char * kb_xpm[] = { 26static 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" .+@@.+@@.+@@.+@@.+@@.+@@@. ",
35" .......................... ", 35" .......................... ",
36" .+++++.+++.+++.+++.++++++. ", 36" .+++++.+++.+++.+++.++++++. ",
37" .+@@@@.+@@.+@@.+@@.+@@@@@. ", 37" .+@@@@.+@@.+@@.+@@.+@@@@@. ",
38" .......................... ", 38" .......................... ",
@@ -49,25 +49,25 @@ KeyboardImpl::KeyboardImpl()
49{ 49{
50} 50}
51 51
52KeyboardImpl::~KeyboardImpl() 52KeyboardImpl::~KeyboardImpl()
53{ 53{
54 delete input; 54 delete input;
55 delete icn; 55 delete icn;
56} 56}
57 57
58QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) 58QWidget *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
65void KeyboardImpl::resetState() 65void KeyboardImpl::resetState()
66{ 66{
67 if ( input ) 67 if ( input )
68 input->resetState(); 68 input->resetState();
69} 69}
70 70
71QPixmap *KeyboardImpl::icon() 71QPixmap *KeyboardImpl::icon()
72{ 72{
73 if ( !icn ) 73 if ( !icn )
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
@@ -13,39 +13,48 @@
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#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
25namespace MultiKey
26{
25class Keyboard; 27class Keyboard;
28}
29
26class QPixmap; 30class QPixmap;
27 31
32namespace
33{
34
28class KeyboardImpl : public InputMethodInterface 35class KeyboardImpl : public InputMethodInterface
29{ 36{
30public: 37public:
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** );
36 Q_REFCOUNT 43 Q_REFCOUNT
37#endif 44#endif
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
45private: 52private:
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