summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
committer mickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
commit34ae22499b91f483f1cf505e515047ea11e8eaf0 (patch) (unidiff)
tree555ad0f77c87d445f1ca688f96a78fe903211190
parent80823d4cbd234a54a15d6b439bd37a8ea42e7904 (diff)
downloadopie-34ae22499b91f483f1cf505e515047ea11e8eaf0.zip
opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.gz
opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.bz2
remove hard coded fonts for dvorak, keyboard, multikey, pickboard, and unikeyboard
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog3
-rw-r--r--inputmethods/dvorak/dvorak.cpp13
-rw-r--r--inputmethods/keyboard/keyboard.cpp13
-rw-r--r--inputmethods/multikey/keyboard.cpp6
-rw-r--r--inputmethods/pickboard/pickboard.cpp15
-rw-r--r--inputmethods/unikeyboard/unikeyboard.cpp12
6 files changed, 45 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index ff579d5..8847714 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,56 +1,57 @@
1 2005-??-??Opie 1.2.0 1 2005-??-??Opie 1.2.0
2 2
3 New Features 3 New Features
4 ------------ 4 ------------
5 5
6 Fixed Bugs 6 Fixed Bugs
7 ---------- 7 ----------
8 * #1501 - Fixing bug in todo sql backend (eilers) 8 * #1501 - Fixed bug in todo sql backend (eilers)
9 * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl)
9 10
10 Internal 11 Internal
11 -------- 12 --------
12 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) 13 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl)
13 14
14 2004-11-26Opie 1.1.8 15 2004-11-26Opie 1.1.8
15 16
16 New Features 17 New Features
17 ------------ 18 ------------
18 * PackageManager supports installation of local ipkg files (drw) 19 * PackageManager supports installation of local ipkg files (drw)
19 * PackageManager supports linking of applications to root (drw) 20 * PackageManager supports linking of applications to root (drw)
20 * PackageManager supports src/gz feeds (drw,wimpie) 21 * PackageManager supports src/gz feeds (drw,wimpie)
21 * Added a syslog information tab to sysinfo (mickeyl) 22 * Added a syslog information tab to sysinfo (mickeyl)
22 * Added new, more consistent, PIM icons + a GIMP teplate (ar) 23 * Added new, more consistent, PIM icons + a GIMP teplate (ar)
23 24
24 Fixed Bugs 25 Fixed Bugs
25 ---------- 26 ----------
26 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) 27 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw)
27 * #1269 - VCards were imported into personal area if it was activated (eilers) 28 * #1269 - VCards were imported into personal area if it was activated (eilers)
28 * #1464 - Packagemanager dont set active filter after install a package (drw) 29 * #1464 - Packagemanager dont set active filter after install a package (drw)
29 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) 30 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers)
30 * #1493 - Fixed one column layout bug of the launcher (hrw) 31 * #1493 - Fixed one column layout bug of the launcher (hrw)
31 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) 32 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw)
32 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) 33 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw)
33 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) 34 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl)
34 35
35 Internal 36 Internal
36 -------- 37 --------
37 * Moved libopie1 to unsupported (mickeyl) 38 * Moved libopie1 to unsupported (mickeyl)
38 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) 39 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers)
39 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) 40 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers)
40 41
41 2004-11-14Opie 1.1.7 42 2004-11-14Opie 1.1.7
42 43
43 New Features 44 New Features
44 ------------ 45 ------------
45 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) 46 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers)
46 * Backup now uses the busy indicator when backing up and restore (ar) 47 * Backup now uses the busy indicator when backing up and restore (ar)
47 * OpiePlayer2 gained adding of Directories to the playlist (zecke) 48 * OpiePlayer2 gained adding of Directories to the playlist (zecke)
48 * OpiePlayer2 better error handling (zecke) 49 * OpiePlayer2 better error handling (zecke)
49 * OpiePlayer2 progress indication while streaming (zecke) 50 * OpiePlayer2 progress indication while streaming (zecke)
50 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) 51 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke)
51 * Ported brightnessapplet from Qtopia 1.7 (mickeyl) 52 * Ported brightnessapplet from Qtopia 1.7 (mickeyl)
52 * Opie-Eye got a Digital Camera File Backend (alwin,zecke) 53 * Opie-Eye got a Digital Camera File Backend (alwin,zecke)
53 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke) 54 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke)
54 * Opie-Console use Custom Font and Size in a Profile (harlekin) 55 * Opie-Console use Custom Font and Size in a Profile (harlekin)
55 * Opie-Console transparently log the Output and Input to a file (harlekin) 56 * Opie-Console transparently log the Output and Input to a file (harlekin)
56 * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem) 57 * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem)
diff --git a/inputmethods/dvorak/dvorak.cpp b/inputmethods/dvorak/dvorak.cpp
index 2137f22..3781e38 100644
--- a/inputmethods/dvorak/dvorak.cpp
+++ b/inputmethods/dvorak/dvorak.cpp
@@ -1,96 +1,103 @@
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#include "dvorak.h" 21#include "dvorak.h"
22 22
23#include <qpe/global.h> 23#include <qpe/global.h>
24 24#include <qpe/config.h>
25#include <qwindowsystem_qws.h> 25#include <qwindowsystem_qws.h>
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qfontmetrics.h> 27#include <qfontmetrics.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <ctype.h> 29#include <ctype.h>
30 30
31 31
32#define USE_SMALL_BACKSPACE 32#define USE_SMALL_BACKSPACE
33 33
34using namespace Dvorak; 34using namespace Dvorak;
35 35
36Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : 36Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) :
37 QFrame(parent, name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), 37 QFrame(parent, name, f), shift(FALSE), lock(FALSE), ctrl(FALSE),
38 alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), 38 alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1),
39 unicode(-1), qkeycode(0), modifiers(0) 39 unicode(-1), qkeycode(0), modifiers(0)
40{ 40{
41 // setPalette(QPalette(QColor(240,240,230))); // Beige! 41 // setPalette(QPalette(QColor(240,240,230))); // Beige!
42 // setFont( QFont( "Helvetica", 8 ) ); 42 // setFont( QFont( "Helvetica", 8 ) );
43// setPalette(QPalette(QColor(200,200,200))); // Gray 43// setPalette(QPalette(QColor(200,200,200))); // Gray
44 setPalette(QPalette(QColor(220,220,220))); // Gray 44 setPalette(QPalette(QColor(220,220,220))); // Gray
45 45
46 // get the default font
47 Config *config = new Config( "qpe" );
48 config->setGroup( "Appearance" );
49 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
50 int fontSize = config->readNumEntry( "FontSize", 10 );
51 delete config;
52
46 picks = new KeyboardPicks( this ); 53 picks = new KeyboardPicks( this );
47 picks->setFont( QFont( "smallsmooth", 9 ) ); 54 picks->setFont( QFont( familyStr, fontSize ) );
48 setFont( QFont( "smallsmooth", 9 ) ); 55 setFont( QFont( familyStr, fontSize ) );
49 picks->initialise(); 56 picks->initialise();
50 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 57 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
51 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 58 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
52 59
53 repeatTimer = new QTimer( this ); 60 repeatTimer = new QTimer( this );
54 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); 61 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
55} 62}
56 63
57void Keyboard::resizeEvent(QResizeEvent*) 64void Keyboard::resizeEvent(QResizeEvent*)
58{ 65{
59 int ph = picks->sizeHint().height(); 66 int ph = picks->sizeHint().height();
60 picks->setGeometry( 0, 0, width(), ph ); 67 picks->setGeometry( 0, 0, width(), ph );
61 keyHeight = (height()-ph)/5; 68 keyHeight = (height()-ph)/5;
62 int nk; 69 int nk;
63 if ( useOptiKeys ) { 70 if ( useOptiKeys ) {
64 nk = 15; 71 nk = 15;
65 } else if ( useLargeKeys ) { 72 } else if ( useLargeKeys ) {
66 nk = 15; 73 nk = 15;
67 } else { 74 } else {
68 nk = 19; 75 nk = 19;
69 } 76 }
70 defaultKeyWidth = width()/nk; 77 defaultKeyWidth = width()/nk;
71 xoffs = (width()-defaultKeyWidth*nk)/2; 78 xoffs = (width()-defaultKeyWidth*nk)/2;
72} 79}
73 80
74void KeyboardPicks::initialise() 81void KeyboardPicks::initialise()
75{ 82{
76 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); 83 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
77 mode = 0; 84 mode = 0;
78 dc = new KeyboardConfig(this); 85 dc = new KeyboardConfig(this);
79 configs.append(dc); 86 configs.append(dc);
80} 87}
81 88
82QSize KeyboardPicks::sizeHint() const 89QSize KeyboardPicks::sizeHint() const
83{ 90{
84 return QSize(240,fontMetrics().lineSpacing()); 91 return QSize(240,fontMetrics().lineSpacing());
85} 92}
86 93
87 94
88void KeyboardConfig::generateText(const QString &s) 95void KeyboardConfig::generateText(const QString &s)
89{ 96{
90#if defined(Q_WS_QWS) || defined(_WS_QWS_) 97#if defined(Q_WS_QWS) || defined(_WS_QWS_)
91 for (int i=0; i<(int)backspaces; i++) { 98 for (int i=0; i<(int)backspaces; i++) {
92 parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); 99 parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false );
93 parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); 100 parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false );
94 } 101 }
95 for (int i=0; i<(int)s.length(); i++) { 102 for (int i=0; i<(int)s.length(); i++) {
96 parent->emitKey( s[i].unicode(), 0, 0, true, false ); 103 parent->emitKey( s[i].unicode(), 0, 0, true, false );
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp
index fb88f2a..39d44cd 100644
--- a/inputmethods/keyboard/keyboard.cpp
+++ b/inputmethods/keyboard/keyboard.cpp
@@ -1,97 +1,104 @@
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#include "keyboard.h" 21#include "keyboard.h"
22 22
23#include <qpe/global.h> 23#include <qpe/global.h>
24 24#include <qpe/config.h>
25#include <qwindowsystem_qws.h> 25#include <qwindowsystem_qws.h>
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qfontmetrics.h> 27#include <qfontmetrics.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <ctype.h> 29#include <ctype.h>
30 30
31#include <sys/utsname.h> 31#include <sys/utsname.h>
32 32
33using namespace KeyboardInput; 33using namespace KeyboardInput;
34 34
35#define USE_SMALL_BACKSPACE 35#define USE_SMALL_BACKSPACE
36 36
37Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : 37Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
38 QFrame(parent, _name, f), shift(FALSE), lock(FALSE), ctrl(FALSE), 38 QFrame(parent, _name, f), shift(FALSE), lock(FALSE), ctrl(FALSE),
39 alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1), 39 alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1),
40 unicode(-1), qkeycode(0), modifiers(0) 40 unicode(-1), qkeycode(0), modifiers(0)
41{ 41{
42 // setPalette(QPalette(QColor(240,240,230))); // Beige! 42 // setPalette(QPalette(QColor(240,240,230))); // Beige!
43 // setFont( QFont( "Helvetica", 8 ) ); 43 // setFont( QFont( "Helvetica", 8 ) );
44// setPalette(QPalette(QColor(200,200,200))); // Gray 44// setPalette(QPalette(QColor(200,200,200))); // Gray
45 setPalette(QPalette(QColor(220,220,220))); // Gray 45 setPalette(QPalette(QColor(220,220,220))); // Gray
46 46
47 // get the default font
48 Config *config = new Config( "qpe" );
49 config->setGroup( "Appearance" );
50 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
51 int fontSize = config->readNumEntry( "FontSize", 10 );
52 delete config;
53
47 picks = new KeyboardPicks( this ); 54 picks = new KeyboardPicks( this );
48 picks->setFont( QFont( "smallsmooth", 9 ) ); 55 picks->setFont( QFont( familyStr, fontSize ) );
49 setFont( QFont( "smallsmooth", 9 ) ); 56 setFont( QFont( familyStr, fontSize ) );
50 picks->initialise(); 57 picks->initialise();
51 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 58 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
52 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 59 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
53 60
54 repeatTimer = new QTimer( this ); 61 repeatTimer = new QTimer( this );
55 62
56 // temporary quick and dirty fix for the "sticky keyboard bug" 63 // temporary quick and dirty fix for the "sticky keyboard bug"
57 // on ipaq. 64 // on ipaq.
58// struct utsname name; 65// struct utsname name;
59// if (uname(&name) != -1) 66// if (uname(&name) != -1)
60 // { 67 // {
61 //QString release=name.release; 68 //QString release=name.release;
62 //qWarning("System release: %s\n", name.release); 69 //qWarning("System release: %s\n", name.release);
63 //if(release.find("embedix",0,TRUE) !=-1) 70 //if(release.find("embedix",0,TRUE) !=-1)
64 // { 71 // {
65 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); 72 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
66 // } 73 // }
67 // } 74 // }
68} 75}
69 76
70void Keyboard::resizeEvent(QResizeEvent*) 77void Keyboard::resizeEvent(QResizeEvent*)
71{ 78{
72 int ph = picks->sizeHint().height(); 79 int ph = picks->sizeHint().height();
73 picks->setGeometry( 0, 0, width(), ph ); 80 picks->setGeometry( 0, 0, width(), ph );
74 keyHeight = (height()-ph)/5; 81 keyHeight = (height()-ph)/5;
75 int nk; 82 int nk;
76 if ( useOptiKeys ) { 83 if ( useOptiKeys ) {
77 nk = 15; 84 nk = 15;
78 } else if ( useLargeKeys ) { 85 } else if ( useLargeKeys ) {
79 nk = 15; 86 nk = 15;
80 } else { 87 } else {
81 nk = 19; 88 nk = 19;
82 } 89 }
83 defaultKeyWidth = width()/nk; 90 defaultKeyWidth = width()/nk;
84 xoffs = (width()-defaultKeyWidth*nk)/2; 91 xoffs = (width()-defaultKeyWidth*nk)/2;
85} 92}
86 93
87void KeyboardPicks::initialise() 94void KeyboardPicks::initialise()
88{ 95{
89 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); 96 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
90 mode = 0; 97 mode = 0;
91 dc = new KeyboardConfig(this); 98 dc = new KeyboardConfig(this);
92 configs.append(dc); 99 configs.append(dc);
93} 100}
94 101
95QSize KeyboardPicks::sizeHint() const 102QSize KeyboardPicks::sizeHint() const
96{ 103{
97 return QSize(240,fontMetrics().lineSpacing()); 104 return QSize(240,fontMetrics().lineSpacing());
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index f8cafd5..96fb484 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -21,109 +21,109 @@
21#include "keyboard.h" 21#include "keyboard.h"
22#include "configdlg.h" 22#include "configdlg.h"
23 23
24#include <qpe/global.h> 24#include <qpe/global.h>
25#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
26 26
27#include <qwindowsystem_qws.h> 27#include <qwindowsystem_qws.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qfontmetrics.h> 29#include <qfontmetrics.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <ctype.h> 33#include <ctype.h>
34#include <qdir.h> 34#include <qdir.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qstringlist.h> 36#include <qstringlist.h>
37 37
38#include <sys/utsname.h> 38#include <sys/utsname.h>
39 39
40using namespace MultiKey; 40using namespace MultiKey;
41 41
42static const char * const kb_config_xpm[] = { 42static const char * const kb_config_xpm[] = {
43"13 7 2 1", 43"13 7 2 1",
44" c None", 44" c None",
45". c #000000", 45". c #000000",
46" ", 46" ",
47" . ", 47" . ",
48" ... ", 48" ... ",
49" ..... ", 49" ..... ",
50" . ", 50" . ",
51" . ", 51" . ",
52" "}; 52" "};
53 53
54/* Keyboard::Keyboard {{{1 */ 54/* Keyboard::Keyboard {{{1 */
55Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : 55Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
56 QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), alt(0), 56 QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), alt(0),
57 meta(0), circumflex(0), diaeresis(0), baccent(0), accent(0), 57 meta(0), circumflex(0), diaeresis(0), baccent(0), accent(0),
58 useLargeKeys(TRUE), usePicks(0), useRepeat(0), 58 useLargeKeys(TRUE), usePicks(0), useRepeat(0),
59 pressedKeyRow(-1), pressedKeyCol(-1), 59 pressedKeyRow(-1), pressedKeyCol(-1),
60 unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), 60 unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0),
61 configdlg(0) 61 configdlg(0)
62 62
63{ 63{
64 64
65 // get the default font 65 // get the default font
66 Config *config = new Config( "qpe" ); 66 Config *config = new Config( "qpe" );
67 config->setGroup( "Appearance" ); 67 config->setGroup( "Appearance" );
68 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); 68 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
69 int fontSize = config->readNumEntry( "FontSize", 10 );
69 delete config; 70 delete config;
70 71
71 config = new Config("multikey"); 72 config = new Config("multikey");
72 config->setGroup ("general"); 73 config->setGroup ("general");
73 usePicks = config->readBoolEntry ("usePickboard", 0); // default closed 74 usePicks = config->readBoolEntry ("usePickboard", 0); // default closed
74 useRepeat = config->readBoolEntry ("useRepeat", 1); 75 useRepeat = config->readBoolEntry ("useRepeat", 1);
75 delete config; 76 delete config;
76 77
77 78 setFont( QFont( familyStr, fontSize ) );
78 setFont( QFont( familyStr, 10 ) );
79 79
80 picks = new KeyboardPicks( this ); 80 picks = new KeyboardPicks( this );
81 picks->setFont( QFont( familyStr, 10 ) ); 81 picks->setFont( QFont( familyStr, fontSize ) );
82 picks->initialise(); 82 picks->initialise();
83 if (usePicks) { 83 if (usePicks) {
84 84
85 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 85 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
86 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 86 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
87 87
88 } else picks->hide(); 88 } else picks->hide();
89 89
90 loadKeyboardColors(); 90 loadKeyboardColors();
91 91
92 keys = new Keys(); 92 keys = new Keys();
93 93
94 repeatTimer = new QTimer( this ); 94 repeatTimer = new QTimer( this );
95 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); 95 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
96 96
97 QCopChannel* kbdChannel = new QCopChannel("MultiKey/Keyboard", this); 97 QCopChannel* kbdChannel = new QCopChannel("MultiKey/Keyboard", this);
98 connect(kbdChannel, SIGNAL(received(const QCString&,const QByteArray&)), 98 connect(kbdChannel, SIGNAL(received(const QCString&,const QByteArray&)),
99 this, SLOT(receive(const QCString&,const QByteArray&))); 99 this, SLOT(receive(const QCString&,const QByteArray&)));
100} 100}
101 101
102Keyboard::~Keyboard() { 102Keyboard::~Keyboard() {
103 103
104 if ( configdlg ) { 104 if ( configdlg ) {
105 delete configdlg; 105 delete configdlg;
106 configdlg = 0; 106 configdlg = 0;
107 } 107 }
108 108
109} 109}
110 110
111/* Keyboard::resizeEvent {{{1 */ 111/* Keyboard::resizeEvent {{{1 */
112void Keyboard::resizeEvent(QResizeEvent*) 112void Keyboard::resizeEvent(QResizeEvent*)
113{ 113{
114 int ph = picks->sizeHint().height(); 114 int ph = picks->sizeHint().height();
115 picks->setGeometry( 0, 0, width(), ph ); 115 picks->setGeometry( 0, 0, width(), ph );
116 keyHeight = (height()-(usePicks ? ph : 0))/(keys->rows()?keys->rows():1); 116 keyHeight = (height()-(usePicks ? ph : 0))/(keys->rows()?keys->rows():1);
117 117
118 int nk; // number of keys? 118 int nk; // number of keys?
119 if ( useLargeKeys ) { 119 if ( useLargeKeys ) {
120 nk = 15; 120 nk = 15;
121 } else { 121 } else {
122 nk = 19; 122 nk = 19;
123 } 123 }
124 defaultKeyWidth = (width()/nk)/2; 124 defaultKeyWidth = (width()/nk)/2;
125 xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces? 125 xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces?
126 126
127} 127}
128 128
129/* KeyboardPicks::initialize {{{1 */ 129/* KeyboardPicks::initialize {{{1 */
diff --git a/inputmethods/pickboard/pickboard.cpp b/inputmethods/pickboard/pickboard.cpp
index 1611cb0..e5365ba 100644
--- a/inputmethods/pickboard/pickboard.cpp
+++ b/inputmethods/pickboard/pickboard.cpp
@@ -1,110 +1,115 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the 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 "pickboard.h" 20#include "pickboard.h"
21#include "pickboardpicks.h" 21#include "pickboardpicks.h"
22#include "pickboardcfg.h" 22#include "pickboardcfg.h"
23 23
24#include <qpe/global.h> 24#include <qpe/global.h>
25 25#include <qpe/config.h>
26#include <qpainter.h> 26#include <qpainter.h>
27#include <qlist.h> 27#include <qlist.h>
28#include <qbitmap.h> 28#include <qbitmap.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qvbox.h> 30#include <qvbox.h>
31#include <qdialog.h> 31#include <qdialog.h>
32#include <qscrollview.h> 32#include <qscrollview.h>
33#include <qpopupmenu.h> 33#include <qpopupmenu.h>
34#include <qhbuttongroup.h> 34#include <qhbuttongroup.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37#ifdef QWS 37#ifdef QWS
38#include <qwindowsystem_qws.h> 38#include <qwindowsystem_qws.h>
39#endif 39#endif
40 40
41/*! \class Pickboard 41/*! \class Pickboard
42 \brief The Pickboard class provides an input method 42 \brief The Pickboard class provides an input method
43 based on a virtual keyboard combined with word-completion. 43 based on a virtual keyboard combined with word-completion.
44 44
45 This version of Pickboard is Dual Licensed Software. However, for you to be 45 This version of Pickboard is Dual Licensed Software. However, for you to be
46 able to license the technology to others, you may require a T9(R) Text 46 able to license the technology to others, you may require a T9(R) Text
47 Input license from Tegic Communications Corporation. More information can 47 Input license from Tegic Communications Corporation. More information can
48 be found at http://www.t9.com/. 48 be found at http://www.t9.com/.
49 49
50 \legalese 50 \legalese
51 This version of Pickboard is Dual Licensed Software. However, for you to be 51 This version of Pickboard is Dual Licensed Software. However, for you to be
52 able to license the technology to others, you may require a T9(R) Text 52 able to license the technology to others, you may require a T9(R) Text
53 Input license from Tegic Communications Corporation. More information can 53 Input license from Tegic Communications Corporation. More information can
54 be found at http://www.t9.com/. 54 be found at http://www.t9.com/.
55*/ 55*/
56 56
57/* XPM */ 57/* XPM */
58static const char * const menu_xpm[]={ 58static const char * const menu_xpm[]={
59"9 9 2 1", 59"9 9 2 1",
60"a c #000000", 60"a c #000000",
61". c None", 61". c None",
62".........", 62".........",
63".........", 63".........",
64".........", 64".........",
65"....a....", 65"....a....",
66"...aaa...", 66"...aaa...",
67"..aaaaa..", 67"..aaaaa..",
68".aaaaaaa.", 68".aaaaaaa.",
69".........", 69".........",
70"........."}; 70"........."};
71 71
72class PickboardPrivate { 72class PickboardPrivate {
73public: 73public:
74 PickboardPrivate(Pickboard* parent) 74 PickboardPrivate(Pickboard* parent)
75 { 75 {
76 picks = new PickboardPicks(parent); 76 picks = new PickboardPicks(parent);
77 picks->initialise(); 77 picks->initialise();
78 menu = new QPushButton(parent); 78 menu = new QPushButton(parent);
79 menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding)); 79 menu->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding));
80 menu->setPixmap(QPixmap((const char **)menu_xpm)); 80 menu->setPixmap(QPixmap((const char **)menu_xpm));
81 QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu())); 81 QObject::connect(menu,SIGNAL(clicked()),picks,SLOT(doMenu()));
82 QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)), 82 QObject::connect(picks,SIGNAL(key(ushort,ushort,ushort,bool,bool)),
83 parent,SIGNAL(key(ushort,ushort,ushort,bool,bool))); 83 parent,SIGNAL(key(ushort,ushort,ushort,bool,bool)));
84 } 84 }
85 85
86 PickboardPicks* picks; 86 PickboardPicks* picks;
87 QPushButton* menu; 87 QPushButton* menu;
88}; 88};
89 89
90Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) : 90Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) :
91 QFrame(parent,name,f) 91 QFrame(parent,name,f)
92{ 92{
93 (new QHBoxLayout(this))->setAutoAdd(TRUE); 93 (new QHBoxLayout(this))->setAutoAdd(TRUE);
94 d = new PickboardPrivate(this); 94 d = new PickboardPrivate(this);
95// under Win32 we may not have smallsmooth font 95
96#ifndef Q_OS_WIN32 96 // get the default font
97 setFont( QFont( "smallsmooth", 9 ) ); 97 Config *config = new Config( "qpe" );
98#endif 98 config->setGroup( "Appearance" );
99 QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
100 int fontSize = config->readNumEntry( "FontSize", 10 );
101 delete config;
102
103 setFont( QFont( familyStr, fontSize ) );
99} 104}
100 105
101Pickboard::~Pickboard() 106Pickboard::~Pickboard()
102{ 107{
103 delete d; 108 delete d;
104} 109}
105 110
106void Pickboard::resetState() 111void Pickboard::resetState()
107{ 112{
108 d->picks->resetState(); 113 d->picks->resetState();
109} 114}
110 115
diff --git a/inputmethods/unikeyboard/unikeyboard.cpp b/inputmethods/unikeyboard/unikeyboard.cpp
index aa74c66..23d96ad 100644
--- a/inputmethods/unikeyboard/unikeyboard.cpp
+++ b/inputmethods/unikeyboard/unikeyboard.cpp
@@ -1,72 +1,72 @@
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#include "unikeyboard.h" 21#include "unikeyboard.h"
22 22
23#include <qpe/fontmanager.h> 23#include <qpe/fontmanager.h>
24 24#include <qpe/config.h>
25#include <qpainter.h> 25#include <qpainter.h>
26#include <qfontmetrics.h> 26#include <qfontmetrics.h>
27#include <qcombobox.h> 27#include <qcombobox.h>
28#if defined(Q_WS_QWS) || defined(_WS_QWS_) 28#if defined(Q_WS_QWS) || defined(_WS_QWS_)
29#include <qwindowsystem_qws.h> 29#include <qwindowsystem_qws.h>
30#endif 30#endif
31 31
32static const int nw = 8; 32static const int nw = 8;
33 33
34typedef struct BlockMap { 34typedef struct BlockMap {
35 ushort start; 35 ushort start;
36 ushort stop; 36 ushort stop;
37 const char *name; 37 const char *name;
38}; 38};
39 39
40//# Start Code; Block Name 40//# Start Code; Block Name
41 41
42static const BlockMap blockMap[] = 42static const BlockMap blockMap[] =
43{ 43{
44{0x0000, 0x007F, "Basic Latin"}, 44{0x0000, 0x007F, "Basic Latin"},
45{0x0080, 0x00FF, "Latin-1 Supplement"}, 45{0x0080, 0x00FF, "Latin-1 Supplement"},
46{0x0100, 0x017F, "Latin Extended-A"}, 46{0x0100, 0x017F, "Latin Extended-A"},
47{0x0180, 0x024F, "Latin Extended-B"}, 47{0x0180, 0x024F, "Latin Extended-B"},
48{0x0250, 0x02AF, "IPA Extensions"}, 48{0x0250, 0x02AF, "IPA Extensions"},
49{0x02B0, 0x02FF, "Spacing Modifier Letters"}, 49{0x02B0, 0x02FF, "Spacing Modifier Letters"},
50{0x0300, 0x036F, "Combining Diacritical Marks"}, 50{0x0300, 0x036F, "Combining Diacritical Marks"},
51{0x0370, 0x03FF, "Greek"}, 51{0x0370, 0x03FF, "Greek"},
52{0x0400, 0x04FF, "Cyrillic"}, 52{0x0400, 0x04FF, "Cyrillic"},
53{0x0530, 0x058F, "Armenian"}, 53{0x0530, 0x058F, "Armenian"},
54{0x0590, 0x05FF, "Hebrew"}, 54{0x0590, 0x05FF, "Hebrew"},
55{0x0600, 0x06FF, "Arabic"}, 55{0x0600, 0x06FF, "Arabic"},
56{0x0700, 0x074F, "Syriac "}, 56{0x0700, 0x074F, "Syriac "},
57{0x0780, 0x07BF, "Thaana"}, 57{0x0780, 0x07BF, "Thaana"},
58{0x0900, 0x097F, "Devanagari"}, 58{0x0900, 0x097F, "Devanagari"},
59{0x0980, 0x09FF, "Bengali"}, 59{0x0980, 0x09FF, "Bengali"},
60{0x0A00, 0x0A7F, "Gurmukhi"}, 60{0x0A00, 0x0A7F, "Gurmukhi"},
61{0x0A80, 0x0AFF, "Gujarati"}, 61{0x0A80, 0x0AFF, "Gujarati"},
62{0x0B00, 0x0B7F, "Oriya"}, 62{0x0B00, 0x0B7F, "Oriya"},
63{0x0B80, 0x0BFF, "Tamil"}, 63{0x0B80, 0x0BFF, "Tamil"},
64{0x0C00, 0x0C7F, "Telugu"}, 64{0x0C00, 0x0C7F, "Telugu"},
65{0x0C80, 0x0CFF, "Kannada"}, 65{0x0C80, 0x0CFF, "Kannada"},
66{0x0D00, 0x0D7F, "Malayalam"}, 66{0x0D00, 0x0D7F, "Malayalam"},
67{0x0D80, 0x0DFF, "Sinhala"}, 67{0x0D80, 0x0DFF, "Sinhala"},
68{0x0E00, 0x0E7F, "Thai"}, 68{0x0E00, 0x0E7F, "Thai"},
69{0x0E80, 0x0EFF, "Lao"}, 69{0x0E80, 0x0EFF, "Lao"},
70{0x0F00, 0x0FFF, "Tibetan"}, 70{0x0F00, 0x0FFF, "Tibetan"},
71{0x1000, 0x109F, "Myanmar "}, 71{0x1000, 0x109F, "Myanmar "},
72{0x10A0, 0x10FF, "Georgian"}, 72{0x10A0, 0x10FF, "Georgian"},
@@ -90,97 +90,105 @@ static const BlockMap blockMap[] =
90{0x2200, 0x22FF, "Mathematical Operators"}, 90{0x2200, 0x22FF, "Mathematical Operators"},
91{0x2300, 0x23FF, "Miscellaneous Technical"}, 91{0x2300, 0x23FF, "Miscellaneous Technical"},
92{0x2400, 0x243F, "Control Pictures"}, 92{0x2400, 0x243F, "Control Pictures"},
93{0x2440, 0x245F, "Optical Character Recognition"}, 93{0x2440, 0x245F, "Optical Character Recognition"},
94{0x2460, 0x24FF, "Enclosed Alphanumerics"}, 94{0x2460, 0x24FF, "Enclosed Alphanumerics"},
95{0x2500, 0x257F, "Box Drawing"}, 95{0x2500, 0x257F, "Box Drawing"},
96{0x2580, 0x259F, "Block Elements"}, 96{0x2580, 0x259F, "Block Elements"},
97{0x25A0, 0x25FF, "Geometric Shapes"}, 97{0x25A0, 0x25FF, "Geometric Shapes"},
98{0x2600, 0x26FF, "Miscellaneous Symbols"}, 98{0x2600, 0x26FF, "Miscellaneous Symbols"},
99{0x2700, 0x27BF, "Dingbats"}, 99{0x2700, 0x27BF, "Dingbats"},
100{0x2800, 0x28FF, "Braille Patterns"}, 100{0x2800, 0x28FF, "Braille Patterns"},
101{0x2E80, 0x2EFF, "CJK Radicals Supplement"}, 101{0x2E80, 0x2EFF, "CJK Radicals Supplement"},
102{0x2F00, 0x2FDF, "Kangxi Radicals"}, 102{0x2F00, 0x2FDF, "Kangxi Radicals"},
103{0x2FF0, 0x2FFF, "Ideographic Description Characters"}, 103{0x2FF0, 0x2FFF, "Ideographic Description Characters"},
104{0x3000, 0x303F, "CJK Symbols and Punctuation"}, 104{0x3000, 0x303F, "CJK Symbols and Punctuation"},
105{0x3040, 0x309F, "Hiragana"}, 105{0x3040, 0x309F, "Hiragana"},
106{0x30A0, 0x30FF, "Katakana"}, 106{0x30A0, 0x30FF, "Katakana"},
107{0x3100, 0x312F, "Bopomofo"}, 107{0x3100, 0x312F, "Bopomofo"},
108{0x3130, 0x318F, "Hangul Compatibility Jamo"}, 108{0x3130, 0x318F, "Hangul Compatibility Jamo"},
109{0x3190, 0x319F, "Kanbun"}, 109{0x3190, 0x319F, "Kanbun"},
110{0x31A0, 0x31BF, "Bopomofo Extended"}, 110{0x31A0, 0x31BF, "Bopomofo Extended"},
111{0x3200, 0x32FF, "Enclosed CJK Letters and Months"}, 111{0x3200, 0x32FF, "Enclosed CJK Letters and Months"},
112{0x3300, 0x33FF, "CJK Compatibility"}, 112{0x3300, 0x33FF, "CJK Compatibility"},
113{0x3400, 0x4DB5, "CJK Unified Ideographs Extension A"}, 113{0x3400, 0x4DB5, "CJK Unified Ideographs Extension A"},
114{0x4E00, 0x9FFF, "CJK Unified Ideographs"}, 114{0x4E00, 0x9FFF, "CJK Unified Ideographs"},
115{0xA000, 0xA48F, "Yi Syllables"}, 115{0xA000, 0xA48F, "Yi Syllables"},
116{0xA490, 0xA4CF, "Yi Radicals"}, 116{0xA490, 0xA4CF, "Yi Radicals"},
117{0xAC00, 0xD7A3, "Hangul Syllables"}, 117{0xAC00, 0xD7A3, "Hangul Syllables"},
118{0xD800, 0xDB7F, "High Surrogates"}, 118{0xD800, 0xDB7F, "High Surrogates"},
119{0xDB80, 0xDBFF, "High Private Use Surrogates"}, 119{0xDB80, 0xDBFF, "High Private Use Surrogates"},
120{0xDC00, 0xDFFF, "Low Surrogates"}, 120{0xDC00, 0xDFFF, "Low Surrogates"},
121{0xE000, 0xF8FF, "Private Use"}, 121{0xE000, 0xF8FF, "Private Use"},
122{0xF900, 0xFAFF, "CJK Compatibility Ideographs"}, 122{0xF900, 0xFAFF, "CJK Compatibility Ideographs"},
123{0xFB00, 0xFB4F, "Alphabetic Presentation Forms"}, 123{0xFB00, 0xFB4F, "Alphabetic Presentation Forms"},
124{0xFB50, 0xFDFF, "Arabic Presentation Forms-A"}, 124{0xFB50, 0xFDFF, "Arabic Presentation Forms-A"},
125{0xFE20, 0xFE2F, "Combining Half Marks"}, 125{0xFE20, 0xFE2F, "Combining Half Marks"},
126{0xFE30, 0xFE4F, "CJK Compatibility Forms"}, 126{0xFE30, 0xFE4F, "CJK Compatibility Forms"},
127{0xFE50, 0xFE6F, "Small Form Variants"}, 127{0xFE50, 0xFE6F, "Small Form Variants"},
128{0xFE70, 0xFEFE, "Arabic Presentation Forms-B"}, 128{0xFE70, 0xFEFE, "Arabic Presentation Forms-B"},
129{0xFF00, 0xFEFF, "Halfwidth and Fullwidth Forms"}, 129{0xFF00, 0xFEFF, "Halfwidth and Fullwidth Forms"},
130{0xFFF0, 0xFFEF, "Specials"}, 130{0xFFF0, 0xFFEF, "Specials"},
131 {0xFFFF, 0xFFFF, 0} }; 131 {0xFFFF, 0xFFFF, 0} };
132 132
133 133
134UniScrollview::UniScrollview(QWidget* parent, const char* name, int f) : 134UniScrollview::UniScrollview(QWidget* parent, const char* name, int f) :
135 QScrollView(parent, name, f) 135 QScrollView(parent, name, f)
136{ 136{
137 // smallFont.setRawName( "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1" ); //###### 137 // smallFont.setRawName( "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1" ); //######
138 smallFont = QFont( "Helvetica", 8 ); 138
139 // get the default font
140 Config *config = new Config( "qpe" );
141 config->setGroup( "Appearance" );
142 QString familyStr = config->readEntry( "FontFamily", "Helvetica" );
143 int fontSize = config->readNumEntry( "FontSize", 8 ) - 2;
144 delete config;
145
146 smallFont = QFont( familyStr, fontSize );
139 QFontMetrics sfm( smallFont ); 147 QFontMetrics sfm( smallFont );
140 xoff = sfm.width( "AAA" ); 148 xoff = sfm.width( "AAA" );
141 setFont( FontManager::unicodeFont( FontManager::Fixed ) ); 149 setFont( FontManager::unicodeFont( FontManager::Fixed ) );
142 QFontMetrics fm( font() ); 150 QFontMetrics fm( font() );
143 cellsize = fm.lineSpacing() + 2; 151 cellsize = fm.lineSpacing() + 2;
144 resizeContents( cellsize*nw, cellsize*65536/nw ); 152 resizeContents( cellsize*nw, cellsize*65536/nw );
145 verticalScrollBar()->setLineStep(cellsize); 153 verticalScrollBar()->setLineStep(cellsize);
146 154
147 viewport()->setBackgroundMode( QWidget::PaletteBase ); 155 viewport()->setBackgroundMode( QWidget::PaletteBase );
148} 156}
149 157
150 158
151 159
152void UniScrollview::contentsMousePressEvent(QMouseEvent* e) 160void UniScrollview::contentsMousePressEvent(QMouseEvent* e)
153{ 161{
154 if ( e->x() < xoff || e->x() > xoff + nw*cellsize ) 162 if ( e->x() < xoff || e->x() > xoff + nw*cellsize )
155 return; 163 return;
156 int row = e->y()/cellsize; 164 int row = e->y()/cellsize;
157 int col = (e->x()-xoff)/cellsize; 165 int col = (e->x()-xoff)/cellsize;
158 int u = row*nw+col; 166 int u = row*nw+col;
159#if defined(Q_WS_QWS) || defined(_WS_QWS_) 167#if defined(Q_WS_QWS) || defined(_WS_QWS_)
160 emit key( u, 0, 0, true, false ); 168 emit key( u, 0, 0, true, false );
161 emit key( u, 0, 0, false, false ); 169 emit key( u, 0, 0, false, false );
162#endif 170#endif
163} 171}
164 172
165 173
166void UniScrollview::contentsMouseReleaseEvent(QMouseEvent*) 174void UniScrollview::contentsMouseReleaseEvent(QMouseEvent*)
167{ 175{
168} 176}
169 177
170void UniScrollview::scrollTo( int unicode ) 178void UniScrollview::scrollTo( int unicode )
171{ 179{
172 int row = unicode / nw; 180 int row = unicode / nw;
173 setContentsPos( 0, row*cellsize ); 181 setContentsPos( 0, row*cellsize );
174} 182}
175 183
176 184
177void UniScrollview::drawContents( QPainter *p, int /*cx*/, int cy, int /*cw*/, int ch ) 185void UniScrollview::drawContents( QPainter *p, int /*cx*/, int cy, int /*cw*/, int ch )
178{ 186{
179 QFontMetrics fm = fontMetrics(); 187 QFontMetrics fm = fontMetrics();
180 int row = cy / cellsize; 188 int row = cy / cellsize;
181 int y = row*cellsize; 189 int y = row*cellsize;
182 while ( y < cy+ch ) { 190 while ( y < cy+ch ) {
183 p->drawLine( xoff, y, xoff+nw*cellsize, y ); 191 p->drawLine( xoff, y, xoff+nw*cellsize, y );
184 if ( row*nw%16 == 0 ) { 192 if ( row*nw%16 == 0 ) {
185 p->setFont( smallFont ); 193 p->setFont( smallFont );
186 QString s; 194 QString s;