CGWindow.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. { CoreGraphics - CGWindow.h
  2. Copyright (c) 2006-2008 Apple Inc.
  3. All rights reserved. }
  4. { Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  5. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  6. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, August 2015 }
  7. {
  8. Modified for use with Free Pascal
  9. Version 308
  10. Please report any bugs to <[email protected]>
  11. }
  12. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  13. {$mode macpas}
  14. {$modeswitch cblocks}
  15. {$packenum 1}
  16. {$macro on}
  17. {$inline on}
  18. {$calling mwpascal}
  19. {$IFNDEF FPC_DOTTEDUNITS}
  20. unit CGWindow;
  21. {$ENDIF FPC_DOTTEDUNITS}
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  24. {$setc GAP_INTERFACES_VERSION := $0308}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  40. {$setc __ppc64__ := 1}
  41. {$elsec}
  42. {$setc __ppc64__ := 0}
  43. {$endc}
  44. {$ifc not defined __i386__ and defined CPUI386}
  45. {$setc __i386__ := 1}
  46. {$elsec}
  47. {$setc __i386__ := 0}
  48. {$endc}
  49. {$ifc not defined __x86_64__ and defined CPUX86_64}
  50. {$setc __x86_64__ := 1}
  51. {$elsec}
  52. {$setc __x86_64__ := 0}
  53. {$endc}
  54. {$ifc not defined __arm__ and defined CPUARM}
  55. {$setc __arm__ := 1}
  56. {$elsec}
  57. {$setc __arm__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm64__ and defined CPUAARCH64}
  60. {$setc __arm64__ := 1}
  61. {$elsec}
  62. {$setc __arm64__ := 0}
  63. {$endc}
  64. {$ifc defined cpu64}
  65. {$setc __LP64__ := 1}
  66. {$elsec}
  67. {$setc __LP64__ := 0}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  70. {$error Conflicting definitions for __ppc__ and __i386__}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__}
  73. {$setc TARGET_CPU_PPC := TRUE}
  74. {$setc TARGET_CPU_PPC64 := FALSE}
  75. {$setc TARGET_CPU_X86 := FALSE}
  76. {$setc TARGET_CPU_X86_64 := FALSE}
  77. {$setc TARGET_CPU_ARM := FALSE}
  78. {$setc TARGET_CPU_ARM64 := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_IPHONE := FALSE}
  81. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  82. {$setc TARGET_OS_EMBEDDED := FALSE}
  83. {$elifc defined __ppc64__ and __ppc64__}
  84. {$setc TARGET_CPU_PPC := FALSE}
  85. {$setc TARGET_CPU_PPC64 := TRUE}
  86. {$setc TARGET_CPU_X86 := FALSE}
  87. {$setc TARGET_CPU_X86_64 := FALSE}
  88. {$setc TARGET_CPU_ARM := FALSE}
  89. {$setc TARGET_CPU_ARM64 := FALSE}
  90. {$setc TARGET_OS_MAC := TRUE}
  91. {$setc TARGET_OS_IPHONE := FALSE}
  92. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  93. {$setc TARGET_OS_EMBEDDED := FALSE}
  94. {$elifc defined __i386__ and __i386__}
  95. {$setc TARGET_CPU_PPC := FALSE}
  96. {$setc TARGET_CPU_PPC64 := FALSE}
  97. {$setc TARGET_CPU_X86 := TRUE}
  98. {$setc TARGET_CPU_X86_64 := FALSE}
  99. {$setc TARGET_CPU_ARM := FALSE}
  100. {$setc TARGET_CPU_ARM64 := FALSE}
  101. {$ifc defined iphonesim}
  102. {$setc TARGET_OS_MAC := FALSE}
  103. {$setc TARGET_OS_IPHONE := TRUE}
  104. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  105. {$elsec}
  106. {$setc TARGET_OS_MAC := TRUE}
  107. {$setc TARGET_OS_IPHONE := FALSE}
  108. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  109. {$endc}
  110. {$setc TARGET_OS_EMBEDDED := FALSE}
  111. {$elifc defined __x86_64__ and __x86_64__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := FALSE}
  115. {$setc TARGET_CPU_X86_64 := TRUE}
  116. {$setc TARGET_CPU_ARM := FALSE}
  117. {$setc TARGET_CPU_ARM64 := FALSE}
  118. {$ifc defined iphonesim}
  119. {$setc TARGET_OS_MAC := FALSE}
  120. {$setc TARGET_OS_IPHONE := TRUE}
  121. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  122. {$elsec}
  123. {$setc TARGET_OS_MAC := TRUE}
  124. {$setc TARGET_OS_IPHONE := FALSE}
  125. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  126. {$endc}
  127. {$setc TARGET_OS_EMBEDDED := FALSE}
  128. {$elifc defined __arm__ and __arm__}
  129. {$setc TARGET_CPU_PPC := FALSE}
  130. {$setc TARGET_CPU_PPC64 := FALSE}
  131. {$setc TARGET_CPU_X86 := FALSE}
  132. {$setc TARGET_CPU_X86_64 := FALSE}
  133. {$setc TARGET_CPU_ARM := TRUE}
  134. {$setc TARGET_CPU_ARM64 := FALSE}
  135. {$setc TARGET_OS_MAC := FALSE}
  136. {$setc TARGET_OS_IPHONE := TRUE}
  137. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  138. {$setc TARGET_OS_EMBEDDED := TRUE}
  139. {$elifc defined __arm64__ and __arm64__}
  140. {$setc TARGET_CPU_PPC := FALSE}
  141. {$setc TARGET_CPU_PPC64 := FALSE}
  142. {$setc TARGET_CPU_X86 := FALSE}
  143. {$setc TARGET_CPU_X86_64 := FALSE}
  144. {$setc TARGET_CPU_ARM := FALSE}
  145. {$setc TARGET_CPU_ARM64 := TRUE}
  146. {$ifc defined ios}
  147. {$setc TARGET_OS_MAC := FALSE}
  148. {$setc TARGET_OS_IPHONE := TRUE}
  149. {$setc TARGET_OS_EMBEDDED := TRUE}
  150. {$elsec}
  151. {$setc TARGET_OS_MAC := TRUE}
  152. {$setc TARGET_OS_IPHONE := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := FALSE}
  154. {$endc}
  155. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  156. {$elsec}
  157. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  158. {$endc}
  159. {$ifc defined __LP64__ and __LP64__ }
  160. {$setc TARGET_CPU_64 := TRUE}
  161. {$elsec}
  162. {$setc TARGET_CPU_64 := FALSE}
  163. {$endc}
  164. {$ifc defined FPC_BIG_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  167. {$elifc defined FPC_LITTLE_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  170. {$elsec}
  171. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  172. {$endc}
  173. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  174. {$setc CALL_NOT_IN_CARBON := FALSE}
  175. {$setc OLDROUTINENAMES := FALSE}
  176. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  177. {$setc OPAQUE_UPP_TYPES := TRUE}
  178. {$setc OTCARBONAPPLICATION := TRUE}
  179. {$setc OTKERNEL := FALSE}
  180. {$setc PM_USE_SESSION_APIS := TRUE}
  181. {$setc TARGET_API_MAC_CARBON := TRUE}
  182. {$setc TARGET_API_MAC_OS8 := FALSE}
  183. {$setc TARGET_API_MAC_OSX := TRUE}
  184. {$setc TARGET_CARBON := TRUE}
  185. {$setc TARGET_CPU_68K := FALSE}
  186. {$setc TARGET_CPU_MIPS := FALSE}
  187. {$setc TARGET_CPU_SPARC := FALSE}
  188. {$setc TARGET_OS_UNIX := FALSE}
  189. {$setc TARGET_OS_WIN32 := FALSE}
  190. {$setc TARGET_RT_MAC_68881 := FALSE}
  191. {$setc TARGET_RT_MAC_CFM := FALSE}
  192. {$setc TARGET_RT_MAC_MACHO := TRUE}
  193. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  194. {$setc TYPE_BOOL := FALSE}
  195. {$setc TYPE_EXTENDED := FALSE}
  196. {$setc TYPE_LONGLONG := TRUE}
  197. {$IFDEF FPC_DOTTEDUNITS}
  198. uses MacOsApi.MacTypes,MacOsApi.CGBase,MacOsApi.CGGeometry,MacOsApi.CGImage,MacOsApi.CFBase,MacOsApi.CFDictionary,MacOsApi.CFArray,MacOsApi.CFNumber;
  199. {$ELSE FPC_DOTTEDUNITS}
  200. uses MacTypes,CGBase,CGGeometry,CGImage,CFBase,CFDictionary,CFArray,CFNumber;
  201. {$ENDIF FPC_DOTTEDUNITS}
  202. {$endc} {not MACOSALLINCLUDE}
  203. {$ALIGN POWER}
  204. { The CGWindowID contains a unique value within the user session
  205. representing a window }
  206. type
  207. CGWindowID = UInt32;
  208. { Options for use with these APIs. }
  209. type
  210. CGWindowListOption = UInt32;
  211. CGWindowImageOption = UInt32;
  212. { Values used for `CGWindowSharingType'. }
  213. const
  214. kCGWindowSharingNone = 0;
  215. kCGWindowSharingReadOnly = 1;
  216. kCGWindowSharingReadWrite = 2;
  217. type
  218. CGWindowSharingType = UInt32;
  219. { Values used for `CGWindowBackingType'. }
  220. const
  221. kCGBackingStoreRetained = 0;
  222. kCGBackingStoreNonretained = 1;
  223. kCGBackingStoreBuffered = 2;
  224. type
  225. CGWindowBackingType = UInt32;
  226. { A value which is never the window ID of any window. }
  227. const
  228. kCGNullWindowID = CGWindowID(0);
  229. {$ifc TARGET_OS_MAC}
  230. { Keys for window dictionaries. }
  231. { The window ID, a unique value within the user session representing the
  232. window. The value of this key is a CFNumber 32-bit signed integer
  233. value. }
  234. var kCGWindowNumber: CFStringRef; external name '_kCGWindowNumber'; (* attribute const *)
  235. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  236. { The backing store type of the window, one of `kCGBackingStoreRetained',
  237. `kCGBackingStoreNonretained', or `kCGBackingStoreBuffered'. The value of
  238. this key is a CFNumber 32-bit signed integer value. }
  239. var kCGWindowStoreType: CFStringRef; external name '_kCGWindowStoreType'; (* attribute const *)
  240. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  241. { The window layer number of the window. The value of this key is a
  242. CFNumber 32-bit signed integer value. }
  243. var kCGWindowLayer: CFStringRef; external name '_kCGWindowLayer'; (* attribute const *)
  244. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  245. { The bounds of the window in screen space, with the origin at the
  246. upper-left corner of the main display. The value of this key is a
  247. CFDictionary; use `CGRectMakeWithDictionaryRepresentation' to obtain the
  248. bounds as a CGRect value. }
  249. var kCGWindowBounds: CFStringRef; external name '_kCGWindowBounds'; (* attribute const *)
  250. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  251. { The sharing state of the window, one of `kCGWindowSharingNone',
  252. `kCGWindowSharingReadOnly', or `kCGWindowSharingReadWrite'. The value of
  253. this key is a CFNumber 32-bit signed integer value. }
  254. var kCGWindowSharingState: CFStringRef; external name '_kCGWindowSharingState'; (* attribute const *)
  255. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  256. { The alpha fade of the window. The value of this key is a CFNumber
  257. floating-point value. The value 1.0 is normal (opaque); the value 0.0 is
  258. fully transparent (invisible). }
  259. var kCGWindowAlpha: CFStringRef; external name '_kCGWindowAlpha'; (* attribute const *)
  260. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  261. { The process ID of the process that owns the window. The value of this key
  262. is a CFNumber 32-bit signed integer value. }
  263. var kCGWindowOwnerPID: CFStringRef; external name '_kCGWindowOwnerPID'; (* attribute const *)
  264. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  265. { An estimate of the memory in bytes currently used by the window and its
  266. supporting data structures. The value of this key is a CFNumber 64-bit
  267. signed integer value. }
  268. var kCGWindowMemoryUsage: CFStringRef; external name '_kCGWindowMemoryUsage'; (* attribute const *)
  269. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  270. { Optional keys for window dictionaries. }
  271. { If present, the workspace ID of the workspace associated with the window.
  272. The value of this key is a CFNumber 32-bit signed integer value. }
  273. var kCGWindowWorkspace: CFStringRef; external name '_kCGWindowWorkspace'; (* attribute const *)
  274. (* CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  275. { If present, the name of the application process which owns the window.
  276. The value of this key is a CFString. }
  277. var kCGWindowOwnerName: CFStringRef; external name '_kCGWindowOwnerName'; (* attribute const *)
  278. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  279. { If present, the name of the window. The value of this key is a
  280. CFString. }
  281. var kCGWindowName: CFStringRef; external name '_kCGWindowName'; (* attribute const *)
  282. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  283. { If present, true if the window is ordered on screen, false otherwise. If
  284. the key is not present, then the window is not ordered on screen. The
  285. value of this key is a CFBoolean. }
  286. var kCGWindowIsOnscreen: CFStringRef; external name '_kCGWindowIsOnscreen'; (* attribute const *)
  287. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  288. { If present, true if the window backing store is in video memory, false
  289. otherwise. If the key is not present, then the window backing store is in
  290. main memory. The value of this key is a CFBoolean. }
  291. var kCGWindowBackingLocationVideoMemory: CFStringRef; external name '_kCGWindowBackingLocationVideoMemory'; (* attribute const *)
  292. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  293. {$endc} {TARGET_OS_MAC}
  294. { Flags for CGWindowListOption values. These may be ORed together. }
  295. const
  296. { List all windows in this user session, including both on- and
  297. off-screen windows. The parameter `relativeToWindow' should be
  298. `kCGNullWindowID'. }
  299. kCGWindowListOptionAll = 0;
  300. { List all on-screen windows in this user session, ordered from front to
  301. back. The parameter `relativeToWindow' should be `kCGNullWindowID'. }
  302. kCGWindowListOptionOnScreenOnly = 1 shl 0;
  303. { List all on-screen windows above the window specified by
  304. `relativeToWindow', ordered from front to back. }
  305. kCGWindowListOptionOnScreenAboveWindow = 1 shl 1;
  306. { List all on-screen windows below the window specified by
  307. `relativeToWindow', ordered from front to back. }
  308. kCGWindowListOptionOnScreenBelowWindow = 1 shl 2;
  309. { Include the window specified by `relativeToWindow' in any list,
  310. effectively creating `at-or-above' or `at-or-below' lists. }
  311. kCGWindowListOptionIncludingWindow = 1 shl 3;
  312. { Exclude any windows from the list that are elements of the desktop. }
  313. kCGWindowListExcludeDesktopElements = 1 shl 4;
  314. {$ifc TARGET_OS_MAC}
  315. { Return an array of window dictionaries for windows within the user
  316. session.
  317. This function returns NULL if the caller is not running within a Quartz
  318. GUI session or the window server is disabled. You should release the
  319. array when you are finished using it. }
  320. function CGWindowListCopyWindowInfo( option: CGWindowListOption; relativeToWindow: CGWindowID ): CFArrayRef; external name '_CGWindowListCopyWindowInfo';
  321. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  322. { Return an array of CGWindowID values for windows within the user session.
  323. This function returns NULL if the caller is not running within a Quartz
  324. GUI session or the window server is disabled. You should release the
  325. array when you are finished using it. }
  326. function CGWindowListCreate( option: CGWindowListOption; relativeToWindow: CGWindowID ): CFArrayRef; external name '_CGWindowListCreate';
  327. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  328. { Return an array of window dictionaries, each corresponding to a window ID
  329. specified in `windowArray'.
  330. This function returns NULL if the caller is not running within a Quartz
  331. GUI session or the window server is disabled. You should release the
  332. array when you are finished using it. }
  333. function CGWindowListCreateDescriptionFromArray( windowArray: CFArrayRef ): CFArrayRef; external name '_CGWindowListCreateDescriptionFromArray';
  334. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  335. {$endc} {TARGET_OS_MAC}
  336. { Flags for CGWindowImageOption values. These may be ORed together. }
  337. const
  338. { If `CGRectNull' is passed as the screen bounds, then then bounds
  339. computation includes window frame ornamentation, such as a shadow. }
  340. kCGWindowImageDefault = 0;
  341. { If `CGRectNull' is passed as the screen bounds, then then bounds
  342. computation excludes window frame ornamentation, such as a shadow. }
  343. kCGWindowImageBoundsIgnoreFraming = 1 shl 0;
  344. { Force the created image to be opaque. Empty areas are white }
  345. kCGWindowImageShouldBeOpaque = 1 shl 1;
  346. { Only draw the windows' shadows, not the windows themselves. }
  347. kCGWindowImageOnlyShadows = 1 shl 2;
  348. { Return the best image resolution. The screen size may be
  349. different than the returned image size. }
  350. kCGWindowImageBestResolution = 1 shl 3;
  351. { Return the nominal image resolution. The screen size
  352. equals the returned image size. }
  353. kCGWindowImageNominalResolution = 1 shl 4;
  354. {$ifc TARGET_OS_MAC}
  355. { Create an image containing a composite of the specified set of windows
  356. contained within a rectangular area. The set of windows is specified
  357. using options from `CGWindowListOption', along with an optional
  358. additional window ID.
  359. The windows list options are:
  360. --- kCGWindowListOptionAll, kCGWindowListOptionOnScreenOnly: Use all
  361. on-screen windows in this user session to construct the image. The
  362. parameter `windowID' should be `kCGNullWindowID'.
  363. --- kCGWindowListOptionOnScreenAboveWindow: Use all on-screen windows in
  364. this user session above the window specified by `windowID', ordered from
  365. front to back, to construct the image. To include the window specified by
  366. `windowID', add the flag `kCGWindowListOptionIncludingWindow'.
  367. --- kCGWindowListOptionOnScreenBelowWindow: Use all on-screen windows in
  368. this user session below the window specified by `windowID', ordered from
  369. front to back, to construct the image. To include the window specified by
  370. `windowID', add the flag `kCGWindowListOptionIncludingWindow'.
  371. --- kCGWindowListOptionIncludingWindow: Use only the window specified by
  372. `windowID' to construct the image.
  373. The parameter `screenBounds' specifies the rectangle in screen space
  374. (origin at the upper-left; y-value increasing downward). Setting
  375. `screenBounds' to `CGRectInfinite' will include all the windows on the
  376. entire desktop. Setting `screenBounds' to `CGRectNull' will use the
  377. bounding box of the specified windows as the screen space rectangle.
  378. The parameter `imageOptions' allows you to specify whether the window
  379. frame ornamentation, such as a shadow or similar effect, should be
  380. included or excluded in the bounds calculation when `CGRectNull' is
  381. specified for the window bounds.
  382. If no windows meet the specified criteria, or the windows can't be read,
  383. then a transparent black image will be returned.
  384. Any on-screen window with sharing type `kCGWindowSharingNone' will not
  385. be included in the image.
  386. This function returns NULL if the caller is not running within a Quartz
  387. GUI session or the window server is disabled. }
  388. function CGWindowListCreateImage( screenBounds: CGRect; listOption: CGWindowListOption; windowID: CGWindowID; imageOption: CGWindowImageOption ): CGImageRef; external name '_CGWindowListCreateImage';
  389. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  390. { Create an image containing a composite of the specified set of windows
  391. contained within a rectangular area à la `CGWindowListCreateImage'. The
  392. set of windows is specified by `windowArray', an array of window IDs. }
  393. function CGWindowListCreateImageFromArray( screenBounds: CGRect; windowArray: CFArrayRef; imageOption: CGWindowImageOption ): CGImageRef; external name '_CGWindowListCreateImageFromArray';
  394. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  395. {$endc} {TARGET_OS_MAC}
  396. { A CFNumberRef encoding appropriate for use with a CGWindowID. }
  397. const
  398. kCGWindowIDCFNumberType = kCFNumberSInt32Type;
  399. { CFNumberRef encoding appropriate for use with CGWindowSharingType }
  400. const
  401. kCGWindowSharingCFNumberType = kCFNumberSInt32Type;
  402. { CFNumberRef encoding appropriate for use with CGWindowBackingType }
  403. const
  404. kCGWindowBackingCFNumberType = kCFNumberSInt32Type;
  405. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  406. end.
  407. {$endc} {not MACOSALLINCLUDE}