summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/DasherScreen.h
authormickeyl <mickeyl>2003-09-27 11:29:26 (UTC)
committer mickeyl <mickeyl>2003-09-27 11:29:26 (UTC)
commit651b6c612db4e809c506973996f2580c4158ac3a (patch) (unidiff)
tree8c8edc86e4b206dd4542a6b556ad1a319d6698ab /inputmethods/dasher/DasherScreen.h
parentd1a11b45e805fe7771ea05944757d767c3c4c8ea (diff)
downloadopie-651b6c612db4e809c506973996f2580c4158ac3a.zip
opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.gz
opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.bz2
merge dasher which has been introduced in BRANCH first (wtf?) into HEAD
Diffstat (limited to 'inputmethods/dasher/DasherScreen.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/DasherScreen.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/inputmethods/dasher/DasherScreen.h b/inputmethods/dasher/DasherScreen.h
new file mode 100644
index 0000000..36ca780
--- a/dev/null
+++ b/inputmethods/dasher/DasherScreen.h
@@ -0,0 +1,102 @@
1//! Class definition for the Dasher screen
2// DasherScreen.h
3//
4/////////////////////////////////////////////////////////////////////////////
5//
6// Copyright (c) 2001-2002 David Ward
7//
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef __DasherScreen_h_
11#define __DasherScreen_h_
12
13#include "DasherWidgetInterface.h"
14#include "DasherTypes.h"
15
16namespace Dasher {class CDasherScreen;}
17class Dasher::CDasherScreen
18{
19public:
20 //! \param width Width of the screen
21 //! \param height Height of the screen
22 CDasherScreen(int width,int height)
23 : m_iWidth(width), m_iHeight(height) {}
24
25 //! Set the widget interface used for communication with the core
26 virtual void SetInterface(CDasherWidgetInterface* DasherInterface) {m_DasherInterface = DasherInterface;}
27
28 //! Return the width of the screen
29 int GetWidth() const { return m_iWidth; }
30
31 //! Return the height of the screen
32 int GetHeight() const { return m_iHeight; }
33
34 //! Structure defining a point on the screen
35 typedef struct tagpoint { int x; int y; } point;
36
37 //! Set the Dasher font (ie, the screen font) to Name
38 //!
39 //! This is the font used to render letters in the main screen
40 virtual void SetFont(std::string Name)=0;
41
42 //! Set the Dasher font to Normal, Big or VBig
43 virtual void SetFontSize(Dasher::Opts::FontSize fontsize)=0;
44
45 //! Return the Dasher font size
46 virtual Dasher::Opts::FontSize GetFontSize()=0;
47
48 // DasherView asks for the width and height of the given symbol at a requested height,
49 // then it is able to sensibly specify the upper left corner in DrawText.
50 //! Set Width and Height to those of the character Character at size Size
51 virtual void TextSize(symbol Character, int* Width, int* Height, int Size) const=0;
52 //! Draw character Character of size Size positioned at x1 and y1
53 virtual void DrawText(symbol Character, int x1, int y1, int Size) const=0;
54
55
56 // Draw a filled rectangle - given position and color id
57 //! Draw a filled rectangle
58 //
59 //! Draw a coloured rectangle on the screen
60 //! \param x1 top left of rectangle (x coordinate)
61 //! \param y1 top left corner of rectangle (y coordinate)
62 //! \param x2 bottom right of rectangle (x coordinate)
63 //! \param y2 bottom right of rectangle (y coordinate)
64 //! \param Color the colour to be used (numeric)
65 //! \param ColorScheme Which colourscheme is to be used
66 virtual void DrawRectangle(int x1, int y1, int x2, int y2, int Color, Opts::ColorSchemes ColorScheme) const=0;
67
68 // Draw a line of fixed colour (usually black). Intended for static UI elements such as a cross-hair
69 //! Draw a line between each of the points in the array
70 //
71 //! \param Number the number of points in the array
72 virtual void Polyline(point* Points, int Number) const=0;
73
74 // Draw a filled polygon - given vertices and color id
75 // This is not (currently) used in standard Dasher. However, it could be very
76 // useful in the future. Please implement unless it will be very difficult,
77 // in which case make this function call Polyline.
78 //! Draw a filled polygon
79 //
80 //! \param Points array of points defining the edge of the polygon
81 //! \param Number number of points in the array
82 //! \param Color colour of the polygon (numeric)
83 //! \param Colorscheme Which colourscheme is to be used
84 virtual void DrawPolygon(point* Points, int Number, int Color, Opts::ColorSchemes ColorScheme) const=0;
85
86 // Signal the screen when a frame is started and finished
87 //! Signal that a frame is being started
88 virtual void Blank() const=0;
89
90 //! Signal that a frame is finished - the screen should be updated
91 virtual void Display()=0;
92
93protected:
94 //! Width and height of the screen
95 const int m_iWidth, m_iHeight;
96
97 //! Pointer to a widget interface for communication with the core
98 CDasherWidgetInterface* m_DasherInterface;
99};
100
101
102#endif /* #ifndef __DasherScreen_h_ */