PMCore.pas 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553
  1. {
  2. File: PrintCore/PMCore.h
  3. Contains: Carbon Printing Manager Interfaces.
  4. Copyright (c) 1998-2006,2008 Apple Inc. All Rights Reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://developer.apple.com/bugreporter/
  8. }
  9. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$modeswitch cblocks}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit PMCore;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  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. {$ifc not defined __arm64__ and defined CPUAARCH64}
  62. {$setc __arm64__ := 1}
  63. {$elsec}
  64. {$setc __arm64__ := 0}
  65. {$endc}
  66. {$ifc defined cpu64}
  67. {$setc __LP64__ := 1}
  68. {$elsec}
  69. {$setc __LP64__ := 0}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  72. {$error Conflicting definitions for __ppc__ and __i386__}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__}
  75. {$setc TARGET_CPU_PPC := TRUE}
  76. {$setc TARGET_CPU_PPC64 := FALSE}
  77. {$setc TARGET_CPU_X86 := FALSE}
  78. {$setc TARGET_CPU_X86_64 := FALSE}
  79. {$setc TARGET_CPU_ARM := FALSE}
  80. {$setc TARGET_CPU_ARM64 := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_IPHONE := FALSE}
  83. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  84. {$setc TARGET_OS_EMBEDDED := FALSE}
  85. {$elifc defined __ppc64__ and __ppc64__}
  86. {$setc TARGET_CPU_PPC := FALSE}
  87. {$setc TARGET_CPU_PPC64 := TRUE}
  88. {$setc TARGET_CPU_X86 := FALSE}
  89. {$setc TARGET_CPU_X86_64 := FALSE}
  90. {$setc TARGET_CPU_ARM := FALSE}
  91. {$setc TARGET_CPU_ARM64 := FALSE}
  92. {$setc TARGET_OS_MAC := TRUE}
  93. {$setc TARGET_OS_IPHONE := FALSE}
  94. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  95. {$setc TARGET_OS_EMBEDDED := FALSE}
  96. {$elifc defined __i386__ and __i386__}
  97. {$setc TARGET_CPU_PPC := FALSE}
  98. {$setc TARGET_CPU_PPC64 := FALSE}
  99. {$setc TARGET_CPU_X86 := TRUE}
  100. {$setc TARGET_CPU_X86_64 := FALSE}
  101. {$setc TARGET_CPU_ARM := FALSE}
  102. {$setc TARGET_CPU_ARM64 := FALSE}
  103. {$ifc defined(iphonesim)}
  104. {$setc TARGET_OS_MAC := FALSE}
  105. {$setc TARGET_OS_IPHONE := TRUE}
  106. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  107. {$elsec}
  108. {$setc TARGET_OS_MAC := TRUE}
  109. {$setc TARGET_OS_IPHONE := FALSE}
  110. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  111. {$endc}
  112. {$setc TARGET_OS_EMBEDDED := FALSE}
  113. {$elifc defined __x86_64__ and __x86_64__}
  114. {$setc TARGET_CPU_PPC := FALSE}
  115. {$setc TARGET_CPU_PPC64 := FALSE}
  116. {$setc TARGET_CPU_X86 := FALSE}
  117. {$setc TARGET_CPU_X86_64 := TRUE}
  118. {$setc TARGET_CPU_ARM := FALSE}
  119. {$setc TARGET_CPU_ARM64 := FALSE}
  120. {$ifc defined(iphonesim)}
  121. {$setc TARGET_OS_MAC := FALSE}
  122. {$setc TARGET_OS_IPHONE := TRUE}
  123. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  124. {$elsec}
  125. {$setc TARGET_OS_MAC := TRUE}
  126. {$setc TARGET_OS_IPHONE := FALSE}
  127. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  128. {$endc}
  129. {$setc TARGET_OS_EMBEDDED := FALSE}
  130. {$elifc defined __arm__ and __arm__}
  131. {$setc TARGET_CPU_PPC := FALSE}
  132. {$setc TARGET_CPU_PPC64 := FALSE}
  133. {$setc TARGET_CPU_X86 := FALSE}
  134. {$setc TARGET_CPU_X86_64 := FALSE}
  135. {$setc TARGET_CPU_ARM := TRUE}
  136. {$setc TARGET_CPU_ARM64 := FALSE}
  137. { will require compiler define when/if other Apple devices with ARM cpus ship }
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. { will require compiler define when/if other Apple devices with ARM cpus ship }
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  156. {$endc}
  157. {$ifc defined __LP64__ and __LP64__ }
  158. {$setc TARGET_CPU_64 := TRUE}
  159. {$elsec}
  160. {$setc TARGET_CPU_64 := FALSE}
  161. {$endc}
  162. {$ifc defined FPC_BIG_ENDIAN}
  163. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  164. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  165. {$elifc defined FPC_LITTLE_ENDIAN}
  166. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  167. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  168. {$elsec}
  169. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  170. {$endc}
  171. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  172. {$setc CALL_NOT_IN_CARBON := FALSE}
  173. {$setc OLDROUTINENAMES := FALSE}
  174. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  175. {$setc OPAQUE_UPP_TYPES := TRUE}
  176. {$setc OTCARBONAPPLICATION := TRUE}
  177. {$setc OTKERNEL := FALSE}
  178. {$setc PM_USE_SESSION_APIS := TRUE}
  179. {$setc TARGET_API_MAC_CARBON := TRUE}
  180. {$setc TARGET_API_MAC_OS8 := FALSE}
  181. {$setc TARGET_API_MAC_OSX := TRUE}
  182. {$setc TARGET_CARBON := TRUE}
  183. {$setc TARGET_CPU_68K := FALSE}
  184. {$setc TARGET_CPU_MIPS := FALSE}
  185. {$setc TARGET_CPU_SPARC := FALSE}
  186. {$setc TARGET_OS_UNIX := FALSE}
  187. {$setc TARGET_OS_WIN32 := FALSE}
  188. {$setc TARGET_RT_MAC_68881 := FALSE}
  189. {$setc TARGET_RT_MAC_CFM := FALSE}
  190. {$setc TARGET_RT_MAC_MACHO := TRUE}
  191. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  192. {$setc TYPE_BOOL := FALSE}
  193. {$setc TYPE_EXTENDED := FALSE}
  194. {$setc TYPE_LONGLONG := TRUE}
  195. uses MacTypes,CFBase,CFArray,MacErrors,Files,QuickdrawTypes,PMDefinitions,CFData,CFDictionary,CFString,CFURL,CGContext,CGDataProvider,CGImage;
  196. {$endc} {not MACOSALLINCLUDE}
  197. {$ifc TARGET_OS_MAC}
  198. {$ALIGN POWER}
  199. {$ifc PM_USE_SESSION_APIS}
  200. (*
  201. //#pragma /mark
  202. //#pragma /mark Retain/Release
  203. //#pragma /mark
  204. *)
  205. {
  206. * PMRetain()
  207. *
  208. * Summary:
  209. * Increases a printing objects refcount by 1.
  210. *
  211. * Discussion:
  212. * You should retain a printing object when you receive it from
  213. * elsewhere (that is, you did not create or copy it) and you want
  214. * it to persist. If you retain a printing object you are
  215. * responsible for releasing it.
  216. *
  217. * Parameters:
  218. *
  219. * object:
  220. * A Carbon Printing Manager object, such as a PMPrintSession
  221. * object, a PMPageFormat object, a PMPrintSettings object, or
  222. * PMPrinter object.
  223. *
  224. * Availability:
  225. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  226. * CarbonLib: in CarbonLib 1.1 and later
  227. * Non-Carbon CFM: not available
  228. *
  229. * Compatibility:
  230. * Not appropriate for CUPS filters, drivers, and backends.
  231. *
  232. }
  233. function PMRetain( objct: PMObject ): OSStatus; external name '_PMRetain';
  234. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  235. {
  236. * PMRelease()
  237. *
  238. * Summary:
  239. * Decreases a printing objects refcount by 1.
  240. *
  241. * Discussion:
  242. * Your application should use the PMRelease function to release any
  243. * printing objects it creates or retains. When an objectÕs
  244. * reference count reaches 0, the object is deallocated. To
  245. * terminate a printing session created with the function
  246. * PMCreateSession, pass the associated PMPrintSession object to
  247. * PMRelease. To release printing objects created with the functions
  248. * PMCreatePageFormat and PMCreatePrintSettings, pass the associated
  249. * PMPageFormat and PMPrintSettings objects to PMRelease. You can
  250. * pass a NULL object but be aware a kPMInvalidParameter error will
  251. * be returned.
  252. *
  253. * Parameters:
  254. *
  255. * object:
  256. * A Carbon Printing Manager object, such as a PMPrintSession
  257. * object, a PMPageFormat object, a PMPrintSettings object, or
  258. * PMPrinter object.
  259. *
  260. * Availability:
  261. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  262. * CarbonLib: in CarbonLib 1.1 and later
  263. * Non-Carbon CFM: not available
  264. *
  265. * Compatibility:
  266. * Not appropriate for CUPS filters, drivers, and backends.
  267. *
  268. }
  269. function PMRelease( objct: PMObject ): OSStatus; external name '_PMRelease';
  270. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  271. (*
  272. //#pragma /mark
  273. //#pragma /mark Session
  274. //#pragma /mark
  275. *)
  276. {
  277. * PMCreateSession()
  278. *
  279. * Summary:
  280. * Creates and initializes a printing session object and creates a
  281. * context for printing operations.
  282. *
  283. * Discussion:
  284. * A session is created with a refcount of 1.
  285. *
  286. * Availability:
  287. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  288. * CarbonLib: in CarbonLib 1.1 and later
  289. * Non-Carbon CFM: not available
  290. *
  291. * Compatibility:
  292. * Not appropriate for CUPS filters, drivers, and backends.
  293. *
  294. }
  295. function PMCreateSession( var printSession: PMPrintSession ): OSStatus; external name '_PMCreateSession';
  296. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  297. {
  298. * PMSessionError()
  299. *
  300. * Availability:
  301. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  302. * CarbonLib: in CarbonLib 1.1 and later
  303. * Non-Carbon CFM: not available
  304. *
  305. * Compatibility:
  306. * Not appropriate for CUPS filters, drivers, and backends.
  307. *
  308. }
  309. function PMSessionError( printSession: PMPrintSession ): OSStatus; external name '_PMSessionError';
  310. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  311. {
  312. * PMSessionSetError()
  313. *
  314. * Availability:
  315. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  316. * CarbonLib: in CarbonLib 1.1 and later
  317. * Non-Carbon CFM: not available
  318. *
  319. * Compatibility:
  320. * Not appropriate for CUPS filters, drivers, and backends.
  321. *
  322. }
  323. function PMSessionSetError( printSession: PMPrintSession; printError: OSStatus ): OSStatus; external name '_PMSessionSetError';
  324. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  325. (*
  326. //#pragma /mark
  327. //#pragma /mark Session: Printing Loop
  328. //#pragma /mark
  329. *)
  330. {
  331. * PMSessionBeginCGDocumentNoDialog()
  332. *
  333. * Summary:
  334. * Begin a new print job for client drawing to a CoreGraphics context.
  335. *
  336. * Discussion:
  337. * This is an updated version of the function
  338. * PMSessionBeginDocumentNoDialog. The functionality is identical to
  339. * PMSessionBeginDocumentNoDialog except that during a print job,
  340. * the caller cannot obtain a Quickdraw grafPort for the printing
  341. * context but can only obtain a Quartz graphics context
  342. * (CGContextRef). This function should be used in conjunction with
  343. * PMSessionGetCGGraphicsContext instead of
  344. * PMSessionGetGraphicsContext.
  345. *
  346. * Availability:
  347. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  348. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  349. * Non-Carbon CFM: not available
  350. *
  351. * Compatibility:
  352. * Not appropriate for CUPS filters, drivers, and backends.
  353. *
  354. }
  355. function PMSessionBeginCGDocumentNoDialog( printSession: PMPrintSession; printSettings: PMPrintSettings; pageFormat: PMPageFormat ): OSStatus; external name '_PMSessionBeginCGDocumentNoDialog';
  356. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  357. {
  358. * PMSessionEndDocumentNoDialog()
  359. *
  360. * Availability:
  361. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  362. * CarbonLib: in CarbonLib 1.6 and later
  363. * Non-Carbon CFM: not available
  364. *
  365. * Compatibility:
  366. * Not appropriate for CUPS filters, drivers, and backends.
  367. *
  368. }
  369. function PMSessionEndDocumentNoDialog( printSession: PMPrintSession ): OSStatus; external name '_PMSessionEndDocumentNoDialog';
  370. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  371. {
  372. * SPECIAL AVAILABILITY note: This routine is available in ApplicationsServices.framework in
  373. * Mac OS X version 10.0 and later. On Mac OS X it is available to CFM applications through CarbonLib
  374. * starting with Mac OS X version 10.2 and later.
  375. *
  376. * On Mac OS 8/9 using CarbonLib, this routine returns kPMNotImplemented
  377. }
  378. {
  379. * PMSessionBeginPageNoDialog()
  380. *
  381. * Availability:
  382. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  383. * CarbonLib: in CarbonLib 1.6 and later
  384. * Non-Carbon CFM: not available
  385. *
  386. * Compatibility:
  387. * Not appropriate for CUPS filters, drivers, and backends.
  388. *
  389. }
  390. function PMSessionBeginPageNoDialog( printSession: PMPrintSession; pageFormat: PMPageFormat; pageFrame: PMRectPtr ): OSStatus; external name '_PMSessionBeginPageNoDialog';
  391. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  392. {
  393. * SPECIAL AVAILABILITY note: This routine is available in ApplicationsServices.framework in
  394. * Mac OS X version 10.0 and later. On Mac OS X it is available to CFM applications through CarbonLib
  395. * starting with Mac OS X version 10.2 and later.
  396. *
  397. * On Mac OS 8/9 using CarbonLib, this routine returns kPMNotImplemented
  398. }
  399. {
  400. * PMSessionEndPageNoDialog()
  401. *
  402. * Availability:
  403. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  404. * CarbonLib: in CarbonLib 1.6 and later
  405. * Non-Carbon CFM: not available
  406. *
  407. * Compatibility:
  408. * Not appropriate for CUPS filters, drivers, and backends.
  409. *
  410. }
  411. function PMSessionEndPageNoDialog( printSession: PMPrintSession ): OSStatus; external name '_PMSessionEndPageNoDialog';
  412. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  413. {
  414. * PMSessionGetCGGraphicsContext()
  415. *
  416. * Summary:
  417. * Return the CGContextRef for the current page in the printing
  418. * session.
  419. *
  420. * Discussion:
  421. * This function returns the CGContextRef for the printing session.
  422. * This function must be called for each page. To use
  423. * PMSessionGetCGGraphicsContext you MUST call
  424. * PMSessionBeginCGDocument or PMSessionBeginCGDocumentNoDialog
  425. * instead of PMSessionBeginDocument or
  426. * PMSessionBeginDocumentNoDialog.
  427. *
  428. * Parameters:
  429. *
  430. * printSession:
  431. * The session for the print job.
  432. *
  433. * context:
  434. * A pointer to a caller supplied CGContextRef variable. If this
  435. * function succeeds then *context will be filled in with the
  436. * printing CGContextRef.
  437. *
  438. * Availability:
  439. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  440. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  441. * Non-Carbon CFM: not available
  442. *
  443. * Compatibility:
  444. * Not appropriate for CUPS filters, drivers, and backends.
  445. *
  446. }
  447. function PMSessionGetCGGraphicsContext( printSession: PMPrintSession; var context: CGContextRef ): OSStatus; external name '_PMSessionGetCGGraphicsContext';
  448. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  449. (*
  450. //#pragma /mark
  451. //#pragma /mark Session: Other routines
  452. //#pragma /mark -
  453. *)
  454. {
  455. * PMSessionGetDestinationType()
  456. *
  457. * Summary:
  458. * Hand back the destination type that will be used for a print job
  459. * with the specified print settings and print session.
  460. *
  461. * Discussion:
  462. * Currently there are five destination types:
  463. * kPMDestinationPrinter, kPMDestinationFile, kPMDestinationFax and
  464. * kPMDestinationPreview, and kPMDestinationProcessPDF.
  465. *
  466. * Parameters:
  467. *
  468. * printSession:
  469. * The session to be used for a print job. The session holds the
  470. * preview setting which can override the destination type in the
  471. * print settings.
  472. *
  473. * printSettings:
  474. * The print settings to be used for a print job. The print
  475. * settings specify whether a job will be directed toward a
  476. * printer or to file.
  477. *
  478. * destTypeP:
  479. * A pointer to a caller supplied PMDestinationType variable. If
  480. * this function succeeds then *'destTypeP' will be filled in with
  481. * the destination type for a print job that used the specified
  482. * session and print settings. If this function fails, then
  483. * *'destType' will be set to kPMDestinationInvalid.
  484. *
  485. * SPECIAL_AVAILABILITY_NOTE:
  486. * This routine is available in ApplicationsServices.framework in
  487. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  488. * CFM applications through CarbonLib starting with Mac OS X
  489. * version 10.2 and later.
  490. *
  491. * Availability:
  492. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  493. * CarbonLib: in CarbonLib 1.5 and later
  494. * Non-Carbon CFM: not available
  495. *
  496. * Compatibility:
  497. * Not appropriate for CUPS filters, drivers, and backends.
  498. *
  499. }
  500. function PMSessionGetDestinationType( printSession: PMPrintSession; printSettings: PMPrintSettings; var destTypeP: PMDestinationType ): OSStatus; external name '_PMSessionGetDestinationType';
  501. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  502. {
  503. * PMSessionCopyDestinationFormat()
  504. *
  505. * Summary:
  506. * Hand back the destination output MIME type associated with the
  507. * provided print session and print settings.
  508. *
  509. * Parameters:
  510. *
  511. * printSession:
  512. * A currently open print session.
  513. *
  514. * printSettings:
  515. * The print settings that are to be searched.
  516. *
  517. * destFormatP:
  518. * A pointer to a caller allocated CFStringRef variable. If this
  519. * routine returns noErr then *'destFormatP' will either be a copy
  520. * of a CFStringRef specifying the output format for the print
  521. * job, or NULL indicating that the default output format will be
  522. * used. If this function return an error, then *'destFormatP'
  523. * will be set to NULL.
  524. *
  525. * SPECIAL_AVAILABILITY_NOTE:
  526. * This routine is available in ApplicationsServices.framework in
  527. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  528. * CFM applications through CarbonLib starting with Mac OS X
  529. * version 10.2 and later.
  530. *
  531. * Availability:
  532. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  533. * CarbonLib: in CarbonLib 1.5 and later
  534. * Non-Carbon CFM: not available
  535. *
  536. * Compatibility:
  537. * Not appropriate for CUPS filters, drivers, and backends.
  538. *
  539. }
  540. function PMSessionCopyDestinationFormat( printSession: PMPrintSession; printSettings: PMPrintSettings; var destFormatP: CFStringRef ): OSStatus; external name '_PMSessionCopyDestinationFormat';
  541. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  542. {
  543. * PMSessionCopyDestinationLocation()
  544. *
  545. * Summary:
  546. * Hand back the URL destination location given a print session and
  547. * print settings.
  548. *
  549. * Discussion:
  550. * Some destination type support a destination location which
  551. * further defines where the output from a pritn job should be sent.
  552. * The kPMDestinationFile destiation type, for example, will use a
  553. * file URL to determine where a new file should be created.
  554. *
  555. * Parameters:
  556. *
  557. * printSession:
  558. * A currently open print session.
  559. *
  560. * printSettings:
  561. * The print settings that are to be searched.
  562. *
  563. * destLocationP:
  564. * A pointer to a caller allocated CFURLRef variable. If this
  565. * routine returns noErr then *'outputFileP' will either be NULL
  566. * indicating that the job is using the default destination
  567. * location for the current destination type or a copy of a
  568. * CFURLRef will be placed in *'destLocationP'. If this function
  569. * returns an error then 'destLocationP' will be set to NULL.
  570. *
  571. * SPECIAL_AVAILABILITY_NOTE:
  572. * This routine is available in ApplicationsServices.framework in
  573. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  574. * CFM applications through CarbonLib starting with Mac OS X
  575. * version 10.2 and later.
  576. *
  577. * Availability:
  578. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  579. * CarbonLib: in CarbonLib 1.5 and later
  580. * Non-Carbon CFM: not available
  581. *
  582. * Compatibility:
  583. * Not appropriate for CUPS filters, drivers, and backends.
  584. *
  585. }
  586. function PMSessionCopyDestinationLocation( printSession: PMPrintSession; printSettings: PMPrintSettings; var destLocationP: CFURLRef ): OSStatus; external name '_PMSessionCopyDestinationLocation';
  587. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  588. {
  589. * PMSessionSetDestination()
  590. *
  591. * Summary:
  592. * Alter a print session and print settings so that an associated
  593. * print job is sent to the provided destination type in the,
  594. * optional, MIME document format.
  595. *
  596. * Discussion:
  597. * This function is most useful when an application would like to
  598. * write its print output to disk without requiring user
  599. * interaction. The list of MIME types that can be sent to the
  600. * provided destination can be obtained from
  601. * PMSessionCopyOutputFormatList and one of these passed to this
  602. * function.
  603. *
  604. * Parameters:
  605. *
  606. * printSession:
  607. * The session to be used for a print job. The session holds the
  608. * preview setting which can override the destination type in the
  609. * print settings.
  610. *
  611. * printSettings:
  612. * The print settings to be used for a print job. The print
  613. * settings specify whether a job will be directed toward a
  614. * printer or to file. It also holds the requested MIME output
  615. * type.
  616. *
  617. * destType:
  618. * The destiation type for a print job associated with the
  619. * provided print session and print settings. Fax is currently not
  620. * supported, but kPMDestinationPrinter, kPMDestinationFile, and
  621. * kPMDestinationPreview can be set.
  622. *
  623. * destFormat:
  624. * The MIME type to be generated for the provided destination
  625. * type. This parameter can be NULL in which the default format
  626. * for the requested destination type is used. To obtain a list of
  627. * valid formats for a given destiation type, use the function
  628. * PMSessionCopyOutputFormatList.
  629. *
  630. * destLocation:
  631. * Some destination types support a destination location. The
  632. * clearest example is the kPMDestinationFile destination type
  633. * which allows a caller to also supply a file URL specifying
  634. * where the output file is to be created.
  635. *
  636. * SPECIAL_AVAILABILITY_NOTE:
  637. * This routine is available in ApplicationsServices.framework in
  638. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  639. * CFM applications through CarbonLib starting with Mac OS X
  640. * version 10.2 and later.
  641. *
  642. * Availability:
  643. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  644. * CarbonLib: in CarbonLib 1.5 and later
  645. * Non-Carbon CFM: not available
  646. *
  647. * Compatibility:
  648. * Not appropriate for CUPS filters, drivers, and backends.
  649. *
  650. }
  651. function PMSessionSetDestination( printSession: PMPrintSession; printSettings: PMPrintSettings; destType: PMDestinationType; destFormat: CFStringRef; destLocation: CFURLRef ): OSStatus; external name '_PMSessionSetDestination';
  652. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  653. {
  654. * PMSessionCopyOutputFormatList()
  655. *
  656. * Summary:
  657. * Hands back an an array of MIME types describing the possible
  658. * output formats for the printer module associated with the current
  659. * printer.
  660. *
  661. * Parameters:
  662. *
  663. * printSession:
  664. * This session's current printer's printer module will be queried
  665. * for its supported output MIME types.
  666. *
  667. * destType:
  668. * A print job can have one of several possible destination types.
  669. * The list of valid output formats is dependent upon the
  670. * destination type. This parameter specifies destination type of
  671. * interest when retrieving the output formats list.
  672. *
  673. * documentFormatP:
  674. * A pointer to a caller's CFArrayRef variable. If this routine
  675. * completes successfully, then *'documentFormatP' will be set to
  676. * a CFArrayRef containing CFStringRefs. Each CFStringRef in the
  677. * array is a MIME type specifying a type of output that can be
  678. * generated by the printer module associated with the current
  679. * printer.
  680. *
  681. * SPECIAL_AVAILABILITY_NOTE:
  682. * This routine is available in ApplicationsServices.framework in
  683. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  684. * CFM applications through CarbonLib starting with Mac OS X
  685. * version 10.2 and later. On Mac OS 8/9 using CarbonLib, this
  686. * routine returns kPMNotImplemented
  687. *
  688. * Availability:
  689. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  690. * CarbonLib: in CarbonLib 1.6 and later
  691. * Non-Carbon CFM: not available
  692. *
  693. * Compatibility:
  694. * Not appropriate for CUPS filters, drivers, and backends.
  695. *
  696. }
  697. function PMSessionCopyOutputFormatList( printSession: PMPrintSession; destType: PMDestinationType; var documentFormatP: CFArrayRef ): OSStatus; external name '_PMSessionCopyOutputFormatList';
  698. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  699. {
  700. * PMSessionCreatePageFormatList()
  701. *
  702. * Summary:
  703. * Hand back a list of page format instances. Each page format
  704. * instance describes a paper size available on the specified
  705. * printer.
  706. *
  707. * Parameters:
  708. *
  709. * printSession:
  710. * A currently valid print session.
  711. *
  712. * printer:
  713. * The printer whose page size list should be enumerated.
  714. *
  715. * pageFormatList:
  716. * If this function is successful then noErr will be returned and
  717. * *'pageFormatList' will be set to a newly created CFArray. Each
  718. * element in the array will be a PMPageFormat describing an
  719. * available paper size for the specified printer. If this
  720. * function fails then a non-zero error code will be returned and
  721. * *'pageFormatList' will be set to NULL.
  722. *
  723. * Discussion:
  724. * If you want to create the page format list for the session's current printer,
  725. * pass the PMPrinter object returned by PMSessionGetCurrentPrinter() as the
  726. * printer parameter.
  727. *
  728. * SPECIAL_AVAILABILITY_NOTE:
  729. * This routine is available in ApplicationsServices.framework in
  730. * Mac OS X version 10.1 and later. On Mac OS X it is available to
  731. * CFM applications through CarbonLib starting with Mac OS X
  732. * version 10.2 and later. On Mac OS 8/9 using CarbonLib, this
  733. * routine returns kPMNotImplemented
  734. *
  735. * Availability:
  736. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  737. * CarbonLib: in CarbonLib 1.6 and later
  738. * Non-Carbon CFM: not available
  739. *
  740. * Compatibility:
  741. * Not appropriate for CUPS filters, drivers, and backends.
  742. *
  743. }
  744. function PMSessionCreatePageFormatList( printSession: PMPrintSession; printer: PMPrinter; var pageFormatList: CFArrayRef ): OSStatus; external name '_PMSessionCreatePageFormatList';
  745. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  746. {
  747. * PMSessionCreatePrinterList()
  748. *
  749. * See also: PMServerCreatePrinterList.
  750. *
  751. * Availability:
  752. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  753. * CarbonLib: in CarbonLib 1.4 and later
  754. * Non-Carbon CFM: not available
  755. *
  756. * Compatibility:
  757. * Not appropriate for CUPS filters, drivers, and backends.
  758. *
  759. }
  760. function PMSessionCreatePrinterList( printSession: PMPrintSession; var printerList: CFArrayRef; var currentIndex: CFIndex; var currentPrinter: PMPrinter ): OSStatus; external name '_PMSessionCreatePrinterList';
  761. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  762. {
  763. * PMSessionGetCurrentPrinter()
  764. *
  765. * Summary:
  766. * Hand back the session's current printer.
  767. *
  768. * Availability:
  769. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  770. * CarbonLib: in CarbonLib 1.1 and later
  771. * Non-Carbon CFM: not available
  772. *
  773. * Compatibility:
  774. * Not appropriate for CUPS filters, drivers, and backends.
  775. *
  776. }
  777. function PMSessionGetCurrentPrinter( printSession: PMPrintSession; var currentPrinter: PMPrinter ): OSStatus; external name '_PMSessionGetCurrentPrinter';
  778. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  779. {
  780. * PMSessionSetCurrentPMPrinter()
  781. *
  782. * Summary:
  783. * Set the session's current printer to a specified PMPrinter.
  784. *
  785. * Availability:
  786. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  787. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  788. * Non-Carbon CFM: not available
  789. *
  790. * Compatibility:
  791. * Not appropriate for CUPS filters, drivers, and backends.
  792. *
  793. }
  794. function PMSessionSetCurrentPMPrinter( session: PMPrintSession; printer: PMPrinter ): OSStatus; external name '_PMSessionSetCurrentPMPrinter';
  795. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  796. {
  797. * PMSessionGetDataFromSession()
  798. *
  799. * Availability:
  800. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  801. * CarbonLib: in CarbonLib 1.1 and later
  802. * Non-Carbon CFM: not available
  803. *
  804. * Compatibility:
  805. * Not appropriate for CUPS filters, drivers, and backends.
  806. *
  807. }
  808. function PMSessionGetDataFromSession( printSession: PMPrintSession; key: CFStringRef; var data: CFTypeRef ): OSStatus; external name '_PMSessionGetDataFromSession';
  809. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  810. {
  811. * PMSessionSetDataInSession()
  812. *
  813. * Availability:
  814. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  815. * CarbonLib: in CarbonLib 1.1 and later
  816. * Non-Carbon CFM: not available
  817. *
  818. * Compatibility:
  819. * Not appropriate for CUPS filters, drivers, and backends.
  820. *
  821. }
  822. function PMSessionSetDataInSession( printSession: PMPrintSession; key: CFStringRef; data: CFTypeRef ): OSStatus; external name '_PMSessionSetDataInSession';
  823. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  824. (*
  825. //#pragma /mark -
  826. //#pragma /mark PageFormat
  827. //#pragma /mark
  828. *)
  829. {
  830. * PMCreatePageFormat()
  831. *
  832. * Summary:
  833. * Allocates memory for a new PMPageFormat object in your
  834. * applicationÕs memory space.
  835. *
  836. * Discussion:
  837. * A pageformat is created with a refcount of 1.
  838. *
  839. * Availability:
  840. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  841. * CarbonLib: in CarbonLib 1.1 and later
  842. * Non-Carbon CFM: not available
  843. *
  844. * Compatibility:
  845. * Not appropriate for CUPS filters, drivers, and backends.
  846. *
  847. }
  848. function PMCreatePageFormat( var pageFormat: PMPageFormat ): OSStatus; external name '_PMCreatePageFormat';
  849. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  850. {
  851. * PMSessionDefaultPageFormat()
  852. *
  853. * Availability:
  854. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  855. * CarbonLib: in CarbonLib 1.1 and later
  856. * Non-Carbon CFM: not available
  857. *
  858. * Compatibility:
  859. * Not appropriate for CUPS filters, drivers, and backends.
  860. *
  861. }
  862. function PMSessionDefaultPageFormat( printSession: PMPrintSession; pageFormat: PMPageFormat ): OSStatus; external name '_PMSessionDefaultPageFormat';
  863. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  864. {
  865. * PMSessionValidatePageFormat()
  866. *
  867. * Availability:
  868. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  869. * CarbonLib: in CarbonLib 1.1 and later
  870. * Non-Carbon CFM: not available
  871. *
  872. * Compatibility:
  873. * Not appropriate for CUPS filters, drivers, and backends.
  874. *
  875. }
  876. function PMSessionValidatePageFormat( printSession: PMPrintSession; pageFormat: PMPageFormat; result: BooleanPtr ): OSStatus; external name '_PMSessionValidatePageFormat';
  877. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  878. {$endc} {PM_USE_SESSION_APIS}
  879. {
  880. * PMCopyPageFormat()
  881. *
  882. * Availability:
  883. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  884. * CarbonLib: in CarbonLib 1.0 and later
  885. * Non-Carbon CFM: not available
  886. *
  887. * Compatibility:
  888. * Not appropriate for CUPS filters, drivers, and backends.
  889. *
  890. }
  891. function PMCopyPageFormat( formatSrc: PMPageFormat; formatDest: PMPageFormat ): OSStatus; external name '_PMCopyPageFormat';
  892. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  893. {
  894. * PMCreatePageFormatWithPMPaper()
  895. *
  896. * Summary:
  897. * Create a pageformat with a specific paper.
  898. *
  899. * Parameters:
  900. *
  901. * pageFormat:
  902. * On return, will contain the pageformat which was created
  903. *
  904. * paper:
  905. * The paper that will be associate with the pageformat
  906. *
  907. * Availability:
  908. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  909. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  910. * Non-Carbon CFM: not available
  911. *
  912. * Compatibility:
  913. * Not appropriate for CUPS filters, drivers, and backends.
  914. *
  915. }
  916. function PMCreatePageFormatWithPMPaper( var pageFormat: PMPageFormat; paper: PMPaper ): OSStatus; external name '_PMCreatePageFormatWithPMPaper';
  917. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  918. {
  919. * PMPageFormatCreateDataRepresentation()
  920. *
  921. * Summary:
  922. * Returns a data representation of a PMPageFormat object as a CFDataRef.
  923. * The caller is responsible for releasing the CFData object returned.
  924. *
  925. * Discussion:
  926. * This function is similar to PMFlattenPageFormatToCFData but allows you
  927. * to specify the format of the data that is returned. Use
  928. * PMPageFormatCreateWithDataRepresentation to create a PMPageFormat from
  929. * a CFDataRef created by this call.
  930. *
  931. * See PMDataFormat for information about the available data formats.
  932. *
  933. * Availability:
  934. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  935. * CarbonLib: not available
  936. * Non-Carbon CFM: not available
  937. *
  938. * Compatibility:
  939. * Not appropriate for CUPS filters, drivers, and backends.
  940. *
  941. }
  942. function PMPageFormatCreateDataRepresentation( pageFormat: PMPageFormat; var data: CFDataRef; format: PMDataFormat ): OSStatus; external name '_PMPageFormatCreateDataRepresentation';
  943. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  944. {
  945. * PMPageFormatCreateWithDataRepresentation()
  946. *
  947. * Summary:
  948. * Creates a PMPageFormat object from a data representation created with
  949. * PMPageFormatCreateDataRepresentation. The caller is responsible
  950. * for releasing the PMPrintSettings object returned with PMRelease.
  951. *
  952. * Availability:
  953. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  954. * CarbonLib: not available
  955. * Non-Carbon CFM: not available
  956. *
  957. * Compatibility:
  958. * Not appropriate for CUPS filters, drivers, and backends.
  959. *
  960. }
  961. function PMPageFormatCreateWithDataRepresentation( data: CFDataRef; var pageFormat: PMPageFormat ): OSStatus; external name '_PMPageFormatCreateWithDataRepresentation';
  962. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  963. {
  964. * PMGetAdjustedPageRect()
  965. *
  966. * Availability:
  967. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  968. * CarbonLib: in CarbonLib 1.0 and later
  969. * Non-Carbon CFM: not available
  970. *
  971. * Compatibility:
  972. * Not appropriate for CUPS filters, drivers, and backends.
  973. *
  974. }
  975. function PMGetAdjustedPageRect( pageFormat: PMPageFormat; var pageRect: PMRect ): OSStatus; external name '_PMGetAdjustedPageRect';
  976. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  977. {
  978. * PMGetAdjustedPaperRect()
  979. *
  980. * Availability:
  981. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  982. * CarbonLib: in CarbonLib 1.0 and later
  983. * Non-Carbon CFM: not available
  984. *
  985. * Compatibility:
  986. * Not appropriate for CUPS filters, drivers, and backends.
  987. *
  988. }
  989. function PMGetAdjustedPaperRect( pageFormat: PMPageFormat; var paperRect: PMRect ): OSStatus; external name '_PMGetAdjustedPaperRect';
  990. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  991. {
  992. * PMGetOrientation()
  993. *
  994. * Availability:
  995. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  996. * CarbonLib: in CarbonLib 1.0 and later
  997. * Non-Carbon CFM: not available
  998. *
  999. * Compatibility:
  1000. * Not appropriate for CUPS filters, drivers, and backends.
  1001. *
  1002. }
  1003. function PMGetOrientation( pageFormat: PMPageFormat; var orientation: PMOrientation ): OSStatus; external name '_PMGetOrientation';
  1004. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1005. {
  1006. * PMGetPageFormatExtendedData()
  1007. *
  1008. * Availability:
  1009. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1010. * CarbonLib: in CarbonLib 1.0 and later
  1011. * Non-Carbon CFM: not available
  1012. *
  1013. * Compatibility:
  1014. * Not appropriate for CUPS filters, drivers, and backends.
  1015. *
  1016. }
  1017. function PMGetPageFormatExtendedData( pageFormat: PMPageFormat; dataID: OSType; var size: UInt32; extendedData: UnivPtr ): OSStatus; external name '_PMGetPageFormatExtendedData';
  1018. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1019. {
  1020. * PMPageFormatGetPrinterID()
  1021. *
  1022. * Summary:
  1023. * Obtains the formatting printer for the pageformat.
  1024. *
  1025. * Discussion:
  1026. * Will either return the formatting printer for the pageformat
  1027. * or will return NULL if the pageformat doesn't have that information.
  1028. *
  1029. * Parameters:
  1030. *
  1031. * pageFormat:
  1032. * The pageformat to obtain the information from.
  1033. *
  1034. * printerID:
  1035. * Where to store the name of the printer
  1036. *
  1037. * Availability:
  1038. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1039. * CarbonLib: not available
  1040. * Non-Carbon CFM: not available
  1041. *
  1042. * Compatibility:
  1043. * Not appropriate for CUPS filters, drivers, and backends.
  1044. *
  1045. }
  1046. function PMPageFormatGetPrinterID( pageFormat: PMPageFormat; var printerID: CFStringRef ): OSStatus; external name '_PMPageFormatGetPrinterID';
  1047. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1048. {
  1049. * PMGetScale()
  1050. *
  1051. * Summary:
  1052. * Obtains the scaling factor currently applied to the page and
  1053. * paper rectangles.
  1054. *
  1055. * Discussion:
  1056. * A value of 100.0 means 100% (no scaling). 50.0 means 50% scaling
  1057. *
  1058. * Availability:
  1059. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1060. * CarbonLib: in CarbonLib 1.0 and later
  1061. * Non-Carbon CFM: not available
  1062. *
  1063. * Compatibility:
  1064. * Not appropriate for CUPS filters, drivers, and backends.
  1065. *
  1066. }
  1067. function PMGetScale( pageFormat: PMPageFormat; var scale: Float64 ): OSStatus; external name '_PMGetScale';
  1068. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1069. {
  1070. * PMGetUnadjustedPageRect()
  1071. *
  1072. * Summary:
  1073. * Obtains the size of the imageable area in points, unaffected by
  1074. * orientation, resolution, or scaling.
  1075. *
  1076. * Discussion:
  1077. * This is the imageable area of the page without regard to
  1078. * resolution, orientation or scaling. Dimensions are returned as a 72dpi
  1079. * values.
  1080. *
  1081. * Availability:
  1082. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1083. * CarbonLib: in CarbonLib 1.1 and later
  1084. * Non-Carbon CFM: not available
  1085. *
  1086. * Compatibility:
  1087. * Not appropriate for CUPS filters, drivers, and backends.
  1088. *
  1089. }
  1090. function PMGetUnadjustedPageRect( pageFormat: PMPageFormat; var pageRect: PMRect ): OSStatus; external name '_PMGetUnadjustedPageRect';
  1091. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1092. {
  1093. * PMGetUnadjustedPaperRect()
  1094. *
  1095. * Summary:
  1096. * Obtains a rectangle that specifies the size of the paper in
  1097. * points, unaffected by rotation, resolution, or scaling.
  1098. *
  1099. * Discussion:
  1100. * This is the physical size of the paper without regard to
  1101. * resolution, orientation or scaling. Dimensions are returned as a 72dpi
  1102. * values.
  1103. *
  1104. * Availability:
  1105. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1106. * CarbonLib: in CarbonLib 1.1 and later
  1107. * Non-Carbon CFM: not available
  1108. *
  1109. * Compatibility:
  1110. * Not appropriate for CUPS filters, drivers, and backends.
  1111. *
  1112. }
  1113. function PMGetUnadjustedPaperRect( pageFormat: PMPageFormat; var paperRect: PMRect ): OSStatus; external name '_PMGetUnadjustedPaperRect';
  1114. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1115. {**********************}
  1116. { PMSetxxx calls only save the value inside the printing object. They make no assumption on the }
  1117. { validity of the value. This should be done using PMValidatePageFormat/PMSessionValidatePageFormat }
  1118. { Any dependent settings are also updated during a validate call. }
  1119. { For example: }
  1120. { PMGetAdjustedPaperRect - returns a rect of a certain size }
  1121. { PMSetScale( aPageFormat, 500.0 ) }
  1122. { PMGetAdjustedPaperRect - returns the SAME rect as the first call }
  1123. { PMGetAdjustedPaperRect - returns a rect of a certain size }
  1124. { PMSetScale( aPageFormat, 500.0 ) }
  1125. { PMValidatePageFormat or PMSessionValidatePageFormat }
  1126. { PMGetAdjustedPaperRect - returns a rect thats scaled 500% from the first call }
  1127. {**********************}
  1128. {
  1129. * PMSetOrientation()
  1130. *
  1131. * Availability:
  1132. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1133. * CarbonLib: in CarbonLib 1.0 and later
  1134. * Non-Carbon CFM: not available
  1135. *
  1136. * Compatibility:
  1137. * Not appropriate for CUPS filters, drivers, and backends.
  1138. *
  1139. }
  1140. function PMSetOrientation( pageFormat: PMPageFormat; orientation: PMOrientation; lock: Boolean ): OSStatus; external name '_PMSetOrientation';
  1141. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1142. {
  1143. * PMSetPageFormatExtendedData()
  1144. *
  1145. * Availability:
  1146. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1147. * CarbonLib: in CarbonLib 1.0 and later
  1148. * Non-Carbon CFM: not available
  1149. *
  1150. * Compatibility:
  1151. * Not appropriate for CUPS filters, drivers, and backends.
  1152. *
  1153. }
  1154. function PMSetPageFormatExtendedData( pageFormat: PMPageFormat; dataID: OSType; size: UInt32; extendedData: UnivPtr ): OSStatus; external name '_PMSetPageFormatExtendedData';
  1155. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1156. {
  1157. * PMSetScale()
  1158. *
  1159. * Availability:
  1160. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1161. * CarbonLib: in CarbonLib 1.0 and later
  1162. * Non-Carbon CFM: not available
  1163. *
  1164. * Compatibility:
  1165. * Not appropriate for CUPS filters, drivers, and backends.
  1166. *
  1167. }
  1168. function PMSetScale( pageFormat: PMPageFormat; scale: Float64 ): OSStatus; external name '_PMSetScale';
  1169. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1170. (*
  1171. //#pragma /mark -
  1172. //#pragma /mark PrintSettings
  1173. //#pragma /mark
  1174. *)
  1175. {$ifc PM_USE_SESSION_APIS}
  1176. {
  1177. * PMCreatePrintSettings()
  1178. *
  1179. * Summary:
  1180. * Allocates memory for a new PMPrintSettings object in your
  1181. * applicationÕs memory space.
  1182. *
  1183. * Discussion:
  1184. * A printSettings is created with a refcount of 1.
  1185. *
  1186. * Availability:
  1187. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1188. * CarbonLib: in CarbonLib 1.1 and later
  1189. * Non-Carbon CFM: not available
  1190. *
  1191. * Compatibility:
  1192. * Not appropriate for CUPS filters, drivers, and backends.
  1193. *
  1194. }
  1195. function PMCreatePrintSettings( var printSettings: PMPrintSettings ): OSStatus; external name '_PMCreatePrintSettings';
  1196. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1197. {
  1198. * PMSessionDefaultPrintSettings()
  1199. *
  1200. * Availability:
  1201. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1202. * CarbonLib: in CarbonLib 1.1 and later
  1203. * Non-Carbon CFM: not available
  1204. *
  1205. * Compatibility:
  1206. * Not appropriate for CUPS filters, drivers, and backends.
  1207. *
  1208. }
  1209. function PMSessionDefaultPrintSettings( printSession: PMPrintSession; printSettings: PMPrintSettings ): OSStatus; external name '_PMSessionDefaultPrintSettings';
  1210. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1211. {
  1212. * PMSessionValidatePrintSettings()
  1213. *
  1214. * Availability:
  1215. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1216. * CarbonLib: in CarbonLib 1.1 and later
  1217. * Non-Carbon CFM: not available
  1218. *
  1219. * Compatibility:
  1220. * Not appropriate for CUPS filters, drivers, and backends.
  1221. *
  1222. }
  1223. function PMSessionValidatePrintSettings( printSession: PMPrintSession; printSettings: PMPrintSettings; result: BooleanPtr ): OSStatus; external name '_PMSessionValidatePrintSettings';
  1224. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1225. {$endc} {PM_USE_SESSION_APIS}
  1226. {
  1227. * PMCopyPrintSettings()
  1228. *
  1229. * Availability:
  1230. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1231. * CarbonLib: in CarbonLib 1.0 and later
  1232. * Non-Carbon CFM: not available
  1233. *
  1234. * Compatibility:
  1235. * Not appropriate for CUPS filters, drivers, and backends.
  1236. *
  1237. }
  1238. function PMCopyPrintSettings( settingSrc: PMPrintSettings; settingDest: PMPrintSettings ): OSStatus; external name '_PMCopyPrintSettings';
  1239. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1240. {
  1241. * PMPrintSettingsCreateDataRepresentation()
  1242. *
  1243. * Summary:
  1244. * Returns a data representation of a PMPrintSettings object as a CFDataRef.
  1245. * The caller is responsible for releasing the CFData object returned.
  1246. *
  1247. * Discussion:
  1248. * This function is similar to PMFlattenPrintSettingsToCFData but allows you
  1249. * to specify the format of the data that is returned. Use
  1250. * PMPrintSettingsCreateWithDataRepresentation to create a PMPrintSettings from
  1251. * a CFDataRef created by this call.
  1252. *
  1253. * See PMDataFormat for information about the available data formats.
  1254. *
  1255. * Availability:
  1256. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1257. * CarbonLib: not available
  1258. * Non-Carbon CFM: not available
  1259. *
  1260. * Compatibility:
  1261. * Not appropriate for CUPS filters, drivers, and backends.
  1262. *
  1263. }
  1264. function PMPrintSettingsCreateDataRepresentation( printSettings: PMPrintSettings; var data: CFDataRef; format: PMDataFormat ): OSStatus; external name '_PMPrintSettingsCreateDataRepresentation';
  1265. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1266. {
  1267. * PMPrintSettingsCreateWithDataRepresentation()
  1268. *
  1269. * Summary:
  1270. * Creates a PMPrintSettings object from a data representation created with
  1271. * PMPrintSettingsCreateDataRepresentation. The caller is responsible
  1272. * for releasing the PMPrintSettings object returned with PMRelease.
  1273. *
  1274. *
  1275. * Availability:
  1276. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1277. * CarbonLib: not available
  1278. * Non-Carbon CFM: not available
  1279. *
  1280. * Compatibility:
  1281. * Not appropriate for CUPS filters, drivers, and backends.
  1282. *
  1283. }
  1284. function PMPrintSettingsCreateWithDataRepresentation( data: CFDataRef; var printSettings: PMPrintSettings ): OSStatus; external name '_PMPrintSettingsCreateWithDataRepresentation';
  1285. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1286. {
  1287. * PMGetCollate()
  1288. *
  1289. * Availability:
  1290. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1291. * CarbonLib: in CarbonLib 1.6 and later
  1292. * Non-Carbon CFM: not available
  1293. *
  1294. * Compatibility:
  1295. * Not appropriate for CUPS filters, drivers, and backends.
  1296. *
  1297. }
  1298. function PMGetCollate( printSettings: PMPrintSettings; var collate: Boolean ): OSStatus; external name '_PMGetCollate';
  1299. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1300. {
  1301. * PMGetCopies()
  1302. *
  1303. * Availability:
  1304. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1305. * CarbonLib: in CarbonLib 1.0 and later
  1306. * Non-Carbon CFM: not available
  1307. *
  1308. * Compatibility:
  1309. * Not appropriate for CUPS filters, drivers, and backends.
  1310. *
  1311. }
  1312. function PMGetCopies( printSettings: PMPrintSettings; var copies: UInt32 ): OSStatus; external name '_PMGetCopies';
  1313. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1314. {
  1315. * PMGetDuplex()
  1316. *
  1317. * Availability:
  1318. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1319. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1320. * Non-Carbon CFM: not available
  1321. *
  1322. * Compatibility:
  1323. * Not appropriate for CUPS filters, drivers, and backends.
  1324. *
  1325. }
  1326. function PMGetDuplex( printSettings: PMPrintSettings; var duplexSetting: PMDuplexMode ): OSStatus; external name '_PMGetDuplex';
  1327. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1328. {
  1329. * PMGetFirstPage()
  1330. *
  1331. * Availability:
  1332. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1333. * CarbonLib: in CarbonLib 1.0 and later
  1334. * Non-Carbon CFM: not available
  1335. *
  1336. * Compatibility:
  1337. * Not appropriate for CUPS filters, drivers, and backends.
  1338. *
  1339. }
  1340. function PMGetFirstPage( printSettings: PMPrintSettings; var first: UInt32 ): OSStatus; external name '_PMGetFirstPage';
  1341. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1342. {
  1343. * PMGetLastPage()
  1344. *
  1345. * Availability:
  1346. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1347. * CarbonLib: in CarbonLib 1.0 and later
  1348. * Non-Carbon CFM: not available
  1349. *
  1350. * Compatibility:
  1351. * Not appropriate for CUPS filters, drivers, and backends.
  1352. *
  1353. }
  1354. function PMGetLastPage( printSettings: PMPrintSettings; var last: UInt32 ): OSStatus; external name '_PMGetLastPage';
  1355. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1356. {
  1357. * PMGetPageRange()
  1358. *
  1359. * Summary:
  1360. * Obtains the valid range of pages that can be printed.
  1361. *
  1362. * Discussion:
  1363. * The default page range is 1 - (all pages). The page range is
  1364. * something that is set by the application. It is NOT the first and
  1365. * last page to print. It serves as limits for setting the first and
  1366. * last page.
  1367. *
  1368. * Availability:
  1369. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1370. * CarbonLib: in CarbonLib 1.0 and later
  1371. * Non-Carbon CFM: not available
  1372. *
  1373. * Compatibility:
  1374. * Not appropriate for CUPS filters, drivers, and backends.
  1375. *
  1376. }
  1377. function PMGetPageRange( printSettings: PMPrintSettings; var minPage: UInt32; var maxPage: UInt32 ): OSStatus; external name '_PMGetPageRange';
  1378. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1379. {
  1380. * PMPrintSettingsGetJobName()
  1381. *
  1382. * Availability:
  1383. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1384. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1385. * Non-Carbon CFM: not available
  1386. *
  1387. * Compatibility:
  1388. * Not appropriate for CUPS filters, drivers, and backends.
  1389. *
  1390. }
  1391. function PMPrintSettingsGetJobName( printSettings: PMPrintSettings; var name: CFStringRef ): OSStatus; external name '_PMPrintSettingsGetJobName';
  1392. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1393. {
  1394. * PMPrintSettingsGetValue()
  1395. *
  1396. * Parameters:
  1397. *
  1398. * printSettings:
  1399. * The printsettings to retrieve the value from
  1400. *
  1401. * key:
  1402. * The key to look for
  1403. *
  1404. * value:
  1405. * The return value. Its either the value for the key or NULL
  1406. *
  1407. * Availability:
  1408. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1409. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1410. * Non-Carbon CFM: not available
  1411. *
  1412. * Compatibility:
  1413. * Not appropriate for CUPS filters, drivers, and backends.
  1414. *
  1415. }
  1416. function PMPrintSettingsGetValue( printSettings: PMPrintSettings; key: CFStringRef; var value: CFTypeRef ): OSStatus; external name '_PMPrintSettingsGetValue';
  1417. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1418. {
  1419. * PMSetCollate()
  1420. *
  1421. * Availability:
  1422. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1423. * CarbonLib: in CarbonLib 1.6 and later
  1424. * Non-Carbon CFM: not available
  1425. *
  1426. * Compatibility:
  1427. * Not appropriate for CUPS filters, drivers, and backends.
  1428. *
  1429. }
  1430. function PMSetCollate( printSettings: PMPrintSettings; collate: Boolean ): OSStatus; external name '_PMSetCollate';
  1431. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1432. {
  1433. * PMSetCopies()
  1434. *
  1435. * Availability:
  1436. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1437. * CarbonLib: in CarbonLib 1.0 and later
  1438. * Non-Carbon CFM: not available
  1439. *
  1440. * Compatibility:
  1441. * Not appropriate for CUPS filters, drivers, and backends.
  1442. *
  1443. }
  1444. function PMSetCopies( printSettings: PMPrintSettings; copies: UInt32; lock: Boolean ): OSStatus; external name '_PMSetCopies';
  1445. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1446. {
  1447. * PMSetDuplex()
  1448. *
  1449. * Availability:
  1450. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1451. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1452. * Non-Carbon CFM: not available
  1453. *
  1454. * Compatibility:
  1455. * Not appropriate for CUPS filters, drivers, and backends.
  1456. *
  1457. }
  1458. function PMSetDuplex( printSettings: PMPrintSettings; duplexSetting: PMDuplexMode ): OSStatus; external name '_PMSetDuplex';
  1459. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1460. {
  1461. * PMSetFirstPage()
  1462. *
  1463. * Availability:
  1464. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1465. * CarbonLib: in CarbonLib 1.0 and later
  1466. * Non-Carbon CFM: not available
  1467. *
  1468. * Compatibility:
  1469. * Not appropriate for CUPS filters, drivers, and backends.
  1470. *
  1471. }
  1472. function PMSetFirstPage( printSettings: PMPrintSettings; first: UInt32; lock: Boolean ): OSStatus; external name '_PMSetFirstPage';
  1473. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1474. {
  1475. * PMSetLastPage()
  1476. *
  1477. * Availability:
  1478. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1479. * CarbonLib: in CarbonLib 1.0 and later
  1480. * Non-Carbon CFM: not available
  1481. *
  1482. * Compatibility:
  1483. * Not appropriate for CUPS filters, drivers, and backends.
  1484. *
  1485. }
  1486. function PMSetLastPage( printSettings: PMPrintSettings; last: UInt32; lock: Boolean ): OSStatus; external name '_PMSetLastPage';
  1487. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1488. {
  1489. * PMSetPageRange()
  1490. *
  1491. * Summary:
  1492. * Sets the valid range of pages that can be printed.
  1493. *
  1494. * Discussion:
  1495. * The first and last page are immediately clipped to the new range.
  1496. * You may pass kPMPrintAllPages for the maxPage value to specified
  1497. * that all pages are available for printing.
  1498. *
  1499. * Availability:
  1500. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1501. * CarbonLib: in CarbonLib 1.0 and later
  1502. * Non-Carbon CFM: not available
  1503. *
  1504. * Compatibility:
  1505. * Not appropriate for CUPS filters, drivers, and backends.
  1506. *
  1507. }
  1508. function PMSetPageRange( printSettings: PMPrintSettings; minPage: UInt32; maxPage: UInt32 ): OSStatus; external name '_PMSetPageRange';
  1509. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1510. {
  1511. * PMPrintSettingsSetJobName()
  1512. *
  1513. * Availability:
  1514. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1515. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1516. * Non-Carbon CFM: not available
  1517. *
  1518. * Compatibility:
  1519. * Not appropriate for CUPS filters, drivers, and backends.
  1520. *
  1521. }
  1522. function PMPrintSettingsSetJobName( printSettings: PMPrintSettings; name: CFStringRef ): OSStatus; external name '_PMPrintSettingsSetJobName';
  1523. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1524. {
  1525. * PMPrintSettingsSetValue()
  1526. *
  1527. * Parameters:
  1528. *
  1529. * printSettings:
  1530. * The printsettings in which to set the value
  1531. *
  1532. * key:
  1533. * The key to store the value in
  1534. *
  1535. * value:
  1536. * The value to store in the key. If NULL, any existing setting item with
  1537. * the specified key is removed.
  1538. *
  1539. * locked:
  1540. * A boolean value indicating whether the item being set should be
  1541. * locked. It is strongly recommended to pass false.
  1542. *
  1543. * Availability:
  1544. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1545. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1546. * Non-Carbon CFM: not available
  1547. *
  1548. * Compatibility:
  1549. * Not appropriate for CUPS filters, drivers, and backends.
  1550. *
  1551. }
  1552. function PMPrintSettingsSetValue( printSettings: PMPrintSettings; key: CFStringRef; value: CFTypeRef; locked: Boolean ): OSStatus; external name '_PMPrintSettingsSetValue';
  1553. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1554. {
  1555. * PMPrintSettingsCopyAsDictionary()
  1556. *
  1557. * Parameters:
  1558. *
  1559. * printSettings:
  1560. * Represent these print settings as a dictionary.
  1561. *
  1562. * settingsDictionary:
  1563. * On exit, if successful *'settingsDictionary' will contain a reference to
  1564. * a CFDictionary describing the print settings. The caller is
  1565. * responsible for releasing this reference. If this call returns
  1566. * an error, then *'settingsDictionary' will be set to NULL.
  1567. *
  1568. * Availability:
  1569. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1570. * CarbonLib: not available
  1571. * Non-Carbon CFM: not available
  1572. *
  1573. * Compatibility:
  1574. * Not appropriate for CUPS filters, drivers, and backends.
  1575. *
  1576. }
  1577. function PMPrintSettingsCopyAsDictionary( printSettings: PMPrintSettings; var settingsDictionary: CFDictionaryRef ): OSStatus; external name '_PMPrintSettingsCopyAsDictionary';
  1578. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1579. {
  1580. * PMPrintSettingsCopyKeys()
  1581. *
  1582. * Parameters:
  1583. *
  1584. * printSettings:
  1585. * Return the keys for items in this print settings.
  1586. *
  1587. * settingsKeys:
  1588. * On exit, if successful *'settingsKeys' will contain a reference to
  1589. * a CFArray describing the item keys in the print settings. Each of these
  1590. * keys may be passed to PMPrintSettingsGetValue() to obtain a value.
  1591. * The caller is responsible for releasing this reference. If this call returns
  1592. * an error, then *'settingsKeys' will be set to NULL.
  1593. *
  1594. * Availability:
  1595. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1596. * CarbonLib: not available
  1597. * Non-Carbon CFM: not available
  1598. *
  1599. * Compatibility:
  1600. * Not appropriate for CUPS filters, drivers, and backends.
  1601. *
  1602. }
  1603. function PMPrintSettingsCopyKeys( printSettings: PMPrintSettings; var settingsKeys: CFArrayRef ): OSStatus; external name '_PMPrintSettingsCopyKeys';
  1604. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1605. (*
  1606. //#pragma /mark -
  1607. //#pragma /mark Printer
  1608. //#pragma /mark
  1609. *)
  1610. {!
  1611. *
  1612. * PMCreateGenericPrinter
  1613. * Summary:
  1614. * Creates a generic PMPrinter
  1615. *
  1616. * Parameters:
  1617. * printer:
  1618. * On return *printer contains the generic priner
  1619. *
  1620. * Availability:
  1621. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1622. * CarbonLib: not available
  1623. * Non-Carbon CFM: not available
  1624. *
  1625. * Compatibility:
  1626. * Not appropriate for CUPS filters, drivers, and backends.
  1627. *
  1628. }
  1629. function PMCreateGenericPrinter( var printer: PMPrinter ): OSStatus; external name '_PMCreateGenericPrinter';
  1630. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1631. {
  1632. * PMServerCreatePrinterList()
  1633. *
  1634. * Summary:
  1635. * Hand back an array of PMPrinter objects that represents the list of printers
  1636. * known to the specified print server.
  1637. *
  1638. * Parameters:
  1639. *
  1640. * server:
  1641. * The print server for which you want to obtain the list of printers.
  1642. * Use kPMServerLocal for the local print server.
  1643. *
  1644. * printerList:
  1645. * On return, *printerList contains the array of PMPrinter objects returned. The
  1646. * caller is responsible for releasing this array. On error, *printerList is NULL.
  1647. *
  1648. * Availability:
  1649. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1650. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1651. * Non-Carbon CFM: not available
  1652. *
  1653. * Compatibility:
  1654. * Not appropriate for CUPS filters, drivers, and backends.
  1655. *
  1656. }
  1657. function PMServerCreatePrinterList( server: PMServer; var printerList: CFArrayRef ): OSStatus; external name '_PMServerCreatePrinterList';
  1658. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1659. {
  1660. * PMServerLaunchPrinterBrowser()
  1661. *
  1662. * Summary:
  1663. * Launch the printer browser, browsing the printers available for
  1664. * the specified print server.
  1665. *
  1666. * Parameters:
  1667. *
  1668. * server:
  1669. * The print server whose available printers the browser should browse.
  1670. * Pass kPMServerLocal for the local print server.
  1671. *
  1672. * options:
  1673. * A CFDictionaryRef specifying how the browser should be presented.
  1674. * Passing NULL presents the browser in the default fashion.
  1675. *
  1676. * Discussion: The local print server allows its printers to be browsed but
  1677. * not all print servers do. Passing in a server whose printers cannot be
  1678. * browsed returns the error code kPMInvalidParameter.
  1679. *
  1680. * Availability:
  1681. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  1682. * CarbonLib: not available
  1683. * Non-Carbon CFM: not available
  1684. *
  1685. * Compatibility:
  1686. * Not appropriate for CUPS filters, drivers, and backends.
  1687. *
  1688. }
  1689. function PMServerLaunchPrinterBrowser( server: PMServer; options: CFDictionaryRef ): OSStatus; external name '_PMServerLaunchPrinterBrowser';
  1690. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1691. {
  1692. * PMPrinterCreateFromPrinterID()
  1693. *
  1694. * Summary:
  1695. * Create a PMPrinter instance from the supplied printerID.
  1696. *
  1697. * Discussion:
  1698. * Returns a PMPrinter instance for the printer whose ID is
  1699. * printerID. The caller is responsible for releasing this instance
  1700. * with PMRelease. The PMPrinter instance returned will be NULL if
  1701. * there is no printer available which corresponds to the supplied
  1702. * printerID.
  1703. *
  1704. * Parameters:
  1705. *
  1706. * printerID:
  1707. * The printerID for the printer for which you want the PMPrinter.
  1708. *
  1709. * Availability:
  1710. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1711. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1712. * Non-Carbon CFM: not available
  1713. *
  1714. * Compatibility:
  1715. * Not appropriate for CUPS filters, drivers, and backends.
  1716. *
  1717. }
  1718. function PMPrinterCreateFromPrinterID( printerID: CFStringRef ): PMPrinter; external name '_PMPrinterCreateFromPrinterID';
  1719. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1720. {
  1721. * PMPrinterCopyDescriptionURL()
  1722. *
  1723. * Summary:
  1724. * Hand back a URL to the printer's PostScript Printer Description (PPD) file in fileURL.
  1725. *
  1726. * Parameters:
  1727. *
  1728. * printer:
  1729. * The printer whose PPD will be returned.
  1730. *
  1731. * descriptionType:
  1732. * The type of description desired. Only kPMPPDDescriptionType is currently supported.
  1733. *
  1734. * fileURL:
  1735. * A pointer to storage for a CFURL reference that will be returned. The caller is responsible
  1736. * for releasing the reference returned. If this call returns an error, then *fileURL will
  1737. * be set to NULL.
  1738. *
  1739. * Discussion:
  1740. * Only descriptionType of kPMPPDDescriptionType is supported, otherwise kPMInvalidParameter
  1741. * is returned.
  1742. *
  1743. * Availability:
  1744. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1745. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1746. * Non-Carbon CFM: not available
  1747. *
  1748. * Compatibility:
  1749. * Not appropriate for CUPS filters, drivers, and backends.
  1750. *
  1751. }
  1752. function PMPrinterCopyDescriptionURL( printer: PMPrinter; descriptionType: CFStringRef; var fileURL: CFURLRef ): OSStatus; external name '_PMPrinterCopyDescriptionURL';
  1753. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1754. {
  1755. * PMPrinterCopyDeviceURI()
  1756. *
  1757. * Summary:
  1758. * Hand back the URI of the printer's device.
  1759. *
  1760. * Parameters:
  1761. *
  1762. * printer:
  1763. * The printer whose device URI is to be retrieved.
  1764. *
  1765. * deviceURI:
  1766. * On exit, if successful *'deviceURI' will contain a reference to
  1767. * a CFURL describing the printer's device. The caller is
  1768. * responsible for releasing this reference. If this call returns
  1769. * an error, then *'deviceURI' will be set to NULL.
  1770. *
  1771. * Availability:
  1772. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  1773. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1774. * Non-Carbon CFM: not available
  1775. *
  1776. * Compatibility:
  1777. * Not appropriate for CUPS filters, drivers, and backends.
  1778. *
  1779. }
  1780. function PMPrinterCopyDeviceURI( printer: PMPrinter; var deviceURI: CFURLRef ): OSStatus; external name '_PMPrinterCopyDeviceURI';
  1781. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1782. {
  1783. * PMPrinterCopyHostName()
  1784. *
  1785. * Summary:
  1786. * Hand back the host name of the print server hosting the printer's print queue.
  1787. *
  1788. * Availability:
  1789. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1790. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1791. * Non-Carbon CFM: not available
  1792. *
  1793. * Compatibility:
  1794. * Not appropriate for CUPS filters, drivers, and backends.
  1795. *
  1796. }
  1797. function PMPrinterCopyHostName( printer: PMPrinter; var hostNameP: CFStringRef ): OSStatus; external name '_PMPrinterCopyHostName';
  1798. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1799. {
  1800. * PMPrinterCopyPresets()
  1801. *
  1802. * Summary:
  1803. * Provides a list of print settings presets for the specified
  1804. * printer.
  1805. *
  1806. * Discussion:
  1807. * A printer may have associated with it a list of preset settings.
  1808. * Each setting is optimized for a particular printing situation.
  1809. * This function returns all of the presets for a given printer. To
  1810. * obtain more information about a particular preset see
  1811. * PMPresetGetAttributes().
  1812. *
  1813. * Parameters:
  1814. *
  1815. * printer:
  1816. * Obtain the presets for this printer.
  1817. *
  1818. * presetList:
  1819. * On exit, *'presetList' is set to reference an array of presets.
  1820. * The caller must call CFRelease when it no longer needs the
  1821. * array. Each element of the array is a PMPreset. If this
  1822. * function fails, returning a non-zero error code, then
  1823. * *'presetList' will be set to NULL.
  1824. *
  1825. * Availability:
  1826. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1827. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1828. * Non-Carbon CFM: not available
  1829. *
  1830. * Compatibility:
  1831. * Not appropriate for CUPS filters, drivers, and backends.
  1832. *
  1833. }
  1834. function PMPrinterCopyPresets( printer: PMPrinter; var presetList: CFArrayRef ): OSStatus; external name '_PMPrinterCopyPresets';
  1835. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1836. {
  1837. * PMPrinterGetCommInfo()
  1838. *
  1839. * Summary:
  1840. * Provides information about the comm channel characteristics for
  1841. * the printer.
  1842. *
  1843. * Discussion:
  1844. * This function is typically relevant only to PostScript capable
  1845. * printers. All PostScript printers, regardless of what
  1846. * communications channel is used to send data to them, support data
  1847. * in the range 0x20 - 0x7F. Many comm channels can support data
  1848. * outside this range. The Boolean returned in *supportsTransparentP
  1849. * indicates whether the comm channel to this printer supports bytes
  1850. * in the range 0x0 to 0x1F. The Boolean returned in
  1851. * *supportsEightBitP indicates whether the comm channel to this
  1852. * printer supports bytes with the high bit set, i.e. bytes in the
  1853. * range 0x80 - 0xFF.
  1854. *
  1855. * Parameters:
  1856. *
  1857. * printer:
  1858. * Obtain the comm information for this printer.
  1859. *
  1860. * supportsControlCharRangeP:
  1861. * Storage for the returned Boolean indicating whether the comm
  1862. * channel to this printer can accept data bytes in the range
  1863. * 0x0 - 0x1F
  1864. *
  1865. * supportsEightBitP:
  1866. * Storage for the returned Boolean indicating whether the comm
  1867. * channel to this printer can accept data bytes in the range
  1868. * 0x80 - 0xFF
  1869. *
  1870. * Availability:
  1871. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1872. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1873. * Non-Carbon CFM: not available
  1874. *
  1875. * Compatibility:
  1876. * Not appropriate for CUPS filters, drivers, and backends.
  1877. *
  1878. }
  1879. function PMPrinterGetCommInfo( printer: PMPrinter; var supportsControlCharRangeP: Boolean; var supportsEightBitP: Boolean ): OSStatus; external name '_PMPrinterGetCommInfo';
  1880. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1881. {
  1882. * PMPrinterGetID()
  1883. *
  1884. * Availability:
  1885. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1886. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1887. * Non-Carbon CFM: not available
  1888. *
  1889. * Compatibility:
  1890. * Not appropriate for CUPS filters, drivers, and backends.
  1891. *
  1892. }
  1893. function PMPrinterGetID( printer: PMPrinter ): CFStringRef; external name '_PMPrinterGetID';
  1894. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1895. {
  1896. * PMPrinterGetLocation()
  1897. *
  1898. * Availability:
  1899. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1900. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1901. * Non-Carbon CFM: not available
  1902. *
  1903. * Compatibility:
  1904. * Not appropriate for CUPS filters, drivers, and backends.
  1905. *
  1906. }
  1907. function PMPrinterGetLocation( printer: PMPrinter ): CFStringRef; external name '_PMPrinterGetLocation';
  1908. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1909. {
  1910. * PMPrinterGetDriverCreator()
  1911. *
  1912. * Availability:
  1913. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1914. * CarbonLib: in CarbonLib 1.1 and later
  1915. * Non-Carbon CFM: not available
  1916. *
  1917. * Compatibility:
  1918. * Not appropriate for CUPS filters, drivers, and backends.
  1919. *
  1920. }
  1921. function PMPrinterGetDriverCreator( printer: PMPrinter; var creator: OSType ): OSStatus; external name '_PMPrinterGetDriverCreator';
  1922. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1923. {
  1924. * PMPrinterGetDriverReleaseInfo()
  1925. *
  1926. * Availability:
  1927. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1928. * CarbonLib: in CarbonLib 1.1 and later
  1929. * Non-Carbon CFM: not available
  1930. *
  1931. * Compatibility:
  1932. * Not appropriate for CUPS filters, drivers, and backends.
  1933. *
  1934. }
  1935. function PMPrinterGetDriverReleaseInfo( printer: PMPrinter; var release: VersRec ): OSStatus; external name '_PMPrinterGetDriverReleaseInfo';
  1936. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1937. {
  1938. * PMPrinterGetPrinterResolutionCount()
  1939. *
  1940. * Summary:
  1941. * Provides the number of available hardware resolution settings a printer supports.
  1942. *
  1943. * Parameters:
  1944. *
  1945. * printer:
  1946. * Obtain the resolution count for this printer.
  1947. *
  1948. * countP:
  1949. * Storage for the returned count indicating the number of available hardware
  1950. * resolution settings for the specified printer.
  1951. *
  1952. * Availability:
  1953. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1954. * CarbonLib: in CarbonLib 1.1 and later
  1955. * Non-Carbon CFM: not available
  1956. *
  1957. * Compatibility:
  1958. * Not appropriate for CUPS filters, drivers, and backends.
  1959. *
  1960. }
  1961. function PMPrinterGetPrinterResolutionCount( printer: PMPrinter; var countP: UInt32 ): OSStatus; external name '_PMPrinterGetPrinterResolutionCount';
  1962. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1963. {
  1964. * PMPrinterGetIndexedPrinterResolution()
  1965. *
  1966. * Summary:
  1967. * Together with PMPrinterGetPrinterResolutionCount, allows iterating over the
  1968. * hardware resolution settings a printer supports.
  1969. *
  1970. * Parameters:
  1971. *
  1972. * printer:
  1973. * The printer of interest.
  1974. *
  1975. * index:
  1976. * The index of the resolution to return. The minimum value for index is 1 and
  1977. * the maximum value of index is the count returned by PMPrinterGetPrinterResolutionCount.
  1978. *
  1979. * resolutionP:
  1980. * Storage for the returned PMResolution data.
  1981. *
  1982. * Availability:
  1983. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1984. * CarbonLib: in CarbonLib 1.1 and later
  1985. * Non-Carbon CFM: not available
  1986. *
  1987. * Compatibility:
  1988. * Not appropriate for CUPS filters, drivers, and backends.
  1989. *
  1990. }
  1991. function PMPrinterGetIndexedPrinterResolution( printer: PMPrinter; index: UInt32; var resolutionP: PMResolution ): OSStatus; external name '_PMPrinterGetIndexedPrinterResolution';
  1992. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1993. {
  1994. * PMPrinterGetOutputResolution()
  1995. *
  1996. * Summary:
  1997. * Obtain the printer hardware output resolution for the supplied
  1998. * printer and print settings.
  1999. *
  2000. * Discussion:
  2001. * Some printers allow programmatic control of their hardware output
  2002. * resolution on a print job basis. The hardware resolution is determined
  2003. * by the combination of printer and print settings used for the print job.
  2004. * PMPrinterGetOutputResolution returns the best guess as to what printer
  2005. * resolution setting will be used for the destination print job. If the
  2006. * resolution setting cannot be reliably determined this function returns
  2007. * kPMKeyNotFound.
  2008. *
  2009. * Most applications do not need to use this function since they draw the same
  2010. * content regardless of the destination device. For those few applications that
  2011. * do adjust their drawing based on the output device, they should only do so
  2012. * when the print job destination is kPMDestinationPrinter or kPMDestinationFax.
  2013. *
  2014. * This call should be used after displaying the print dialog to the user so
  2015. * that it correctly reflects settings changes performed prior to printing.
  2016. *
  2017. * Parameters:
  2018. *
  2019. * printer:
  2020. * The destination printer.
  2021. *
  2022. * printSettings:
  2023. * The print settings from which to obtain the printer hardware output resolution.
  2024. *
  2025. * resolutionP:
  2026. * Storage for the returned PMResolution data.
  2027. *
  2028. * Availability:
  2029. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2030. * CarbonLib: not available
  2031. * Non-Carbon CFM: not available
  2032. *
  2033. * Compatibility:
  2034. * Not appropriate for CUPS filters, drivers, and backends.
  2035. *
  2036. }
  2037. function PMPrinterGetOutputResolution( printer: PMPrinter; printSettings: PMPrintSettings; var resolutionP: PMResolution ): OSStatus; external name '_PMPrinterGetOutputResolution';
  2038. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2039. {
  2040. * PMPrinterSetOutputResolution()
  2041. *
  2042. * Summary:
  2043. * Set the printer hardware output resolution in the print settings
  2044. * for the supplied printer.
  2045. *
  2046. * Discussion:
  2047. * Some printers allow programmatic control of their hardware output
  2048. * resolution on a print job basis. The hardware resolution is determined
  2049. * by the combination of printer and print settings used for the print job.
  2050. * PMPrinterSetOutputResolution configures the print settings to the closest
  2051. * resolution setting that can be used for the destination print job. Note
  2052. * that not all printers allow control of their resolution setting.
  2053. *
  2054. * This function is rarely used since most applications do not set the output
  2055. * resolution but instead use the setting supplied by the user in the print dialog.
  2056. *
  2057. * Parameters:
  2058. *
  2059. * printer:
  2060. * The destination printer.
  2061. *
  2062. * printSettings:
  2063. * The print settings in which to set the hardware resolution.
  2064. *
  2065. * resolutionP:
  2066. * A pointer to the PMResolution to use to set the hardware output resolution.
  2067. *
  2068. * Availability:
  2069. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2070. * CarbonLib: not available
  2071. * Non-Carbon CFM: not available
  2072. *
  2073. * Compatibility:
  2074. * Not appropriate for CUPS filters, drivers, and backends.
  2075. *
  2076. }
  2077. function PMPrinterSetOutputResolution( printer: PMPrinter; printSettings: PMPrintSettings; const (*var*) resolutionP: PMResolution ): OSStatus; external name '_PMPrinterSetOutputResolution';
  2078. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2079. {
  2080. * PMPrinterGetLanguageInfo()
  2081. *
  2082. * Availability:
  2083. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2084. * CarbonLib: in CarbonLib 1.1 and later
  2085. * Non-Carbon CFM: not available
  2086. *
  2087. * Compatibility:
  2088. * Not appropriate for CUPS filters, drivers, and backends.
  2089. *
  2090. }
  2091. function PMPrinterGetLanguageInfo( printer: PMPrinter; var info: PMLanguageInfo ): OSStatus; external name '_PMPrinterGetLanguageInfo';
  2092. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  2093. {
  2094. * PMPrinterGetMakeAndModelName()
  2095. *
  2096. * Availability:
  2097. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2098. * CarbonLib: in CarbonLib 1.6 and later
  2099. * Non-Carbon CFM: not available
  2100. *
  2101. * Compatibility:
  2102. * Not appropriate for CUPS filters, drivers, and backends.
  2103. *
  2104. }
  2105. function PMPrinterGetMakeAndModelName( printer: PMPrinter; var makeAndModel: CFStringRef ): OSStatus; external name '_PMPrinterGetMakeAndModelName';
  2106. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2107. {
  2108. * PMPrinterGetMimeTypes()
  2109. *
  2110. * Summary:
  2111. * Return the array of mime type supported by the printer for a
  2112. * given set of print settings.
  2113. *
  2114. * Parameters:
  2115. *
  2116. * printer:
  2117. * The printer.
  2118. *
  2119. * settings:
  2120. * The print settings for the print job. The part of the print
  2121. * settings that effects the available mime type is the
  2122. * destination. This parameter can be NULL.
  2123. *
  2124. * mimeTypes:
  2125. * If this function returns without error then *'mimeTypes' is
  2126. * filled in with a reference to an array of CFStrings. Each
  2127. * CFString names a mime type supported by the printer with the
  2128. * specified print settings. The caller must not release this
  2129. * reference without first doing a retain. If this function
  2130. * returns an error then 'mimeTypes' will be set to NULL.
  2131. *
  2132. * Availability:
  2133. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2134. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2135. * Non-Carbon CFM: not available
  2136. *
  2137. * Compatibility:
  2138. * Not appropriate for CUPS filters, drivers, and backends.
  2139. *
  2140. }
  2141. function PMPrinterGetMimeTypes( printer: PMPrinter; settings: PMPrintSettings; var mimeTypes: CFArrayRef ): OSStatus; external name '_PMPrinterGetMimeTypes';
  2142. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2143. {
  2144. * PMPrinterGetName()
  2145. *
  2146. * Availability:
  2147. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2148. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2149. * Non-Carbon CFM: not available
  2150. *
  2151. * Compatibility:
  2152. * Not appropriate for CUPS filters, drivers, and backends.
  2153. *
  2154. }
  2155. function PMPrinterGetName( printer: PMPrinter ): CFStringRef; external name '_PMPrinterGetName';
  2156. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2157. {
  2158. * PMPrinterGetPaperList()
  2159. *
  2160. * Summary:
  2161. * Returns the list of papers available for a given printer.
  2162. *
  2163. * Parameters:
  2164. *
  2165. * printer:
  2166. * Obtain the paper list for this printer.
  2167. *
  2168. * paperList:
  2169. * If successful noErr is returned and *paperList is a CFArray of
  2170. * PMPapers representing the list of papers available for the
  2171. * printer.
  2172. *
  2173. * Availability:
  2174. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2175. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2176. * Non-Carbon CFM: not available
  2177. *
  2178. * Compatibility:
  2179. * Not appropriate for CUPS filters, drivers, and backends.
  2180. *
  2181. }
  2182. function PMPrinterGetPaperList( printer: PMPrinter; var paperList: CFArrayRef ): OSStatus; external name '_PMPrinterGetPaperList';
  2183. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2184. {
  2185. * PMPrinterGetState()
  2186. *
  2187. * Availability:
  2188. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2189. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2190. * Non-Carbon CFM: not available
  2191. *
  2192. * Compatibility:
  2193. * Not appropriate for CUPS filters, drivers, and backends.
  2194. *
  2195. }
  2196. function PMPrinterGetState( printer: PMPrinter; var state: PMPrinterState ): OSStatus; external name '_PMPrinterGetState';
  2197. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2198. {
  2199. * PMPrinterIsDefault()
  2200. *
  2201. * Availability:
  2202. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2203. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2204. * Non-Carbon CFM: not available
  2205. *
  2206. * Compatibility:
  2207. * Not appropriate for CUPS filters, drivers, and backends.
  2208. *
  2209. }
  2210. function PMPrinterIsDefault( printer: PMPrinter ): Boolean; external name '_PMPrinterIsDefault';
  2211. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2212. {
  2213. * PMPrinterIsFavorite()
  2214. *
  2215. * Summary:
  2216. * Return true if the printer is in the user's favorite printer list.
  2217. *
  2218. * Availability:
  2219. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2220. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2221. * Non-Carbon CFM: not available
  2222. *
  2223. * Compatibility:
  2224. * Not appropriate for CUPS filters, drivers, and backends.
  2225. *
  2226. }
  2227. function PMPrinterIsFavorite( printer: PMPrinter ): Boolean; external name '_PMPrinterIsFavorite';
  2228. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2229. {
  2230. * PMPrinterIsPostScriptCapable()
  2231. *
  2232. * Availability:
  2233. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2234. * CarbonLib: in CarbonLib 1.6 and later
  2235. * Non-Carbon CFM: not available
  2236. *
  2237. * Compatibility:
  2238. * Not appropriate for CUPS filters, drivers, and backends.
  2239. *
  2240. }
  2241. function PMPrinterIsPostScriptCapable( printer: PMPrinter ): Boolean; external name '_PMPrinterIsPostScriptCapable';
  2242. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  2243. {!
  2244. * @function PMPrinterIsPostScriptPrinter
  2245. * @abstract Set *isPSPrinter true if the printer is a PostScript printer.
  2246. *
  2247. * @discussion A PostScript printer is one whose driver takes PostScript directly.
  2248. *
  2249. * Availability:
  2250. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2251. * CarbonLib: not available
  2252. * Non-Carbon CFM: not available
  2253. *
  2254. * Compatibility:
  2255. * Not appropriate for CUPS filters, drivers, and backends.
  2256. *
  2257. }
  2258. function PMPrinterIsPostScriptPrinter( printer: PMPrinter; var isPSPrinter: Boolean ): OSStatus; external name '_PMPrinterIsPostScriptPrinter';
  2259. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2260. {
  2261. * PMPrinterIsRemote()
  2262. *
  2263. * Summary:
  2264. * Hand back a boolean indicating whether the printer is hosted by remote print server.
  2265. *
  2266. * Discussion:
  2267. * If on return *isRemoteP is true, the print queue represents a printer hosted and
  2268. * managed by a remote print server.
  2269. *
  2270. * If on return *isRemoteP is false, the print queue represents a directly connected
  2271. * printer, a network printer, or a remote printer that is locally managed. Consult
  2272. * the queue's device URI to determine the type of connection that is used to communicate
  2273. * with the printer.
  2274. *
  2275. * Whether a printer is remote is derived from the CUPS printer-type attribute for the print queue.
  2276. *
  2277. * Availability:
  2278. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2279. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2280. * Non-Carbon CFM: not available
  2281. *
  2282. * Compatibility:
  2283. * Not appropriate for CUPS filters, drivers, and backends.
  2284. *
  2285. }
  2286. function PMPrinterIsRemote( printer: PMPrinter; var isRemoteP: Boolean ): OSStatus; external name '_PMPrinterIsRemote';
  2287. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2288. {
  2289. * PMPrinterSetDefault()
  2290. *
  2291. * Summary:
  2292. * Set the default printer for the current user.
  2293. *
  2294. * Parameters:
  2295. *
  2296. * printer:
  2297. * The printer to set as the default printer.
  2298. *
  2299. * Special considerations:
  2300. * It is not typical for an application to set the current default printer
  2301. * for the user; the printing system itself takes care of managing the default printer.
  2302. * This function should be used only in rare circumstances.
  2303. *
  2304. * Availability:
  2305. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2306. * CarbonLib: not available
  2307. * Non-Carbon CFM: not available
  2308. *
  2309. * Compatibility:
  2310. * Not appropriate for CUPS filters, drivers, and backends.
  2311. *
  2312. }
  2313. function PMPrinterSetDefault( printer: PMPrinter ): OSStatus; external name '_PMPrinterSetDefault';
  2314. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2315. (*
  2316. //#pragma /mark
  2317. //#pragma /mark Preset
  2318. //#pragma /mark
  2319. *)
  2320. {
  2321. * PMPresetCopyName()
  2322. *
  2323. * Summary:
  2324. * Hand back a copy of the localized name for the specified preset.
  2325. *
  2326. * Parameters:
  2327. *
  2328. * preset:
  2329. * The preset whose name is needed.
  2330. *
  2331. * name:
  2332. * On exit, if this routine succeeds, *'name' is filled in with a
  2333. * reference to a localized string with the preset's name. If this
  2334. * routine fails, then *'name' is set to NULL.
  2335. *
  2336. * Availability:
  2337. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2338. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2339. * Non-Carbon CFM: not available
  2340. *
  2341. * Compatibility:
  2342. * Not appropriate for CUPS filters, drivers, and backends.
  2343. *
  2344. }
  2345. function PMPresetCopyName( preset: PMPreset; var name: CFStringRef ): OSStatus; external name '_PMPresetCopyName';
  2346. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2347. {
  2348. * PMPresetCreatePrintSettings()
  2349. *
  2350. * Summary:
  2351. * Create a print settings conforming to the specified print
  2352. * settings preset.
  2353. *
  2354. * Parameters:
  2355. *
  2356. * preset:
  2357. * A preset specifying a set of initial print settings.
  2358. *
  2359. * session:
  2360. * A valid print session.
  2361. *
  2362. * printSettings:
  2363. * On exit, *'printSettings' is set to a newly created print
  2364. * settings that contains the settings specified by 'preset'. The
  2365. * caller is responsible for calling PMRelease when the print
  2366. * settings are no longer needed.
  2367. *
  2368. * Availability:
  2369. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2370. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2371. * Non-Carbon CFM: not available
  2372. *
  2373. * Compatibility:
  2374. * Not appropriate for CUPS filters, drivers, and backends.
  2375. *
  2376. }
  2377. function PMPresetCreatePrintSettings( preset: PMPreset; session: PMPrintSession; var printSettings: PMPrintSettings ): OSStatus; external name '_PMPresetCreatePrintSettings';
  2378. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2379. {
  2380. * PMPresetGetAttributes()
  2381. *
  2382. * Summary:
  2383. * Hand back the meta-data describing a given preset.
  2384. *
  2385. * Discussion:
  2386. * Each preset has associated with it a dictionary containing
  2387. * meta-data. The meta-data provides the preset's id, the preset's
  2388. * localized names, and descriptions of the environment for which
  2389. * the preset it intended.
  2390. *
  2391. * Parameters:
  2392. *
  2393. * preset:
  2394. * A print settings preset as obtained from PMPrinterCopyPresets().
  2395. *
  2396. * attributes:
  2397. * On exit, *'attributes' is set to reference a dictionary
  2398. * containing the preset's meta-data. The caller is responsible
  2399. * for retaining this reference if it is to be used beyond the
  2400. * lifetime of 'preset'. If this function fails, returning a
  2401. * non-zero error code, then *'attributes' is set to NULL.
  2402. *
  2403. * Availability:
  2404. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2405. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2406. * Non-Carbon CFM: not available
  2407. *
  2408. * Compatibility:
  2409. * Not appropriate for CUPS filters, drivers, and backends.
  2410. *
  2411. }
  2412. function PMPresetGetAttributes( preset: PMPreset; var attributes: CFDictionaryRef ): OSStatus; external name '_PMPresetGetAttributes';
  2413. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2414. (*
  2415. //#pragma /mark
  2416. //#pragma /mark Paper
  2417. //#pragma /mark
  2418. *)
  2419. {
  2420. * PMGetPageFormatPaper()
  2421. *
  2422. * Summary:
  2423. * Returns the paper associated with a pageformat.
  2424. *
  2425. * Parameters:
  2426. *
  2427. * format:
  2428. * Obtain the paper for this pageformat.
  2429. *
  2430. * paper:
  2431. * If successful noErr is returned and *paper will contain a
  2432. * PMPaper object describing the current paper associated with the
  2433. * pageformat.
  2434. *
  2435. * Availability:
  2436. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2437. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2438. * Non-Carbon CFM: not available
  2439. *
  2440. * Compatibility:
  2441. * Not appropriate for CUPS filters, drivers, and backends.
  2442. *
  2443. }
  2444. function PMGetPageFormatPaper( format: PMPageFormat; var paper: PMPaper ): OSStatus; external name '_PMGetPageFormatPaper';
  2445. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2446. {
  2447. * PMPaperCreateCustom()
  2448. *
  2449. * Summary:
  2450. * Create a new custom paper instance.
  2451. *
  2452. * Parameters:
  2453. *
  2454. * printer:
  2455. * The new paper size is appropriate for this printer.
  2456. *
  2457. * id:
  2458. * A unique identifier for this paper type.
  2459. *
  2460. * name:
  2461. * The name to display to the user for this paper type.
  2462. *
  2463. * width:
  2464. * The width, in points, of the paper.
  2465. *
  2466. * height:
  2467. * The height, in points, of the paper.
  2468. *
  2469. * margins:
  2470. * The unprintable margins on the paper.
  2471. *
  2472. * paperP:
  2473. * if this function is successful, returning noErr, then *'paperP'
  2474. * is set to be a reference to a newly created PMPaper instance.
  2475. * The caller is responsible for calling PMRelease when the
  2476. * instance is no longer needed. If this functions fails, it will
  2477. * return a non-zero error and set *'paperP' to NULL.
  2478. *
  2479. * Discussion:
  2480. * This function creates a new custom paper instance. To obtain one of the available
  2481. * built-in paper sizes for a given printer, use PMPrinterGetPaperList.
  2482. *
  2483. * Availability:
  2484. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2485. * CarbonLib: not available
  2486. * Non-Carbon CFM: not available
  2487. *
  2488. * Compatibility:
  2489. * Not appropriate for CUPS filters, drivers, and backends.
  2490. *
  2491. }
  2492. function PMPaperCreateCustom( printer: PMPrinter; id: CFStringRef; name: CFStringRef; width: Float64; height: Float64; const (*var*) margins: PMPaperMargins; var paperP: PMPaper ): OSStatus; external name '_PMPaperCreateCustom';
  2493. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2494. {
  2495. * PMPaperGetWidth()
  2496. *
  2497. * Summary:
  2498. * Returns the width for a given paper.
  2499. *
  2500. * Parameters:
  2501. *
  2502. * paper:
  2503. * Obtain the width for this paper.
  2504. *
  2505. * paperWidth:
  2506. * If successful noErr is returned and *paperWidth is set to the
  2507. * width of the paper.
  2508. *
  2509. * Availability:
  2510. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2511. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2512. * Non-Carbon CFM: not available
  2513. *
  2514. * Compatibility:
  2515. * Not appropriate for CUPS filters, drivers, and backends.
  2516. *
  2517. }
  2518. function PMPaperGetWidth( paper: PMPaper; var paperWidth: Float64 ): OSStatus; external name '_PMPaperGetWidth';
  2519. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2520. {
  2521. * PMPaperGetHeight()
  2522. *
  2523. * Summary:
  2524. * Returns the height for a given paper.
  2525. *
  2526. * Parameters:
  2527. *
  2528. * paper:
  2529. * Obtain the height for this paper.
  2530. *
  2531. * paperHeight:
  2532. * If successful noErr is returned and *paperHeight is set to the
  2533. * height of the paper.
  2534. *
  2535. * Availability:
  2536. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2537. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2538. * Non-Carbon CFM: not available
  2539. *
  2540. * Compatibility:
  2541. * Not appropriate for CUPS filters, drivers, and backends.
  2542. *
  2543. }
  2544. function PMPaperGetHeight( paper: PMPaper; var paperHeight: Float64 ): OSStatus; external name '_PMPaperGetHeight';
  2545. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2546. {
  2547. * PMPaperGetMargins()
  2548. *
  2549. * Summary:
  2550. * Returns the margins for a given paper.
  2551. *
  2552. * Parameters:
  2553. *
  2554. * paper:
  2555. * Obtain the margin information for this paper.
  2556. *
  2557. * paperMargins:
  2558. * If successful noErr is returned and *paperMargins is set to the
  2559. * margins of the paper.
  2560. *
  2561. * Availability:
  2562. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2563. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2564. * Non-Carbon CFM: not available
  2565. *
  2566. * Compatibility:
  2567. * Not appropriate for CUPS filters, drivers, and backends.
  2568. *
  2569. }
  2570. function PMPaperGetMargins( paper: PMPaper; var paperMargins: PMPaperMargins ): OSStatus; external name '_PMPaperGetMargins';
  2571. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2572. {
  2573. * PMPaperGetID()
  2574. *
  2575. * Summary:
  2576. * Returns the id for a given paper.
  2577. *
  2578. * Parameters:
  2579. *
  2580. * paper:
  2581. * Obtain the id for this paper.
  2582. *
  2583. * paperID:
  2584. * If successful noErr is returned and *paperID is set to the id
  2585. * of the paper.
  2586. *
  2587. * Availability:
  2588. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2589. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2590. * Non-Carbon CFM: not available
  2591. *
  2592. * Compatibility:
  2593. * Not appropriate for CUPS filters, drivers, and backends.
  2594. *
  2595. }
  2596. function PMPaperGetID( paper: PMPaper; var paperID: CFStringRef ): OSStatus; external name '_PMPaperGetID';
  2597. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2598. {
  2599. * PMPaperGetPPDPaperName()
  2600. *
  2601. * Summary:
  2602. * Returns the PPD name for a given paper.
  2603. *
  2604. * Parameters:
  2605. *
  2606. * paper:
  2607. * Obtain the PPD name for this paper.
  2608. *
  2609. * paperName:
  2610. * If successful, noErr is returned and *paperName is set to the
  2611. * PPD name of the paper. The returned result may be NULL.
  2612. *
  2613. * Discussion:
  2614. * The Mac OS X printing system uses a PostScript Printer Description (PPD)
  2615. * file to describe a given printer and print queue for that printer. The
  2616. * PPD name is the name that uniquely identifies a given paper
  2617. * to the printer to which the paper corresponds.
  2618. *
  2619. * Availability:
  2620. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2621. * CarbonLib: not available
  2622. * Non-Carbon CFM: not available
  2623. *
  2624. * Compatibility:
  2625. * Not appropriate for CUPS filters, drivers, and backends.
  2626. *
  2627. }
  2628. function PMPaperGetPPDPaperName( paper: PMPaper; var paperName: CFStringRef ): OSStatus; external name '_PMPaperGetPPDPaperName';
  2629. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2630. {
  2631. * PMPaperCreateLocalizedName()
  2632. *
  2633. * Summary:
  2634. * Returns the localized name for a given paper.
  2635. * Use of PMPaperCreateLocalizedName
  2636. * is recommended instead of PMPaperGetName.
  2637. *
  2638. * Parameters:
  2639. *
  2640. * paper:
  2641. * Obtain the localized name for this paper.
  2642. *
  2643. * printer:
  2644. * The printer for which the localization should be performed.
  2645. *
  2646. * paperName:
  2647. * If successful, noErr is returned and *paperName is set to the
  2648. * localized name of the paper. The returned paper name is that appropriate
  2649. * to display to a user. The returned result may be NULL.
  2650. * If non-NULL, the caller is responsible for releasing the name returned.
  2651. *
  2652. * Availability:
  2653. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2654. * CarbonLib: not available
  2655. * Non-Carbon CFM: not available
  2656. *
  2657. * Compatibility:
  2658. * Not appropriate for CUPS filters, drivers, and backends.
  2659. *
  2660. }
  2661. function PMPaperCreateLocalizedName( paper: PMPaper; printer: PMPrinter; var paperName: CFStringRef ): OSStatus; external name '_PMPaperCreateLocalizedName';
  2662. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2663. {
  2664. * PMPaperGetPrinterID()
  2665. *
  2666. * Summary:
  2667. * Returns the printerID of the printer for which the paper corresponds.
  2668. *
  2669. * Parameters:
  2670. *
  2671. * paper:
  2672. * Obtain the printer ID for this paper.
  2673. *
  2674. * printerID:
  2675. * If successful, noErr is returned and *printerID is set to the
  2676. * ID of the printer for which the paper corresponds. The returned
  2677. * result may be NULL.
  2678. *
  2679. * Availability:
  2680. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2681. * CarbonLib: not available
  2682. * Non-Carbon CFM: not available
  2683. *
  2684. * Compatibility:
  2685. * Not appropriate for CUPS filters, drivers, and backends.
  2686. *
  2687. }
  2688. function PMPaperGetPrinterID( paper: PMPaper; var printerID: CFStringRef ): OSStatus; external name '_PMPaperGetPrinterID';
  2689. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2690. {
  2691. * PMPaperIsCustom()
  2692. *
  2693. * Summary:
  2694. * Returns true if the paper is a custom paper.
  2695. *
  2696. * Parameters:
  2697. *
  2698. * paper:
  2699. * Determines if this is a custom paper.
  2700. *
  2701. * Availability:
  2702. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2703. * CarbonLib: not available
  2704. * Non-Carbon CFM: not available
  2705. *
  2706. * Compatibility:
  2707. * Not appropriate for CUPS filters, drivers, and backends.
  2708. *
  2709. }
  2710. function PMPaperIsCustom( paper: PMPaper ): Boolean; external name '_PMPaperIsCustom';
  2711. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2712. (*
  2713. //#pragma /mark
  2714. //#pragma /mark PDF Workflow
  2715. //#pragma /mark
  2716. *)
  2717. {
  2718. * PMWorkflowCopyItems()
  2719. *
  2720. * Summary:
  2721. * Hand back an array of dictionaries describing the PDF Workflow
  2722. * items installed on the system
  2723. *
  2724. * Parameters:
  2725. *
  2726. * workflowItems:
  2727. * If this function returns without error then *'workflowItems'
  2728. * will be filled in with a reference to an array. It is the
  2729. * caller's responsability to release the array when done with it.
  2730. * Each element in the array describes a PDF Workflow item or a
  2731. * folder holding workflow items. A dictionary describing a
  2732. * workflow item has, at least, the following keys and values:
  2733. * displayName - The user's diaplayable name for the workflow item
  2734. * itemURL - A CFURLRef pointing to the workflow item. A
  2735. * dictionary describing a workflow folder has at least the
  2736. * following keys: displayName - The user's diaplayable name for
  2737. * the workflow item folderURL - A CFURLRef pointing to the
  2738. * folder. items - A CFArrayRef describing the workflow items in
  2739. * the folder. If this function returns a non-zero error code then
  2740. * *'workflowItems' will be set to NULL.
  2741. *
  2742. * Availability:
  2743. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2744. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2745. * Non-Carbon CFM: not available
  2746. *
  2747. * Compatibility:
  2748. * Not appropriate for CUPS filters, drivers, and backends.
  2749. *
  2750. }
  2751. function PMWorkflowCopyItems( var workflowItems: CFArrayRef ): OSStatus; external name '_PMWorkflowCopyItems';
  2752. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2753. {
  2754. * PMWorkflowSubmitPDFWithOptions()
  2755. *
  2756. * Summary:
  2757. * Submit a PDF file for workflow processing.
  2758. *
  2759. * Discussion:
  2760. * The print dialog uses this function is conjunction with
  2761. * PMWorkflowGetItems to implement the PDF workflow button. Caller's
  2762. * can use PMWorkflowGetItems to obtain a CFURLRef that can be
  2763. * passed to PMWorkflowPDF or they can create a CFURLRef to another
  2764. * file system item.
  2765. *
  2766. * Parameters:
  2767. *
  2768. * workflowItem:
  2769. * A file system URL pointing to the workflow item that will
  2770. * handle the PDF file. Here are the different types of workflow
  2771. * items currently supported: Folder alias: The PDF is moved to
  2772. * the resolved folder. Application or application alias: The
  2773. * application is sent an open event along with a reference to the
  2774. * PDF file. Compiled data fork AppleScript: The applescript is
  2775. * run with an open event along with a reference to the PDF file.
  2776. * executable tool: The tool is run with the following parameters:
  2777. * title options pdfFile
  2778. *
  2779. * title:
  2780. * The user displayable name of the document.
  2781. *
  2782. * options:
  2783. * A string of CUPS style key-value pairs that may be passed to
  2784. * the PDF Workflow item. This parameter can be NULL in which case
  2785. * an empty string of options is used.
  2786. *
  2787. * pdfFile:
  2788. * A file system URL pointing to the file to be processed by the
  2789. * workflow item.
  2790. *
  2791. * Availability:
  2792. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2793. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2794. * Non-Carbon CFM: not available
  2795. *
  2796. * Compatibility:
  2797. * Not appropriate for CUPS filters, drivers, and backends.
  2798. *
  2799. }
  2800. function PMWorkflowSubmitPDFWithOptions( workflowItem: CFURLRef; title: CFStringRef; options: ConstCStringPtr; pdfFile: CFURLRef ): OSStatus; external name '_PMWorkflowSubmitPDFWithOptions';
  2801. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2802. {
  2803. * PMWorkflowSubmitPDFWithSettings()
  2804. *
  2805. * Summary:
  2806. * Submit a PDF file for workflow processing.
  2807. *
  2808. * Discussion:
  2809. * The print dialog uses this function is conjunction with
  2810. * PMWorkflowGetItems to implement the PDF workflow button. Caller's
  2811. * can use PMWorkflowGetItems to obtain a CFURLRef that can be
  2812. * passed to PMWorkflowPDF or they can create a CFURLRef to another
  2813. * file system item.
  2814. *
  2815. * Parameters:
  2816. *
  2817. * workflowItem:
  2818. * A file system URL pointing to the workflow item that will
  2819. * handle the PDF file. Here are the different types of workflow
  2820. * items currently supported: Folder alias: The PDF is moved to
  2821. * the resolved folder. Application or application alias: The
  2822. * application is sent an open event along with a reference to the
  2823. * PDF file. Compiled data fork AppleScript: The applescript is
  2824. * run with an open event along with a reference to the PDF file.
  2825. * executable tool: The tool is run with the following parameters:
  2826. * title options pdfFile
  2827. *
  2828. * settings:
  2829. * The prints settings to apply to the PDF.
  2830. *
  2831. * pdfFile:
  2832. * A file system URL pointing to the file to be processed by the
  2833. * workflow item.
  2834. *
  2835. * Availability:
  2836. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2837. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2838. * Non-Carbon CFM: not available
  2839. *
  2840. * Compatibility:
  2841. * Not appropriate for CUPS filters, drivers, and backends.
  2842. *
  2843. }
  2844. function PMWorkflowSubmitPDFWithSettings( workflowItem: CFURLRef; settings: PMPrintSettings; pdfFile: CFURLRef ): OSStatus; external name '_PMWorkflowSubmitPDFWithSettings';
  2845. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2846. (*
  2847. //#pragma /mark
  2848. //#pragma /mark Job Submission
  2849. //#pragma /mark
  2850. *)
  2851. {
  2852. * PMPrinterPrintWithProvider()
  2853. *
  2854. * Summary:
  2855. * Submit print data to a specified printer.
  2856. *
  2857. * Discussion:
  2858. * For using EPS data together with other application drawing
  2859. * using Quartz, see PMCGImageCreateWithEPSDataProvider.
  2860. *
  2861. * Parameters:
  2862. *
  2863. * printer:
  2864. * The printer.
  2865. *
  2866. * settings:
  2867. * The print settings for the print job.
  2868. *
  2869. * format:
  2870. * The page format specifying the physical page size and orientation on which the document
  2871. * should be printed. This parameter can be NULL.
  2872. *
  2873. * mimeType:
  2874. * The mime type of the file to be printed. This parameter can not
  2875. * be NULL. Use PMPrinterPrintWithFile() if auto-typing is desired.
  2876. *
  2877. * provider:
  2878. * The data provider that supplies the print data.
  2879. *
  2880. * Availability:
  2881. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2882. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2883. * Non-Carbon CFM: not available
  2884. *
  2885. * Compatibility:
  2886. * Not appropriate for CUPS filters, drivers, and backends.
  2887. *
  2888. }
  2889. function PMPrinterPrintWithProvider( printer: PMPrinter; settings: PMPrintSettings; format: PMPageFormat; mimeType: CFStringRef; provider: CGDataProviderRef ): OSStatus; external name '_PMPrinterPrintWithProvider';
  2890. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2891. {
  2892. * PMPrinterPrintWithFile()
  2893. *
  2894. * Summary:
  2895. * Submit a file for printing to a specified printer.
  2896. *
  2897. * Discussion:
  2898. *
  2899. * One reason this function may fail is if the specified printer can
  2900. * not handle the file's mime type. Use PMPrinterGetMimeTypes() to
  2901. * check whether a mime type is supported.
  2902. *
  2903. * For using EPS data together with other application drawing
  2904. * using Quartz, see PMCGImageCreateWithEPSDataProvider.
  2905. *
  2906. * Parameters:
  2907. *
  2908. * printer:
  2909. * The printer.
  2910. *
  2911. * settings:
  2912. * The print settings for the print job.
  2913. *
  2914. * format:
  2915. * The page format specifying the physical page size and orientation on which the document
  2916. * should be printed. This parameter can be NULL.
  2917. *
  2918. * mimeType:
  2919. * The mime type of the file to be printed. If this parameter is
  2920. * NULL then the supplied file will be auto-typed.
  2921. *
  2922. * fileURL:
  2923. * A file URL specifying the file to be printed.
  2924. *
  2925. * Availability:
  2926. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  2927. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  2928. * Non-Carbon CFM: not available
  2929. *
  2930. * Compatibility:
  2931. * Not appropriate for CUPS filters, drivers, and backends.
  2932. *
  2933. }
  2934. function PMPrinterPrintWithFile( printer: PMPrinter; settings: PMPrintSettings; format: PMPageFormat; mimeType: CFStringRef; fileURL: CFURLRef ): OSStatus; external name '_PMPrinterPrintWithFile';
  2935. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  2936. {
  2937. * PMPrinterWritePostScriptToURL()
  2938. *
  2939. * Summary:
  2940. * Convert an input file of the specified mimeType to printer ready PostScript for the destination printer.
  2941. *
  2942. * Discussion:
  2943. *
  2944. * The conversion of the input file to PostScript is performed before this function returns. This can take a significant
  2945. * amount of time for longer documents. The caller of PMPrinterWritePostScriptToURL may want to perform this operation
  2946. * on a thread other than the main application thread or fork a separate process for this purpose.
  2947. *
  2948. * One reason this function may fail is if conversion from the input mimeType to PostScript cannot be performed.
  2949. *
  2950. *
  2951. * Parameters:
  2952. *
  2953. * printer:
  2954. * The printer for which the printer ready PostScript will be generated.
  2955. *
  2956. * settings:
  2957. * The print settings for the print job.
  2958. *
  2959. * format:
  2960. * The page format specifying the physical page size and orientation on which the document
  2961. * should be printed.
  2962. *
  2963. * mimeType:
  2964. * The mime type of the file to be printed. If NULL, the file is auto-typed.
  2965. *
  2966. * sourceFileURL:
  2967. * A file URL specifying the input file to be converted to printer ready PostScript data. Only file based URLs
  2968. * are supported. This file is deleted when the conversion is completed.
  2969. *
  2970. * destinationFileURL:
  2971. * A file URL specifying the destination file to be created. If the file already exists it will be overwritten. Only
  2972. * file based URLs are supported.
  2973. *
  2974. * Availability:
  2975. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  2976. * CarbonLib: not available
  2977. * Non-Carbon CFM: not available
  2978. *
  2979. * Compatibility:
  2980. * Not appropriate for CUPS filters, drivers, and backends.
  2981. *
  2982. }
  2983. function PMPrinterWritePostScriptToURL( printer: PMPrinter; settings: PMPrintSettings; format: PMPageFormat; mimeType: CFStringRef; sourceFileURL: CFURLRef; destinationFileURL: CFURLRef ): OSStatus; external name '_PMPrinterWritePostScriptToURL';
  2984. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  2985. {
  2986. * PMPrintSettingsToOptions()
  2987. *
  2988. * Summary:
  2989. * Convert print settings to a CUPS style options string.
  2990. *
  2991. * Parameters:
  2992. *
  2993. * settings:
  2994. * The print settings that should be converted to a CUPS style
  2995. * options string.
  2996. *
  2997. * options:
  2998. * On exit *'options' will be filled in with a malloc'ed C string
  2999. * describing the passed in print settings. It is the caller's
  3000. * responsibility to free this memory when done with it. If this
  3001. * function fails returning a non-zero error code then *'options'
  3002. * will be set to NULL.
  3003. *
  3004. * Availability:
  3005. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  3006. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3007. * Non-Carbon CFM: not available
  3008. *
  3009. * Compatibility:
  3010. * Not appropriate for CUPS filters, drivers, and backends.
  3011. *
  3012. }
  3013. function PMPrintSettingsToOptions( settings: PMPrintSettings; var options: CStringPtr ): OSStatus; external name '_PMPrintSettingsToOptions';
  3014. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3015. {
  3016. * PMPrintSettingsToOptionsWithPrinterAndPageFormat()
  3017. *
  3018. * Summary:
  3019. * Convert a print settings and page format to a CUPS style options string.
  3020. *
  3021. * Parameters:
  3022. *
  3023. * settings:
  3024. * The print settings that should be converted to a CUPS style
  3025. * options string. Must not be NULL.
  3026. *
  3027. * printer:
  3028. * The printer to use for converting the print settings. Must not be NULL.
  3029. *
  3030. * format:
  3031. * The page format for use in creating the cups options. Can be NULL.
  3032. *
  3033. * options:
  3034. * On exit *'options' will be filled in with a malloc'd C string
  3035. * describing the passed in print settings and format. It is the caller's
  3036. * responsibility to free this memory when done with it. If this
  3037. * function fails returning a non-zero error code then *'options'
  3038. * will be set to NULL.
  3039. *
  3040. * Availability:
  3041. * Mac OS X: in version 10.5 and later in ApplicationServices.framework
  3042. * CarbonLib: not available
  3043. * Non-Carbon CFM: not available
  3044. *
  3045. * Compatibility:
  3046. * Not appropriate for CUPS filters, drivers, and backends.
  3047. *
  3048. }
  3049. function PMPrintSettingsToOptionsWithPrinterAndPageFormat( settings: PMPrintSettings; printer: PMPrinter; pageFormat: PMPageFormat; var options: CStringPtr ): OSStatus; external name '_PMPrintSettingsToOptionsWithPrinterAndPageFormat';
  3050. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  3051. (*
  3052. //#pragma /mark
  3053. //#pragma /mark PrinterCommandSupport
  3054. //#pragma /mark
  3055. *)
  3056. {
  3057. * PMPrinterSendCommand()
  3058. *
  3059. * Summary:
  3060. * Submit a command file containing the specified string data to a print queue.
  3061. *
  3062. * Parameters:
  3063. *
  3064. * printer:
  3065. * The destination print queue.
  3066. *
  3067. * commandString:
  3068. * The contents of the command file as a CFStringRef.
  3069. *
  3070. * jobTitle:
  3071. * The title of the job associated with the command file. If NULL,
  3072. * a job title will be automatically generated but it may not be
  3073. * meaningful to a user.
  3074. *
  3075. * options:
  3076. * A dictionary containing options that apply to the job.
  3077. * This parameter should be NULL; it is reserved for future expansion.
  3078. *
  3079. * Availability:
  3080. * Mac OS X: in version 10.6 and later in ApplicationServices.framework
  3081. * CarbonLib: not available
  3082. *
  3083. * Compatibility:
  3084. * Not appropriate for CUPS filters, drivers, and backends.
  3085. *
  3086. }
  3087. function PMPrinterSendCommand( printer: PMPrinter; commandString: CFStringRef; jobTitle: CFStringRef; options: CFDictionaryRef ): OSStatus; external name '_PMPrinterSendCommand';
  3088. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  3089. {
  3090. * PMPrinterCopyState()
  3091. *
  3092. * Summary:
  3093. * Copies the current "marker-change-time", "marker-colors",
  3094. * "marker-high-levels", "marker-levels", "marker-low-levels",
  3095. * "marker-message", "marker-names", "marker-types", "printer-state",
  3096. * "printer-state-change-time", "printer-state-message", and
  3097. * "printer-state-reasons" values for a print queue. These attributes are
  3098. * defined in the "CUPS Implementation of IPP" specification at:
  3099. *
  3100. * http://www.cups.org/documentation.php/spec-ipp.html
  3101. * http://localhost:631/help/spec-ipp.html
  3102. *
  3103. * Each attribute is returned using the corresponding CoreFoundation
  3104. * data type:
  3105. *
  3106. * Attribute Type
  3107. * --------------------------- ------------------------
  3108. * "marker-change-time" CFDateRef
  3109. * "marker-colors" CFArrayRef + CFStringRef
  3110. * "marker-high-levels" CFArrayRef + CFNumberRef
  3111. * "marker-levels" CFArrayRef + CFNumberRef
  3112. * "marker-low-levels" CFArrayRef + CFNumberRef
  3113. * "marker-message" CFStringRef
  3114. * "marker-names" CFArrayRef + CFStringRef
  3115. * "marker-types" CFArrayRef + CFStringRef
  3116. * "printer-state" CFNumberRef
  3117. * "printer-state-change-time" CFDateRef
  3118. * "printer-state-message" CFStringRef
  3119. * "printer-state-reasons" CFArrayRef + CFStringRef
  3120. *
  3121. * Localization Considerations:
  3122. *
  3123. * The "marker-message" and "printer-state-message" attributes may be
  3124. * localized by the printer driver using the language of the last processed
  3125. * print job.
  3126. *
  3127. * The "marker-names" and "printer-state-reasons" attributes are typically
  3128. * English-language keywords that may be localized using the printer's PPD
  3129. * file and CUPS ppdLocalizeMarkerName and ppdLocalizeIPPReason APIs,
  3130. * respectively.
  3131. *
  3132. * All other attributes are predefined keywords or values that are not
  3133. * localized.
  3134. *
  3135. * Parameters:
  3136. *
  3137. * printer:
  3138. * The destination print queue.
  3139. *
  3140. * stateDict:
  3141. * A pointer to a CFDictionaryRef variable to hold the values.
  3142. * You must release the dictionary when you are done using it.
  3143. * The dictionary returned is not mutable.
  3144. *
  3145. * Availability:
  3146. * Mac OS X: in version 10.6 and later in ApplicationServices.framework
  3147. * CarbonLib: not available
  3148. *
  3149. * Compatibility:
  3150. * Not appropriate for CUPS filters, drivers, and backends.
  3151. *
  3152. }
  3153. function PMPrinterCopyState( printer: PMPrinter; var stateDict: CFDictionaryRef ): OSStatus; external name '_PMPrinterCopyState';
  3154. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  3155. (*
  3156. //#pragma /mark
  3157. //#pragma /mark PPD related
  3158. //#pragma /mark
  3159. *)
  3160. {
  3161. * PMCopyAvailablePPDs()
  3162. *
  3163. * Summary:
  3164. * Hand back the list of PPDs in the specified PPD domain.
  3165. *
  3166. * Parameters:
  3167. *
  3168. * domain:
  3169. * The domain to search for PPDs.
  3170. *
  3171. * ppds:
  3172. * If this function completes without error, *'ppds' is set to an
  3173. * array of CFURLs. Each CFURL specifies the location of a PPD
  3174. * file or a compressed PPD file. The caller is responsible for
  3175. * releasing the array. If this function returns a non-zero error
  3176. * code then *'ppds' is set to NULL.
  3177. *
  3178. * Availability:
  3179. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  3180. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3181. * Non-Carbon CFM: not available
  3182. *
  3183. * Compatibility:
  3184. * Not appropriate for CUPS filters, drivers, and backends.
  3185. *
  3186. }
  3187. function PMCopyAvailablePPDs( domain: PMPPDDomain; var ppds: CFArrayRef ): OSStatus; external name '_PMCopyAvailablePPDs';
  3188. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3189. {
  3190. * PMCopyLocalizedPPD()
  3191. *
  3192. * Summary:
  3193. * Hand back a reference to a localized PPD.
  3194. *
  3195. * Parameters:
  3196. *
  3197. * ppd:
  3198. * A PPD reference. Typically this is a CFURLRef returned from
  3199. * PMCopyAvailablePPDs().
  3200. *
  3201. * localizedPPD:
  3202. * If this function completes without error, *'localizedPPD' will
  3203. * be set to a CFURLRef referencing the PPD that should be used
  3204. * given the current user's language preferences. If this function
  3205. * returns an error then *'localizedPPD' will be set to to NULL.
  3206. *
  3207. * Availability:
  3208. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  3209. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3210. * Non-Carbon CFM: not available
  3211. *
  3212. * Compatibility:
  3213. * Not appropriate for CUPS filters, drivers, and backends.
  3214. *
  3215. }
  3216. function PMCopyLocalizedPPD( ppd: CFURLRef; var localizedPPD: CFURLRef ): OSStatus; external name '_PMCopyLocalizedPPD';
  3217. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3218. {
  3219. * PMCopyPPDData()
  3220. *
  3221. * Summary:
  3222. * Hand back the uncompressed PPD data for a PPD or compressed PPD
  3223. * file.
  3224. *
  3225. * Parameters:
  3226. *
  3227. * ppd:
  3228. * A reference to a PPD or compressed PPD file. This reference is
  3229. * usually obtained from PMCopyAvailablePPDs() or from
  3230. * PMCopyLocalizedPPD().
  3231. *
  3232. * data:
  3233. * If this function completes without error then *'data' is set to
  3234. * reference the uncompressed PPD data from the PPD file. If this
  3235. * function returns a non-zero error then *'data is set to NULL.
  3236. *
  3237. * Availability:
  3238. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  3239. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  3240. * Non-Carbon CFM: not available
  3241. *
  3242. * Compatibility:
  3243. * Not appropriate for CUPS filters, drivers, and backends.
  3244. *
  3245. }
  3246. function PMCopyPPDData( ppd: CFURLRef; var data: CFDataRef ): OSStatus; external name '_PMCopyPPDData';
  3247. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  3248. (*
  3249. //#pragma /mark
  3250. //#pragma /mark EPS related
  3251. //#pragma /mark
  3252. *)
  3253. {
  3254. * PMCGImageCreateWithEPSDataProvider()
  3255. *
  3256. * Summary:
  3257. * Create an image reference that references both the PostScript
  3258. * contents of an EPS file and a preview (proxy) image for that EPS
  3259. * file.
  3260. *
  3261. * Discussion:
  3262. * For OS X 10.1.0, this function ignores the passed in data
  3263. * provider. The passed in image reference is retained and then
  3264. * returned. For 10.1.1 and later, then the data provider is used
  3265. * and the returned image reference is different than the passed in
  3266. * image reference, so please be careful with your use of these
  3267. * references. It is likely that the data will not be read from the
  3268. * EPS data provider until well after this function returns. The
  3269. * caller should be careful not to free the underlying EPS data
  3270. * until the provider's release routine is invoked. Similarly the
  3271. * preview image's data may be needed long after you think it should
  3272. * be. Do not free the image data until the image data provider's
  3273. * release data function has been called. To make sure these data
  3274. * providers are properly reference counted, release your reference
  3275. * the EPS data provider and on the EPS image preview when they are
  3276. * no longer needed by your application. For Mac OS X 10.2 and
  3277. * later, the contents of the EPS provider at the time of this call
  3278. * can be dumped to a file if you first do the following, BEFORE
  3279. * running your application.
  3280. *
  3281. * From the command line in terminal:
  3282. * defaults write NSGlobalDomain com.apple.print.eps.testProvider /tmp/dump.eps
  3283. *
  3284. * causes a dump of the EPS data into a file /tmp/dump.eps.
  3285. *
  3286. * Parameters:
  3287. *
  3288. * epsDataProvider:
  3289. * A Core Graphics data provider that can supply the PostScript
  3290. * contents of the EPS file. Post OS X 10.1, there will be some
  3291. * checking done on the EPS data provided to the
  3292. * PMCGImageCreateWithEPSDataProvider() call. It is important that
  3293. * the EPS data begin with the EPSF required header and bounding
  3294. * box DSC comments.
  3295. *
  3296. * epsPreview:
  3297. * A Core Graphics image reference to the proxy image for the EPS
  3298. * file. When the image reference result of this function is
  3299. * rendered on screen or printed to a printer that can not render
  3300. * PostScript this proxy image is drawn instead.
  3301. *
  3302. * Result:
  3303. * an image reference capable of rendering either the EPS content or
  3304. * the proxy image depending upon the capabilities of the targeted
  3305. * context.
  3306. *
  3307. * Availability:
  3308. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  3309. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  3310. * Non-Carbon CFM: not available
  3311. *
  3312. * Compatibility:
  3313. * Not appropriate for CUPS filters, drivers, and backends.
  3314. *
  3315. }
  3316. function PMCGImageCreateWithEPSDataProvider( epsDataProvider: CGDataProviderRef; epsPreview: CGImageRef ): CGImageRef; external name '_PMCGImageCreateWithEPSDataProvider';
  3317. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  3318. {$endc} {TARGET_OS_MAC}
  3319. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  3320. end.
  3321. {$endc} {not MACOSALLINCLUDE}