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

« back to all changes in this revision

Viewing changes to lib/PdfSharp/PdfSharp.Drawing.Shapes/Shape.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
 
 
32
#if under_constructioin
 
33
namespace PdfSharp.Drawing.Shapes
 
34
{
 
35
  public sealed class Ellipse : Shape
 
36
  {
 
37
    //    // Methods
 
38
    //    static Ellipse();
 
39
    //    public Ellipse();
 
40
    //    protected override Size ArrangeOverride(Size finalSize);
 
41
    //    protected override Size MeasureOverride(Size constraint);
 
42
    //    protected override void OnRender(DrawingContext dc);
 
43
    //
 
44
    //    // Properties
 
45
    //    public double CenterX { get; set; }
 
46
    //    public double CenterY { get; set; }
 
47
    //    public double RadiusX { get; set; }
 
48
    //    public double RadiusY { get; set; }
 
49
    //
 
50
    //    // Fields
 
51
    //    private Rect _shapeBounds;
 
52
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
53
    //    public static readonly DependencyProperty CenterXProperty;
 
54
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
55
    //    public static readonly DependencyProperty CenterYProperty;
 
56
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
57
    //    public static readonly DependencyProperty RadiusXProperty;
 
58
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
59
    //    public static readonly DependencyProperty RadiusYProperty;
 
60
  }
 
61
 
 
62
  public sealed class Glyphs : Shape
 
63
  {
 
64
    //    // Methods
 
65
    //    static Glyphs();
 
66
    //    public Glyphs();
 
67
    //    protected override Size ArrangeOverride(Size finalSize);
 
68
    //    public GlyphRun ComputeGlyphRun();
 
69
    //    private void ComputeMeasurementGlyphRunAndOrigin();
 
70
    //    private static double GetAdvanceWidth(GlyphTypeface glyphTypeface, ushort glyphIndex, bool sideways);
 
71
    //    private static bool IsEmpty(string s);
 
72
    //    protected override Size MeasureOverride(Size constraint);
 
73
    //    protected override void OnRender(DrawingContext ctx);
 
74
    //    private IList<bool> ParseCaretStops();
 
75
    //    [SecurityCritical, SecurityTreatAsSafe]
 
76
    //    private void ParseGlyphRunProperties();
 
77
    //    private int ParseGlyphsProperty(GlyphTypeface fontFace, string unicodeString, bool sideways, out List<ParsedGlyphData> parsedGlyphs, out ushort[] clusterMap);
 
78
    //    private bool ReadGlyphIndex(string valueSpec, ref bool inCluster, ref int glyphClusterSize, ref int characterClusterSize, ref ushort glyphIndex);
 
79
    //
 
80
    //    // Properties
 
81
    //    public int BidiLevel { get; set; }
 
82
    //    public string CaretStops { get; set; }
 
83
    //    [Obsolete("This property is obsolete and will be removed in a future version. Use the fragment portion of FontUri property to specify TTC index instead.")]
 
84
    //    public int FontFaceIndex { get; set; }
 
85
    //    public double FontRenderingEmSize { get; set; }
 
86
    //    public Uri FontUri { get; set; }
 
87
    //    public string Indices { get; set; }
 
88
    //    public bool IsSideways { get; set; }
 
89
    //    public double OriginX { get; set; }
 
90
    //    public double OriginY { get; set; }
 
91
    //    public StyleSimulations StyleSimulations { get; set; }
 
92
    //    Uri IUriContext.BaseUri { get; set; }
 
93
    //    public string UnicodeString { get; set; }
 
94
    //
 
95
    //    // Fields
 
96
    //    private Point _glyphRunOrigin;
 
97
    //    private LayoutDependentGlyphRunProperties _glyphRunProperties;
 
98
    //    private GlyphRun _measurementGlyphRun;
 
99
    //    public static readonly DependencyProperty BidiLevelProperty;
 
100
    //    public static readonly DependencyProperty CaretStopsProperty;
 
101
    //    private const double EmMultiplier = 100;
 
102
    //    [Obsolete("This property is obsolete and will be removed in a future version. Use the fragment portion of FontUri property to specify TTC index instead.")]
 
103
    //    public static readonly DependencyProperty FontFaceIndexProperty;
 
104
    //    [TypeConverter("System.Windows.FontSizeConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
105
    //    public static readonly DependencyProperty FontRenderingEmSizeProperty;
 
106
    //    public static readonly DependencyProperty FontUriProperty;
 
107
    //    public static readonly DependencyProperty IndicesProperty;
 
108
    //    public static readonly DependencyProperty IsSidewaysProperty;
 
109
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
110
    //    public static readonly DependencyProperty OriginXProperty;
 
111
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
112
    //    public static readonly DependencyProperty OriginYProperty;
 
113
    //    public static readonly DependencyProperty StyleSimulationsProperty;
 
114
    //    public static readonly DependencyProperty UnicodeStringProperty;
 
115
    //
 
116
    //    // Nested Types
 
117
    //    private class LayoutDependentGlyphRunProperties
 
118
    //    {
 
119
    //      // Methods
 
120
    //      public LayoutDependentGlyphRunProperties();
 
121
    //      public GlyphRun CreateGlyphRun(Point origin, CultureInfo culture);
 
122
    //
 
123
    //      // Fields
 
124
    //      public double[] advanceWidths;
 
125
    //      public int bidiLevel;
 
126
    //      public IList<bool> caretStops;
 
127
    //      public ushort[] clusterMap;
 
128
    //      public double fontRenderingSize;
 
129
    //      public ushort[] glyphIndices;
 
130
    //      public Point[] glyphOffsets;
 
131
    //      public GlyphTypeface glyphTypeface;
 
132
    //      public bool sideways;
 
133
    //      public string unicodeString;
 
134
    //    }
 
135
    //
 
136
    //    private class ParsedGlyphData
 
137
    //    {
 
138
    //      // Methods
 
139
    //      public ParsedGlyphData();
 
140
    //
 
141
    //      // Fields
 
142
    //      public double advanceWidth;
 
143
    //      public ushort glyphIndex;
 
144
    //      public double offsetX;
 
145
    //      public double offsetY;
 
146
    //     }
 
147
  }
 
148
 
 
149
  public sealed class Line : StretchableShape
 
150
  {
 
151
    //    // Methods
 
152
    //    static Line();
 
153
    //    public Line();
 
154
    //    internal override void CacheDefiningGeometry();
 
155
    //
 
156
    //    // Properties
 
157
    //    protected override Geometry DefiningGeometry { get; }
 
158
    //    public double X1 { get; set; }
 
159
    //    public double X2 { get; set; }
 
160
    //    public double Y1 { get; set; }
 
161
    //    public double Y2 { get; set; }
 
162
    //
 
163
    //    // Fields
 
164
    //    private LineGeometry _lineGeometry;
 
165
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
166
    //    public static readonly DependencyProperty X1Property;
 
167
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
168
    //    public static readonly DependencyProperty X2Property;
 
169
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
170
    //    public static readonly DependencyProperty Y1Property;
 
171
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
172
    //    public static readonly DependencyProperty Y2Property;
 
173
  }
 
174
 
 
175
  public sealed class Path : StretchableShape
 
176
  {
 
177
    //    // Methods
 
178
    //    static Path();
 
179
    //    public Path();
 
180
    //    internal override void CacheDefiningGeometry();
 
181
    //    private static void PathDataInvalidator(DependencyObject d);
 
182
    //
 
183
    //    // Properties
 
184
    //    public Geometry Data { get; set; }
 
185
    //    protected override Geometry DefiningGeometry { get; }
 
186
    //    public FillRule FillRule { get; set; }
 
187
    //
 
188
    //    // Fields
 
189
    //    private Geometry _cachedGeometry;
 
190
    //    public static readonly DependencyProperty DataProperty;
 
191
    //    public static readonly DependencyProperty FillRuleProperty;
 
192
  }
 
193
 
 
194
  public sealed class Polygon : StretchableShape
 
195
  {
 
196
    //    // Methods
 
197
    //    static Polygon();
 
198
    //    public Polygon();
 
199
    //    internal override void CacheDefiningGeometry();
 
200
    //
 
201
    //    // Properties
 
202
    //    protected override Geometry DefiningGeometry { get; }
 
203
    //    public FillRule FillRule { get; set; }
 
204
    //    public PointCollection Points { get; set; }
 
205
    //
 
206
    //    // Fields
 
207
    //    private PathGeometry _polygonGeometry;
 
208
    //    public static readonly DependencyProperty FillRuleProperty;
 
209
    //    public static readonly DependencyProperty PointsProperty;
 
210
  }
 
211
 
 
212
  public sealed class Polyline : StretchableShape
 
213
  {
 
214
    //    // Methods
 
215
    //    static Polyline();
 
216
    //    public Polyline();
 
217
    //    internal override void CacheDefiningGeometry();
 
218
    //    protected override void OnRender(DrawingContext dc);
 
219
    //
 
220
    //    // Properties
 
221
    //    protected override Geometry DefiningGeometry { get; }
 
222
    //    public FillRule FillRule { get; set; }
 
223
    //    public PointCollection Points { get; set; }
 
224
    //
 
225
    //    // Fields
 
226
    //    private PathGeometry _polylineGeometry;
 
227
    //    public static readonly DependencyProperty FillRuleProperty;
 
228
    //    public static readonly DependencyProperty PointsProperty;
 
229
  }
 
230
 
 
231
  public sealed class Rectangle : StretchableShape
 
232
  {
 
233
    //    // Methods
 
234
    //    static Rectangle();
 
235
    //    public Rectangle();
 
236
    //    protected override Size ArrangeOverride(Size finalSize);
 
237
    //    internal override void CacheDefiningGeometry();
 
238
    //    internal override Rect GetDefiningGeometryBounds();
 
239
    //    internal override Size GetNaturalSize();
 
240
    //    protected override Size MeasureOverride(Size constraint);
 
241
    //    protected override void OnRender(DrawingContext dc);
 
242
    //
 
243
    //    // Properties
 
244
    //    protected override Geometry DefiningGeometry { get; }
 
245
    //    public override Transform GeometryTransform { get; }
 
246
    //    public double RadiusX { get; set; }
 
247
    //    public double RadiusY { get; set; }
 
248
    //    public override Geometry RenderedGeometry { get; }
 
249
    //
 
250
    //    // Fields
 
251
    //    private Rect _rect;
 
252
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
253
    //    public static readonly DependencyProperty RadiusXProperty;
 
254
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
255
    //    public static readonly DependencyProperty RadiusYProperty;
 
256
  }
 
257
 
 
258
  public abstract class Shape
 
259
  {
 
260
    //    // Methods
 
261
    //    static Shape();
 
262
    //    protected Shape();
 
263
    //    internal Pen GetPen(Size sizeReference);
 
264
    //    internal double GetStrokeThickness();
 
265
    //    internal static bool IsDoubleFinite(object o);
 
266
    //    internal static bool IsDoubleFiniteNonNegative(object o);
 
267
    //    private static void PenInvalidated(DependencyObject d);
 
268
    //
 
269
    //    // Properties
 
270
    //    public Brush Fill { get; set; }
 
271
    //    internal bool IsPenNoOp { get; }
 
272
    //    public Brush Stroke { get; set; }
 
273
    //    public DoubleCollection StrokeDashArray { get; set; }
 
274
    //    public PenLineCap StrokeDashCap { get; set; }
 
275
    //    public double StrokeDashOffset { get; set; }
 
276
    //    public PenLineCap StrokeEndLineCap { get; set; }
 
277
    //    public PenLineJoin StrokeLineJoin { get; set; }
 
278
    //    public double StrokeMiterLimit { get; set; }
 
279
    //    public PenLineCap StrokeStartLineCap { get; set; }
 
280
    //    public double StrokeThickness { get; set; }
 
281
    //
 
282
    //    // Fields
 
283
    //    private Pen _pen;
 
284
    //    public static readonly DependencyProperty FillProperty;
 
285
    //    public static readonly DependencyProperty StrokeDashArrayProperty;
 
286
    //    public static readonly DependencyProperty StrokeDashCapProperty;
 
287
    //    public static readonly DependencyProperty StrokeDashOffsetProperty;
 
288
    //    public static readonly DependencyProperty StrokeEndLineCapProperty;
 
289
    //    public static readonly DependencyProperty StrokeLineJoinProperty;
 
290
    //    public static readonly DependencyProperty StrokeMiterLimitProperty;
 
291
    //    public static readonly DependencyProperty StrokeProperty;
 
292
    //    public static readonly DependencyProperty StrokeStartLineCapProperty;
 
293
    //    [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
 
294
    //    public static readonly DependencyProperty StrokeThicknessProperty;
 
295
  }
 
296
 
 
297
  public abstract class StretchableShape : Shape
 
298
  {
 
299
    //    // Methods
 
300
    //    static StretchableShape();
 
301
    //    internal StretchableShape();
 
302
    //    protected override Size ArrangeOverride(Size finalSize);
 
303
    //    internal abstract void CacheDefiningGeometry();
 
304
    //    internal Stretch GetAdjustedStretch(Size size);
 
305
    //    internal virtual Rect GetDefiningGeometryBounds();
 
306
    //    internal virtual Size GetNaturalSize();
 
307
    //    protected override Size MeasureOverride(Size constraint);
 
308
    //    protected override void OnRender(DrawingContext dc);
 
309
    //    internal void Render(DrawingContext dc, Brush brush);
 
310
    //    internal void ResetStretchMatrix();
 
311
    //    internal void SetStretchedGeometry(Size finalSize);
 
312
    //    internal void SetStretchMatrix(Size size, Stretch mode, double penThickness);
 
313
    //
 
314
    //    // Properties
 
315
    //    protected abstract Geometry DefiningGeometry { get; }
 
316
    //    public virtual Transform GeometryTransform { get; }
 
317
    //    public virtual Geometry RenderedGeometry { get; }
 
318
    //    public Stretch Stretch { get; set; }
 
319
    //
 
320
    //    // Fields
 
321
    //    private Geometry _renderedGeometry;
 
322
    //    private Matrix _stretchMatrix;
 
323
    //    public static readonly DependencyProperty StretchProperty;
 
324
  }
 
325
}
 
326
#endif
 
 
b'\\ No newline at end of file'