summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/QtDasherScreen.h
Unidiff
Diffstat (limited to 'inputmethods/dasher/QtDasherScreen.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/QtDasherScreen.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/inputmethods/dasher/QtDasherScreen.h b/inputmethods/dasher/QtDasherScreen.h
index 06689d6..d3d67cb 100644
--- a/inputmethods/dasher/QtDasherScreen.h
+++ b/inputmethods/dasher/QtDasherScreen.h
@@ -1,97 +1,97 @@
1// QtDasherScreen.h 1// QtDasherScreen.h
2// (c) 2003 Yann Dirson 2// (c) 2003 Yann Dirson
3// Derived from GtkDasherCanvas.h 3// Derived from GtkDasherCanvas.h
4// (c) 2002 Philip Cowans 4// (c) 2002 Philip Cowans
5 5
6#ifndef QT_DASHER_SCREEN_H 6#ifndef QT_DASHER_SCREEN_H
7#define QT_DASHER_SCREEN_H 7#define QT_DASHER_SCREEN_H
8 8
9#include <string> 9#include <string>
10#include <sys/time.h> 10#include <sys/time.h>
11 11
12#include <qwidget.h> 12#include <qwidget.h>
13#include <qpainter.h> 13#include <qpainter.h>
14#include <qfont.h> 14#include <qfont.h>
15#include <qstring.h> 15#include <qstring.h>
16#include <qpixmap.h> 16#include <qpixmap.h>
17#include <qtimer.h> 17#include <qtimer.h>
18#include <qcursor.h> 18#include <qcursor.h>
19 19
20#include "DasherScreen.h" 20#include "DasherScreen.h"
21#include "DashEdit.h" 21#include "DashEdit.h"
22#include "DasherInterface.h" 22#include "DasherInterface.h"
23 23
24using namespace Dasher; 24using namespace Dasher;
25 25
26class QtDasherScreen : public QWidget, public Dasher::CDasherScreen 26class QtDasherScreen : public QWidget, public Dasher::CDasherScreen
27 27
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 public: 30 public:
31 QtDasherScreen (int _width, int _height, 31 QtDasherScreen (int _width, int _height,
32 CDasherInterface *_interface, 32 CDasherInterface *_interface,
33 QWidget * _parent=0, Dasher::CDashEditbox* edit=0); 33 QWidget * _parent=0, Dasher::CDashEditbox* edit=0);
34 QtDasherScreen::~QtDasherScreen(); 34 QtDasherScreen::~QtDasherScreen();
35 35
36 void SetFont(std::string Name) 36 void SetFont(std::string Name)
37 { fontname = Name; /* set_the_font(); */ } 37 { fontname = Name; /* set_the_font(); */ }
38 38
39 void SetFontSize(Dasher::Opts::FontSize fontsize) 39 void SetFontSize(Dasher::Opts::FontSize )
40 { 40 {
41#warning QtDasherScreen::SetFontSize() not implemented 41#warning QtDasherScreen::SetFontSize() not implemented
42 } 42 }
43 Dasher::Opts::FontSize GetFontSize() 43 Dasher::Opts::FontSize GetFontSize()
44 { 44 {
45#warning QtDasherScreen::GetFontSize() not implemented 45#warning QtDasherScreen::GetFontSize() not implemented
46 return (Dasher::Opts::Normal); 46 return (Dasher::Opts::Normal);
47 } 47 }
48 48
49 void TextSize(symbol Character, int* Width, int* Height, int Size) const 49 void TextSize(symbol , int* Width, int* Height, int ) const
50 { 50 {
51 // should probably use QPainter::boundingRect() 51 // should probably use QPainter::boundingRect()
52 *Width = *Height = font.pixelSize(); 52 *Width = *Height = font.pixelSize();
53 53
54 } 54 }
55 void DrawText(symbol Character, int x1, int y1, int Size) const 55 void DrawText(symbol Character, int x1, int y1, int Size) const
56 { 56 {
57 // QFont font = QFont (fontname.c_str(), Size); 57 // QFont font = QFont (fontname.c_str(), Size);
58 // font.setPixelSize(Size); 58 // font.setPixelSize(Size);
59 QPoint point = QPoint(x1, y1+Size/2); 59 QPoint point = QPoint(x1, y1+Size/2);
60 60
61 painter->setFont (font); 61 painter->setFont (font);
62 painter->drawText (point, 62 painter->drawText (point,
63 QString(interface->GetDisplayText(Character).c_str())); 63 QString(interface->GetDisplayText(Character).c_str()));
64 } 64 }
65 65
66 void DrawRectangle(int x1, int y1, int x2, int y2, 66 void DrawRectangle(int x1, int y1, int x2, int y2,
67 int Color, Opts::ColorSchemes ColorScheme) const; 67 int Color, Opts::ColorSchemes ColorScheme) const;
68 void Polyline(point* Points, int Number) const; 68 void Polyline(point* Points, int Number) const;
69 void DrawPolygon(point* Points, int Number, int Color, 69 void DrawPolygon(point* Points, int Number, int Color,
70 Opts::ColorSchemes ColorScheme) const; 70 Opts::ColorSchemes ColorScheme) const;
71 71
72 std::vector<int> FontSizes; 72 std::vector<int> FontSizes;
73 std::vector<QFont> Fonts; 73 std::vector<QFont> Fonts;
74 QFont font; 74 QFont font;
75 int fontsize; 75 int fontsize;
76 void Blank() const { 76 void Blank() const {
77 painter->begin(pixmap); 77 painter->begin(pixmap);
78 painter->setPen (NoPen); 78 painter->setPen (NoPen);
79 painter->fillRect(0, 0, m_iWidth, m_iHeight, 79 painter->fillRect(0, 0, m_iWidth, m_iHeight,
80 QColor(255,255,255)); 80 QColor(255,255,255));
81 } 81 }
82 void Display() { 82 void Display() {
83 painter->end(); 83 painter->end();
84 repaint(); 84 repaint();
85 } 85 }
86 86
87 void paintEvent( QPaintEvent * ) 87 void paintEvent( QPaintEvent * )
88 { 88 {
89 bitBlt(this, 0, 0, pixmap); 89 bitBlt(this, 0, 0, pixmap);
90 } 90 }
91 91
92 void mousePressEvent (QMouseEvent *e); 92 void mousePressEvent (QMouseEvent *e);
93 void mouseReleaseEvent (QMouseEvent *e); 93 void mouseReleaseEvent (QMouseEvent *e);
94 94
95 protected: 95 protected:
96 QColor getColor(int Color, const Opts::ColorSchemes ColorScheme) const; 96 QColor getColor(int Color, const Opts::ColorSchemes ColorScheme) const;
97 97