OSDN Git Service

選択領域の表示時の処理を最適化した
[fooeditengine/FooEditEngine.git] / Core / 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 FooEditEngine;
14 #if WINDOWS_UWP
15 using Windows.UI.Xaml.Shapes;
16 #endif
17
18 namespace FooEditEngine
19 {
20     class DummyRender : IEditorRender,IDisposable
21     {
22         public DummyRender()
23         {
24         }
25         public bool RightToLeft
26         {
27             get;
28             set;
29         }
30
31         public Rectangle TextArea
32         {
33             get;
34             set;
35         }
36
37         public double LineNemberWidth
38         {
39             get { return 0; }
40         }
41
42         public double FoldingWidth
43         {
44             get { return 0; }
45         }
46
47         public Size emSize
48         {
49             get { return new Size(); }
50         }
51
52         public int TabWidthChar
53         {
54             get;
55             set;
56         }
57
58         public bool ShowFullSpace
59         {
60             get;
61             set;
62         }
63
64         public bool ShowHalfSpace
65         {
66             get;
67             set;
68         }
69
70         public bool ShowTab
71         {
72             get;
73             set;
74         }
75
76         public bool ShowLineBreak
77         {
78             get;
79             set;
80         }
81
82         #pragma warning disable 0067
83         //ダミーレンダーなので使わない
84         public event ChangedRenderResourceEventHandler ChangedRenderResource;
85         public event EventHandler ChangedRightToLeft;
86         #pragma warning restore 0067
87
88         public void DrawCachedBitmap(Rectangle rect)
89         {
90             throw new NotImplementedException();
91         }
92
93         public void DrawLine(Point from, Point to)
94         {
95             throw new NotImplementedException();
96         }
97
98         public void CacheContent()
99         {
100             throw new NotImplementedException();
101         }
102
103         public bool IsVaildCache()
104         {
105             throw new NotImplementedException();
106         }
107
108         public void DrawString(string str, double x, double y, StringAlignment align, Size layoutRect,StringColorType type)
109         {
110             throw new NotImplementedException();
111         }
112
113         public void FillRectangle(Rectangle rect, FillRectType type)
114         {
115             throw new NotImplementedException();
116         }
117
118         public void DrawFoldingMark(bool expand, double x, double y)
119         {
120             throw new NotImplementedException();
121         }
122
123         public void FillBackground(Rectangle rect)
124         {
125             throw new NotImplementedException();
126         }
127
128         public void DrawOneLine(Document doc, LineToIndexTable lti, int row, double x, double y)
129         {
130             throw new NotImplementedException();
131         }
132
133         public List<LineToIndexTableData> BreakLine(Document doc,LineToIndexTable layoutLineCollection, int startIndex, int endIndex, double wrapwidth)
134         {
135             throw new NotImplementedException();
136         }
137
138         public ITextLayout CreateLaytout(string str, SyntaxInfo[] syntaxCollection, IEnumerable<Marker> MarkerRanges, IEnumerable<Selection> SelectRanges)
139         {
140             return new DummyTextLayout();
141         }
142
143         public void DrawGripper(Point p, double radius)
144         {
145             throw new NotImplementedException();
146         }
147
148         public void BeginClipRect(Rectangle rect)
149         {
150         }
151
152         public void EndClipRect()
153         {
154         }
155
156         public void Dispose()
157         {
158         }
159
160 #if WINDOWS_UWP
161         public double FontSize
162         {
163             get;
164             set;
165         }
166         public void SetImeConvationInfo(Windows.UI.Text.Core.CoreTextFormatUpdatingEventArgs arg)
167         {
168         }
169
170         public void DrawContent(EditView view, bool isEnabled, Rectangle updateRect)
171         {
172         }
173
174         public bool Resize(Windows.UI.Xaml.Shapes.Rectangle rectangle, double width, double height)
175         {
176             return false;
177         }
178 #endif
179     }
180     class DummyTextLayout : ITextLayout
181     {
182         public double Width
183         {
184             get { return 0; }
185         }
186
187         public double Height
188         {
189             get { return 0; }
190         }
191
192         public bool Disposed
193         {
194             get;
195             private set;
196         }
197
198         public bool Invaild
199         {
200             get { return false; }
201         }
202
203         public int GetIndexFromColPostion(double x)
204         {
205             return 0;
206         }
207
208         public double GetWidthFromIndex(int index)
209         {
210             return 0;
211         }
212
213         public double GetColPostionFromIndex(int index)
214         {
215             return index;
216         }
217
218         public int AlignIndexToNearestCluster(int index, AlignDirection flow)
219         {
220             if(flow == AlignDirection.Back)
221                 return Math.Max(index - 1,0);
222             if (flow == AlignDirection.Forward)
223                 return index + 1;
224             throw new ArgumentOutOfRangeException("flowの値がおかしい");
225         }
226
227         public void Dispose()
228         {
229             this.Disposed = true;
230         }
231     }
232 }