Diffstat (limited to 'inputmethods/dasher/QtDasherScreen.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/QtDasherScreen.cc | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/inputmethods/dasher/QtDasherScreen.cc b/inputmethods/dasher/QtDasherScreen.cc index 7d77511..747b705 100644 --- a/inputmethods/dasher/QtDasherScreen.cc +++ b/inputmethods/dasher/QtDasherScreen.cc | |||
@@ -1,85 +1,82 @@ | |||
1 | // QtDasherScreen.cc | 1 | // QtDasherScreen.cc |
2 | // (c) 2003 Yann Dirson | 2 | // (c) 2003 Yann Dirson |
3 | // Derived from GtkDasherCanvas.cc | 3 | // Derived from GtkDasherCanvas.cc |
4 | // (c) 2002 Philip Cowans | 4 | // (c) 2002 Philip Cowans |
5 | 5 | ||
6 | #include <iostream> | 6 | #include <iostream> |
7 | #include <string> | 7 | #include <string> |
8 | 8 | ||
9 | #include <qpointarray.h> | 9 | #include <qpointarray.h> |
10 | #include <qpoint.h> | 10 | #include <qpoint.h> |
11 | 11 | ||
12 | #include "QtDasherScreen.h" | 12 | #include "QtDasherScreen.h" |
13 | #include "DasherScreen.h" | 13 | #include "DasherScreen.h" |
14 | #include "SettingsStore.h" | 14 | #include "SettingsStore.h" |
15 | 15 | ||
16 | #define MAXFONTSIZE 25 | 16 | #define MAXFONTSIZE 25 |
17 | #define MINFONTSIZE 8 | 17 | #define MINFONTSIZE 8 |
18 | 18 | ||
19 | #include <iconv.h> | ||
20 | #include <iostream> | ||
21 | |||
22 | QtDasherScreen::QtDasherScreen (int _width, int _height, | 19 | QtDasherScreen::QtDasherScreen (int _width, int _height, |
23 | CDasherInterface *_interface, | 20 | CDasherInterface *_interface, |
24 | QWidget * _parent, Dasher::CDashEditbox *edit): | 21 | QWidget * _parent, Dasher::CDashEditbox *edit): |
25 | QWidget(_parent), interface( _interface ), | 22 | QWidget(_parent), interface( _interface ), |
26 | fontname( "fixed" ), fontsize(12), | 23 | fontname( "fixed" ), fontsize(12), |
27 | Dasher::CDasherScreen(_width, _height) | 24 | Dasher::CDasherScreen(_width, _height) |
28 | { | 25 | { |
29 | font = QFont (fontname.c_str(), fontsize); | 26 | font = QFont (fontname.c_str(), fontsize); |
30 | painter = new QPainter (); | 27 | painter = new QPainter (); |
31 | 28 | ||
32 | pixmap = new QPixmap (_width, _height); | 29 | pixmap = new QPixmap (_width, _height); |
33 | pixmap->setOptimization(QPixmap::BestOptim); | 30 | pixmap->setOptimization(QPixmap::BestOptim); |
34 | interface->SetSettingsStore(new CSettingsStore); | 31 | interface->SetSettingsStore(new CSettingsStore); |
35 | 32 | ||
36 | interface->ChangeLanguageModel(0); | 33 | interface->ChangeLanguageModel(0); |
37 | interface->ChangeView(0); | 34 | interface->ChangeView(0); |
38 | interface->ChangeEdit(edit); | 35 | interface->ChangeEdit(edit); |
39 | 36 | ||
40 | /* interface->GetFontSizes(&FontSizes); | 37 | /* interface->GetFontSizes(&FontSizes); |
41 | 38 | ||
42 | for (int i=0; i<FontSizes.size(); i++) { | 39 | for (int i=0; i<FontSizes.size(); i++) { |
43 | if (FontSizes[i]>Fonts.size()) | 40 | if (FontSizes[i]>Fonts.size()) |
44 | Fonts.resize((FontSizes[i])+1); | 41 | Fonts.resize((FontSizes[i])+1); |
45 | Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]); | 42 | Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]); |
46 | // Fonts[FontSizes[i]].setPixelSize(FontSizes[i]); | 43 | // Fonts[FontSizes[i]].setPixelSize(FontSizes[i]); |
47 | } | 44 | } |
48 | */ | 45 | */ |
49 | interface->ChangeScreen(this); | 46 | interface->ChangeScreen(this); |
50 | 47 | ||
51 | paused=true; | 48 | paused=true; |
52 | 49 | ||
53 | QTimer *tmr = new QTimer(this); | 50 | QTimer *tmr = new QTimer(this); |
54 | connect (tmr, SIGNAL(timeout()), SLOT(timer())); | 51 | connect (tmr, SIGNAL(timeout()), SLOT(timer())); |
55 | tmr->start(200); | 52 | tmr->start(200); |
56 | 53 | ||
57 | } | 54 | } |
58 | 55 | ||
59 | long QtDasherScreen::get_time() | 56 | long QtDasherScreen::get_time() |
60 | { | 57 | { |
61 | long s_now; | 58 | long s_now; |
62 | long ms_now; | 59 | long ms_now; |
63 | 60 | ||
64 | struct timeval tv; | 61 | struct timeval tv; |
65 | struct timezone tz; | 62 | struct timezone tz; |
66 | 63 | ||
67 | gettimeofday( &tv, &tz ); | 64 | gettimeofday( &tv, &tz ); |
68 | 65 | ||
69 | s_now = tv.tv_sec-1054487600; | 66 | s_now = tv.tv_sec-1054487600; |
70 | 67 | ||
71 | ms_now = tv.tv_usec / 1000; | 68 | ms_now = tv.tv_usec / 1000; |
72 | 69 | ||
73 | return( long(s_now*1000 + ms_now) ); | 70 | return( long(s_now*1000 + ms_now) ); |
74 | 71 | ||
75 | } | 72 | } |
76 | 73 | ||
77 | QtDasherScreen::~QtDasherScreen() | 74 | QtDasherScreen::~QtDasherScreen() |
78 | { | 75 | { |
79 | delete painter; | 76 | delete painter; |
80 | delete interface; | 77 | delete interface; |
81 | delete edit; | 78 | delete edit; |
82 | } | 79 | } |
83 | 80 | ||
84 | QColor QtDasherScreen::getColor(int Color, const Opts::ColorSchemes ColorScheme) const | 81 | QColor QtDasherScreen::getColor(int Color, const Opts::ColorSchemes ColorScheme) const |
85 | { | 82 | { |