author | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
commit | 651b6c612db4e809c506973996f2580c4158ac3a (patch) (unidiff) | |
tree | 8c8edc86e4b206dd4542a6b556ad1a319d6698ab /inputmethods/dasher/QtDasherImpl.cc | |
parent | d1a11b45e805fe7771ea05944757d767c3c4c8ea (diff) | |
download | opie-651b6c612db4e809c506973996f2580c4158ac3a.zip opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.gz opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.bz2 |
merge dasher which has been introduced in BRANCH first (wtf?) into HEAD
Diffstat (limited to 'inputmethods/dasher/QtDasherImpl.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/QtDasherImpl.cc | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/inputmethods/dasher/QtDasherImpl.cc b/inputmethods/dasher/QtDasherImpl.cc new file mode 100644 index 0000000..55c21b1 --- a/dev/null +++ b/inputmethods/dasher/QtDasherImpl.cc | |||
@@ -0,0 +1,85 @@ | |||
1 | #include <iostream> | ||
2 | #include <qapplication.h> | ||
3 | #include <qobject.h> | ||
4 | #include <qpixmap.h> | ||
5 | #include "DasherInterface.h" | ||
6 | #include "QtDasherScreen.h" | ||
7 | #include "QtDasherImpl.h" | ||
8 | |||
9 | /* XPM */ | ||
10 | static const char * qtdasher_xpm[]={ | ||
11 | "28 7 2 1", | ||
12 | "# c #303030", | ||
13 | " c None", | ||
14 | " ########################## ", | ||
15 | " ", | ||
16 | " # # ", | ||
17 | " # # # # ", | ||
18 | " # # # # ", | ||
19 | " # # # ", | ||
20 | " ########################## "}; | ||
21 | |||
22 | |||
23 | QtDasherImpl::QtDasherImpl() | ||
24 | : qtdasherwidget(0), icn(0), ref(0), qtdasherinterface(0) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | QtDasherImpl::~QtDasherImpl() | ||
29 | { | ||
30 | delete qtdasherwidget; | ||
31 | delete icn; | ||
32 | } | ||
33 | |||
34 | QWidget *QtDasherImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | ||
35 | { | ||
36 | if ( !qtdasherwidget ) { | ||
37 | qtdasherwidget = new QtDasherPlugin( parent, "Dasher", f ); | ||
38 | } | ||
39 | return qtdasherwidget; | ||
40 | } | ||
41 | |||
42 | void QtDasherImpl::resetState() | ||
43 | { | ||
44 | if ( qtdasherwidget ) | ||
45 | qtdasherwidget->resetState(); | ||
46 | } | ||
47 | |||
48 | QPixmap *QtDasherImpl::icon() | ||
49 | { | ||
50 | if ( !icn ) | ||
51 | icn = new QPixmap( (const char **)qtdasher_xpm ); | ||
52 | return icn; | ||
53 | } | ||
54 | |||
55 | QString QtDasherImpl::name() | ||
56 | { | ||
57 | return qApp->translate( "InputMethods", "Dasher" ); | ||
58 | } | ||
59 | |||
60 | void QtDasherImpl::onKeyPress( QObject *receiver, const char *slot ) | ||
61 | { | ||
62 | if ( qtdasherwidget ) | ||
63 | QObject::connect( qtdasherwidget, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); | ||
64 | } | ||
65 | |||
66 | #ifndef QT_NO_COMPONENT | ||
67 | QRESULT QtDasherImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
68 | { | ||
69 | *iface = 0; | ||
70 | if ( uuid == IID_QUnknown ) | ||
71 | *iface = this; | ||
72 | else if ( uuid == IID_InputMethod ) | ||
73 | *iface = this; | ||
74 | |||
75 | if ( *iface ) | ||
76 | (*iface)->addRef(); | ||
77 | return QS_OK; | ||
78 | } | ||
79 | |||
80 | Q_EXPORT_INTERFACE() | ||
81 | { | ||
82 | Q_CREATE_INSTANCE( QtDasherImpl ) | ||
83 | } | ||
84 | #endif | ||
85 | |||