00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <qapplication.h>
00021 #include <qpixmap.h>
00022 #include "keyview.h"
00023 #include "keyboardimpl.h"
00024
00025
00026 static const char * kb_xpm[] = {
00027 "28 13 81 1",
00028 " c None",
00029 ". c #000000",
00030 "+ c #E5E1D5",
00031 "@ c #FFFFFF",
00032 "# c #DBDBDB",
00033 "$ c #132B07",
00034 "% c #426362",
00035 "& c #558384",
00036 "* c #6E6D67",
00037 "= c #DCD8CD",
00038 "- c #929292",
00039 "; c #446463",
00040 "> c #558585",
00041 ", c #466565",
00042 "' c #558685",
00043 ") c #B7B7B7",
00044 "! c #A2A2A2",
00045 "~ c #9A9A9A",
00046 "{ c #959595",
00047 "] c #939393",
00048 "^ c #486767",
00049 "/ c #383838",
00050 "( c #303030",
00051 "_ c #2C2C2C",
00052 ": c #2A2A2A",
00053 "< c #292929",
00054 "[ c #333333",
00055 "} c #FFFFE9",
00056 "| c #FEFFDD",
00057 "1 c #E4E5AD",
00058 "2 c #202020",
00059 "3 c #466665",
00060 "4 c #2F2F2F",
00061 "5 c #FEFFC1",
00062 "6 c #575742",
00063 "7 c #191919",
00064 "8 c #2D2D2D",
00065 "9 c #29291F",
00066 "0 c #141414",
00067 "a c #122207",
00068 "b c #548584",
00069 "c c #111111",
00070 "d c #131313",
00071 "e c #1B2514",
00072 "f c #112106",
00073 "g c #416160",
00074 "h c #538484",
00075 "i c #2B2B2B",
00076 "j c #0F0F0F",
00077 "k c #14190F",
00078 "l c #192312",
00079 "m c #0F1F06",
00080 "n c #40605F",
00081 "o c #518483",
00082 "p c #9D9D9D",
00083 "q c #747474",
00084 "r c #2B2C2B",
00085 "s c #060704",
00086 "t c #0B0E09",
00087 "u c #12180D",
00088 "v c #17210F",
00089 "w c #0E1E04",
00090 "x c #3D5E5D",
00091 "y c #508382",
00092 "z c #898989",
00093 "A c #9C9C9C",
00094 "B c #050704",
00095 "C c #0A0D08",
00096 "D c #10170B",
00097 "E c #141E0C",
00098 "F c #0C1B04",
00099 "G c #395C5A",
00100 "H c #4F8181",
00101 "I c #242424",
00102 "J c #050604",
00103 "K c #090C06",
00104 "L c #0E1509",
00105 "M c #121C0A",
00106 "N c #0B1A03",
00107 "O c #375A58",
00108 "P c #4D807F",
00109 "...........+..@.@@@@@@@#.$%&",
00110 "..........*=.@.@.@@@@@##.-;>",
00111 "..............@.@.@@@###.-,'",
00112 ")!~{{]]]{]]].@.@.@@#.##-.-^'",
00113 "/(_::<<<:<<<..@.@@#..#--.-^'",
00114 "[}|12}|12}|12.#.@#.-.---.-3'",
00115 "4|567|567|567..@@...---.--,'",
00116 "81690169016901.@#.----.--a;b",
00117 "82700ccc0cccd.@@......--efgh",
00118 "i}|1c}|1c}|1j.@#.------klmno",
00119 "i|56c|56c|56.@#.--pqrstuvwxy",
00120 "i169c169c16.@#.--zAqrBCDEFGH",
00121 "82700ccc0cj...--IzAqrJKLMNOP"};
00122
00123
00124
00125
00126 KeyboardImpl::KeyboardImpl()
00127 : input(0), icn(0), ref(0)
00128 {
00129 }
00130
00131 KeyboardImpl::~KeyboardImpl()
00132 {
00133 delete input;
00134 delete icn;
00135 }
00136
00137 QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
00138 {
00139 if ( !input )
00140 input = new Keyview( parent, "Keyview", f );
00141 return input;
00142 }
00143
00144 void KeyboardImpl::resetState()
00145 {
00146
00147
00148
00149
00150 }
00151
00152 QPixmap *KeyboardImpl::icon()
00153 {
00154 if ( !icn )
00155 icn = new QPixmap( (const char **)kb_xpm );
00156 return icn;
00157 }
00158
00159 QString KeyboardImpl::name()
00160 {
00161
00162 return "Keyview";
00163 }
00164
00165 void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot )
00166 {
00167 Q_UNUSED( receiver );
00168 Q_CONST_UNUSED( slot );
00169
00170
00171 }
00172
00173 #ifndef QT_NO_COMPONENT
00174 QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
00175 {
00176 *iface = 0;
00177 if ( uuid == IID_QUnknown )
00178 *iface = this;
00179 else if ( uuid == IID_InputMethod )
00180 *iface = this;
00181 else
00182 return QS_FALSE;
00183
00184 if ( *iface )
00185 (*iface)->addRef();
00186 return QS_OK;
00187 }
00188
00189 Q_EXPORT_INTERFACE()
00190 {
00191 Q_CREATE_INSTANCE( KeyboardImpl )
00192 }
00193 #endif