PageRenderTime 11ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/univint/src/CGPDFOperatorTable.pas

https://github.com/slibre/freepascal
Pascal | 208 lines | 10 code | 26 blank | 172 comment | 0 complexity | 860e6dc779f7d418e9513b4c30f93982 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1{ CoreGraphics - CGPDFOperatorTable.h
  2 * Copyright (c) 2004-2008 Apple Inc.
  3 * All rights reserved. }
  4{       Pascal Translation:  Peter N Lewis, <peter@stairways.com.au>, August 2005 }
  5{       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2009 }
  6{       Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2012 }
  7{
  8    Modified for use with Free Pascal
  9    Version 308
 10    Please report any bugs to <gpc@microbizz.nl>
 11}
 12
 13{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 14{$mode macpas}
 15{$packenum 1}
 16{$macro on}
 17{$inline on}
 18{$calling mwpascal}
 19
 20unit CGPDFOperatorTable;
 21interface
 22{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
 23{$setc GAP_INTERFACES_VERSION := $0308}
 24
 25{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
 26    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
 27{$endc}
 28
 29{$ifc defined CPUPOWERPC and defined CPUI386}
 30	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
 31{$endc}
 32{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
 33	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 34{$endc}
 35
 36{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 37	{$setc __ppc__ := 1}
 38{$elsec}
 39	{$setc __ppc__ := 0}
 40{$endc}
 41{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
 42	{$setc __ppc64__ := 1}
 43{$elsec}
 44	{$setc __ppc64__ := 0}
 45{$endc}
 46{$ifc not defined __i386__ and defined CPUI386}
 47	{$setc __i386__ := 1}
 48{$elsec}
 49	{$setc __i386__ := 0}
 50{$endc}
 51{$ifc not defined __x86_64__ and defined CPUX86_64}
 52	{$setc __x86_64__ := 1}
 53{$elsec}
 54	{$setc __x86_64__ := 0}
 55{$endc}
 56{$ifc not defined __arm__ and defined CPUARM}
 57	{$setc __arm__ := 1}
 58{$elsec}
 59	{$setc __arm__ := 0}
 60{$endc}
 61
 62{$ifc defined cpu64}
 63  {$setc __LP64__ := 1}
 64{$elsec}
 65  {$setc __LP64__ := 0}
 66{$endc}
 67
 68
 69{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 70	{$error Conflicting definitions for __ppc__ and __i386__}
 71{$endc}
 72
 73{$ifc defined __ppc__ and __ppc__}
 74	{$setc TARGET_CPU_PPC := TRUE}
 75	{$setc TARGET_CPU_PPC64 := FALSE}
 76	{$setc TARGET_CPU_X86 := FALSE}
 77	{$setc TARGET_CPU_X86_64 := FALSE}
 78	{$setc TARGET_CPU_ARM := FALSE}
 79	{$setc TARGET_OS_MAC := TRUE}
 80	{$setc TARGET_OS_IPHONE := FALSE}
 81	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 82	{$setc TARGET_OS_EMBEDDED := FALSE}
 83{$elifc defined __ppc64__ and __ppc64__}
 84	{$setc TARGET_CPU_PPC := FALSE}
 85	{$setc TARGET_CPU_PPC64 := TRUE}
 86	{$setc TARGET_CPU_X86 := FALSE}
 87	{$setc TARGET_CPU_X86_64 := FALSE}
 88	{$setc TARGET_CPU_ARM := FALSE}
 89	{$setc TARGET_OS_MAC := TRUE}
 90	{$setc TARGET_OS_IPHONE := FALSE}
 91	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 92	{$setc TARGET_OS_EMBEDDED := FALSE}
 93{$elifc defined __i386__ and __i386__}
 94	{$setc TARGET_CPU_PPC := FALSE}
 95	{$setc TARGET_CPU_PPC64 := FALSE}
 96	{$setc TARGET_CPU_X86 := TRUE}
 97	{$setc TARGET_CPU_X86_64 := FALSE}
 98	{$setc TARGET_CPU_ARM := FALSE}
 99{$ifc defined(iphonesim)}
100 	{$setc TARGET_OS_MAC := FALSE}
101	{$setc TARGET_OS_IPHONE := TRUE}
102	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
103{$elsec}
104	{$setc TARGET_OS_MAC := TRUE}
105	{$setc TARGET_OS_IPHONE := FALSE}
106	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
107{$endc}
108	{$setc TARGET_OS_EMBEDDED := FALSE}
109{$elifc defined __x86_64__ and __x86_64__}
110	{$setc TARGET_CPU_PPC := FALSE}
111	{$setc TARGET_CPU_PPC64 := FALSE}
112	{$setc TARGET_CPU_X86 := FALSE}
113	{$setc TARGET_CPU_X86_64 := TRUE}
114	{$setc TARGET_CPU_ARM := FALSE}
115	{$setc TARGET_OS_MAC := TRUE}
116	{$setc TARGET_OS_IPHONE := FALSE}
117	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
118	{$setc TARGET_OS_EMBEDDED := FALSE}
119{$elifc defined __arm__ and __arm__}
120	{$setc TARGET_CPU_PPC := FALSE}
121	{$setc TARGET_CPU_PPC64 := FALSE}
122	{$setc TARGET_CPU_X86 := FALSE}
123	{$setc TARGET_CPU_X86_64 := FALSE}
124	{$setc TARGET_CPU_ARM := TRUE}
125	{ will require compiler define when/if other Apple devices with ARM cpus ship }
126	{$setc TARGET_OS_MAC := FALSE}
127	{$setc TARGET_OS_IPHONE := TRUE}
128	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
129	{$setc TARGET_OS_EMBEDDED := TRUE}
130{$elsec}
131	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
132{$endc}
133
134{$ifc defined __LP64__ and __LP64__ }
135  {$setc TARGET_CPU_64 := TRUE}
136{$elsec}
137  {$setc TARGET_CPU_64 := FALSE}
138{$endc}
139
140{$ifc defined FPC_BIG_ENDIAN}
141	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
142	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
143{$elifc defined FPC_LITTLE_ENDIAN}
144	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
145	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
146{$elsec}
147	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
148{$endc}
149{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
150{$setc CALL_NOT_IN_CARBON := FALSE}
151{$setc OLDROUTINENAMES := FALSE}
152{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
153{$setc OPAQUE_UPP_TYPES := TRUE}
154{$setc OTCARBONAPPLICATION := TRUE}
155{$setc OTKERNEL := FALSE}
156{$setc PM_USE_SESSION_APIS := TRUE}
157{$setc TARGET_API_MAC_CARBON := TRUE}
158{$setc TARGET_API_MAC_OS8 := FALSE}
159{$setc TARGET_API_MAC_OSX := TRUE}
160{$setc TARGET_CARBON := TRUE}
161{$setc TARGET_CPU_68K := FALSE}
162{$setc TARGET_CPU_MIPS := FALSE}
163{$setc TARGET_CPU_SPARC := FALSE}
164{$setc TARGET_OS_UNIX := FALSE}
165{$setc TARGET_OS_WIN32 := FALSE}
166{$setc TARGET_RT_MAC_68881 := FALSE}
167{$setc TARGET_RT_MAC_CFM := FALSE}
168{$setc TARGET_RT_MAC_MACHO := TRUE}
169{$setc TYPED_FUNCTION_POINTERS := TRUE}
170{$setc TYPE_BOOL := FALSE}
171{$setc TYPE_EXTENDED := FALSE}
172{$setc TYPE_LONGLONG := TRUE}
173uses MacTypes,CGBase;
174{$endc} {not MACOSALLINCLUDE}
175
176{$ALIGN POWER}
177
178
179// CGPDFOperatorTableRef defined in CGBase
180
181
182type
183	CGPDFOperatorCallback = procedure( scanner: CGPDFScannerRef; info: UnivPtr );
184
185{ Return an empty operator table. }
186
187function CGPDFOperatorTableCreate: CGPDFOperatorTableRef; external name '_CGPDFOperatorTableCreate';
188(* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
189
190{ Increment the retain count of `table'. }
191
192function CGPDFOperatorTableRetain( table: CGPDFOperatorTableRef ): CGPDFOperatorTableRef; external name '_CGPDFOperatorTableRetain';
193(* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
194
195{ Decrement the retain count of `table'. }
196
197procedure CGPDFOperatorTableRelease( table: CGPDFOperatorTableRef ); external name '_CGPDFOperatorTableRelease';
198(* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
199
200{ Set the callback for the operator named `name' to `callback' }
201
202procedure CGPDFOperatorTableSetCallback( table: CGPDFOperatorTableRef; name: ConstCStringPtr; callback: CGPDFOperatorCallback ); external name '_CGPDFOperatorTableSetCallback';
203(* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
204
205{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
206
207end.
208{$endc} {not MACOSALLINCLUDE}