author | mark <mark> | 2002-02-04 22:53:18 (UTC) |
---|---|---|
committer | mark <mark> | 2002-02-04 22:53:18 (UTC) |
commit | af8212fa21bf4c747707ee314ba838b46bd8211d (patch) (unidiff) | |
tree | a907a3f80615c8ee931c158bae580f5e52042e61 /inputmethods/jumpx/keyboardimpl.cpp | |
parent | 61b7a750723422ad33332cbdbcb5294cc35a6326 (diff) | |
download | opie-af8212fa21bf4c747707ee314ba838b46bd8211d.zip opie-af8212fa21bf4c747707ee314ba838b46bd8211d.tar.gz opie-af8212fa21bf4c747707ee314ba838b46bd8211d.tar.bz2 |
Importing qjumpx
Diffstat (limited to 'inputmethods/jumpx/keyboardimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/jumpx/keyboardimpl.cpp | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/inputmethods/jumpx/keyboardimpl.cpp b/inputmethods/jumpx/keyboardimpl.cpp new file mode 100644 index 0000000..92abb09 --- a/dev/null +++ b/inputmethods/jumpx/keyboardimpl.cpp | |||
@@ -0,0 +1,97 @@ | |||
1 | /**************************************************************************************94x78** | ||
2 | ** | ||
3 | ** This file may be distributed and/or modified under the terms of the | ||
4 | ** GNU General Public License version 2 as published by the Free Software | ||
5 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
6 | ** packaging of this file. | ||
7 | ** | ||
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. | ||
10 | ** | ||
11 | *********************************************************************************************/ | ||
12 | #include <qapplication.h> | ||
13 | #include <qpixmap.h> | ||
14 | #include "keyboard.h" | ||
15 | #include "keyboardimpl.h" | ||
16 | |||
17 | /* XPM */ | ||
18 | static const char * icon_xpm[] = { | ||
19 | "26 13 2 1", | ||
20 | " c None", | ||
21 | ".c #000000", | ||
22 | " ... ... ... ... ... ... ", | ||
23 | ". . . . . . . ", | ||
24 | ". . . . . . . ", | ||
25 | ". . . . . . . ", | ||
26 | " ....... ... ... ....... ", | ||
27 | ". . . . . ", | ||
28 | ". . . . . ", | ||
29 | ". . . . . ", | ||
30 | " ....... ... ... ....... ", | ||
31 | ". . . . . . . ", | ||
32 | ". . . . . . . ", | ||
33 | ". . . . . . . ", | ||
34 | " ... ... ... ... ... ... "}; | ||
35 | |||
36 | |||
37 | KeyboardImpl::KeyboardImpl() | ||
38 | : input(0), icn(0), ref(0) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | KeyboardImpl::~KeyboardImpl() | ||
43 | { | ||
44 | delete input; | ||
45 | delete icn; | ||
46 | } | ||
47 | |||
48 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | ||
49 | { | ||
50 | if ( !input ) | ||
51 | input = new Keyboard( parent, "Keyboard", f ); | ||
52 | return input; | ||
53 | } | ||
54 | |||
55 | void KeyboardImpl::resetState() | ||
56 | { | ||
57 | if ( input ) | ||
58 | input->resetState(); | ||
59 | } | ||
60 | |||
61 | QPixmap *KeyboardImpl::icon() | ||
62 | { | ||
63 | if ( !icn ) | ||
64 | icn = new QPixmap( (const char **)icon_xpm ); | ||
65 | return icn; | ||
66 | } | ||
67 | |||
68 | QString KeyboardImpl::name() | ||
69 | { | ||
70 | return qApp->translate( "InputMethods", "JumpX" ); | ||
71 | } | ||
72 | |||
73 | void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot ) | ||
74 | { | ||
75 | if ( input ) | ||
76 | QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); | ||
77 | } | ||
78 | |||
79 | #ifndef QT_NO_COMPONENT | ||
80 | QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
81 | { | ||
82 | *iface = 0; | ||
83 | if ( uuid == IID_QUnknown ) | ||
84 | *iface = this; | ||
85 | else if ( uuid == IID_InputMethod ) | ||
86 | *iface = this; | ||
87 | |||
88 | if ( *iface ) | ||
89 | (*iface)->addRef(); | ||
90 | return QS_OK; | ||
91 | } | ||
92 | |||
93 | Q_EXPORT_INTERFACE() | ||
94 | { | ||
95 | Q_CREATE_INSTANCE( KeyboardImpl ) | ||
96 | } | ||
97 | #endif | ||