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 List<LineToIndexTableData> BreakLine(Document doc,LineToIndexTable layoutLineCollection, int startIndex, int endIndex, double wrapwidth)
129         {
130             throw new NotImplementedException();
131         }
132
133         public void DrawGripper(Point p, double radius)
134         {
135             throw new NotImplementedException();
136         }
137
138         public void BeginClipRect(Rectangle rect)
139         {
140         }
141
142         public void EndClipRect()
143         {
144         }
145
146         public ITextLayout CreateLaytout(string str, SyntaxInfo[] syntaxCollection, IEnumerable<Marker> MarkerRanges, IEnumerable<Selection> Selections, double WrapWidth)
147         {
148             return new DummyTextLayout();
149         }
150     }
151     class DummyTextLayout : ITextLayout
152     {
153         public double Width
154         {
155             get { return 0; }
156         }
157
158         public double Height
159         {
160             get { return 0; }
161         }
162
163         public bool Disposed
164         {
165             get;
166             private set;
167         }
168
169         public bool Invaild
170         {
171             get { return false; }
172         }
173
174         public int GetIndexFromColPostion(double x)
175         {
176             return 0;
177         }
178
179         public double GetWidthFromIndex(int index)
180         {
181             return 0;
182         }
183
184         public double GetColPostionFromIndex(int index)
185         {
186             return index;
187         }
188
189         public int AlignIndexToNearestCluster(int index, AlignDirection flow)
190         {
191             if(flow == AlignDirection.Back)
192                 return Math.Max(index - 1,0);
193             if (flow == AlignDirection.Forward)
194                 return index + 1;
195             throw new ArgumentOutOfRangeException("flowの値がおかしい");
196         }
197
198         public void Dispose()
199         {
200             this.Disposed = true;
201         }
202
203         public int GetIndexFromPostion(double x, double y)
204         {
205             return 0;
206         }
207
208         public Point GetPostionFromIndex(int index)
209         {
210             return new Point(0,0);
211         }
212     }
213 }