-rw-r--r-- | inputmethods/handwriting/qimpeninput.cpp | 4 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpeninput.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/inputmethods/handwriting/qimpeninput.cpp b/inputmethods/handwriting/qimpeninput.cpp index 3f7a347..db33c9b 100644 --- a/inputmethods/handwriting/qimpeninput.cpp +++ b/inputmethods/handwriting/qimpeninput.cpp | |||
@@ -89,98 +89,98 @@ static char * enter_xpm[] = { | |||
89 | "12 12 5 1", | 89 | "12 12 5 1", |
90 | " c None", | 90 | " c None", |
91 | ".c #333333", | 91 | ".c #333333", |
92 | "+c #000000", | 92 | "+c #000000", |
93 | "@c #FFFFFF", | 93 | "@c #FFFFFF", |
94 | "#c #666666", | 94 | "#c #666666", |
95 | " ", | 95 | " ", |
96 | " .+. ", | 96 | " .+. ", |
97 | " +@+ ", | 97 | " +@+ ", |
98 | " . +@+ ", | 98 | " . +@+ ", |
99 | " ++ +@+ ", | 99 | " ++ +@+ ", |
100 | " +@#++++@+ ", | 100 | " +@#++++@+ ", |
101 | " +@@@@@@@@+ ", | 101 | " +@@@@@@@@+ ", |
102 | " +@#+++++. ", | 102 | " +@#+++++. ", |
103 | " ++ ", | 103 | " ++ ", |
104 | " . ", | 104 | " . ", |
105 | " ", | 105 | " ", |
106 | " "}; | 106 | " "}; |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | /* XPM */ | 110 | /* XPM */ |
111 | static char * help_xpm[] = { | 111 | static char * help_xpm[] = { |
112 | "12 12 5 1", | 112 | "12 12 5 1", |
113 | " c None", | 113 | " c None", |
114 | ".c #000000", | 114 | ".c #000000", |
115 | "+c #FFFFFF", | 115 | "+c #FFFFFF", |
116 | "@c #666666", | 116 | "@c #666666", |
117 | "#c #333333", | 117 | "#c #333333", |
118 | " ", | 118 | " ", |
119 | " ... ", | 119 | " ... ", |
120 | " .+++. ", | 120 | " .+++. ", |
121 | " .+..@+. ", | 121 | " .+..@+. ", |
122 | " #.# .+. ", | 122 | " #.# .+. ", |
123 | " .+. ", | 123 | " .+. ", |
124 | " .+. ", | 124 | " .+. ", |
125 | " .+. ", | 125 | " .+. ", |
126 | " .+. ", | 126 | " .+. ", |
127 | " #.# ", | 127 | " #.# ", |
128 | " .+. ", | 128 | " .+. ", |
129 | " #.# "}; | 129 | " #.# "}; |
130 | 130 | ||
131 | 131 | ||
132 | /*! | 132 | /*! |
133 | \class QIMPenInput qimpeninput.h | 133 | \class QIMPenInput qimpeninput.h |
134 | 134 | ||
135 | Pen input widget. | 135 | Pen input widget. |
136 | */ | 136 | */ |
137 | QIMPenInput::QIMPenInput( QWidget *parent, const char *name, WFlags f ) | 137 | QIMPenInput::QIMPenInput( QWidget *parent, const char *name, WFlags wf ) |
138 | : QFrame( parent, name, f ), helpDlg(0), profile(0) | 138 | : QFrame( parent, name, wf ), helpDlg(0), profile(0) |
139 | { | 139 | { |
140 | setFrameStyle( Box | Plain ); | 140 | setFrameStyle( Box | Plain ); |
141 | 141 | ||
142 | profileList.setAutoDelete( true ); | 142 | profileList.setAutoDelete( true ); |
143 | 143 | ||
144 | matcher = new QIMPenMatch( this ); | 144 | matcher = new QIMPenMatch( this ); |
145 | connect( matcher, SIGNAL(keypress(uint)), this, SLOT(keypress(uint)) ); | 145 | connect( matcher, SIGNAL(keypress(uint)), this, SLOT(keypress(uint)) ); |
146 | connect( matcher, SIGNAL(erase()), this, SLOT(erase()) ); | 146 | connect( matcher, SIGNAL(erase()), this, SLOT(erase()) ); |
147 | 147 | ||
148 | QGridLayout *gl = new QGridLayout( this, 5, 2, 1, 0 ); | 148 | QGridLayout *gl = new QGridLayout( this, 5, 2, 1, 0 ); |
149 | gl->setColStretch( 0, 1 ); | 149 | gl->setColStretch( 0, 1 ); |
150 | 150 | ||
151 | wordPicker = new QIMPenWordPick( this ); | 151 | wordPicker = new QIMPenWordPick( this ); |
152 | connect( wordPicker, SIGNAL(wordClicked(const QString &)), | 152 | connect( wordPicker, SIGNAL(wordClicked(const QString &)), |
153 | this, SLOT(wordPicked(const QString &)) ); | 153 | this, SLOT(wordPicked(const QString &)) ); |
154 | connect( matcher, SIGNAL(matchedCharacters(const QIMPenCharMatchList &)), | 154 | connect( matcher, SIGNAL(matchedCharacters(const QIMPenCharMatchList &)), |
155 | this, SLOT(matchedCharacters(const QIMPenCharMatchList &)) ); | 155 | this, SLOT(matchedCharacters(const QIMPenCharMatchList &)) ); |
156 | connect( matcher, SIGNAL(matchedWords(const QIMPenMatch::MatchWordList&)), | 156 | connect( matcher, SIGNAL(matchedWords(const QIMPenMatch::MatchWordList&)), |
157 | wordPicker, SLOT(setWords(const QIMPenMatch::MatchWordList&)) ); | 157 | wordPicker, SLOT(setWords(const QIMPenMatch::MatchWordList&)) ); |
158 | QFont f("smallsmooth",9); | 158 | QFont f("smallsmooth",9); |
159 | QFontInfo fi( f ); | 159 | QFontInfo fi( f ); |
160 | wordPicker->setFont( f ); | 160 | wordPicker->setFont( f ); |
161 | wordPicker->setBackgroundColor( white ); | 161 | wordPicker->setBackgroundColor( white ); |
162 | gl->addMultiCellWidget( wordPicker, 0, 0, 0, 1 ); | 162 | gl->addMultiCellWidget( wordPicker, 0, 0, 0, 1 ); |
163 | if ( !Global::fixedDawg().root() || !matcher->isWordMatchingEnabled() ) | 163 | if ( !Global::fixedDawg().root() || !matcher->isWordMatchingEnabled() ) |
164 | wordPicker->hide(); | 164 | wordPicker->hide(); |
165 | 165 | ||
166 | pw = new QIMPenWidget( this ); | 166 | pw = new QIMPenWidget( this ); |
167 | gl->addMultiCellWidget( pw, 1, 4, 0, 0 ); | 167 | gl->addMultiCellWidget( pw, 1, 4, 0, 0 ); |
168 | 168 | ||
169 | int bh = pw->sizeHint().height()/4; | 169 | int bh = pw->sizeHint().height()/4; |
170 | 170 | ||
171 | QPushButton *b = new QPushButton( this ); | 171 | QPushButton *b = new QPushButton( this ); |
172 | b->setFocusPolicy( NoFocus ); | 172 | b->setFocusPolicy( NoFocus ); |
173 | b->setPixmap( QPixmap( (const char **)bs_xpm ) ); | 173 | b->setPixmap( QPixmap( (const char **)bs_xpm ) ); |
174 | b->setFixedHeight(pw->sizeHint().height()-3*bh); // left-over space goes here | 174 | b->setFixedHeight(pw->sizeHint().height()-3*bh); // left-over space goes here |
175 | b->setAutoRepeat( TRUE ); | 175 | b->setAutoRepeat( TRUE ); |
176 | gl->addWidget( b, 1, 1 ); | 176 | gl->addWidget( b, 1, 1 ); |
177 | connect( b, SIGNAL(clicked()), SLOT(backspace())); | 177 | connect( b, SIGNAL(clicked()), SLOT(backspace())); |
178 | 178 | ||
179 | b = new QPushButton( this ); | 179 | b = new QPushButton( this ); |
180 | b->setFocusPolicy( NoFocus ); | 180 | b->setFocusPolicy( NoFocus ); |
181 | b->setPixmap( QPixmap( (const char **)enter_xpm ) ); | 181 | b->setPixmap( QPixmap( (const char **)enter_xpm ) ); |
182 | b->setFixedHeight(bh); | 182 | b->setFixedHeight(bh); |
183 | b->setAutoRepeat( TRUE ); | 183 | b->setAutoRepeat( TRUE ); |
184 | gl->addWidget( b, 2, 1 ); | 184 | gl->addWidget( b, 2, 1 ); |
185 | connect( b, SIGNAL(clicked()), SLOT(enter())); | 185 | connect( b, SIGNAL(clicked()), SLOT(enter())); |
186 | 186 | ||
diff --git a/inputmethods/handwriting/qimpeninput.h b/inputmethods/handwriting/qimpeninput.h index b4e4006..75cf260 100644 --- a/inputmethods/handwriting/qimpeninput.h +++ b/inputmethods/handwriting/qimpeninput.h | |||
@@ -1,92 +1,92 @@ | |||
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 | 20 | ||
21 | #ifndef _QIMPENINPUT_H_ | 21 | #ifndef _QIMPENINPUT_H_ |
22 | #define _QIMPENINPUT_H_ | 22 | #define _QIMPENINPUT_H_ |
23 | 23 | ||
24 | #include "qimpenprofile.h" | 24 | #include "qimpenprofile.h" |
25 | 25 | ||
26 | #include <qpe/qdawg.h> | 26 | #include <qpe/qdawg.h> |
27 | 27 | ||
28 | #include <qframe.h> | 28 | #include <qframe.h> |
29 | #include <qlist.h> | 29 | #include <qlist.h> |
30 | #include <qguardedptr.h> | 30 | #include <qguardedptr.h> |
31 | 31 | ||
32 | class QPushButton; | 32 | class QPushButton; |
33 | class QTimer; | 33 | class QTimer; |
34 | class QIMPenWidget; | 34 | class QIMPenWidget; |
35 | class QIMPenSetup; | 35 | class QIMPenSetup; |
36 | class QIMPenWordPick; | 36 | class QIMPenWordPick; |
37 | class QIMPenMatch; | 37 | class QIMPenMatch; |
38 | class HandwritingHelp; | 38 | class HandwritingHelp; |
39 | 39 | ||
40 | class QIMPenInput : public QFrame | 40 | class QIMPenInput : public QFrame |
41 | { | 41 | { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | public: | 43 | public: |
44 | QIMPenInput( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 44 | QIMPenInput( QWidget *parent = 0, const char *name = 0, WFlags wf = 0 ); |
45 | virtual ~QIMPenInput(); | 45 | virtual ~QIMPenInput(); |
46 | 46 | ||
47 | void resetState(); | 47 | void resetState(); |
48 | 48 | ||
49 | QSize sizeHint() const; | 49 | QSize sizeHint() const; |
50 | 50 | ||
51 | signals: | 51 | signals: |
52 | void key( ushort, ushort, ushort, bool, bool ); | 52 | void key( ushort, ushort, ushort, bool, bool ); |
53 | 53 | ||
54 | private slots: | 54 | private slots: |
55 | void wordPicked( const QString & ); | 55 | void wordPicked( const QString & ); |
56 | void selectCharSet( int ); | 56 | void selectCharSet( int ); |
57 | void beginStroke(); | 57 | void beginStroke(); |
58 | void strokeEntered( QIMPenStroke *st ); | 58 | void strokeEntered( QIMPenStroke *st ); |
59 | void matchedCharacters( const QIMPenCharMatchList &cl ); | 59 | void matchedCharacters( const QIMPenCharMatchList &cl ); |
60 | void keypress( uint scan_uni ); | 60 | void keypress( uint scan_uni ); |
61 | void erase(); | 61 | void erase(); |
62 | void help(); | 62 | void help(); |
63 | void setup(); | 63 | void setup(); |
64 | void backspace(); | 64 | void backspace(); |
65 | void enter(); | 65 | void enter(); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | void loadProfiles(); | 68 | void loadProfiles(); |
69 | void selectProfile( const QString &name ); | 69 | void selectProfile( const QString &name ); |
70 | void handleExtended( const QString & ); | 70 | void handleExtended( const QString & ); |
71 | void updateWordMatch( QIMPenCharMatchList &ml ); | 71 | void updateWordMatch( QIMPenCharMatchList &ml ); |
72 | void matchWords(); | 72 | void matchWords(); |
73 | void scanDict( const QDawg::Node* n, int ipos, const QString& str, int error ); | 73 | void scanDict( const QDawg::Node* n, int ipos, const QString& str, int error ); |
74 | 74 | ||
75 | enum Mode { Normal, Switch, SwitchLock }; | 75 | enum Mode { Normal, Switch, SwitchLock }; |
76 | 76 | ||
77 | private: | 77 | private: |
78 | Mode mode; | 78 | Mode mode; |
79 | QRect prefRect; | 79 | QRect prefRect; |
80 | QIMPenWidget *pw; | 80 | QIMPenWidget *pw; |
81 | QPushButton *helpBtn; | 81 | QPushButton *helpBtn; |
82 | QPushButton *setupBtn; | 82 | QPushButton *setupBtn; |
83 | QIMPenSetup *setupDlg; | 83 | QIMPenSetup *setupDlg; |
84 | QIMPenMatch *matcher; | 84 | QIMPenMatch *matcher; |
85 | QGuardedPtr<HandwritingHelp> helpDlg; | 85 | QGuardedPtr<HandwritingHelp> helpDlg; |
86 | QIMPenProfile *profile; | 86 | QIMPenProfile *profile; |
87 | QList<QIMPenProfile> profileList; | 87 | QList<QIMPenProfile> profileList; |
88 | QIMPenCharSet *shortcutCharSet; | 88 | QIMPenCharSet *shortcutCharSet; |
89 | QIMPenCharSetList baseSets; | 89 | QIMPenCharSetList baseSets; |
90 | int currCharSet; | 90 | int currCharSet; |
91 | QIMPenWordPick *wordPicker; | 91 | QIMPenWordPick *wordPicker; |
92 | }; | 92 | }; |