00001
00002
00004
00005
00006
00008
00009
00011
00012
00014
00015 #ifndef __DasherView_h_
00016 #define __DasherView_h_
00017
00018 #include "MSVC_Unannoy.h"
00019 #include "DasherScreen.h"
00020 #include "DasherModel.h"
00021
00022
00023
00024
00025
00026 namespace Dasher {class CDasherView;}
00027 class Dasher::CDasherView
00028 {
00029 public:
00030 CDasherView(CDasherScreen* DasherScreen, CDasherModel& DasherModel, Dasher::Opts::ScreenOrientations Orientation=Dasher::Opts::LeftToRight);
00031 virtual ~CDasherView() {}
00032
00033 void ChangeOrientation(Dasher::Opts::ScreenOrientations Orientation);
00034
00035
00036 void FlushAt(int mousex,int mousey);
00037
00038
00039 inline void Render();
00040
00041
00042
00043 virtual void TapOnDisplay(int mousex, int mousey, unsigned long Time)=0;
00044
00045 virtual void ChangeScreen(CDasherScreen* NewScreen)
00046 {
00047 m_Screen=NewScreen;
00048
00049
00050
00051 }
00052
00053 virtual void DrawMouse(int mousex, int mousey)=0;
00054 virtual void DrawKeyboard()=0;
00055
00056
00057 CDasherModel& DasherModel() {return m_DasherModel;}
00058 CDasherScreen& Screen() {return *m_Screen;}
00059
00060 void Display() {m_Screen->Display();}
00061
00062
00063 void SetColourMode(bool colourmode) {ColourMode=colourmode;}
00064
00065 protected:
00066
00067 inline void MapScreen(int* DrawX, int* DrawY);
00068 inline void UnMapScreen(int* DrawX, int* DrawY);
00069
00070 private:
00071 CDasherScreen* m_Screen;
00072 CDasherModel& m_DasherModel;
00073
00074
00075 virtual void Crosshair(myint sx)=0;
00076 virtual int RenderNode(const symbol Character, const int Color, Opts::ColorSchemes ColorScheme,
00077 myint y1, myint y2, int& mostleft, bool& force, bool text)=0;
00078
00079
00080 int RecursiveRender(CDasherNode* Render, myint y1,myint y2,int mostleft, bool text);
00081
00082
00083 void RenderGroups(CDasherNode* Render, myint y1, myint y2, bool text);
00084
00085
00086 Dasher::Opts::ScreenOrientations ScreenOrientation;
00087
00088
00089 bool ColourMode;
00090
00091
00092
00093 };
00094
00095
00096 #include "DasherView.inl"
00097
00098
00099 #endif