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