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

« back to all changes in this revision

Viewing changes to fpcsrc/packages/univint/src/CGPDFPage.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 - CGPDFPage.h
 
2
 * Copyright (c) 2001-2004 Apple Computer, Inc.
 
3
 * All rights reserved.
 
4
 }
 
5
{       Pascal Translation:  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 CGPDFPage;
 
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,CGAffineTransforms,CFBase,CGBase,CGPDFDocument,CGGeometry;
 
95
{$ALIGN POWER}
 
96
 
 
97
 
 
98
// CGPDFPageRef defined in CGBase
 
99
 
 
100
 
 
101
type
 
102
        CGPDFBox = SInt32;
 
103
const
 
104
        kCGPDFMediaBox = 0;
 
105
        kCGPDFCropBox = 1;
 
106
        kCGPDFBleedBox = 2;
 
107
        kCGPDFTrimBox = 3;
 
108
        kCGPDFArtBox = 4;
 
109
 
 
110
 
 
111
{ Equivalent to `CFRetain(page)', except it doesn't crash (as CFRetain
 
112
 * does) if `page' is NULL. }
 
113
 
 
114
function CGPDFPageRetain( page: CGPDFPageRef ): CGPDFPageRef; external name '_CGPDFPageRetain'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
115
 
 
116
{ Equivalent to `CFRelease(page)', except it doesn't crash (as CFRelease
 
117
 * does) if `page' is NULL. }
 
118
 
 
119
procedure CGPDFPageRelease( page: CGPDFPageRef ); external name '_CGPDFPageRelease'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
120
 
 
121
{ Return the document of `page'. }
 
122
 
 
123
function CGPDFPageGetDocument( page: CGPDFPageRef ): CGPDFDocumentRef; external name '_CGPDFPageGetDocument'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
124
 
 
125
{ Return the page number of `page'. }
 
126
 
 
127
function CGPDFPageGetPageNumber( page: CGPDFPageRef ): size_t; external name '_CGPDFPageGetPageNumber'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
128
 
 
129
{ Return the rectangle associated with `box' in `page'.  This is the value
 
130
 * of the corresponding entry (such as /MediaBox, /ArtBox, and so on) in
 
131
 * the page's dictionary. }
 
132
 
 
133
function CGPDFPageGetBoxRect( page: CGPDFPageRef; box: CGPDFBox ): CGRect; external name '_CGPDFPageGetBoxRect'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
134
 
 
135
{ Return the rotation angle (in degrees) of `page'.  This is the value of
 
136
 * the /Rotate entry in the page's dictionary. }
 
137
 
 
138
function CGPDFPageGetRotationAngle( page: CGPDFPageRef ): SInt32; external name '_CGPDFPageGetRotationAngle'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
139
 
 
140
{ Return a transform mapping the box specified by `box' to `rect' as
 
141
 * follows:
 
142
 *   - Compute the effective rect by intersecting the rect associated with
 
143
 *     `box' and the /MediaBox entry of the page.
 
144
 *   - Rotate the effective rect according to the page's /Rotate entry.
 
145
 *   - Center the resulting rect on `rect'.  If `rotation' is non-zero,
 
146
 *     then the rect will rotated clockwise by `rotation' degrees.
 
147
 *     `rotation' must be a multiple of 90.
 
148
 *   - Scale the rect down, if necessary, so that it coincides with the
 
149
 *     edges of `rect'.  If `preserveAspectRatio' is true, then the final
 
150
 *     rect will coincide with the edges of `rect' only in the more
 
151
 *     restrictive dimension. }
 
152
 
 
153
function CGPDFPageGetDrawingTransform( page: CGPDFPageRef; box: CGPDFBox; rect: CGRect; rotate: SInt32; preserveAspectRatio: CBool ): CGAffineTransform; external name '_CGPDFPageGetDrawingTransform'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
154
 
 
155
{ Return the dictionary of `page'. }
 
156
 
 
157
function CGPDFPageGetDictionary( page: CGPDFPageRef ): CGPDFDictionaryRef; external name '_CGPDFPageGetDictionary'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
158
 
 
159
{ Return the CFTypeID for CGPDFPageRefs. }
 
160
 
 
161
function CGPDFPageGetTypeID: CFTypeID; external name '_CGPDFPageGetTypeID'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
162
 
 
163
 
 
164
end.