Diffstat (limited to 'development/keyview/keyboardimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | development/keyview/keyboardimpl.cpp | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/development/keyview/keyboardimpl.cpp b/development/keyview/keyboardimpl.cpp new file mode 100644 index 0000000..673eaa5 --- a/dev/null +++ b/development/keyview/keyboardimpl.cpp | |||
@@ -0,0 +1,189 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include <qapplication.h> | ||
21 | #include <qpixmap.h> | ||
22 | #include "keyview.h" | ||
23 | #include "keyboardimpl.h" | ||
24 | |||
25 | /* XPM */ | ||
26 | static const char * kb_xpm[] = { | ||
27 | "28 13 81 1", | ||
28 | " c None", | ||
29 | ".c #000000", | ||
30 | "+c #E5E1D5", | ||
31 | "@c #FFFFFF", | ||
32 | "#c #DBDBDB", | ||
33 | "$c #132B07", | ||
34 | "%c #426362", | ||
35 | "&c #558384", | ||
36 | "*c #6E6D67", | ||
37 | "=c #DCD8CD", | ||
38 | "-c #929292", | ||
39 | ";c #446463", | ||
40 | ">c #558585", | ||
41 | ",c #466565", | ||
42 | "'c #558685", | ||
43 | ")c #B7B7B7", | ||
44 | "!c #A2A2A2", | ||
45 | "~c #9A9A9A", | ||
46 | "{c #959595", | ||
47 | "]c #939393", | ||
48 | "^c #486767", | ||
49 | "/c #383838", | ||
50 | "(c #303030", | ||
51 | "_c #2C2C2C", | ||
52 | ":c #2A2A2A", | ||
53 | "<c #292929", | ||
54 | "[c #333333", | ||
55 | "}c #FFFFE9", | ||
56 | "|c #FEFFDD", | ||
57 | "1c #E4E5AD", | ||
58 | "2c #202020", | ||
59 | "3c #466665", | ||
60 | "4c #2F2F2F", | ||
61 | "5c #FEFFC1", | ||
62 | "6c #575742", | ||
63 | "7c #191919", | ||
64 | "8c #2D2D2D", | ||
65 | "9c #29291F", | ||
66 | "0c #141414", | ||
67 | "ac #122207", | ||
68 | "bc #548584", | ||
69 | "cc #111111", | ||
70 | "dc #131313", | ||
71 | "ec #1B2514", | ||
72 | "fc #112106", | ||
73 | "gc #416160", | ||
74 | "hc #538484", | ||
75 | "ic #2B2B2B", | ||
76 | "jc #0F0F0F", | ||
77 | "kc #14190F", | ||
78 | "lc #192312", | ||
79 | "mc #0F1F06", | ||
80 | "nc #40605F", | ||
81 | "oc #518483", | ||
82 | "pc #9D9D9D", | ||
83 | "qc #747474", | ||
84 | "rc #2B2C2B", | ||
85 | "sc #060704", | ||
86 | "tc #0B0E09", | ||
87 | "uc #12180D", | ||
88 | "vc #17210F", | ||
89 | "wc #0E1E04", | ||
90 | "xc #3D5E5D", | ||
91 | "yc #508382", | ||
92 | "zc #898989", | ||
93 | "Ac #9C9C9C", | ||
94 | "Bc #050704", | ||
95 | "Cc #0A0D08", | ||
96 | "Dc #10170B", | ||
97 | "Ec #141E0C", | ||
98 | "Fc #0C1B04", | ||
99 | "Gc #395C5A", | ||
100 | "Hc #4F8181", | ||
101 | "Ic #242424", | ||
102 | "Jc #050604", | ||
103 | "Kc #090C06", | ||
104 | "Lc #0E1509", | ||
105 | "Mc #121C0A", | ||
106 | "Nc #0B1A03", | ||
107 | "Oc #375A58", | ||
108 | "Pc #4D807F", | ||
109 | "...........+..@.@@@@@@@#.$%&", | ||
110 | "..........*=.@.@.@@@@@##.-;>", | ||
111 | "..............@.@.@@@###.-,'", | ||
112 | ")!~{{]]]{]]].@.@.@@#.##-.-^'", | ||
113 | "/(_::<<<:<<<..@.@@#..#--.-^'", | ||
114 | "[}|12}|12}|12.#.@#.-.---.-3'", | ||
115 | "4|567|567|567..@@...---.--,'", | ||
116 | "81690169016901.@#.----.--a;b", | ||
117 | "82700ccc0cccd.@@......--efgh", | ||
118 | "i}|1c}|1c}|1j.@#.------klmno", | ||
119 | "i|56c|56c|56.@#.--pqrstuvwxy", | ||
120 | "i169c169c16.@#.--zAqrBCDEFGH", | ||
121 | "82700ccc0cj...--IzAqrJKLMNOP"}; | ||
122 | |||
123 | |||
124 | |||
125 | |||
126 | KeyboardImpl::KeyboardImpl() | ||
127 | : input(0), icn(0), ref(0) | ||
128 | { | ||
129 | } | ||
130 | |||
131 | KeyboardImpl::~KeyboardImpl() | ||
132 | { | ||
133 | delete input; | ||
134 | delete icn; | ||
135 | } | ||
136 | |||
137 | QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | ||
138 | { | ||
139 | if ( !input ) | ||
140 | input = new Keyview( parent, "Keyview", f ); | ||
141 | return input; | ||
142 | } | ||
143 | |||
144 | void KeyboardImpl::resetState() | ||
145 | { | ||
146 | /* | ||
147 | if ( input ) | ||
148 | input->resetState(); | ||
149 | */ | ||
150 | } | ||
151 | |||
152 | QPixmap *KeyboardImpl::icon() | ||
153 | { | ||
154 | if ( !icn ) | ||
155 | icn = new QPixmap( (const char **)kb_xpm ); | ||
156 | return icn; | ||
157 | } | ||
158 | |||
159 | QString KeyboardImpl::name() | ||
160 | { | ||
161 | // return qApp->translate( "InputMethods", "Keyboard" ); | ||
162 | return "Keyview"; | ||
163 | } | ||
164 | |||
165 | void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot ) | ||
166 | { | ||
167 | //if ( input ) | ||
168 | //QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); | ||
169 | } | ||
170 | |||
171 | #ifndef QT_NO_COMPONENT | ||
172 | QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
173 | { | ||
174 | *iface = 0; | ||
175 | if ( uuid == IID_QUnknown ) | ||
176 | *iface = this; | ||
177 | else if ( uuid == IID_InputMethod ) | ||
178 | *iface = this; | ||
179 | |||
180 | if ( *iface ) | ||
181 | (*iface)->addRef(); | ||
182 | return QS_OK; | ||
183 | } | ||
184 | |||
185 | Q_EXPORT_INTERFACE() | ||
186 | { | ||
187 | Q_CREATE_INSTANCE( KeyboardImpl ) | ||
188 | } | ||
189 | #endif | ||