~ubuntu-branches/ubuntu/trusty/pdfmod/trusty

« back to all changes in this revision

Viewing changes to lib/PdfSharp/PdfSharp.Drawing/IXGraphicsRenderer.cs

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-06-18 03:44:46 UTC
  • Revision ID: james.westby@ubuntu.com-20100618034446-bogifrsscpayp361
Tags: upstream-0.8.3
Import upstream version 0.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#region PDFsharp - A .NET library for processing PDF
 
2
//
 
3
// Authors:
 
4
//   Stefan Lange (mailto:Stefan.Lange@pdfsharp.com)
 
5
//
 
6
// Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany)
 
7
//
 
8
// http://www.pdfsharp.com
 
9
// http://sourceforge.net/projects/pdfsharp
 
10
//
 
11
// Permission is hereby granted, free of charge, to any person obtaining a
 
12
// copy of this software and associated documentation files (the "Software"),
 
13
// to deal in the Software without restriction, including without limitation
 
14
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
15
// and/or sell copies of the Software, and to permit persons to whom the
 
16
// Software is furnished to do so, subject to the following conditions:
 
17
//
 
18
// The above copyright notice and this permission notice shall be included
 
19
// in all copies or substantial portions of the Software.
 
20
//
 
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
24
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 
27
// DEALINGS IN THE SOFTWARE.
 
28
#endregion
 
29
 
 
30
using System;
 
31
using System.Text;
 
32
using System.IO;
 
33
#if GDI
 
34
using System.Drawing;
 
35
using System.Drawing.Drawing2D;
 
36
#endif
 
37
#if WPF
 
38
using System.Windows.Media;
 
39
#endif
 
40
using PdfSharp.Internal;
 
41
 
 
42
namespace PdfSharp.Drawing
 
43
{
 
44
  /// <summary>
 
45
  /// Represents an abstract drawing surface for PdfPages.
 
46
  /// </summary>
 
47
  internal interface IXGraphicsRenderer
 
48
  {
 
49
    void Close();
 
50
 
 
51
    #region Drawing
 
52
 
 
53
    /// <summary>
 
54
    /// Fills the entire drawing surface with the specified color.
 
55
    /// </summary>
 
56
    void Clear(XColor color);
 
57
 
 
58
    /// <summary>
 
59
    /// Draws a straight line.
 
60
    /// </summary>
 
61
    void DrawLine(XPen pen, double x1, double y1, double x2, double y2);
 
62
 
 
63
    /// <summary>
 
64
    /// Draws a series of straight lines.
 
65
    /// </summary>
 
66
    void DrawLines(XPen pen, XPoint[] points);
 
67
 
 
68
    /// <summary>
 
69
    /// Draws a B�zier spline.
 
70
    /// </summary>
 
71
    void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
 
72
 
 
73
    /// <summary>
 
74
    /// Draws a series of B�zier splines.
 
75
    /// </summary>
 
76
    void DrawBeziers(XPen pen, XPoint[] points);
 
77
 
 
78
    /// <summary>
 
79
    /// Draws a cardinal spline.
 
80
    /// </summary>
 
81
    void DrawCurve(XPen pen, XPoint[] points, double tension);
 
82
 
 
83
    /// <summary>
 
84
    /// Draws an arc.
 
85
    /// </summary>
 
86
    void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle);
 
87
 
 
88
    /// <summary>
 
89
    /// Draws a rectangle.
 
90
    /// </summary>
 
91
    void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height);
 
92
 
 
93
    /// <summary>
 
94
    /// Draws a series of rectangles.
 
95
    /// </summary>
 
96
    void DrawRectangles(XPen pen, XBrush brush, XRect[] rects);
 
97
 
 
98
    /// <summary>
 
99
    /// Draws a rectangle with rounded corners.
 
100
    /// </summary>
 
101
    void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight);
 
102
 
 
103
    /// <summary>
 
104
    /// Draws an ellipse.
 
105
    /// </summary>
 
106
    void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height);
 
107
 
 
108
    /// <summary>
 
109
    /// Draws a polygon.
 
110
    /// </summary>
 
111
    void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode);
 
112
 
 
113
    /// <summary>
 
114
    /// Draws a pie.
 
115
    /// </summary>
 
116
    void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle);
 
117
 
 
118
    /// <summary>
 
119
    /// Draws a cardinal spline.
 
120
    /// </summary>
 
121
    void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode);
 
122
 
 
123
    /// <summary>
 
124
    /// Draws a graphical path.
 
125
    /// </summary>
 
126
    void DrawPath(XPen pen, XBrush brush, XGraphicsPath path);
 
127
 
 
128
    /// <summary>
 
129
    /// Draws a series of glyphs identified by the specified text and font.
 
130
    /// </summary>
 
131
    void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format);
 
132
 
 
133
    /// <summary>
 
134
    /// Draws an image.
 
135
    /// </summary>
 
136
    void DrawImage(XImage image, double x, double y, double width, double height);
 
137
    void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit);
 
138
 
 
139
    #endregion
 
140
 
 
141
    #region Save and Restore
 
142
 
 
143
    /// <summary>
 
144
    /// Saves the current graphics state without changing it.
 
145
    /// </summary>
 
146
    void Save(XGraphicsState state);
 
147
 
 
148
    /// <summary>
 
149
    /// Restores the specified graphics state.
 
150
    /// </summary>
 
151
    void Restore(XGraphicsState state);
 
152
 
 
153
    /// <summary>
 
154
    /// 
 
155
    /// </summary>
 
156
    void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit);
 
157
 
 
158
    /// <summary>
 
159
    /// 
 
160
    /// </summary>
 
161
    void EndContainer(XGraphicsContainer container);
 
162
 
 
163
    #endregion
 
164
 
 
165
    #region Transformation
 
166
 
 
167
    //void TranslateTransform(double dx, double dy, XMatrixOrder order);
 
168
    //void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order);
 
169
    //void ScaleTransform(double scaleXY, XMatrixOrder order);
 
170
    //void RotateTransform(double angle, XMatrixOrder order);
 
171
    //void MultiplyTransform(XMatrix matrix, XMatrixOrder order);
 
172
 
 
173
    /// <summary>
 
174
    /// Sets all values that influence the page transformation.
 
175
    /// </summary>
 
176
    void SetPageTransform(XPageDirection direction, XPoint origion, XGraphicsUnit unit);
 
177
 
 
178
    /// <summary>
 
179
    /// Gets or sets the transformation matrix.
 
180
    /// </summary>
 
181
    XMatrix Transform {/*get;*/ set;}
 
182
 
 
183
    #endregion
 
184
 
 
185
    #region Clipping
 
186
 
 
187
    void SetClip(XGraphicsPath path, XCombineMode combineMode);
 
188
    
 
189
    void ResetClip();
 
190
 
 
191
    //public void SetClip(GraphicsPath path);
 
192
    //public void SetClip(Graphics g);
 
193
    //public void SetClip(Rectangle rect);
 
194
    //public void SetClip(XRect rect);
 
195
    //public void SetClip(GraphicsPath path, CombineMode combineMode);
 
196
    //public void SetClip(Graphics g, CombineMode combineMode);
 
197
    //public void SetClip(Rectangle rect, CombineMode combineMode);
 
198
    //public void SetClip(XRect rect, CombineMode combineMode);
 
199
    //public void SetClip(Region region, CombineMode combineMode);
 
200
    //public void ExcludeClip(Rectangle rect);
 
201
    //public void ExcludeClip(Region region);
 
202
    //public void IntersectClip(Rectangle rect);
 
203
    //public void IntersectClip(XRect rect);
 
204
    //public void IntersectClip(Region region);
 
205
 
 
206
    #endregion
 
207
 
 
208
    #region Miscellaneous
 
209
    /// <summary>
 
210
    /// Writes a comment to the output stream. Comments have no effect on the rendering of the output.
 
211
    /// </summary>
 
212
    void WriteComment(string comment);
 
213
    #endregion
 
214
  }
 
215
}