-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
IShapeRenderer.cs
171 lines (152 loc) · 7.69 KB
/
IShapeRenderer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Core2D.Containers;
using Core2D.Shapes;
using Core2D.Style;
namespace Core2D.Renderer
{
/// <summary>
/// Defines shape renderer contract.
/// </summary>
public interface IShapeRenderer
{
/// <summary>
/// Gets or sets renderer state.
/// </summary>
IShapeRendererState State { get; set; }
/// <summary>
/// Invalidates style cache.
/// </summary>
/// <param name="style">The style to invalidate.</param>
void InvalidateCache(IShapeStyle style);
/// <summary>
/// Invalidates matrix cache.
/// </summary>
/// <param name="matrix">The matrix to invalidate.</param>
void InvalidateCache(IMatrixObject matrix);
/// <summary>
/// Invalidates shape cache.
/// </summary>
/// <param name="shape">The shape to invalidate.</param>
/// <param name="style">The style to invalidate.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void InvalidateCache(IBaseShape shape, IShapeStyle style, double dx, double dy);
/// <summary>
/// Clears renderer cache.
/// </summary>
/// <param name="isZooming">The flag indicating zooming state.</param>
void ClearCache(bool isZooming);
/// <summary>
/// Fills rectangle with specified color using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="x">The X coordinate of rectangle origin point.</param>
/// <param name="y">The Y coordinate of rectangle origin point.</param>
/// <param name="width">The width of rectangle.</param>
/// <param name="height">The height of rectangle.</param>
/// <param name="color">The fill color.</param>
void Fill(object dc, double x, double y, double width, double height, IColor color);
/// <summary>
/// Push matrix.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="matrix">The matrix to push.</param>
/// <returns>The previous matrix state.</returns>
object PushMatrix(object dc, IMatrixObject matrix);
/// <summary>
/// Pop matrix.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="state">The previous matrix state.</param>
void PopMatrix(object dc, object state);
/// <summary>
/// Draws a <see cref="IPageContainer"/> using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="container">The <see cref="IPageContainer"/> object.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IPageContainer container, double dx, double dy);
/// <summary>
/// Draws a <see cref="ILayerContainer"/> using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="layer">The <see cref="ILayerContainer"/> object.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, ILayerContainer layer, double dx, double dy);
/// <summary>
/// Draws a <see cref="ILineShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="line">The <see cref="ILineShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, ILineShape line, double dx, double dy);
/// <summary>
/// Draws a <see cref="IRectangleShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="rectangle">The <see cref="IRectangleShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IRectangleShape rectangle, double dx, double dy);
/// <summary>
/// Draws a <see cref="IEllipseShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="ellipse">The <see cref="IEllipseShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IEllipseShape ellipse, double dx, double dy);
/// <summary>
/// Draws a <see cref="IArcShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="arc">The <see cref="IArcShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IArcShape arc, double dx, double dy);
/// <summary>
/// Draws a <see cref="ICubicBezierShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="cubicBezier">The <see cref="ICubicBezierShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, ICubicBezierShape cubicBezier, double dx, double dy);
/// <summary>
/// Draws a <see cref="IQuadraticBezierShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="quadraticBezier">The <see cref="IQuadraticBezierShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IQuadraticBezierShape quadraticBezier, double dx, double dy);
/// <summary>
/// Draws a <see cref="ITextShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="text">The <see cref="ITextShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, ITextShape text, double dx, double dy);
/// <summary>
/// Draws a <see cref="IImageShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="image">The <see cref="IImageShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IImageShape image, double dx, double dy);
/// <summary>
/// Draws a <see cref="IPathShape"/> shape using drawing context.
/// </summary>
/// <param name="dc">The native drawing context.</param>
/// <param name="path">The <see cref="IPathShape"/> shape.</param>
/// <param name="dx">The X coordinate offset.</param>
/// <param name="dy">The Y coordinate offset.</param>
void Draw(object dc, IPathShape path, double dx, double dy);
}
}