Diffstat (limited to 'inputmethods/dasher/DasherView.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/DasherView.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inputmethods/dasher/DasherView.h b/inputmethods/dasher/DasherView.h index 81cc24e..6257c03 100644 --- a/inputmethods/dasher/DasherView.h +++ b/inputmethods/dasher/DasherView.h | |||
@@ -1,99 +1,99 @@ | |||
1 | // DasherView.h | 1 | // DasherView.h |
2 | // | 2 | // |
3 | ///////////////////////////////////////////////////////////////////////////// | 3 | ///////////////////////////////////////////////////////////////////////////// |
4 | // | 4 | // |
5 | // Copyright (c) 2001-2002 David Ward | 5 | // Copyright (c) 2001-2002 David Ward |
6 | // | 6 | // |
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | 9 | ||
10 | ////////////////////////////////////////////////////////////////////// | 10 | ////////////////////////////////////////////////////////////////////// |
11 | // DasherView.h: interface for the DasherView class. | 11 | // DasherView.h: interface for the DasherView class. |
12 | // Copyright 2002 David Ward | 12 | // Copyright 2002 David Ward |
13 | ////////////////////////////////////////////////////////////////////// | 13 | ////////////////////////////////////////////////////////////////////// |
14 | 14 | ||
15 | #ifndef __DasherView_h_ | 15 | #ifndef __DasherView_h_ |
16 | #define __DasherView_h_ | 16 | #define __DasherView_h_ |
17 | 17 | ||
18 | #include "MSVC_Unannoy.h" | 18 | #include "MSVC_Unannoy.h" |
19 | #include "DasherScreen.h" | 19 | #include "DasherScreen.h" |
20 | #include "DasherModel.h" | 20 | #include "DasherModel.h" |
21 | 21 | ||
22 | // CDasherView is an abstract view class | 22 | // CDasherView is an abstract view class |
23 | // The implentation must provide several functions - defined here as pure virtual functions | 23 | // The implentation must provide several functions - defined here as pure virtual functions |
24 | // See the CDasherViewSquare class for an example | 24 | // See the CDasherViewSquare class for an example |
25 | 25 | ||
26 | namespace Dasher {class CDasherView;} | 26 | namespace Dasher {class CDasherView;} |
27 | class Dasher::CDasherView | 27 | class Dasher::CDasherView |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | CDasherView(CDasherScreen* DasherScreen, CDasherModel& DasherModel, Dasher::Opts::ScreenOrientations Orientation=Dasher::Opts::LeftToRight); | 30 | CDasherView(CDasherScreen* DasherScreen, CDasherModel& DasherModel, Dasher::Opts::ScreenOrientations Orientation=Dasher::Opts::LeftToRight); |
31 | ~CDasherView() {} | 31 | virtual ~CDasherView() {} |
32 | 32 | ||
33 | void ChangeOrientation(Dasher::Opts::ScreenOrientations Orientation); | 33 | void ChangeOrientation(Dasher::Opts::ScreenOrientations Orientation); |
34 | 34 | ||
35 | // TODO Sort this out | 35 | // TODO Sort this out |
36 | void FlushAt(int mousex,int mousey); | 36 | void FlushAt(int mousex,int mousey); |
37 | 37 | ||
38 | // renders Dasher | 38 | // renders Dasher |
39 | inline void Render(); | 39 | inline void Render(); |
40 | 40 | ||
41 | // translates the screen coordinates to Dasher coordinates and calls | 41 | // translates the screen coordinates to Dasher coordinates and calls |
42 | // dashermodel.TapOnDisplay | 42 | // dashermodel.TapOnDisplay |
43 | virtual void TapOnDisplay(int mousex, int mousey, unsigned long Time)=0; | 43 | virtual void TapOnDisplay(int mousex, int mousey, unsigned long Time)=0; |
44 | 44 | ||
45 | virtual void ChangeScreen(CDasherScreen* NewScreen) | 45 | virtual void ChangeScreen(CDasherScreen* NewScreen) |
46 | { | 46 | { |
47 | m_Screen=NewScreen; | 47 | m_Screen=NewScreen; |
48 | 48 | ||
49 | // DJW - removed floating point stuff | 49 | // DJW - removed floating point stuff |
50 | //XYScale = (double)m_Screen->GetHeight() / m_Screen->GetWidth(); | 50 | //XYScale = (double)m_Screen->GetHeight() / m_Screen->GetWidth(); |
51 | } | 51 | } |
52 | 52 | ||
53 | virtual void DrawMouse(int mousex, int mousey)=0; | 53 | virtual void DrawMouse(int mousex, int mousey)=0; |
54 | virtual void DrawKeyboard()=0; | 54 | virtual void DrawKeyboard()=0; |
55 | 55 | ||
56 | // Return references to the model and the screen: | 56 | // Return references to the model and the screen: |
57 | CDasherModel& DasherModel() {return m_DasherModel;} | 57 | CDasherModel& DasherModel() {return m_DasherModel;} |
58 | CDasherScreen& Screen() {return *m_Screen;} | 58 | CDasherScreen& Screen() {return *m_Screen;} |
59 | 59 | ||
60 | void Display() {m_Screen->Display();} | 60 | void Display() {m_Screen->Display();} |
61 | 61 | ||
62 | // Toggle advanced colour mode | 62 | // Toggle advanced colour mode |
63 | void SetColourMode(bool colourmode) {ColourMode=colourmode;} | 63 | void SetColourMode(bool colourmode) {ColourMode=colourmode;} |
64 | 64 | ||
65 | protected: | 65 | protected: |
66 | // Orientation of Dasher Screen | 66 | // Orientation of Dasher Screen |
67 | inline void MapScreen(int* DrawX, int* DrawY); | 67 | inline void MapScreen(int* DrawX, int* DrawY); |
68 | inline void UnMapScreen(int* DrawX, int* DrawY); | 68 | inline void UnMapScreen(int* DrawX, int* DrawY); |
69 | 69 | ||
70 | private: | 70 | private: |
71 | CDasherScreen* m_Screen; // provides the graphics (text, lines, rectangles): | 71 | CDasherScreen* m_Screen; // provides the graphics (text, lines, rectangles): |
72 | CDasherModel& m_DasherModel; // Model view represents | 72 | CDasherModel& m_DasherModel; // Model view represents |
73 | 73 | ||
74 | // Pure virtuals to implement | 74 | // Pure virtuals to implement |
75 | virtual void Crosshair(myint sx)=0; // Tells m_Screen to draw a crosshair - or other static decoration | 75 | virtual void Crosshair(myint sx)=0; // Tells m_Screen to draw a crosshair - or other static decoration |
76 | virtual int RenderNode(const symbol Character, const int Color, Opts::ColorSchemes ColorScheme, | 76 | virtual int RenderNode(const symbol Character, const int Color, Opts::ColorSchemes ColorScheme, |
77 | myint y1, myint y2, int& mostleft, bool& force, bool text)=0; | 77 | myint y1, myint y2, int& mostleft, bool& force, bool text)=0; |
78 | 78 | ||
79 | // Responsible for all the Render_node calls | 79 | // Responsible for all the Render_node calls |
80 | int RecursiveRender(CDasherNode* Render, myint y1,myint y2,int mostleft, bool text); | 80 | int RecursiveRender(CDasherNode* Render, myint y1,myint y2,int mostleft, bool text); |
81 | 81 | ||
82 | // Displays some nodes inside one parent node. Used to group capital letters, accents, punctuation etc. | 82 | // Displays some nodes inside one parent node. Used to group capital letters, accents, punctuation etc. |
83 | void RenderGroups(CDasherNode* Render, myint y1, myint y2, bool text); | 83 | void RenderGroups(CDasherNode* Render, myint y1, myint y2, bool text); |
84 | 84 | ||
85 | // Orientation of Dasher Screen | 85 | // Orientation of Dasher Screen |
86 | Dasher::Opts::ScreenOrientations ScreenOrientation; | 86 | Dasher::Opts::ScreenOrientations ScreenOrientation; |
87 | 87 | ||
88 | // Advanced colour mode | 88 | // Advanced colour mode |
89 | bool ColourMode; | 89 | bool ColourMode; |
90 | 90 | ||
91 | // DJW - removed floating point stuff | 91 | // DJW - removed floating point stuff |
92 | //double XYScale; | 92 | //double XYScale; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | 95 | ||
96 | #include "DasherView.inl" | 96 | #include "DasherView.inl" |
97 | 97 | ||
98 | 98 | ||
99 | #endif /* #ifndef __DasherView_h_ */ | 99 | #endif /* #ifndef __DasherView_h_ */ |