OSDN Git Service

バージョンナンバーを増やした
[fooeditengine/FooEditEngine.git] / WPF / UnitTest / DummyRender.cs
1 /*
2  * Copyright (C) 2013 FooProject
3  * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5
6  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 
7  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
9 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
10  */
11 using System;
12 using System.Collections.Generic;
13 using System.Linq;
14 using System.Text;
15 using System.Threading.Tasks;
16 using FooEditEngine;
17
18 namespace UnitTest
19 {
20     class DummyRender : IEditorRender
21     {
22         public bool RightToLeft
23         {
24             get;
25             set;
26         }
27
28         public Rectangle TextArea
29         {
30             get;
31             set;
32         }
33
34         public double LineNemberWidth
35         {
36             get { return 0; }
37         }
38
39         public double FoldingWidth
40         {
41             get { return 0; }
42         }
43
44         public Size emSize
45         {
46             get { return new Size(); }
47         }
48
49         public int TabWidthChar
50         {
51             get;
52             set;
53         }
54
55         public bool ShowFullSpace
56         {
57             get;
58             set;
59         }
60
61         public bool ShowHalfSpace
62         {
63             get;
64             set;
65         }
66
67         public bool ShowTab
68         {
69             get;
70             set;
71         }
72
73         public bool ShowLineBreak
74         {
75             get;
76             set;
77         }
78
79         public event ChangedRenderResourceEventHandler ChangedRenderResource;
80
81         public event EventHandler ChangedRightToLeft;
82
83         public void DrawCachedBitmap(Rectangle rect)
84         {
85             throw new NotImplementedException();
86         }
87
88         public void DrawLine(Point from, Point to)
89         {
90             throw new NotImplementedException();
91         }
92
93         public void CacheContent()
94         {
95             throw new NotImplementedException();
96         }
97
98         public bool IsVaildCache()
99         {
100             throw new NotImplementedException();
101         }
102
103         public void DrawString(string str, double x, double y, StringAlignment align, Size layoutRect,StringColorType type)
104         {
105             throw new NotImplementedException();
106         }
107
108         public void FillRectangle(Rectangle rect, FillRectType type)
109         {
110             throw new NotImplementedException();
111         }
112
113         public void DrawFoldingMark(bool expand, double x, double y)
114         {
115             throw new NotImplementedException();
116         }
117
118         public void FillBackground(Rectangle rect)
119         {
120             throw new NotImplementedException();
121         }
122
123         public void DrawOneLine(Document doc, LineToIndexTable lti, int row, double x, double y)
124         {
125             throw new NotImplementedException();
126         }
127
128         public void DrawGripper(Point p, double radius)
129         {
130             throw new NotImplementedException();
131         }
132
133         public void BeginClipRect(Rectangle rect)
134         {
135         }
136
137         public void EndClipRect()
138         {
139         }
140
141         public ITextLayout CreateLaytout(string str, SyntaxInfo[] syntaxCollection, IEnumerable<Marker> MarkerRanges, IEnumerable<Selection> Selections, double WrapWidth)
142         {
143             return new DummyTextLayout();
144         }
145     }
146     class DummyTextLayout : ITextLayout
147     {
148         public double Width
149         {
150             get { return 0; }
151         }
152
153         public double Height
154         {
155             get { return 0; }
156         }
157
158         public bool Disposed
159         {
160             get;
161             private set;
162         }
163
164         public bool Invaild
165         {
166             get { return false; }
167         }
168
169         public int GetIndexFromColPostion(double x)
170         {
171             return 0;
172         }
173
174         public double GetWidthFromIndex(int index)
175         {
176             return 0;
177         }
178
179         public double GetColPostionFromIndex(int index)
180         {
181             return index;
182         }
183
184         public int AlignIndexToNearestCluster(int index, AlignDirection flow)
185         {
186             if(flow == AlignDirection.Back)
187                 return Math.Max(index - 1,0);
188             if (flow == AlignDirection.Forward)
189                 return index + 1;
190             throw new ArgumentOutOfRangeException("flowの値がおかしい");
191         }
192
193         public void Dispose()
194         {
195             this.Disposed = true;
196         }
197
198         public int GetIndexFromPostion(double x, double y)
199         {
200             return 0;
201         }
202
203         public Point GetPostionFromIndex(int index)
204         {
205             return new Point(0,0);
206         }
207     }
208 }