1 | // <developer>kevin@kevlindev.com</developer>
|
---|
2 | // <completed>0</completed>
|
---|
3 |
|
---|
4 | using System;
|
---|
5 | using System.Xml;
|
---|
6 |
|
---|
7 | namespace SharpVectors.Dom.Svg
|
---|
8 | {
|
---|
9 | public delegate void RenderEvent(SvgRectF updatedRect);
|
---|
10 |
|
---|
11 | /// <summary>
|
---|
12 | /// Defines the interface required by a renderer to render the SVG DOM.
|
---|
13 | /// </summary>
|
---|
14 | /// <remarks>
|
---|
15 | /// The <see cref="ISvgRenderer">ISvgRenderer</see> is used to render
|
---|
16 | /// a <see cref="SvgElement">SvgElement</see> object onto a bitmap.
|
---|
17 | /// During the rendering process, it will also generate
|
---|
18 | /// <see cref="RenderingNode">RenderingNode</see> objects for each
|
---|
19 | /// <see cref="XmlElement">XmlElement</see> object in the DOM tree to
|
---|
20 | /// assist in the rendering.
|
---|
21 | /// </remarks>
|
---|
22 | public interface ISvgRenderer
|
---|
23 | {
|
---|
24 | /// <summary>
|
---|
25 | /// The window that is being rendered to.
|
---|
26 | /// </summary>
|
---|
27 | ISvgWindow Window
|
---|
28 | {
|
---|
29 | get;
|
---|
30 | set;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /// <summary>
|
---|
34 | /// Renders an <see cref="SvgElement">SvgElement</see> object onto a
|
---|
35 | /// bitmap and returns that bitmap.
|
---|
36 | /// </summary>
|
---|
37 | /// <param name="node">
|
---|
38 | /// The SvgElement object to be rendered.
|
---|
39 | /// </param>
|
---|
40 | /// <returns>
|
---|
41 | /// A bitmap with <c>node</c> rendered onto it.
|
---|
42 | /// </returns>
|
---|
43 | void Render(ISvgElement node);
|
---|
44 |
|
---|
45 | /// <summary>
|
---|
46 | /// Renders an <see cref="SvgDocument">SvgDocument</see> object onto
|
---|
47 | /// a bitmap and returns that bitmap.
|
---|
48 | /// </summary>
|
---|
49 | /// <param name="node">
|
---|
50 | /// The SvgDocument object to be rendered.
|
---|
51 | /// </param>
|
---|
52 | /// <returns>
|
---|
53 | /// A bitmap with <c>node</c> rendered onto it.
|
---|
54 | /// </returns>
|
---|
55 | void Render(ISvgDocument node);
|
---|
56 |
|
---|
57 | /// <summary>
|
---|
58 | /// Controls the rendering of the document.
|
---|
59 | /// </summary>
|
---|
60 | SvgRectF InvalidRect
|
---|
61 | {
|
---|
62 | get;
|
---|
63 | set;
|
---|
64 | }
|
---|
65 |
|
---|
66 | /// <summary>
|
---|
67 | /// Allows you to establish or add to the existing invalidation rectangle
|
---|
68 | /// </summary>
|
---|
69 | /// <param name="rect"></param>
|
---|
70 | void InvalidateRect(SvgRectF rect);
|
---|
71 |
|
---|
72 | /// <summary>
|
---|
73 | /// Event Delegate to report when the SVG renderer does it's work.
|
---|
74 | /// </summary>
|
---|
75 | RenderEvent OnRender
|
---|
76 | {
|
---|
77 | get;
|
---|
78 | set;
|
---|
79 | }
|
---|
80 |
|
---|
81 | ISvgRect GetRenderedBounds(ISvgElement element, float margin);
|
---|
82 | }
|
---|
83 | }
|
---|