summaryrefslogtreecommitdiff
path: root/inputmethods/unikeyboard
authorzecke <zecke>2004-02-05 17:15:20 (UTC)
committer zecke <zecke>2004-02-05 17:15:20 (UTC)
commitf6487edaaad38c6454fc50697d7884f0bc627489 (patch) (unidiff)
tree26b2ea805710488c84a731fef576467047fb80fd /inputmethods/unikeyboard
parent416c72588577bca18ba1c9180701143e7e572eed (diff)
downloadopie-f6487edaaad38c6454fc50697d7884f0bc627489.zip
opie-f6487edaaad38c6454fc50697d7884f0bc627489.tar.gz
opie-f6487edaaad38c6454fc50697d7884f0bc627489.tar.bz2
More janitor....
remove ulong ref because we use Q_REFCOUNT which also takes care of initializing the refcount to 0 "And if you save yourself You will make him happy He'll keep you in a jar And you'll think you're happy He'll give you breathing holes"
Diffstat (limited to 'inputmethods/unikeyboard') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/unikeyboard/unikeyboardimpl.cpp2
-rw-r--r--inputmethods/unikeyboard/unikeyboardimpl.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/inputmethods/unikeyboard/unikeyboardimpl.cpp b/inputmethods/unikeyboard/unikeyboardimpl.cpp
index e7fc00e..451f340 100644
--- a/inputmethods/unikeyboard/unikeyboardimpl.cpp
+++ b/inputmethods/unikeyboard/unikeyboardimpl.cpp
@@ -1,107 +1,107 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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#include <qapplication.h> 20#include <qapplication.h>
21#include <qobject.h> 21#include <qobject.h>
22#include <qpixmap.h> 22#include <qpixmap.h>
23#include "unikeyboard.h" 23#include "unikeyboard.h"
24#include "unikeyboardimpl.h" 24#include "unikeyboardimpl.h"
25 25
26/* XPM */ 26/* XPM */
27static const char * uni_xpm[]={ 27static const char * uni_xpm[]={
28"28 13 2 1", 28"28 13 2 1",
29"# c #000000", 29"# c #000000",
30". c None", 30". c None",
31"............................", 31"............................",
32"...####....#####.....####...", 32"...####....#####.....####...",
33"...####....######....####...", 33"...####....######....####...",
34"...####....#######..........", 34"...####....#######..........",
35"...####....########..####...", 35"...####....########..####...",
36"...####....####.####.####...", 36"...####....####.####.####...",
37"...####....####..########...", 37"...####....####..########...",
38"...####....####...#######...", 38"...####....####...#######...",
39"...####....####....######...", 39"...####....####....######...",
40"...#####..#####.....#####...", 40"...#####..#####.....#####...",
41"....##########.......####...", 41"....##########.......####...",
42"......######..........###...", 42"......######..........###...",
43"............................"}; 43"............................"};
44 44
45UniKeyboardImpl::UniKeyboardImpl() 45UniKeyboardImpl::UniKeyboardImpl()
46 : input(0), icn(0), ref(0) 46 : input(0), icn(0)
47{ 47{
48} 48}
49 49
50UniKeyboardImpl::~UniKeyboardImpl() 50UniKeyboardImpl::~UniKeyboardImpl()
51{ 51{
52 delete input; 52 delete input;
53 delete icn; 53 delete icn;
54} 54}
55 55
56QWidget *UniKeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) 56QWidget *UniKeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
57{ 57{
58 if ( !input ) 58 if ( !input )
59 input = new UniKeyboard( parent, "UniKeyboard", f ); 59 input = new UniKeyboard( parent, "UniKeyboard", f );
60 return input; 60 return input;
61} 61}
62 62
63void UniKeyboardImpl::resetState() 63void UniKeyboardImpl::resetState()
64{ 64{
65 if ( input ) 65 if ( input )
66 input->resetState(); 66 input->resetState();
67} 67}
68 68
69QPixmap *UniKeyboardImpl::icon() 69QPixmap *UniKeyboardImpl::icon()
70{ 70{
71 if ( !icn ) 71 if ( !icn )
72 icn = new QPixmap( (const char **)uni_xpm ); 72 icn = new QPixmap( (const char **)uni_xpm );
73 return icn; 73 return icn;
74} 74}
75 75
76QString UniKeyboardImpl::name() 76QString UniKeyboardImpl::name()
77{ 77{
78 return qApp->translate( "InputMethods", "Unicode" ); 78 return qApp->translate( "InputMethods", "Unicode" );
79} 79}
80 80
81void UniKeyboardImpl::onKeyPress( QObject *receiver, const char *slot ) 81void UniKeyboardImpl::onKeyPress( QObject *receiver, const char *slot )
82{ 82{
83 if ( input ) 83 if ( input )
84 QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); 84 QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
85} 85}
86 86
87QRESULT UniKeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 87QRESULT UniKeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
88{ 88{
89 *iface = 0; 89 *iface = 0;
90 if ( uuid == IID_QUnknown ) 90 if ( uuid == IID_QUnknown )
91 *iface = this; 91 *iface = this;
92 else if ( uuid == IID_InputMethod ) 92 else if ( uuid == IID_InputMethod )
93 *iface = this; 93 *iface = this;
94 else 94 else
95 return QS_FALSE; 95 return QS_FALSE;
96 96
97 if ( *iface ) 97 if ( *iface )
98 (*iface)->addRef(); 98 (*iface)->addRef();
99 return QS_OK; 99 return QS_OK;
100} 100}
101 101
102Q_EXPORT_INTERFACE() 102Q_EXPORT_INTERFACE()
103{ 103{
104 Q_CREATE_INSTANCE( UniKeyboardImpl ) 104 Q_CREATE_INSTANCE( UniKeyboardImpl )
105} 105}
106 106
107 107
diff --git a/inputmethods/unikeyboard/unikeyboardimpl.h b/inputmethods/unikeyboard/unikeyboardimpl.h
index 97b1ff6..8c7802f 100644
--- a/inputmethods/unikeyboard/unikeyboardimpl.h
+++ b/inputmethods/unikeyboard/unikeyboardimpl.h
@@ -1,49 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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 UNIKEYBOARDIMPL_H 20#ifndef UNIKEYBOARDIMPL_H
21#define UNIKEYBOARDIMPL_H 21#define UNIKEYBOARDIMPL_H
22 22
23#include <qpe/inputmethodinterface.h> 23#include <qpe/inputmethodinterface.h>
24 24
25class UniKeyboard; 25class UniKeyboard;
26class QPixmap; 26class QPixmap;
27 27
28class UniKeyboardImpl : public InputMethodInterface 28class UniKeyboardImpl : public InputMethodInterface
29{ 29{
30public: 30public:
31 UniKeyboardImpl(); 31 UniKeyboardImpl();
32 virtual ~UniKeyboardImpl(); 32 virtual ~UniKeyboardImpl();
33 33
34 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 34 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
35 Q_REFCOUNT 35 Q_REFCOUNT
36 36
37 virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); 37 virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f );
38 virtual void resetState(); 38 virtual void resetState();
39 virtual QPixmap *icon(); 39 virtual QPixmap *icon();
40 virtual QString name(); 40 virtual QString name();
41 virtual void onKeyPress( QObject *receiver, const char *slot ); 41 virtual void onKeyPress( QObject *receiver, const char *slot );
42 42
43private: 43private:
44 UniKeyboard *input; 44 UniKeyboard *input;
45 QPixmap *icn; 45 QPixmap *icn;
46 ulong ref;
47}; 46};
48 47
49#endif 48#endif