~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/univint/src/CGContext.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ CoreGraphics - CGContext.h
 
2
 * Copyright (c) 2000-2003 Apple Computer, Inc.
 
3
 * All rights reserved.
 
4
 }
 
5
{       Pascal Translation Updated:  Peter N Lewis, <peter@stairways.com.au>, August 2005 }
 
6
{
 
7
    Modified for use with Free Pascal
 
8
    Version 210
 
9
    Please report any bugs to <gpc@microbizz.nl>
 
10
}
 
11
 
 
12
{$mode macpas}
 
13
{$packenum 1}
 
14
{$macro on}
 
15
{$inline on}
 
16
{$calling mwpascal}
 
17
 
 
18
unit CGContext;
 
19
interface
 
20
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
 
21
{$setc GAP_INTERFACES_VERSION := $0210}
 
22
 
 
23
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
 
24
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
 
25
{$endc}
 
26
 
 
27
{$ifc defined CPUPOWERPC and defined CPUI386}
 
28
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
 
29
{$endc}
 
30
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
 
31
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 
32
{$endc}
 
33
 
 
34
{$ifc not defined __ppc__ and defined CPUPOWERPC}
 
35
        {$setc __ppc__ := 1}
 
36
{$elsec}
 
37
        {$setc __ppc__ := 0}
 
38
{$endc}
 
39
{$ifc not defined __i386__ and defined CPUI386}
 
40
        {$setc __i386__ := 1}
 
41
{$elsec}
 
42
        {$setc __i386__ := 0}
 
43
{$endc}
 
44
 
 
45
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 
46
        {$error Conflicting definitions for __ppc__ and __i386__}
 
47
{$endc}
 
48
 
 
49
{$ifc defined __ppc__ and __ppc__}
 
50
        {$setc TARGET_CPU_PPC := TRUE}
 
51
        {$setc TARGET_CPU_X86 := FALSE}
 
52
{$elifc defined __i386__ and __i386__}
 
53
        {$setc TARGET_CPU_PPC := FALSE}
 
54
        {$setc TARGET_CPU_X86 := TRUE}
 
55
{$elsec}
 
56
        {$error Neither __ppc__ nor __i386__ is defined.}
 
57
{$endc}
 
58
{$setc TARGET_CPU_PPC_64 := FALSE}
 
59
 
 
60
{$ifc defined FPC_BIG_ENDIAN}
 
61
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
 
62
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
 
63
{$elifc defined FPC_LITTLE_ENDIAN}
 
64
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
 
65
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
 
66
{$elsec}
 
67
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
 
68
{$endc}
 
69
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
 
70
{$setc CALL_NOT_IN_CARBON := FALSE}
 
71
{$setc OLDROUTINENAMES := FALSE}
 
72
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
 
73
{$setc OPAQUE_UPP_TYPES := TRUE}
 
74
{$setc OTCARBONAPPLICATION := TRUE}
 
75
{$setc OTKERNEL := FALSE}
 
76
{$setc PM_USE_SESSION_APIS := TRUE}
 
77
{$setc TARGET_API_MAC_CARBON := TRUE}
 
78
{$setc TARGET_API_MAC_OS8 := FALSE}
 
79
{$setc TARGET_API_MAC_OSX := TRUE}
 
80
{$setc TARGET_CARBON := TRUE}
 
81
{$setc TARGET_CPU_68K := FALSE}
 
82
{$setc TARGET_CPU_MIPS := FALSE}
 
83
{$setc TARGET_CPU_SPARC := FALSE}
 
84
{$setc TARGET_OS_MAC := TRUE}
 
85
{$setc TARGET_OS_UNIX := FALSE}
 
86
{$setc TARGET_OS_WIN32 := FALSE}
 
87
{$setc TARGET_RT_MAC_68881 := FALSE}
 
88
{$setc TARGET_RT_MAC_CFM := FALSE}
 
89
{$setc TARGET_RT_MAC_MACHO := TRUE}
 
90
{$setc TYPED_FUNCTION_POINTERS := TRUE}
 
91
{$setc TYPE_BOOL := FALSE}
 
92
{$setc TYPE_EXTENDED := FALSE}
 
93
{$setc TYPE_LONGLONG := TRUE}
 
94
uses MacTypes,CFBase,CGGeometry,CGBase,CFDictionary,CGAffineTransforms,CGColorSpace,CGFont,CGImage,CGPDFDocument,CGPath,CGColor,CGShading,CGPDFPage;
 
95
{$ALIGN POWER}
 
96
 
 
97
 
 
98
type
 
99
        CGContextRef = ^SInt32; { an opaque 32-bit type }
 
100
 
 
101
 
 
102
{ Line join styles. }
 
103
 
 
104
type
 
105
        CGLineJoin = SInt32;
 
106
const
 
107
        kCGLineJoinMiter = 0;
 
108
        kCGLineJoinRound = 1;
 
109
        kCGLineJoinBevel = 2;
 
110
 
 
111
{ Line cap styles. }
 
112
 
 
113
type
 
114
        CGLineCap = SInt32;
 
115
const
 
116
        kCGLineCapButt = 0;
 
117
        kCGLineCapRound = 1;
 
118
        kCGLineCapSquare = 2;
 
119
 
 
120
{ Drawing modes for paths. }
 
121
 
 
122
type
 
123
        CGPathDrawingMode = SInt32;
 
124
const
 
125
        kCGPathFill = 0;
 
126
        kCGPathEOFill = 1;
 
127
        kCGPathStroke = 2;
 
128
        kCGPathFillStroke = 3;
 
129
        kCGPathEOFillStroke = 4;
 
130
 
 
131
{ Drawing modes for text. }
 
132
 
 
133
type
 
134
        CGTextDrawingMode = SInt32;
 
135
const
 
136
        kCGTextFill = 0;
 
137
        kCGTextStroke = 1;
 
138
        kCGTextFillStroke = 2;
 
139
        kCGTextInvisible = 3;
 
140
        kCGTextFillClip = 4;
 
141
        kCGTextStrokeClip = 5;
 
142
        kCGTextFillStrokeClip = 6;
 
143
        kCGTextClip = 7;
 
144
 
 
145
{ Text encodings. }
 
146
 
 
147
type
 
148
        CGTextEncoding = SInt32;
 
149
const
 
150
        kCGEncodingFontSpecific = 0;
 
151
        kCGEncodingMacRoman = 1;
 
152
 
 
153
{ Interpolation quality. }
 
154
 
 
155
type
 
156
        CGInterpolationQuality = SInt32;
 
157
const
 
158
        kCGInterpolationDefault = 0;            { Let the context decide. }
 
159
        kCGInterpolationNone = 1;               { Never interpolate. }
 
160
        kCGInterpolationLow = 2;                { Faster, lower quality. }
 
161
        kCGInterpolationHigh = 3;               { Slower, higher quality. }
 
162
 
 
163
{ Blend modes. }
 
164
 
 
165
type
 
166
        CGBlendMode = SInt32;
 
167
const
 
168
        kCGBlendModeNormal = 0;
 
169
        kCGBlendModeMultiply = 1;
 
170
        kCGBlendModeScreen = 2;
 
171
        kCGBlendModeOverlay = 3;
 
172
        kCGBlendModeDarken = 4;
 
173
        kCGBlendModeLighten = 5;
 
174
        kCGBlendModeColorDodge = 6;
 
175
        kCGBlendModeColorBurn = 7;
 
176
        kCGBlendModeSoftLight = 8;
 
177
        kCGBlendModeHardLight = 9;
 
178
        kCGBlendModeDifference = 10;
 
179
        kCGBlendModeExclusion = 11;
 
180
        kCGBlendModeHue = 12;
 
181
        kCGBlendModeSaturation = 13;
 
182
        kCGBlendModeColor = 14;
 
183
        kCGBlendModeLuminosity = 15; { Available in Mac OS X 10.4 & later. }
 
184
 
 
185
 
 
186
{ Return the CFTypeID for CGContextRefs. }
 
187
 
 
188
function CGContextGetTypeID: CFTypeID; external name '_CGContextGetTypeID'; (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
189
 
 
190
{* Graphics state functions. *}
 
191
 
 
192
{ Push a copy of the current graphics state onto the graphics state
 
193
 * stack. Note that the path is not considered part of the gstate, and is
 
194
 * not saved. }
 
195
 
 
196
procedure CGContextSaveGState( c: CGContextRef ); external name '_CGContextSaveGState';
 
197
 
 
198
{ Restore the current graphics state from the one on the top of the
 
199
 * graphics state stack, popping the graphics state stack in the
 
200
 * process. }
 
201
 
 
202
procedure CGContextRestoreGState( c: CGContextRef ); external name '_CGContextRestoreGState';
 
203
 
 
204
{* Coordinate space transformations. *}
 
205
 
 
206
{ Scale the current graphics state's transformation matrix (the CTM) by
 
207
 * `(sx, sy)'. }
 
208
 
 
209
procedure CGContextScaleCTM( c: CGContextRef; sx: Float32; sy: Float32 ); external name '_CGContextScaleCTM';
 
210
 
 
211
{ Translate the current graphics state's transformation matrix (the CTM)
 
212
 * by `(tx, ty)'. }
 
213
 
 
214
procedure CGContextTranslateCTM( c: CGContextRef; tx: Float32; ty: Float32 ); external name '_CGContextTranslateCTM';
 
215
 
 
216
{ Rotate the current graphics state's transformation matrix (the CTM) by
 
217
 * `angle' radians. }
 
218
 
 
219
procedure CGContextRotateCTM( c: CGContextRef; angle: Float32 ); external name '_CGContextRotateCTM';
 
220
 
 
221
{ Concatenate the current graphics state's transformation matrix (the CTM)
 
222
 * with the affine transform `transform'. }
 
223
 
 
224
procedure CGContextConcatCTM( c: CGContextRef; transform: CGAffineTransform ); external name '_CGContextConcatCTM';
 
225
 
 
226
{ Return the current graphics state's transformation matrix. }
 
227
 
 
228
function CGContextGetCTM( c: CGContextRef ): CGAffineTransform; external name '_CGContextGetCTM';
 
229
 
 
230
{* Drawing attribute functions. *}
 
231
 
 
232
{ Set the line width in the current graphics state to `width'. }
 
233
 
 
234
procedure CGContextSetLineWidth( c: CGContextRef; width: Float32 ); external name '_CGContextSetLineWidth';
 
235
 
 
236
{ Set the line cap in the current graphics state to `cap'. }
 
237
 
 
238
procedure CGContextSetLineCap( c: CGContextRef; cap: CGLineCap ); external name '_CGContextSetLineCap';
 
239
 
 
240
{ Set the line join in the current graphics state to `join'. }
 
241
 
 
242
procedure CGContextSetLineJoin( c: CGContextRef; join: CGLineJoin ); external name '_CGContextSetLineJoin';
 
243
 
 
244
{ Set the miter limit in the current graphics state to `limit'. }
 
245
 
 
246
procedure CGContextSetMiterLimit( c: CGContextRef; limit: Float32 ); external name '_CGContextSetMiterLimit';
 
247
 
 
248
{ Set the line dash patttern in the current graphics state of `c'. }
 
249
 
 
250
procedure CGContextSetLineDash( c: CGContextRef; phase: Float32; {const} lengths: {variable-size-array} Float32Ptr; count: size_t ); external name '_CGContextSetLineDash';
 
251
 
 
252
{ Set the path flatness parameter in the current graphics state of `c' to
 
253
 * `flatness'. }
 
254
 
 
255
procedure CGContextSetFlatness( c: CGContextRef; flatness: Float32 ); external name '_CGContextSetFlatness';
 
256
 
 
257
{ Set the alpha value in the current graphics state of `c' to `alpha'. }
 
258
 
 
259
procedure CGContextSetAlpha( c: CGContextRef; alpha: Float32 ); external name '_CGContextSetAlpha';
 
260
 
 
261
{ Set the blend mode of `context' to `mode'. }
 
262
 
 
263
procedure CGContextSetBlendMode( context: CGContextRef; mode: CGBlendMode ); external name '_CGContextSetBlendMode'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
264
 
 
265
{* Path construction functions. *}
 
266
 
 
267
{ Note that a context has a single path in use at any time: a path is not
 
268
 * part of the graphics state. }
 
269
 
 
270
{ Begin a new path.  The old path is discarded. }
 
271
 
 
272
procedure CGContextBeginPath( c: CGContextRef ); external name '_CGContextBeginPath';
 
273
 
 
274
{ Start a new subpath at point `(x, y)' in the context's path. }
 
275
 
 
276
procedure CGContextMoveToPoint( c: CGContextRef; x: Float32; y: Float32 ); external name '_CGContextMoveToPoint';
 
277
 
 
278
{ Append a straight line segment from the current point to `(x, y)'. }
 
279
 
 
280
procedure CGContextAddLineToPoint( c: CGContextRef; x: Float32; y: Float32 ); external name '_CGContextAddLineToPoint';
 
281
 
 
282
{ Append a cubic Bezier curve from the current point to `(x,y)', with
 
283
 * control points `(cp1x, cp1y)' and `(cp2x, cp2y)'. }
 
284
 
 
285
procedure CGContextAddCurveToPoint( c: CGContextRef; cp1x: Float32; cp1y: Float32; cp2x: Float32; cp2y: Float32; x: Float32; y: Float32 ); external name '_CGContextAddCurveToPoint';
 
286
 
 
287
{ Append a quadratic curve from the current point to `(x, y)', with
 
288
 * control point `(cpx, cpy)'. }
 
289
 
 
290
procedure CGContextAddQuadCurveToPoint( c: CGContextRef; cpx: Float32; cpy: Float32; x: Float32; y: Float32 ); external name '_CGContextAddQuadCurveToPoint';
 
291
 
 
292
{ Close the current subpath of the context's path. }
 
293
 
 
294
procedure CGContextClosePath( c: CGContextRef ); external name '_CGContextClosePath';
 
295
 
 
296
{* Path construction convenience functions. *}
 
297
 
 
298
{ Add a single rect to the context's path. }
 
299
 
 
300
procedure CGContextAddRect( c: CGContextRef; rect: CGRect ); external name '_CGContextAddRect';
 
301
 
 
302
{ Add a set of rects to the context's path. }
 
303
 
 
304
procedure CGContextAddRects( c: CGContextRef; {const} rects: {variable-size-array} CGRectPtr; count: size_t ); external name '_CGContextAddRects';
 
305
 
 
306
{ Add a set of lines to the context's path. }
 
307
 
 
308
procedure CGContextAddLines( c: CGContextRef; {const} points: {variable-size-array} CGPointPtr; count: size_t ); external name '_CGContextAddLines';
 
309
 
 
310
{ Add an ellipse inside `rect' to the current path of `context'.  See the
 
311
 * function `CGPathAddEllipseInRect' for more information on how the path
 
312
 * for the ellipse is constructed. }
 
313
 
 
314
procedure CGContextAddEllipseInRect( context: CGContextRef; rect: CGRect ); external name '_CGContextAddEllipseInRect'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
315
 
 
316
{ Add an arc of a circle to the context's path, possibly preceded by a
 
317
 * straight line segment.  `(x, y)' is the center of the arc; `radius' is
 
318
 * its radius; `startAngle' is the angle to the first endpoint of the arc;
 
319
 * `endAngle' is the angle to the second endpoint of the arc; and
 
320
 * `clockwise' is 1 if the arc is to be drawn clockwise, 0 otherwise.
 
321
 * `startAngle' and `endAngle' are measured in radians. }
 
322
 
 
323
procedure CGContextAddArc( c: CGContextRef; x: Float32; y: Float32; radius: Float32; startAngle: Float32; endAngle: Float32; clockwise: SInt32 ); external name '_CGContextAddArc';
 
324
 
 
325
{ Add an arc of a circle to the context's path, possibly preceded by a
 
326
 * straight line segment.  `radius' is the radius of the arc.  The arc is
 
327
 * tangent to the line from the current point to `(x1, y1)', and the line
 
328
 * from `(x1, y1)' to `(x2, y2)'. }
 
329
 
 
330
procedure CGContextAddArcToPoint( c: CGContextRef; x1: Float32; y1: Float32; x2: Float32; y2: Float32; radius: Float32 ); external name '_CGContextAddArcToPoint';
 
331
 
 
332
{ Add `path' to the path of context.  The points in `path' are transformed
 
333
 * by the CTM of context before they are added. }
 
334
 
 
335
procedure CGContextAddPath( context: CGContextRef; path: CGPathRef ); external name '_CGContextAddPath'; (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
336
 
 
337
{* Path stroking. *}
 
338
 
 
339
{ Replace the path in context with the stroked version of the path, using
 
340
 * the parameters of `context' to calculate the stroked path.  The
 
341
 * resulting path is created such that filling it with the appropriate
 
342
 * color will produce the same results as stroking the original path. You
 
343
 * can use this path in the same way you can use the path of any context;
 
344
 * for example, you can clip to the stroked version of a path by calling
 
345
 * this function followed by a call to "CGContextClipPath". }
 
346
 
 
347
procedure CGContextReplacePathWithStrokedPath( c: CGContextRef ); external name '_CGContextReplacePathWithStrokedPath'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
348
 
 
349
{* Path information functions. *}
 
350
 
 
351
{ Return true if the context's path contains no elements, false otherwise. }
 
352
 
 
353
function CGContextIsPathEmpty( c: CGContextRef ): CBool; external name '_CGContextIsPathEmpty';
 
354
 
 
355
{ Return the current point of the current subpath of the context's
 
356
 * path. }
 
357
 
 
358
function CGContextGetPathCurrentPoint( c: CGContextRef ): CGPoint; external name '_CGContextGetPathCurrentPoint';
 
359
 
 
360
{ Return the bounding box of the context's path.  The bounding box is the
 
361
 * smallest rectangle completely enclosing all points in the path,
 
362
 * including control points for Bezier and quadratic curves. }
 
363
 
 
364
function CGContextGetPathBoundingBox( c: CGContextRef ): CGRect; external name '_CGContextGetPathBoundingBox';
 
365
 
 
366
{ Return true if `point' is contained in the current path of `context'.  A
 
367
 * point is contained within a context's path if it is inside the painted
 
368
 * region when the path is stroked or filled with opaque colors using the
 
369
 * path drawing mode `mode'.  `point' is specified is user space. }
 
370
 
 
371
function CGContextPathContainsPoint( context: CGContextRef; point: CGPoint; mode: CGPathDrawingMode ): CBool; external name '_CGContextPathContainsPoint'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
372
 
 
373
{* Path drawing functions. *}
 
374
 
 
375
{ Draw the context's path using drawing mode `mode'. }
 
376
 
 
377
procedure CGContextDrawPath( c: CGContextRef; mode: CGPathDrawingMode ); external name '_CGContextDrawPath';
 
378
 
 
379
{* Path drawing convenience functions. *}
 
380
 
 
381
{ Fill the context's path using the winding-number fill rule.  Any open
 
382
 * subpath of the path is implicitly closed. }
 
383
 
 
384
procedure CGContextFillPath( c: CGContextRef ); external name '_CGContextFillPath';
 
385
 
 
386
{ Fill the context's path using the even-odd fill rule.  Any open subpath
 
387
 * of the path is implicitly closed. }
 
388
 
 
389
procedure CGContextEOFillPath( c: CGContextRef ); external name '_CGContextEOFillPath';
 
390
 
 
391
{ Stroke the context's path. }
 
392
 
 
393
procedure CGContextStrokePath( c: CGContextRef ); external name '_CGContextStrokePath';
 
394
 
 
395
{ Fill `rect' with the current fill color. }
 
396
 
 
397
procedure CGContextFillRect( c: CGContextRef; rect: CGRect ); external name '_CGContextFillRect';
 
398
 
 
399
{ Fill `rects', an array of `count' CGRects, with the current fill
 
400
 * color. }
 
401
 
 
402
procedure CGContextFillRects( c: CGContextRef; {const} rects: {variable-size-array} CGRectPtr; count: size_t ); external name '_CGContextFillRects';
 
403
 
 
404
{ Stroke `rect' with the current stroke color and the current linewidth. }
 
405
 
 
406
procedure CGContextStrokeRect( c: CGContextRef; rect: CGRect ); external name '_CGContextStrokeRect';
 
407
 
 
408
{ Stroke `rect' with the current stroke color, using `width' as the the
 
409
 * line width. }
 
410
 
 
411
procedure CGContextStrokeRectWithWidth( c: CGContextRef; rect: CGRect; width: Float32 ); external name '_CGContextStrokeRectWithWidth';
 
412
 
 
413
{ Clear `rect' (that is, set the region within the rect to
 
414
 * transparent). }
 
415
 
 
416
procedure CGContextClearRect( c: CGContextRef; rect: CGRect ); external name '_CGContextClearRect';
 
417
 
 
418
{ Fill an ellipse (an oval) inside `rect'. }
 
419
 
 
420
procedure CGContextFillEllipseInRect( context: CGContextRef; rect: CGRect ); external name '_CGContextFillEllipseInRect'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
421
 
 
422
{ Stroke an ellipse (an oval) inside `rect'. }
 
423
 
 
424
procedure CGContextStrokeEllipseInRect( context: CGContextRef; rect: CGRect ); external name '_CGContextStrokeEllipseInRect'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
425
 
 
426
{ Stroke a sequence of line segments one after another in `context'.  The
 
427
 * line segments are specified by `points', an array of `count' CGPoints.
 
428
 * This function is equivalent to
 
429
 *   CGContextBeginPath(context);
 
430
 *   for (k = 0; k < count; k += 2) begin
 
431
 *       CGContextMoveToPoint(context, s[k].x, s[k].y);
 
432
 *       CGContextAddLineToPoint(context, s[k+1].x, s[k+1].y);
 
433
 *   end;
 
434
 *   CGContextStrokePath(context);
 
435
 }
 
436
 
 
437
procedure CGContextStrokeLineSegments( c: CGContextRef; {const} points: {variable-size-array} CGPointPtr; count: size_t ); external name '_CGContextStrokeLineSegments'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
438
 
 
439
{* Clipping functions. *}
 
440
 
 
441
{ Intersect the context's path with the current clip path and use the
 
442
 * resulting path as the clip path for subsequent rendering operations.
 
443
 * Use the winding-number fill rule for deciding what's inside the path. }
 
444
 
 
445
procedure CGContextClip( c: CGContextRef ); external name '_CGContextClip';
 
446
 
 
447
{ Intersect the context's path with the current clip path and use the
 
448
 * resulting path as the clip path for subsequent rendering operations.
 
449
 * Use the even-odd fill rule for deciding what's inside the path. }
 
450
 
 
451
procedure CGContextEOClip( c: CGContextRef ); external name '_CGContextEOClip';
 
452
 
 
453
{ Add `mask' transformed to `rect' to the clipping area of `context'.  The
 
454
 * mask, which may be either an image mask or an image, is mapped into the
 
455
 * specified rectangle and intersected with the current clipping area of
 
456
 * the context.
 
457
 *
 
458
 * If `mask' is an image mask, then it clips in a manner identical to the
 
459
 * behavior if it were used with "CGContextDrawImage": it indicates an area
 
460
 * to be masked out (left unchanged) when drawing.  The source samples of
 
461
 * the image mask determine which points of the clipping area are changed,
 
462
 * acting as an "inverse alpha": if the value of a source sample in the
 
463
 * image mask is S, then the corresponding point in the current clipping
 
464
 * area will be multiplied by an alpha of (1-S).  (For example, if S is 1,
 
465
 * then the point in the clipping area becomes clear, while if S is 0, the
 
466
 * point in the clipping area is unchanged.
 
467
 *
 
468
 * If `mask' is an image, then it serves as alpha mask and is blended with
 
469
 * the current clipping area.  The source samples of mask determine which
 
470
 * points of the clipping area are changed: if the value of the source
 
471
 * sample in mask is S, then the corresponding point in the current
 
472
 * clipping area will be multiplied by an alpha of S.  (For example, if S
 
473
 * is 0, then the point in the clipping area becomes clear, while if S is
 
474
 * 1, the point in the clipping area is unchanged.
 
475
 *
 
476
 * If `mask' is an image, then it must be in the DeviceGray color space,
 
477
 * may not have alpha, and may not be masked by an image mask or masking
 
478
 * color. }
 
479
 
 
480
procedure CGContextClipToMask( c: CGContextRef; rect: CGRect; mask: CGImageRef ); external name '_CGContextClipToMask';
 
481
 
 
482
{ Return the bounding box of the clip path of `c' in user space.  The
 
483
 * bounding box is the smallest rectangle completely enclosing all points
 
484
 * in the clip. }
 
485
 
 
486
function CGContextGetClipBoundingBox( c: CGContextRef ): CGRect; external name '_CGContextGetClipBoundingBox'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
487
 
 
488
{* Clipping convenience functions. *}
 
489
 
 
490
{ Intersect the current clipping path with `rect'.  Note that this
 
491
 * function resets the context's path to the empty path. }
 
492
 
 
493
procedure CGContextClipToRect( c: CGContextRef; rect: CGRect ); external name '_CGContextClipToRect';
 
494
 
 
495
{ Intersect the current clipping path with the clipping region formed by
 
496
 * creating a path consisting of all rects in `rects'.  Note that this
 
497
 * function resets the context's path to the empty path. }
 
498
 
 
499
procedure CGContextClipToRects( c: CGContextRef; {const} rects: {variable-size-array} CGRectPtr; count: size_t ); external name '_CGContextClipToRects';
 
500
 
 
501
{* Primitive color functions. *}
 
502
 
 
503
{ Set the current fill color in the context `c' to `color'. }
 
504
 
 
505
procedure CGContextSetFillColorWithColor( c: CGContextRef; color: CGColorRef ); external name '_CGContextSetFillColorWithColor'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
506
 
 
507
{ Set the current stroke color in the context `c' to `color'. }
 
508
 
 
509
procedure CGContextSetStrokeColorWithColor( c: CGContextRef; color: CGColorRef ); external name '_CGContextSetStrokeColorWithColor'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
510
 
 
511
{* Colorspace functions. *}
 
512
 
 
513
{ Set the current fill colorspace in the context `c' to `colorspace'.  As
 
514
 * a side-effect, set the fill color to a default value appropriate for the
 
515
 * colorspace. }
 
516
 
 
517
procedure CGContextSetFillColorSpace( c: CGContextRef; colorspace: CGColorSpaceRef ); external name '_CGContextSetFillColorSpace';
 
518
 
 
519
{ Set the current stroke colorspace in the context `c' to `colorspace'.
 
520
 * As a side-effect, set the stroke color to a default value appropriate
 
521
 * for the colorspace. }
 
522
 
 
523
procedure CGContextSetStrokeColorSpace( c: CGContextRef; colorspace: CGColorSpaceRef ); external name '_CGContextSetStrokeColorSpace';
 
524
 
 
525
{* Color functions. *}
 
526
 
 
527
{ Set the components of the current fill color in the context `c' to the
 
528
 * values specifed by `components'.  The number of elements in `components'
 
529
 * must be one greater than the number of components in the current fill
 
530
 * colorspace (N color components + 1 alpha component).  The current fill
 
531
 * colorspace must not be a pattern colorspace. }
 
532
 
 
533
procedure CGContextSetFillColor( c: CGContextRef; {const} components: {variable-size-array} Float32Ptr ); external name '_CGContextSetFillColor';
 
534
 
 
535
{ Set the components of the current stroke color in the context `c' to the
 
536
 * values specifed by `components'.  The number of elements in `components'
 
537
 * must be one greater than the number of components in the current stroke
 
538
 * colorspace (N color components + 1 alpha component).  The current stroke
 
539
 * colorspace must not be a pattern colorspace. }
 
540
 
 
541
procedure CGContextSetStrokeColor( c: CGContextRef; {const} components: {variable-size-array} Float32Ptr ); external name '_CGContextSetStrokeColor';
 
542
 
 
543
{* Pattern functions. *}
 
544
 
 
545
{ Set the components of the current fill color in the context `c' to the
 
546
 * values specifed by `components', and set the current fill pattern to
 
547
 * `pattern'.  The number of elements in `components' must be one greater
 
548
 * than the number of components in the current fill colorspace (N color
 
549
 * components + 1 alpha component).  The current fill colorspace must be a
 
550
 * pattern colorspace. }
 
551
 
 
552
procedure CGContextSetFillPattern( c: CGContextRef; pattern: CGPatternRef; {const} components: {variable-size-array} Float32Ptr ); external name '_CGContextSetFillPattern';
 
553
 
 
554
{ Set the components of the current stroke color in the context `c' to the
 
555
 * values specifed by `components', and set the current stroke pattern to
 
556
 * `pattern'.  The number of elements in `components' must be one greater
 
557
 * than the number of components in the current stroke colorspace (N color
 
558
 * components + 1 alpha component).  The current stroke colorspace must be
 
559
 * a pattern colorspace. }
 
560
 
 
561
procedure CGContextSetStrokePattern( c: CGContextRef; pattern: CGPatternRef; {const} components: {variable-size-array} Float32Ptr ); external name '_CGContextSetStrokePattern';
 
562
 
 
563
{ Set the pattern phase in the current graphics state of the context `c'
 
564
 * to `phase'. }
 
565
 
 
566
procedure CGContextSetPatternPhase( c: CGContextRef; phase: CGSize ); external name '_CGContextSetPatternPhase';
 
567
 
 
568
{* Color convenience functions. *}
 
569
 
 
570
{ Set the current fill colorspace in the context `c' to `DeviceGray' and
 
571
 * set the components of the current fill color to `(gray, alpha)'. }
 
572
 
 
573
procedure CGContextSetGrayFillColor( c: CGContextRef; gray: Float32; alpha: Float32 ); external name '_CGContextSetGrayFillColor';
 
574
 
 
575
{ Set the current stroke colorspace in the context `c' to `DeviceGray' and
 
576
 * set the components of the current stroke color to `(gray, alpha)'. }
 
577
 
 
578
procedure CGContextSetGrayStrokeColor( c: CGContextRef; gray: Float32; alpha: Float32 ); external name '_CGContextSetGrayStrokeColor';
 
579
 
 
580
{ Set the current fill colorspace in the context `c' to `DeviceRGB' and
 
581
 * set the components of the current fill color to `(red, green, blue,
 
582
 * alpha)'. }
 
583
 
 
584
procedure CGContextSetRGBFillColor( c: CGContextRef; red: Float32; green: Float32; blue: Float32; alpha: Float32 ); external name '_CGContextSetRGBFillColor';
 
585
 
 
586
{ Set the current stroke colorspace in the context `c' to `DeviceRGB' and
 
587
 * set the components of the current stroke color to `(red, green, blue,
 
588
 * alpha)'. }
 
589
 
 
590
procedure CGContextSetRGBStrokeColor( c: CGContextRef; red: Float32; green: Float32; blue: Float32; alpha: Float32 ); external name '_CGContextSetRGBStrokeColor';
 
591
 
 
592
{ Set the current fill colorspace in the context `c' to `DeviceCMYK' and
 
593
 * set the components of the current fill color to `(cyan, magenta, yellow,
 
594
 * black, alpha)'. }
 
595
 
 
596
procedure CGContextSetCMYKFillColor( c: CGContextRef; cyan: Float32; magenta: Float32; yellow: Float32; black: Float32; alpha: Float32 ); external name '_CGContextSetCMYKFillColor';
 
597
 
 
598
{ Set the current stroke colorspace in the context `c' to `DeviceCMYK' and
 
599
 * set the components of the current stroke color to `(cyan, magenta,
 
600
 * yellow, black, alpha)'. }
 
601
 
 
602
procedure CGContextSetCMYKStrokeColor( c: CGContextRef; cyan: Float32; magenta: Float32; yellow: Float32; black: Float32; alpha: Float32 ); external name '_CGContextSetCMYKStrokeColor';
 
603
 
 
604
{* Rendering intent. *}
 
605
 
 
606
{ Set the rendering intent in the current graphics state of context `c' to
 
607
 * `intent'. }
 
608
 
 
609
procedure CGContextSetRenderingIntent( c: CGContextRef; intent: CGColorRenderingIntent ); external name '_CGContextSetRenderingIntent';
 
610
 
 
611
{* Image functions. *}
 
612
 
 
613
{ Draw `image' in the rectangular area specified by `rect' in the context
 
614
 * `c'.  The image is scaled, if necessary, to fit into `rect'. }
 
615
 
 
616
procedure CGContextDrawImage( c: CGContextRef; rect: CGRect; image: CGImageRef ); external name '_CGContextDrawImage';
 
617
 
 
618
{ Return the interpolation quality for image rendering of the context `c'.
 
619
 * The interpolation quality is a gstate-parameter which controls the level
 
620
 * of interpolation performed when an image is interpolated (for example,
 
621
 * when scaling the image). Note that it is merely a hint to the context:
 
622
 * not all contexts support all interpolation quality levels. }
 
623
 
 
624
function CGContextGetInterpolationQuality( c: CGContextRef ): CGInterpolationQuality; external name '_CGContextGetInterpolationQuality';
 
625
 
 
626
{ Set the interpolation quality of the context `c' to `quality'. }
 
627
 
 
628
procedure CGContextSetInterpolationQuality( c: CGContextRef; quality: CGInterpolationQuality ); external name '_CGContextSetInterpolationQuality';
 
629
 
 
630
{* Shadow support. *}
 
631
 
 
632
{ Set the shadow parameters in `context'.  `offset' specifies a
 
633
 * translation in base-space; `blur' is a non-negative number specifying
 
634
 * the amount of blur; `color' specifies the color of the shadow, which may
 
635
 * contain a non-opaque alpha value.  If `color' is NULL, it's equivalent
 
636
 * to specifying a fully transparent color.  The shadow is a gstate
 
637
 * parameter. After a shadow is specified, all objects drawn subsequently
 
638
 * will be shadowed.  To turn off shadowing, set the shadow color to a
 
639
 * fully transparent color (or pass NULL as the color), or use the standard
 
640
 * gsave/grestore mechanism. }
 
641
 
 
642
procedure CGContextSetShadowWithColor( context: CGContextRef; offset: CGSize; blur: Float32; color: CGColorRef ); external name '_CGContextSetShadowWithColor'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
643
 
 
644
{ Equivalent to calling
 
645
 *   CGContextSetShadowWithColor(context, offset, blur, color)
 
646
 * where color is black with 1/3 alpha (i.e., RGBA = (0, 0, 0, 1.0/3.0)) in
 
647
 * the DeviceRGB colorspace. }
 
648
 
 
649
procedure CGContextSetShadow( context: CGContextRef; offset: CGSize; blur: Float32 ); external name '_CGContextSetShadow'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
650
 
 
651
{* Shading functions. *}
 
652
 
 
653
{ Fill the current clipping region of `c' with `shading'. }
 
654
 
 
655
procedure CGContextDrawShading( c: CGContextRef; shading: CGShadingRef ); external name '_CGContextDrawShading'; (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
656
 
 
657
{* Text functions. *}
 
658
 
 
659
{ Set the current character spacing in the context `c' to `spacing'.  The
 
660
 * character spacing is added to the displacement between the origin of one
 
661
 * character and the origin of the next. }
 
662
 
 
663
procedure CGContextSetCharacterSpacing( c: CGContextRef; spacing: Float32 ); external name '_CGContextSetCharacterSpacing';
 
664
 
 
665
{ Set the user-space point at which text will be drawn in the context `c'
 
666
 * to `(x, y)'. }
 
667
 
 
668
procedure CGContextSetTextPosition( c: CGContextRef; x: Float32; y: Float32 ); external name '_CGContextSetTextPosition';
 
669
 
 
670
{ Return the user-space point at which text will be drawn in the context
 
671
 * `c'. }
 
672
 
 
673
function CGContextGetTextPosition( c: CGContextRef ): CGPoint; external name '_CGContextGetTextPosition';
 
674
 
 
675
{ Set the text matrix in the context `c' to `t'. }
 
676
 
 
677
procedure CGContextSetTextMatrix( c: CGContextRef; t: CGAffineTransform ); external name '_CGContextSetTextMatrix';
 
678
 
 
679
{ Return the text matrix in the context `c'. }
 
680
 
 
681
function CGContextGetTextMatrix( c: CGContextRef ): CGAffineTransform; external name '_CGContextGetTextMatrix';
 
682
 
 
683
{ Set the text drawing mode in the current graphics state of the context
 
684
 * `c' to `mode'. }
 
685
 
 
686
procedure CGContextSetTextDrawingMode( c: CGContextRef; mode: CGTextDrawingMode ); external name '_CGContextSetTextDrawingMode';
 
687
 
 
688
{ Set the font in the current graphics state of the context `c' to
 
689
 * `font'. }
 
690
 
 
691
procedure CGContextSetFont( c: CGContextRef; font: CGFontRef ); external name '_CGContextSetFont';
 
692
 
 
693
{ Set the font size in the current graphics state of the context `c' to
 
694
 * `size'. }
 
695
 
 
696
procedure CGContextSetFontSize( c: CGContextRef; size: Float32 ); external name '_CGContextSetFontSize';
 
697
 
 
698
{ Attempts to find the font named `name' and, if successful, sets it as
 
699
 * the font in the current graphics state of `c' and sets the font size in
 
700
 * the current graphics state to `size'. `textEncoding' specifies how to
 
701
 * translate from bytes to glyphs when displaying text. }
 
702
 
 
703
procedure CGContextSelectFont( c: CGContextRef; name: ConstCStringPtr; size: Float32; textEncoding: CGTextEncoding ); external name '_CGContextSelectFont';
 
704
 
 
705
{ Draw `string', a string of `length' bytes, at the point specified by the
 
706
 * text matrix in the context `c'.  Each byte of the string is mapped
 
707
 * through the encoding vector of the current font to obtain the glyph to
 
708
 * display. }
 
709
 
 
710
procedure CGContextShowText( c: CGContextRef; strng: ConstCStringPtr; length: size_t ); external name '_CGContextShowText';
 
711
 
 
712
{ Draw the glyphs pointed to by `g', an array of `count' glyphs, at the
 
713
 * point specified by the text matrix in the context `c'. }
 
714
 
 
715
procedure CGContextShowGlyphs( c: CGContextRef; {const} g: {variable-size-array} CGGlyphPtr; count: size_t ); external name '_CGContextShowGlyphs';
 
716
 
 
717
{ Draw `glyphs', an array of `count' CGGlyphs, at the current point
 
718
 * specified by the text matrix.  Each element of `advances' specifies the
 
719
 * offset from the previous glyph's origin to the origin of the associated
 
720
 * glyph; the advances are specified in user space. }
 
721
 
 
722
procedure CGContextShowGlyphsWithAdvances( c: CGContextRef; {const} glyphs: {variable-size-array} CGGlyphPtr; {const} advances: {variable-size-array} CGSizePtr; count: size_t ); external name '_CGContextShowGlyphsWithAdvances'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
723
 
 
724
{* Text convenience functions. *}
 
725
 
 
726
{ Draw `string', a string of `length' bytes, at the point `(x, y)',
 
727
 * specified in user space, in the context `c'.  Each byte of the string is
 
728
 * mapped through the encoding vector of the current font to obtain the
 
729
 * glyph to display. }
 
730
 
 
731
procedure CGContextShowTextAtPoint( c: CGContextRef; x: Float32; y: Float32; strng: ConstCStringPtr; length: size_t ); external name '_CGContextShowTextAtPoint';
 
732
 
 
733
{ Display the glyphs pointed to by `glyphs', an array of `count' glyphs,
 
734
 * at at the point `(x, y)', specified in user space, in the context
 
735
 * `c'. }
 
736
 
 
737
procedure CGContextShowGlyphsAtPoint( c: CGContextRef; x: Float32; y: Float32; {const} glyphs: {variable-size-array} CGGlyphPtr; count: size_t ); external name '_CGContextShowGlyphsAtPoint';
 
738
 
 
739
{* PDF functions. *}
 
740
 
 
741
{ Draw `page' in the current user space of the context `c'. }
 
742
 
 
743
procedure CGContextDrawPDFPage( c: CGContextRef; page: CGPDFPageRef ); external name '_CGContextDrawPDFPage'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
744
 
 
745
{ DEPRECATED; use the CGPDFPage API instead.
 
746
 * Draw `page' in `document' in the rectangular area specified by `rect' in
 
747
 * the context `c'.  The media box of the page is scaled, if necessary, to
 
748
 * fit into `rect'. }
 
749
 
 
750
procedure CGContextDrawPDFDocument( c: CGContextRef; rect: CGRect; document: CGPDFDocumentRef; page: SInt32 ); external name '_CGContextDrawPDFDocument';
 
751
 
 
752
{* Output page functions. *}
 
753
 
 
754
{ Begin a new page. }
 
755
 
 
756
procedure CGContextBeginPage( c: CGContextRef; const (*var*) mediaBox: CGRect ); external name '_CGContextBeginPage';
 
757
 
 
758
{ End the current page. }
 
759
 
 
760
procedure CGContextEndPage( c: CGContextRef ); external name '_CGContextEndPage';
 
761
 
 
762
{* Context functions. *}
 
763
 
 
764
{ Equivalent to `CFRetain(c)'. }
 
765
 
 
766
function CGContextRetain( c: CGContextRef ): CGContextRef; external name '_CGContextRetain';
 
767
 
 
768
{ Equivalent to `CFRelease(c)'. }
 
769
 
 
770
procedure CGContextRelease( c: CGContextRef ); external name '_CGContextRelease';
 
771
 
 
772
{ Flush all drawing to the destination. }
 
773
 
 
774
procedure CGContextFlush( c: CGContextRef ); external name '_CGContextFlush';
 
775
 
 
776
{ Synchronized drawing. }
 
777
 
 
778
procedure CGContextSynchronize( c: CGContextRef ); external name '_CGContextSynchronize';
 
779
 
 
780
{* Antialiasing functions. *}
 
781
 
 
782
{ Turn on antialiasing if `shouldAntialias' is true; turn it off
 
783
 * otherwise.  This parameter is part of the graphics state. }
 
784
 
 
785
procedure CGContextSetShouldAntialias( c: CGContextRef; shouldAntialias: CBool ); external name '_CGContextSetShouldAntialias';
 
786
 
 
787
{ Allow antialiasing in context `c' if `allowsAntialiasing' is true; don't
 
788
 * allow it otherwise. This parameter is not part of the graphics state. A
 
789
 * context will perform antialiasing if both `allowsAntialiasing' and the
 
790
 * graphics state parameter `shouldAntialias' are true. }
 
791
 
 
792
procedure CGContextSetAllowsAntialiasing( context: CGContextRef; allowsAntialiasing: CBool ); external name '_CGContextSetAllowsAntialiasing'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
793
 
 
794
{* Font smoothing functions. *}
 
795
 
 
796
{ Turn on font smoothing if `shouldSmoothFonts' is true; turn it off
 
797
 * otherwise.  This parameter is part of the graphics state. Note that this
 
798
 * doesn't guarantee that font smoothing will occur: not all destination
 
799
 * contexts support font smoothing. }
 
800
 
 
801
procedure CGContextSetShouldSmoothFonts( c: CGContextRef; shouldSmoothFonts: CBool ); external name '_CGContextSetShouldSmoothFonts'; (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
802
 
 
803
{* Transparency layer support. *}
 
804
 
 
805
{ Begin a transparency layer.  All subsequent drawing operations until a
 
806
 * corresponding CGContextEndTransparencyLayer are composited into a fully
 
807
 * transparent backdrop (which is treated as a separate destination buffer
 
808
 * from the context); after a call to CGContextEndTransparencyLayer, the
 
809
 * result is composited into the context using the global alpha and shadow
 
810
 * state of the context.  This operation respects the clipping region of
 
811
 * the context.  After a call to this function, all of the parameters in
 
812
 * the graphics state remain unchanged with the exception of the following:
 
813
 *   The global alpha is set to 1.
 
814
 *   The shadow is turned off.
 
815
 * Ending the transparency layer restores these parameters to the values
 
816
 * they had before CGContextBeginTransparencyLayer was called.
 
817
 * Transparency layers may be nested. }
 
818
 
 
819
procedure CGContextBeginTransparencyLayer( context: CGContextRef; auxiliaryInfo: CFDictionaryRef ); external name '_CGContextBeginTransparencyLayer'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
820
 
 
821
{ End a tranparency layer. }
 
822
 
 
823
procedure CGContextEndTransparencyLayer( context: CGContextRef ); external name '_CGContextEndTransparencyLayer'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
824
 
 
825
{* User space to device space tranformations. *}
 
826
 
 
827
{ Return the affine transform mapping the user space (abstract
 
828
 * coordinates) of `context' to device space (pixels). }
 
829
 
 
830
function CGContextGetUserSpaceToDeviceSpaceTransform( c: CGContextRef ): CGAffineTransform; external name '_CGContextGetUserSpaceToDeviceSpaceTransform'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
831
 
 
832
{ Transform `point' from the user space of `context' to device space. }
 
833
 
 
834
function CGContextConvertPointToDeviceSpace( c: CGContextRef; point: CGPoint ): CGPoint; external name '_CGContextConvertPointToDeviceSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
835
 
 
836
{ Transform `point' from device space to the user space of `context'. }
 
837
 
 
838
function CGContextConvertPointToUserSpace( c: CGContextRef; point: CGPoint ): CGPoint; external name '_CGContextConvertPointToUserSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
839
 
 
840
{ Transform `size' from the user space of `context' to device space. }
 
841
 
 
842
function CGContextConvertSizeToDeviceSpace( c: CGContextRef; size: CGSize ): CGSize; external name '_CGContextConvertSizeToDeviceSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
843
 
 
844
{ Transform `size' from device space to the user space of `context'. }
 
845
 
 
846
function CGContextConvertSizeToUserSpace( c: CGContextRef; size: CGSize ): CGSize; external name '_CGContextConvertSizeToUserSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
847
 
 
848
{ Transform `rect' from the user space of `context' to device space. Since
 
849
 * affine transforms do not preserve rectangles in general, this function
 
850
 * returns the smallest rectangle which contains the transformed corner
 
851
 * points of `rect'. }
 
852
 
 
853
function CGContextConvertRectToDeviceSpace( c: CGContextRef; rect: CGRect ): CGRect; external name '_CGContextConvertRectToDeviceSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
854
 
 
855
{ Transform `rect' from device space to the user space of `context'. Since
 
856
 * affine transforms do not preserve rectangles in general, this function
 
857
 * returns the smallest rectangle which contains the transformed corner
 
858
 * points of `rect'. }
 
859
 
 
860
function CGContextConvertRectToUserSpace( c: CGContextRef; rect: CGRect ): CGRect; external name '_CGContextConvertRectToUserSpace'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
861
 
 
862
 
 
863
end.