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