CGDisplayConfiguration.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. { CoreGraphics - CGDisplayConfiguration.h
  2. Copyright (c) 2002-2011 Apple Inc.
  3. All rights reserved. }
  4. { Pascal Translation: Peter N Lewis, <[email protected]>, August 2005 }
  5. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  6. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  7. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, August 2015 }
  8. {
  9. Modified for use with Free Pascal
  10. Version 308
  11. Please report any bugs to <[email protected]>
  12. }
  13. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  14. {$mode macpas}
  15. {$modeswitch cblocks}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. {$IFNDEF FPC_DOTTEDUNITS}
  21. unit CGDisplayConfiguration;
  22. {$ENDIF FPC_DOTTEDUNITS}
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  25. {$setc GAP_INTERFACES_VERSION := $0308}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  41. {$setc __ppc64__ := 1}
  42. {$elsec}
  43. {$setc __ppc64__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc not defined __x86_64__ and defined CPUX86_64}
  51. {$setc __x86_64__ := 1}
  52. {$elsec}
  53. {$setc __x86_64__ := 0}
  54. {$endc}
  55. {$ifc not defined __arm__ and defined CPUARM}
  56. {$setc __arm__ := 1}
  57. {$elsec}
  58. {$setc __arm__ := 0}
  59. {$endc}
  60. {$ifc not defined __arm64__ and defined CPUAARCH64}
  61. {$setc __arm64__ := 1}
  62. {$elsec}
  63. {$setc __arm64__ := 0}
  64. {$endc}
  65. {$ifc defined cpu64}
  66. {$setc __LP64__ := 1}
  67. {$elsec}
  68. {$setc __LP64__ := 0}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  71. {$error Conflicting definitions for __ppc__ and __i386__}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__}
  74. {$setc TARGET_CPU_PPC := TRUE}
  75. {$setc TARGET_CPU_PPC64 := FALSE}
  76. {$setc TARGET_CPU_X86 := FALSE}
  77. {$setc TARGET_CPU_X86_64 := FALSE}
  78. {$setc TARGET_CPU_ARM := FALSE}
  79. {$setc TARGET_CPU_ARM64 := FALSE}
  80. {$setc TARGET_OS_MAC := TRUE}
  81. {$setc TARGET_OS_IPHONE := FALSE}
  82. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  83. {$setc TARGET_OS_EMBEDDED := FALSE}
  84. {$elifc defined __ppc64__ and __ppc64__}
  85. {$setc TARGET_CPU_PPC := FALSE}
  86. {$setc TARGET_CPU_PPC64 := TRUE}
  87. {$setc TARGET_CPU_X86 := FALSE}
  88. {$setc TARGET_CPU_X86_64 := FALSE}
  89. {$setc TARGET_CPU_ARM := FALSE}
  90. {$setc TARGET_CPU_ARM64 := FALSE}
  91. {$setc TARGET_OS_MAC := TRUE}
  92. {$setc TARGET_OS_IPHONE := FALSE}
  93. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  94. {$setc TARGET_OS_EMBEDDED := FALSE}
  95. {$elifc defined __i386__ and __i386__}
  96. {$setc TARGET_CPU_PPC := FALSE}
  97. {$setc TARGET_CPU_PPC64 := FALSE}
  98. {$setc TARGET_CPU_X86 := TRUE}
  99. {$setc TARGET_CPU_X86_64 := FALSE}
  100. {$setc TARGET_CPU_ARM := FALSE}
  101. {$setc TARGET_CPU_ARM64 := FALSE}
  102. {$ifc defined iphonesim}
  103. {$setc TARGET_OS_MAC := FALSE}
  104. {$setc TARGET_OS_IPHONE := TRUE}
  105. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  106. {$elsec}
  107. {$setc TARGET_OS_MAC := TRUE}
  108. {$setc TARGET_OS_IPHONE := FALSE}
  109. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  110. {$endc}
  111. {$setc TARGET_OS_EMBEDDED := FALSE}
  112. {$elifc defined __x86_64__ and __x86_64__}
  113. {$setc TARGET_CPU_PPC := FALSE}
  114. {$setc TARGET_CPU_PPC64 := FALSE}
  115. {$setc TARGET_CPU_X86 := FALSE}
  116. {$setc TARGET_CPU_X86_64 := TRUE}
  117. {$setc TARGET_CPU_ARM := FALSE}
  118. {$setc TARGET_CPU_ARM64 := FALSE}
  119. {$ifc defined iphonesim}
  120. {$setc TARGET_OS_MAC := FALSE}
  121. {$setc TARGET_OS_IPHONE := TRUE}
  122. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  123. {$elsec}
  124. {$setc TARGET_OS_MAC := TRUE}
  125. {$setc TARGET_OS_IPHONE := FALSE}
  126. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  127. {$endc}
  128. {$setc TARGET_OS_EMBEDDED := FALSE}
  129. {$elifc defined __arm__ and __arm__}
  130. {$setc TARGET_CPU_PPC := FALSE}
  131. {$setc TARGET_CPU_PPC64 := FALSE}
  132. {$setc TARGET_CPU_X86 := FALSE}
  133. {$setc TARGET_CPU_X86_64 := FALSE}
  134. {$setc TARGET_CPU_ARM := TRUE}
  135. {$setc TARGET_CPU_ARM64 := FALSE}
  136. {$setc TARGET_OS_MAC := FALSE}
  137. {$setc TARGET_OS_IPHONE := TRUE}
  138. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  139. {$setc TARGET_OS_EMBEDDED := TRUE}
  140. {$elifc defined __arm64__ and __arm64__}
  141. {$setc TARGET_CPU_PPC := FALSE}
  142. {$setc TARGET_CPU_PPC64 := FALSE}
  143. {$setc TARGET_CPU_X86 := FALSE}
  144. {$setc TARGET_CPU_X86_64 := FALSE}
  145. {$setc TARGET_CPU_ARM := FALSE}
  146. {$setc TARGET_CPU_ARM64 := TRUE}
  147. {$ifc defined ios}
  148. {$setc TARGET_OS_MAC := FALSE}
  149. {$setc TARGET_OS_IPHONE := TRUE}
  150. {$setc TARGET_OS_EMBEDDED := TRUE}
  151. {$elsec}
  152. {$setc TARGET_OS_MAC := TRUE}
  153. {$setc TARGET_OS_IPHONE := FALSE}
  154. {$setc TARGET_OS_EMBEDDED := FALSE}
  155. {$endc}
  156. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  157. {$elsec}
  158. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  159. {$endc}
  160. {$ifc defined __LP64__ and __LP64__ }
  161. {$setc TARGET_CPU_64 := TRUE}
  162. {$elsec}
  163. {$setc TARGET_CPU_64 := FALSE}
  164. {$endc}
  165. {$ifc defined FPC_BIG_ENDIAN}
  166. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  167. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  168. {$elifc defined FPC_LITTLE_ENDIAN}
  169. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  170. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  171. {$elsec}
  172. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  173. {$endc}
  174. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  175. {$setc CALL_NOT_IN_CARBON := FALSE}
  176. {$setc OLDROUTINENAMES := FALSE}
  177. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  178. {$setc OPAQUE_UPP_TYPES := TRUE}
  179. {$setc OTCARBONAPPLICATION := TRUE}
  180. {$setc OTKERNEL := FALSE}
  181. {$setc PM_USE_SESSION_APIS := TRUE}
  182. {$setc TARGET_API_MAC_CARBON := TRUE}
  183. {$setc TARGET_API_MAC_OS8 := FALSE}
  184. {$setc TARGET_API_MAC_OSX := TRUE}
  185. {$setc TARGET_CARBON := TRUE}
  186. {$setc TARGET_CPU_68K := FALSE}
  187. {$setc TARGET_CPU_MIPS := FALSE}
  188. {$setc TARGET_CPU_SPARC := FALSE}
  189. {$setc TARGET_OS_UNIX := FALSE}
  190. {$setc TARGET_OS_WIN32 := FALSE}
  191. {$setc TARGET_RT_MAC_68881 := FALSE}
  192. {$setc TARGET_RT_MAC_CFM := FALSE}
  193. {$setc TARGET_RT_MAC_MACHO := TRUE}
  194. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  195. {$setc TYPE_BOOL := FALSE}
  196. {$setc TYPE_EXTENDED := FALSE}
  197. {$setc TYPE_LONGLONG := TRUE}
  198. {$IFDEF FPC_DOTTEDUNITS}
  199. uses MacOsApi.MacTypes,MacOsApi.CGBase,MacOsApi.CGDirectDisplay,MacOsApi.CGColorSpace,MacOsApi.CGErrors,MacOsApi.CFDictionary,MacOsApi.CGGeometry;
  200. {$ELSE FPC_DOTTEDUNITS}
  201. uses MacTypes,CGBase,CGDirectDisplay,CGColorSpace,CGErrors,CFDictionary,CGGeometry;
  202. {$ENDIF FPC_DOTTEDUNITS}
  203. {$endc} {not MACOSALLINCLUDE}
  204. {$ALIGN POWER}
  205. { The display reconfiguration process:
  206. - Call `CGBeginDisplayConfiguration' to start.
  207. - Make all desired changes for all displays.
  208. - Commit the changes using `CGPerformDisplayConfiguration', or cancel
  209. with `CGCancelDisplayConfiguration'.
  210. The resulting layout will be adjusted to remove gaps or overlaps from the
  211. requested layout, if needed. }
  212. type
  213. CGDisplayConfigRef = ^_CGDisplayConfigRef; { an opaque type }
  214. _CGDisplayConfigRef = record end;
  215. {$ifc TARGET_OS_MAC}
  216. { Begin a new set of display configuration changes. This function creates a
  217. display configuration which provides a context for a set of display
  218. configuration changes. Use `CGCompleteDisplayConfiguration' to apply the
  219. changes in a single transaction. }
  220. function CGBeginDisplayConfiguration( var config: CGDisplayConfigRef ): CGError; external name '_CGBeginDisplayConfiguration';
  221. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  222. { Configure the origin of a display in global display coordinates.
  223. The new origin of the display is placed as close as possible to the
  224. requested location, without overlapping or leaving a gap between
  225. displays.
  226. Any display whose origin is not explicitly set in a reconfiguration will
  227. be repositioned to a location as close as possible to its current
  228. location without overlapping or leaving a gap between displays.
  229. Note that setting the origin of a display which is mirroring another
  230. display will remove that display from any mirroring set. }
  231. function CGConfigureDisplayOrigin( config: CGDisplayConfigRef; display: CGDirectDisplayID; x: SInt32; y: SInt32 ): CGError; external name '_CGConfigureDisplayOrigin';
  232. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  233. { Configure the display mode of a display. The "options" field is reserved
  234. for future expansion; pass NULL for now.
  235. A display mode is a set of properties such as width, height, pixel depth,
  236. and refresh rate, and options such as stretched LCD panel filling.
  237. If you use this function to change the mode of a display in a mirroring
  238. set, Quartz may adjust the bounds, resolutions, and depth of the other
  239. displays in the set to a safe mode, with matching depth and the smallest
  240. enclosing size. }
  241. function CGConfigureDisplayWithDisplayMode( config: CGDisplayConfigRef; display: CGDirectDisplayID; mode: CGDisplayModeRef; options: CFDictionaryRef ): CGError; external name '_CGConfigureDisplayWithDisplayMode';
  242. (* CG_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA) *)
  243. { Enable or disable stereo operation for a display.
  244. Note that the system normally detects the presence of a stereo window,
  245. and will automatically switch a display containing a stereo window to
  246. stereo operation. This function provides a mechanism to force a display
  247. to stereo operation, and to set options (such as blue line sync signal)
  248. when in stereo operation.
  249. When in stereo operation, a display may need to generate a special stereo
  250. sync signal as part of the video output. The sync signal consists of a
  251. blue line which occupies the first 25% of the last scanline for the left
  252. eye view, and the first 75% of the last scanline for the right eye view.
  253. The remainder of the scanline is black. To force the display to generate
  254. this sync signal, pass true for `forceBlueLine'; otherwise, pass false.
  255. Returns `kCGErrorSuccess' on success, or `kCGErrorRangeCheck' if the
  256. display does not support the stereo operation settings requested.
  257. On success, the display resolution, mirroring mode, and available display
  258. modes may change due to hardware-specific capabilities and limitations.
  259. You should check these settings to verify that they are appropriate for
  260. your application. }
  261. function CGConfigureDisplayStereoOperation( config: CGDisplayConfigRef; display: CGDirectDisplayID; stereo: boolean_t; forceBlueLine: boolean_t ): CGError; external name '_CGConfigureDisplayStereoOperation';
  262. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  263. { Make a display a mirror of a master display.
  264. Pass `kCGNullDirectDisplay' for the master display to disable mirroring.
  265. Pass `CGMainDisplayID()' for the master display to mirror the main
  266. display.
  267. Display mirroring and display matte generation are implemented either in
  268. hardware (preferred) or software, at the discretion of the device driver.
  269. - Hardware mirroring
  270. With hardware mirroring enabled, all drawing is directed to the primary
  271. display --- see CGDisplayPrimaryDisplay.
  272. If the device driver selects hardware matte generation, the display
  273. bounds and rowbytes values are adjusted to reflect the active drawable
  274. area.
  275. - Software mirroring
  276. In this form of mirroring, identical content is drawn into each display
  277. in the mirroring set. Applications that use the window system need not
  278. be concerned about mirroring, as the window system takes care of all
  279. flushing of window content to the appropriate displays.
  280. Applications that draw directly to the display, as with display
  281. capture, must make sure to draw the same content to all mirrored
  282. displays in a software mirror set. When drawing to software mirrored
  283. displays using a full screen OpenGL context (not drawing through a
  284. window), you should create shared OpenGL contexts for each display and
  285. re-render for each display.
  286. You can use the function `CGGetActiveDisplayList' to determine which
  287. displays are active, or drawable. This automatically gives your
  288. application the correct view of the current displays. }
  289. function CGConfigureDisplayMirrorOfDisplay( config: CGDisplayConfigRef; display: CGDirectDisplayID; master: CGDirectDisplayID ): CGError; external name '_CGConfigureDisplayMirrorOfDisplay';
  290. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  291. { Cancel a set of display configuration changes. On return, the
  292. configuration is cancelled and is no longer valid. }
  293. function CGCancelDisplayConfiguration( config: CGDisplayConfigRef ): CGError; external name '_CGCancelDisplayConfiguration';
  294. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  295. { Complete a set of display configuration changes. On return, the
  296. configuration is no longer valid.
  297. A configuration change can apply for the life of an application, the life
  298. of a login session, or permanently. If a request is made to make a change
  299. permanent, and the change cannot be supported by Mac OS X user interface,
  300. then the configuration change lasts only for the current login session.
  301. A permanent configuration change also becomes the current session's
  302. configuration.
  303. When the system reverts configurations at app termination, the
  304. configuration reverts to the session or permanent configuration setting.
  305. When the system reverts configurations at session termination, the
  306. configuration reverts to the permanent configuration setting.
  307. This operation may fail if an unsupported display mode is requested, or
  308. if another app is running in full-screen mode. }
  309. const
  310. kCGConfigureForAppOnly = 0;
  311. kCGConfigureForSession = 1;
  312. kCGConfigurePermanently = 2;
  313. type
  314. CGConfigureOption = UInt32;
  315. function CGCompleteDisplayConfiguration( config: CGDisplayConfigRef; option: CGConfigureOption ): CGError; external name '_CGCompleteDisplayConfiguration';
  316. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  317. { Restore the permanent display configuration settings for the current
  318. user. }
  319. procedure CGRestorePermanentDisplayConfiguration; external name '_CGRestorePermanentDisplayConfiguration';
  320. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  321. { Display changes are reported via a callback mechanism.
  322. Callbacks are invoked when the app is listening for events, on the event
  323. processing thread, or from within the display reconfiguration function
  324. when in the program that is driving the reconfiguration.
  325. Callbacks should avoid changing display configurations, and should not
  326. raise exceptions or perform a non-local return such as calling longjmp().
  327. Before display reconfiguration, a callback fires to inform applications
  328. of a configuration change. The callback runs once for each on-line
  329. display. The flag is set to `kCGDisplayBeginConfigurationFlag'. This
  330. callback does not carry other per-display information, as details of how
  331. a reconfiguration affects a particular device rely on device-specific
  332. behaviors which may not be exposed by a device driver.
  333. After display reconfiguration, at the time the callback function is
  334. invoked, all display state reported by CoreGraphics, QuickDraw, and the
  335. Carbon Display Manager API will be up to date. This callback runs after
  336. the Carbon Display Manager notification callbacks. The callback runs once
  337. for each added, removed, and currently on-line display. Note that in the
  338. case of removed displays, calls into the CoreGraphics API with the
  339. removed display ID will fail. }
  340. const
  341. kCGDisplayBeginConfigurationFlag = 1 shl 0; { Set in pre-reconfiguration callback }
  342. kCGDisplayMovedFlag = 1 shl 1; { post-reconfiguration callback flag }
  343. kCGDisplaySetMainFlag = 1 shl 2; { post-reconfiguration callback flag }
  344. kCGDisplaySetModeFlag = 1 shl 3; { post-reconfiguration callback flag }
  345. kCGDisplayAddFlag = 1 shl 4; { post-reconfiguration callback flag }
  346. kCGDisplayRemoveFlag = 1 shl 5; { post-reconfiguration callback flag }
  347. kCGDisplayEnabledFlag = 1 shl 8; { post-reconfiguration callback flag }
  348. kCGDisplayDisabledFlag = 1 shl 9; { post-reconfiguration callback flag }
  349. kCGDisplayMirrorFlag = 1 shl 10;{ post-reconfiguration callback flag }
  350. kCGDisplayUnMirrorFlag = 1 shl 11; { post-reconfiguration callback flag }
  351. kCGDisplayDesktopShapeChangedFlag = 1 shl 12;
  352. type
  353. CGDisplayChangeSummaryFlags = UInt32;
  354. { A client-supplied callback function that’s invoked whenever the
  355. configuration of a local display is changed. }
  356. type
  357. CGDisplayReconfigurationCallBack = procedure( display: CGDirectDisplayID; flags: CGDisplayChangeSummaryFlags; userInfo: UnivPtr );
  358. { Register a display reconfiguration callback procedure. The `userInfo'
  359. argument is passed back to the callback procedure each time it is
  360. invoked. }
  361. function CGDisplayRegisterReconfigurationCallback( callback: CGDisplayReconfigurationCallBack; userInfo: UnivPtr ): CGError; external name '_CGDisplayRegisterReconfigurationCallback';
  362. (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
  363. { Remove a display reconfiguration callback procedure. }
  364. function CGDisplayRemoveReconfigurationCallback( callback: CGDisplayReconfigurationCallBack; userInfo: UnivPtr ): CGError; external name '_CGDisplayRemoveReconfigurationCallback';
  365. (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
  366. { Specialized configuration changes should be done outside of the scope of
  367. a `CGBeginDisplayConfiguration'/`CGCompleteDisplayConfiguration' pair, as
  368. they may alter things such as the available display modes which a normal
  369. reconfiguration sequence might assume are invariant. }
  370. { Immediately enable or disable stereo operation for a display.
  371. Note that the system normally detects the presence of a stereo window,
  372. and will automatically switch a display containing a stereo window to
  373. stereo operation. This function provides a mechanism to force a display
  374. to stereo operation, and to set options (such as blue line sync signal)
  375. when in stereo operation.
  376. When in stereo operation, a display may need to generate a special stereo
  377. sync signal as part of the video output. The sync signal consists of a
  378. blue line which occupies the first 25% of the last scanline for the left
  379. eye view, and the first 75% of the last scanline for the right eye view.
  380. The remainder of the scanline is black. To force the display to generate
  381. this sync signal, pass true for `forceBlueLine'; otherwise, pass false.
  382. Returns `kCGErrorSuccess' on success, or `kCGErrorRangeCheck' if the
  383. display does not support the stereo operation settings requested.
  384. On success, the display resolution, mirroring mode, and available display
  385. modes may change due to hardware-specific capabilities and limitations.
  386. You should check these settings to verify that they are appropriate for
  387. your application. }
  388. function CGDisplaySetStereoOperation( display: CGDirectDisplayID; stereo: boolean_t; forceBlueLine: boolean_t; option: CGConfigureOption ): CGError; external name '_CGDisplaySetStereoOperation';
  389. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  390. { Return true if the display is connected, awake, and available for
  391. drawing; false otherwise. }
  392. function CGDisplayIsActive( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsActive';
  393. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  394. { Return true if the display is asleep (and is therefore not drawable);
  395. false otherwise. }
  396. function CGDisplayIsAsleep( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsAsleep';
  397. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  398. { Return true if the display is connected or online; false otherwise. }
  399. function CGDisplayIsOnline( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsOnline';
  400. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  401. { Return true if the display is the current main display; false
  402. otherwise. }
  403. function CGDisplayIsMain( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsMain';
  404. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  405. { Return true if the display is built-in, such as the internal display in
  406. portable systems; false otherwise. }
  407. function CGDisplayIsBuiltin( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsBuiltin';
  408. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  409. { Return true if the display is in a mirroring set; false otherwise. }
  410. function CGDisplayIsInMirrorSet( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsInMirrorSet';
  411. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  412. { Return true if the display is always in a mirroring set and cannot be
  413. unmirrored; false otherwise. }
  414. function CGDisplayIsAlwaysInMirrorSet( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsAlwaysInMirrorSet';
  415. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  416. { Return true if the display is in a hardware mirroring set; false
  417. otherwise. }
  418. function CGDisplayIsInHWMirrorSet( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsInHWMirrorSet';
  419. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  420. { For a secondary display in a mirror set, return the display being
  421. mirrored (the primary display), or `kCGNullDirectDisplay' if the display
  422. is the primary display or if the display is unmirrored. }
  423. function CGDisplayMirrorsDisplay( display: CGDirectDisplayID ): CGDirectDisplayID; external name '_CGDisplayMirrorsDisplay';
  424. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  425. { Return true if the display is using OpenGL acceleration; false
  426. otherwise. }
  427. function CGDisplayUsesOpenGLAcceleration( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayUsesOpenGLAcceleration';
  428. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  429. { Return true if the display is running in a stereo graphics mode; false
  430. otherwise. }
  431. function CGDisplayIsStereo( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsStereo';
  432. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *) { 10.4.3 and later. }
  433. { Return the primary display in a hardware mirror set, or `display' if the
  434. display is not hardware-mirrored. }
  435. function CGDisplayPrimaryDisplay( display: CGDirectDisplayID ): CGDirectDisplayID; external name '_CGDisplayPrimaryDisplay';
  436. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  437. { Return the logical unit number of a display. }
  438. function CGDisplayUnitNumber( display: CGDirectDisplayID ): UInt32; external name '_CGDisplayUnitNumber';
  439. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  440. { Return the vendor number of a display's monitor. }
  441. function CGDisplayVendorNumber( display: CGDirectDisplayID ): UInt32; external name '_CGDisplayVendorNumber';
  442. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  443. { Return the model number of a display's monitor. }
  444. function CGDisplayModelNumber( display: CGDirectDisplayID ): UInt32; external name '_CGDisplayModelNumber';
  445. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  446. { Return the serial number of a display's monitor. }
  447. function CGDisplaySerialNumber( display: CGDirectDisplayID ): UInt32; external name '_CGDisplaySerialNumber';
  448. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  449. { Return the IOKit service port of a display. }
  450. // uncomment when IOKit translated:
  451. // function CGDisplayIOServicePort( display: CGDirectDisplayID ): io_service_t;
  452. // CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA);
  453. { Return the width and height of a display in millimeters.
  454. If 'display' is not a valid display ID, the size returned has a width and
  455. height of 0.
  456. If Extended Display Identification Data (EDID) for the display device is
  457. not available, the size is estimated based on the device width and height
  458. in pixels from `CGDisplayBounds', with an assumed resolution of 2.835
  459. pixels/mm, or 72 DPI, a reasonable guess for displays predating EDID
  460. support. }
  461. function CGDisplayScreenSize( display: CGDirectDisplayID ): CGSize; external name '_CGDisplayScreenSize';
  462. (* CG_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
  463. { Return the rotation angle of a display in degrees clockwise.
  464. A display rotation of 90° implies the display is rotated clockwise 90°,
  465. such that what was the physical bottom of the display is now the left
  466. side, and what was the physical top is now the right side.
  467. If `display' is not a valid display ID, the rotation returned is 0. }
  468. function CGDisplayRotation( display: CGDirectDisplayID ): Float64; external name '_CGDisplayRotation';
  469. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  470. { Return the color space of a display. }
  471. function CGDisplayCopyColorSpace( display: CGDirectDisplayID ): CGColorSpaceRef; external name '_CGDisplayCopyColorSpace';
  472. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  473. { These functions are deprecated; do not use them. }
  474. {
  475. * Set the display mode
  476. *
  477. * The mode dictionary passed in must be a dictionary vended by other CGDirectDisplay
  478. * APIs such as CGDisplayBestModeForParameters() and CGDisplayAvailableModes().
  479. *
  480. * When changing display modes of displays in a mirroring set, other displays in
  481. * the mirroring set whose mode is not explicitly changed will be set to a display
  482. * mode capable of mirroring the bounds of the largest display being explicitly set.
  483. }
  484. function CGConfigureDisplayMode( config: CGDisplayConfigRef; display: CGDirectDisplayID; mode: CFDictionaryRef ): CGError; external name '_CGConfigureDisplayMode';
  485. (* CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6,__IPHONE_NA, __IPHONE_NA) *)
  486. {$endc}
  487. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  488. end.
  489. {$endc} {not MACOSALLINCLUDE}