1
{ CoreGraphics - CGPDFScanner.h
2
* Copyright (c) 2004 Apple Computer, Inc.
5
{ Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
7
Modified for use with Free Pascal
9
Please report any bugs to <gpc@microbizz.nl>
20
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
21
{$setc GAP_INTERFACES_VERSION := $0200}
23
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
24
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
27
{$ifc defined CPUPOWERPC and defined CPUI386}
28
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
30
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
31
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
34
{$ifc not defined __ppc__ and defined CPUPOWERPC}
39
{$ifc not defined __i386__ and defined CPUI386}
45
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
46
{$error Conflicting definitions for __ppc__ and __i386__}
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}
56
{$error Neither __ppc__ nor __i386__ is defined.}
58
{$setc TARGET_CPU_PPC_64 := FALSE}
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}
67
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
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,CGBase,CGPDFObject;
98
// CGPDFScannerRef defined in CGBase
101
{ Create a scanner. }
103
function CGPDFScannerCreate( cs: CGPDFContentStreamRef; table: CGPDFOperatorTableRef; info: UnivPtr ): CGPDFScannerRef; external name '_CGPDFScannerCreate'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
105
{ Retain `scanner'. }
107
function CGPDFScannerRetain( scanner: CGPDFScannerRef ): CGPDFScannerRef; external name '_CGPDFScannerRetain'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
109
{ Release `scanner'. }
111
procedure CGPDFScannerRelease( scanner: CGPDFScannerRef ); external name '_CGPDFScannerRelease'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
113
{ Scan the content stream of `scanner'. Returns true if the entire stream
114
* was scanned successfully; false if scanning failed for some reason (for
115
* example, if the stream's data is corrupted). }
117
function CGPDFScannerScan( scanner: CGPDFScannerRef ): CBool; external name '_CGPDFScannerScan'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
119
{ Return the content stream associated with `scanner'. }
121
function CGPDFScannerGetContentStream( scanner: CGPDFScannerRef ): CGPDFContentStreamRef; external name '_CGPDFScannerGetContentStream'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
123
{ Pop an object from the stack of `scanner' and return it in `value'. }
125
function CGPDFScannerPopObject( scanner: CGPDFScannerRef; var value: CGPDFObjectRef ): CBool; external name '_CGPDFScannerPopObject'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
127
{ Pop an object from the stack of `scanner' and, if it's a boolean, return
128
* it in `value'. Return false if the top of the stack isn't a boolean. }
130
function CGPDFScannerPopBoolean( scanner: CGPDFScannerRef; var value: CGPDFBoolean ): CBool; external name '_CGPDFScannerPopBoolean'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
132
{ Pop an object from the stack of `scanner' and, if it's an integer,
133
* return it in `value'. Return false if the top of the stack isn't an
136
function CGPDFScannerPopInteger( scanner: CGPDFScannerRef; var value: CGPDFInteger ): CBool; external name '_CGPDFScannerPopInteger'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
138
{ Pop an object from the stack of `scanner' and, if it's a number, return
139
* it in `value'. Return false if the top of the stack isn't a number. }
141
function CGPDFScannerPopNumber( scanner: CGPDFScannerRef; var value: CGPDFReal ): CBool; external name '_CGPDFScannerPopNumber'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
143
{ Pop an object from the stack of `scanner' and, if it's a name, return it
144
* in `value'. Return false if the top of the stack isn't a name. }
146
function CGPDFScannerPopName( scanner: CGPDFScannerRef; var value: ConstCStringPtr ): CBool; external name '_CGPDFScannerPopName'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
148
{ Pop an object from the stack of `scanner' and, if it's a string, return
149
* it in `value'. Return false if the top of the stack isn't a string. }
151
function CGPDFScannerPopString( scanner: CGPDFScannerRef; var value: CGPDFStringRef ): CBool; external name '_CGPDFScannerPopString'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
153
{ Pop an object from the stack of `scanner' and, if it's an array, return
154
* it in `value'. Return false if the top of the stack isn't an array. }
156
function CGPDFScannerPopArray( scanner: CGPDFScannerRef; var value: CGPDFArrayRef ): CBool; external name '_CGPDFScannerPopArray'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
158
{ Pop an object from the stack of `scanner' and, if it's a dictionary,
159
* return it in `value'. Return false if the top of the stack isn't a
162
function CGPDFScannerPopDictionary( scanner: CGPDFScannerRef; var value: CGPDFDictionaryRef ): CBool; external name '_CGPDFScannerPopDictionary'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
164
{ Pop an object from the stack of `scanner' and, if it's a stream, return
165
* it in `value'. Return false if the top of the stack isn't a stream. }
167
function CGPDFScannerPopStream( scanner: CGPDFScannerRef; var value: CGPDFStreamRef ): CBool; external name '_CGPDFScannerPopStream'; (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)