~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/univint/CGDirectDisplay.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
 *  CGDirectDisplay.h
3
 
 *  CoreGraphics
4
 
 *
5
 
 *  Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
6
 
 *
7
 
 }
8
 
{       Pascal Translation Updated:  Peter N Lewis, <peter@stairways.com.au>, August 2005 }
9
 
{
10
 
    Modified for use with Free Pascal
11
 
    Version 200
12
 
    Please report any bugs to <gpc@microbizz.nl>
13
 
}
14
 
 
15
 
{$mode macpas}
16
 
{$packenum 1}
17
 
{$macro on}
18
 
{$inline on}
19
 
{$CALLING MWPASCAL}
20
 
 
21
 
unit CGDirectDisplay;
22
 
interface
23
 
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
24
 
{$setc GAP_INTERFACES_VERSION := $0200}
25
 
 
26
 
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
27
 
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
28
 
{$endc}
29
 
 
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
 
 
37
 
{$ifc not defined __ppc__ and defined CPUPOWERPC}
38
 
        {$setc __ppc__ := 1}
39
 
{$elsec}
40
 
        {$setc __ppc__ := 0}
41
 
{$endc}
42
 
{$ifc not defined __i386__ and defined CPUI386}
43
 
        {$setc __i386__ := 1}
44
 
{$elsec}
45
 
        {$setc __i386__ := 0}
46
 
{$endc}
47
 
 
48
 
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
49
 
        {$error Conflicting definitions for __ppc__ and __i386__}
50
 
{$endc}
51
 
 
52
 
{$ifc defined __ppc__ and __ppc__}
53
 
        {$setc TARGET_CPU_PPC := TRUE}
54
 
        {$setc TARGET_CPU_X86 := FALSE}
55
 
{$elifc defined __i386__ and __i386__}
56
 
        {$setc TARGET_CPU_PPC := FALSE}
57
 
        {$setc TARGET_CPU_X86 := TRUE}
58
 
{$elsec}
59
 
        {$error Neither __ppc__ nor __i386__ is defined.}
60
 
{$endc}
61
 
{$setc TARGET_CPU_PPC_64 := FALSE}
62
 
 
63
 
{$ifc defined FPC_BIG_ENDIAN}
64
 
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
65
 
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
66
 
{$elifc defined FPC_LITTLE_ENDIAN}
67
 
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
68
 
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
69
 
{$elsec}
70
 
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
71
 
{$endc}
72
 
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
73
 
{$setc CALL_NOT_IN_CARBON := FALSE}
74
 
{$setc OLDROUTINENAMES := FALSE}
75
 
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
76
 
{$setc OPAQUE_UPP_TYPES := TRUE}
77
 
{$setc OTCARBONAPPLICATION := TRUE}
78
 
{$setc OTKERNEL := FALSE}
79
 
{$setc PM_USE_SESSION_APIS := TRUE}
80
 
{$setc TARGET_API_MAC_CARBON := TRUE}
81
 
{$setc TARGET_API_MAC_OS8 := FALSE}
82
 
{$setc TARGET_API_MAC_OSX := TRUE}
83
 
{$setc TARGET_CARBON := TRUE}
84
 
{$setc TARGET_CPU_68K := FALSE}
85
 
{$setc TARGET_CPU_MIPS := FALSE}
86
 
{$setc TARGET_CPU_SPARC := FALSE}
87
 
{$setc TARGET_OS_MAC := TRUE}
88
 
{$setc TARGET_OS_UNIX := FALSE}
89
 
{$setc TARGET_OS_WIN32 := FALSE}
90
 
{$setc TARGET_RT_MAC_68881 := FALSE}
91
 
{$setc TARGET_RT_MAC_CFM := FALSE}
92
 
{$setc TARGET_RT_MAC_MACHO := TRUE}
93
 
{$setc TYPED_FUNCTION_POINTERS := TRUE}
94
 
{$setc TYPE_BOOL := FALSE}
95
 
{$setc TYPE_EXTENDED := FALSE}
96
 
{$setc TYPE_LONGLONG := TRUE}
97
 
uses MacTypes,CFBase,CFArray,CFDictionary,CGContext,CGBase,CGGeometry,CGErrors;
98
 
{$ALIGN POWER}
99
 
 
100
 
 
101
 
{
102
 
 * The following construct is present to avoid problems with some Apple tools.
103
 
 * API in this module is not available in Mac OS Classic variations!
104
 
 }
105
 
 
106
 
 
107
 
type
108
 
        CGDirectDisplayID = ^SInt32; { an opaque 32-bit type }
109
 
        CGDirectDisplayIDPtr = ^CGDirectDisplayID;  { when a var xx:CGDirectDisplayID parameter can be nil, it is changed to xx: CGDirectDisplayIDPtr }
110
 
type
111
 
        CGDirectPaletteRef = ^SInt32; { an opaque 32-bit type }
112
 
        CGDirectPaletteRefPtr = ^CGDirectPaletteRef;  { when a var xx:CGDirectPaletteRef parameter can be nil, it is changed to xx: CGDirectPaletteRefPtr }
113
 
type
114
 
        CGDisplayCount = UInt32;
115
 
type
116
 
        CGTableCount = UInt32;
117
 
type
118
 
        CGDisplayCoord = SInt32;
119
 
type
120
 
        CGByteValue = SInt8;
121
 
        CGByteValuePtr                                  = ^CGByteValue;
122
 
type
123
 
        CGOpenGLDisplayMask = UInt32;
124
 
type
125
 
        CGBeamPosition = UInt32;
126
 
type
127
 
        CGMouseDelta = SInt32;
128
 
type
129
 
        CGRefreshRate = double;
130
 
type
131
 
        CGCaptureOptions = UInt32;
132
 
 
133
 
type
134
 
        CGDisplayErr = CGError;
135
 
 
136
 
const
137
 
        CGDisplayNoErr                          = kCGErrorSuccess;
138
 
 
139
 
        kCGDirectMainDisplay            = nil;
140
 
 
141
 
{ Returns the display ID of the current main display }
142
 
function CGMainDisplayID: CGDirectDisplayID; external name '_CGMainDisplayID';
143
 
 
144
 
{
145
 
 * Mechanisms used to find screen IDs
146
 
 * An array length (maxDisplays) and array of CGDirectDisplayIDs are passed in.
147
 
 * Up to maxDisplays of the array are filled in with the displays meeting the
148
 
 * specified criteria.  The actual number of displays filled in is returned in
149
 
 * dspyCnt.
150
 
 *
151
 
 * If the dspys array is NULL, maxDisplays is ignored, and *dspyCnt is filled
152
 
 * in with the number of displays meeting the function's requirements.
153
 
 }
154
 
function CGGetDisplaysWithPoint( point: CGPoint; maxDisplays: CGDisplayCount; dspys: CGDirectDisplayIDPtr; var dspyCnt: CGDisplayCount ): CGDisplayErr; external name '_CGGetDisplaysWithPoint';
155
 
 
156
 
function CGGetDisplaysWithRect( rect: CGRect; maxDisplays: CGDisplayCount; dspys: CGDirectDisplayIDPtr; var dspyCnt: CGDisplayCount ): CGDisplayErr; external name '_CGGetDisplaysWithRect';
157
 
 
158
 
function CGGetDisplaysWithOpenGLDisplayMask( mask: CGOpenGLDisplayMask; maxDisplays: CGDisplayCount; dspys: CGDirectDisplayIDPtr; var dspyCnt: CGDisplayCount ): CGDisplayErr; external name '_CGGetDisplaysWithOpenGLDisplayMask';
159
 
                            
160
 
{
161
 
 * Get lists of displays.  Use this to determine display IDs
162
 
 *
163
 
 * If the activeDspys array is NULL, maxDisplays is ignored, and *dspyCnt is filled
164
 
 * in with the number of displays meeting the function's requirements.
165
 
 *
166
 
 * The first display returned in the list is the main display,
167
 
 * the one with the menu bar.
168
 
 * When mirroring, this will be the largest drawable display in the mirror,
169
 
 * set, or if all are the same size, the one with the deepest pixel depth.
170
 
 }
171
 
function CGGetActiveDisplayList( maxDisplays: CGDisplayCount; activeDspys: CGDirectDisplayIDPtr; var dspyCnt: CGDisplayCount ): CGDisplayErr; external name '_CGGetActiveDisplayList';
172
 
 
173
 
{
174
 
 * With hardware mirroring, a display may be on-line,
175
 
 * but not necessarily active, or drawable.
176
 
 * Programs which manipulate display settings such as the
177
 
 * palette or gamma tables need access to all displays in use,
178
 
 * including hardware mirrors which are not drawable.
179
 
 }
180
 
function CGGetOnlineDisplayList( maxDisplays: CGDisplayCount; onlineDspys: CGDirectDisplayIDPtr; var dspyCnt: CGDisplayCount ): CGDisplayErr; external name '_CGGetOnlineDisplayList';
181
 
 
182
 
{ Map a display to an OpenGL display mask; returns 0 on invalid display }
183
 
function CGDisplayIDToOpenGLDisplayMask( display: CGDirectDisplayID ): CGOpenGLDisplayMask; external name '_CGDisplayIDToOpenGLDisplayMask';
184
 
 
185
 
{
186
 
 * Map an OpenGL display mask to a display.
187
 
 * Returns kCGNullDirectDisplay if a bit doesn't
188
 
 * match a display.
189
 
 * Passing in multiple bits results in an arbitrary match. 
190
 
 }
191
 
function CGOpenGLDisplayMaskToDisplayID( mask: CGOpenGLDisplayMask ): CGDirectDisplayID; external name '_CGOpenGLDisplayMaskToDisplayID';
192
 
 
193
 
{ Return screen size and origin in global coords; Empty rect if display is invalid }
194
 
function CGDisplayBounds( display: CGDirectDisplayID ): CGRect; external name '_CGDisplayBounds';
195
 
 
196
 
function CGDisplayPixelsWide( display: CGDirectDisplayID ): size_t; external name '_CGDisplayPixelsWide';
197
 
function CGDisplayPixelsHigh( display: CGDirectDisplayID ): size_t; external name '_CGDisplayPixelsHigh';
198
 
 
199
 
{
200
 
 * Display mode selection
201
 
 * Display modes are represented as CFDictionaries
202
 
 * All dictionaries and arrays returned via these mechanisms are
203
 
 * owned by the framework and should not be released.  The framework
204
 
 * will not release them out from under your application.
205
 
 *
206
 
 * Values associated with the following keys are CFNumber types.
207
 
 * With CFNumberGetValue(), use kCFNumberLongType for best results.
208
 
 * kCGDisplayRefreshRate encodes a double value, so to get the fractional
209
 
 * refresh rate use kCFNumberDoubleType.
210
 
 }
211
 
 
212
 
{
213
 
 * Keys used in mode dictionaries.  Source C strings shown won't change.
214
 
 * Some CFM environments cannot import data variables, and so
215
 
 * the definitions are provided directly.
216
 
 *
217
 
 * These keys are used only within the scope of the mode dictionaries,
218
 
 * so further uniquing, as by prefix, of the source string is not needed.
219
 
 }
220
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
221
 
{$definec kCGDisplayWidth CFSTRP('Width')}
222
 
{$endc}
223
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
224
 
{$definec kCGDisplayHeight CFSTRP('Height')}
225
 
{$endc}
226
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
227
 
{$definec kCGDisplayMode CFSTRP('Mode')}
228
 
{$endc}
229
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
230
 
{$definec kCGDisplayBitsPerPixel CFSTRP('BitsPerPixel')}
231
 
{$endc}
232
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
233
 
{$definec kCGDisplayBitsPerSample CFSTRP('BitsPerSample')}
234
 
{$endc}
235
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
236
 
{$definec kCGDisplaySamplesPerPixel CFSTRP('SamplesPerPixel')}
237
 
{$endc}
238
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
239
 
{$definec kCGDisplayRefreshRate CFSTRP('RefreshRate')}
240
 
{$endc}
241
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
242
 
{$definec kCGDisplayModeUsableForDesktopGUI CFSTRP('UsableForDesktopGUI')}
243
 
{$endc}
244
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
245
 
{$definec kCGDisplayIOFlags CFSTRP('IOFlags')}
246
 
{$endc}
247
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
248
 
{$definec kCGDisplayBytesPerRow CFSTRP('kCGDisplayBytesPerRow')}
249
 
{$endc}
250
 
 
251
 
{
252
 
 * Keys to describe optional properties of display modes.
253
 
 *
254
 
 * The key will only be present if the property applies,
255
 
 * and will be associated with a value of kCFBooleanTrue.
256
 
 * Keys not relevant to a particular display mode will not
257
 
 * appear in the mode dictionary.
258
 
 *
259
 
 * These strings must remain unchanged in future releases, of course.
260
 
 }
261
 
 
262
 
{ Set if display mode doesn't need a confirmation dialog to be set }
263
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
264
 
{$definec kCGDisplayModeIsSafeForHardware CFSTRP('kCGDisplayModeIsSafeForHardware')}
265
 
{$endc}
266
 
 
267
 
{ The following keys reflect interesting bits of the IOKit display mode flags }
268
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
269
 
{$definec kCGDisplayModeIsInterlaced CFSTRP('kCGDisplayModeIsInterlaced')}
270
 
{$endc}
271
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
272
 
{$definec kCGDisplayModeIsStretched CFSTRP('kCGDisplayModeIsStretched')}
273
 
{$endc}
274
 
{$ifc USE_CFSTR_CONSTANT_MACROS}
275
 
{$definec kCGDisplayModeIsTelevisionOutput CFSTRP('kCGDisplayModeIsTelevisionOutput')}
276
 
{$endc}
277
 
 
278
 
 
279
 
{
280
 
 * Return a CFArray of CFDictionaries describing all display modes.
281
 
 * Returns NULL if the display is invalid.
282
 
 }
283
 
function CGDisplayAvailableModes( display: CGDirectDisplayID ): CFArrayRef; external name '_CGDisplayAvailableModes';
284
 
{
285
 
 * Try to find a display mode of specified depth with dimensions equal or greater than
286
 
 * specified.
287
 
 * If no depth match is found, try for the next larger depth with dimensions equal or greater
288
 
 * than specified.  If no luck, then just return the current mode.
289
 
 *
290
 
 * exactmatch, if not NULL, is set to 'true' if an exact match in width, height, and depth is found,
291
 
 * and 'false' otherwise.
292
 
 *
293
 
 * CGDisplayBestModeForParametersAndRefreshRateWithProperty searches the list, looking for
294
 
 * display modes with the specified property.  The property should be one of:
295
 
 *      kCGDisplayModeIsSafeForHardware;
296
 
 *      kCGDisplayModeIsInterlaced;
297
 
 *      kCGDisplayModeIsStretched;
298
 
 *      kCGDisplayModeIsTelevisionOutput
299
 
 *      
300
 
 * Returns NULL if display is invalid.
301
 
 }
302
 
function CGDisplayBestModeForParameters( display: CGDirectDisplayID; bitsPerPixel: size_t; width: size_t; height: size_t; var exactMatch: boolean_t ): CFDictionaryRef; external name '_CGDisplayBestModeForParameters';
303
 
 
304
 
function CGDisplayBestModeForParametersAndRefreshRate( display: CGDirectDisplayID; bitsPerPixel: size_t; width: size_t; height: size_t; refresh: CGRefreshRate; var exactMatch: boolean_t ): CFDictionaryRef; external name '_CGDisplayBestModeForParametersAndRefreshRate';
305
 
 
306
 
function CGDisplayBestModeForParametersAndRefreshRateWithProperty( display: CGDirectDisplayID; bitsPerPixel: size_t; width: size_t; height: size_t; refresh: CGRefreshRate; property: CFStringRef; var exactMatch: boolean_t ): CFDictionaryRef; external name '_CGDisplayBestModeForParametersAndRefreshRateWithProperty';
307
 
 
308
 
{
309
 
 * Return a CFDictionary describing the current display mode.
310
 
 * Returns NULL if display is invalid.
311
 
 }
312
 
function CGDisplayCurrentMode( display: CGDirectDisplayID ): CFDictionaryRef; external name '_CGDisplayCurrentMode';
313
 
{
314
 
 * Switch display mode.  Note that after switching, 
315
 
 * display parameters and addresses may change.
316
 
 * The selected display mode persists for the life of the program, and automatically
317
 
 * reverts to the permanent setting made by Preferences when the program terminates.
318
 
 * The mode dictionary passed in must be a dictionary vended by other CGDirectDisplay
319
 
 * APIs such as CGDisplayBestModeForParameters() and CGDisplayAvailableModes().
320
 
 *
321
 
 * The mode dictionary passed in must be a dictionary vended by other CGDirectDisplay
322
 
 * APIs such as CGDisplayBestModeForParameters() and CGDisplayAvailableModes().
323
 
 *
324
 
 * When changing display modes of displays in a mirroring set, other displays in
325
 
 * the mirroring set will be set to a display mode capable of mirroring the bounds
326
 
 * of the largest display being explicitly set. 
327
 
 }
328
 
function CGDisplaySwitchToMode( display: CGDirectDisplayID; mode: CFDictionaryRef ): CGDisplayErr; external name '_CGDisplaySwitchToMode';
329
 
 
330
 
{ Query parameters for current mode }
331
 
function CGDisplayBitsPerPixel( display: CGDirectDisplayID ): size_t; external name '_CGDisplayBitsPerPixel';
332
 
function CGDisplayBitsPerSample( display: CGDirectDisplayID ): size_t; external name '_CGDisplayBitsPerSample';
333
 
function CGDisplaySamplesPerPixel( display: CGDirectDisplayID ): size_t; external name '_CGDisplaySamplesPerPixel';
334
 
function CGDisplayBytesPerRow( display: CGDirectDisplayID ): size_t; external name '_CGDisplayBytesPerRow';
335
 
 
336
 
{
337
 
 * Set a display gamma/transfer function from a formula specifying
338
 
 * min and max values and a gamma for each channel.
339
 
 * Gamma values must be greater than 0.0.
340
 
 * To get an antigamma of 1.6, one would specify a value of (1.0 / 1.6)
341
 
 * Min values must be greater than or equal to 0.0 and less than 1.0.
342
 
 * Max values must be greater than 0.0 and less than or equal to 1.0.
343
 
 * Out of range values, or Max greater than or equal to Min result
344
 
 * in a kCGSRangeCheck error.
345
 
 *
346
 
 * Values are computed by sampling a function for a range of indices from 0 through 1:
347
 
 *      value = Min + ((Max - Min) * pow(index, Gamma))
348
 
 * The resulting values are converted to a machine specific format
349
 
 * and loaded into hardware.
350
 
 }
351
 
type
352
 
        CGGammaValue = Float32;
353
 
        CGGammaValuePtr                                 = ^CGGammaValue;
354
 
                                              
355
 
function CGSetDisplayTransferByFormula( display: CGDirectDisplayID; redMin: CGGammaValue; redMax: CGGammaValue; redGamma: CGGammaValue; greenMin: CGGammaValue; greenMax: CGGammaValue; greenGamma: CGGammaValue; blueMin: CGGammaValue; blueMax: CGGammaValue; blueGamma: CGGammaValue ): CGDisplayErr; external name '_CGSetDisplayTransferByFormula';
356
 
                                              
357
 
function CGGetDisplayTransferByFormula( display: CGDirectDisplayID; var redMin: CGGammaValue; var redMax: CGGammaValue; var redGamma: CGGammaValue; var greenMin: CGGammaValue; var greenMax: CGGammaValue; var greenGamma: CGGammaValue; var blueMin: CGGammaValue; var blueMax: CGGammaValue; var blueGamma: CGGammaValue ): CGDisplayErr; external name '_CGGetDisplayTransferByFormula';
358
 
{
359
 
 * Returns the capacity, or nunber of entries, in the camma table for the specified
360
 
 * display.  If 'display' is invalid, returns 0.
361
 
 }
362
 
function CGDisplayGammaTableCapacity( display: CGDirectDisplayID ): CGTableCount; external name '_CGDisplayGammaTableCapacity'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
363
 
 
364
 
{
365
 
 * Set a display gamma/transfer function using tables of data for each channel.
366
 
 * Values within each table should have values in the range of 0.0 through 1.0.
367
 
 * The same table may be passed in for red, green, and blue channels. 'tableSize'
368
 
 * indicates the number of entries in each table.
369
 
 * The tables are interpolated as needed to generate the number of samples needed
370
 
 * by hardware.
371
 
 }
372
 
function CGSetDisplayTransferByTable( display: CGDirectDisplayID; tableSize: CGTableCount; redTable: {const} CGGammaValuePtr; greenTable: {const} CGGammaValuePtr; blueTable: {const} CGGammaValuePtr ): CGDisplayErr; external name '_CGSetDisplayTransferByTable';
373
 
 
374
 
{
375
 
 * Get transfer tables.  Capacity should contain the number of samples each
376
 
 * array can hold, and *sampleCount is filled in with the number of samples
377
 
 * actually copied in.
378
 
 }
379
 
function CGGetDisplayTransferByTable( display: CGDirectDisplayID; capacity: CGTableCount; redTable: CGGammaValuePtr; greenTable: CGGammaValuePtr; blueTable: CGGammaValuePtr; var sampleCount: CGTableCount ): CGDisplayErr; external name '_CGGetDisplayTransferByTable';
380
 
 
381
 
{ As a convenience, allow setting of the gamma table by byte values }
382
 
function CGSetDisplayTransferByByteTable( display: CGDirectDisplayID; tableSize: CGTableCount; redTable: {const} CGByteValuePtr; greenTable: {const} CGByteValuePtr; blueTable: {const} CGByteValuePtr ): CGDisplayErr; external name '_CGSetDisplayTransferByByteTable';
383
 
 
384
 
{ Restore gamma tables of system displays to the user's ColorSync specified values }
385
 
procedure CGDisplayRestoreColorSyncSettings; external name '_CGDisplayRestoreColorSyncSettings';
386
 
 
387
 
{
388
 
 * Options used with CGDisplayCaptureWithOptions and CGCaptureAllDisplaysWithOptions
389
 
 }
390
 
const
391
 
        kCGCaptureNoOptions = 0;        { Default behavior }
392
 
        kCGCaptureNoFill = 1 shl 0;     { Disables fill with black on display capture }
393
 
 
394
 
{ Display capture and release }
395
 
function CGDisplayIsCaptured( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayIsCaptured';
396
 
function CGDisplayCapture( display: CGDirectDisplayID ): CGDisplayErr; external name '_CGDisplayCapture';
397
 
function CGDisplayCaptureWithOptions( display: CGDirectDisplayID; options: CGCaptureOptions ): CGDisplayErr; external name '_CGDisplayCaptureWithOptions'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
398
 
function CGDisplayRelease( display: CGDirectDisplayID ): CGDisplayErr; external name '_CGDisplayRelease';
399
 
 
400
 
{
401
 
 * Capture all displays; this has the nice effect of providing an immersive
402
 
 * environment, and preventing other apps from trying to adjust themselves
403
 
 * to display changes only needed by your app.
404
 
 }
405
 
function CGCaptureAllDisplays: CGDisplayErr; external name '_CGCaptureAllDisplays';
406
 
function CGCaptureAllDisplaysWithOptions( options: CGCaptureOptions ): CGDisplayErr; external name '_CGCaptureAllDisplaysWithOptions'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
407
 
 
408
 
{
409
 
 * Release all captured displays, and restore the display modes to the
410
 
 * user's preferences.  May be used in conjunction with CGDisplayCapture()
411
 
 * or CGCaptureAllDisplays().
412
 
 }
413
 
function CGReleaseAllDisplays: CGDisplayErr; external name '_CGReleaseAllDisplays';
414
 
 
415
 
{
416
 
 * Returns CoreGraphics raw shield window ID or NULL if not shielded
417
 
 * This value may be used with drawing surface APIs.
418
 
 }
419
 
function CGShieldingWindowID( display: CGDirectDisplayID ): UnivPtr; external name '_CGShieldingWindowID';
420
 
 
421
 
{
422
 
 * Returns the window level used for the shield window.
423
 
 * This value may be used with Cocoa windows to position the
424
 
 * Cocoa window in the same window level as the shield window.
425
 
 }
426
 
function CGShieldingWindowLevel: SInt32; external name '_CGShieldingWindowLevel';
427
 
 
428
 
{
429
 
 * Returns base address of display or NULL for an invalid display.
430
 
 * If the display has not been captured, the returned address may refer
431
 
 * to read-only memory.
432
 
 }
433
 
function CGDisplayBaseAddress( display: CGDirectDisplayID ): UnivPtr; external name '_CGDisplayBaseAddress';
434
 
{
435
 
 * return address for X,Y in global coordinates;
436
 
 *      (0,0) represents the upper left corner of the main display.
437
 
 * returns NULL for an invalid display or out of bounds coordinates
438
 
 * If the display has not been captured, the returned address may refer
439
 
 * to read-only memory.
440
 
 }
441
 
function CGDisplayAddressForPosition( display: CGDirectDisplayID; x: CGDisplayCoord; y: CGDisplayCoord ): UnivPtr; external name '_CGDisplayAddressForPosition';
442
 
 
443
 
 
444
 
{ Mouse Cursor controls }
445
 
function CGDisplayHideCursor( display: CGDirectDisplayID ): CGDisplayErr; external name '_CGDisplayHideCursor'; { increments hide cursor count }
446
 
function CGDisplayShowCursor( display: CGDirectDisplayID ): CGDisplayErr; external name '_CGDisplayShowCursor'; { decrements hide cursor count  }
447
 
 
448
 
{
449
 
 * Move the cursor to the specified point relative to the display origin
450
 
 * (the upper left corner of the display).  Returns CGDisplayNoErr on success.
451
 
 * No events are generated as a result of this move.
452
 
 * Points that would lie outside the desktop are clipped to the desktop.
453
 
 }
454
 
function CGDisplayMoveCursorToPoint( display: CGDirectDisplayID; point: CGPoint ): CGDisplayErr; external name '_CGDisplayMoveCursorToPoint';
455
 
 
456
 
{
457
 
 * Report the mouse position change associated with the last mouse move event
458
 
 * recieved by this application.
459
 
 }
460
 
procedure CGGetLastMouseDelta( var deltaX: CGMouseDelta; var deltaY: CGMouseDelta ); external name '_CGGetLastMouseDelta';
461
 
 
462
 
 
463
 
{ Palette controls (8 bit pseudocolor only) }
464
 
 
465
 
{
466
 
 * Returns TRUE if the current display mode supports palettes.
467
 
 * Display must not be a hardware mirror of another, and should
468
 
 * have a depth of 8 bits per pixel for this to return TRUE.
469
 
 }
470
 
function CGDisplayCanSetPalette( display: CGDirectDisplayID ): boolean_t; external name '_CGDisplayCanSetPalette';
471
 
 
472
 
{
473
 
 * Set a palette.  The current gamma function is applied to the palette
474
 
 * elements before being loaded into hardware.  The display must not be
475
 
 * a hardware mirror of another, and should have a depth of 8 bits per pixel.
476
 
 * Setting the palette on the active, or primary display in a hardware
477
 
 * mirroring set affects all displays in that set.
478
 
 }
479
 
function CGDisplaySetPalette( display: CGDirectDisplayID; palette: CGDirectPaletteRef ): CGDisplayErr; external name '_CGDisplaySetPalette';
480
 
 
481
 
{
482
 
 * Wait until the beam position is outside the range specified by upperScanLine and lowerScanLine.
483
 
 * Note that if upperScanLine and lowerScanLine encompass the entire display height,
484
 
 * the function returns an error.
485
 
 * lowerScanLine must be greater than or equal to upperScanLine.
486
 
 *
487
 
 * Some display systems may not conventional video vertical and horizontal sweep in painting.
488
 
 * These displays report a kCGDisplayRefreshRate of 0 in the CFDictionaryRef returned by
489
 
 * CGDisplayCurrentMode().  On such displays, this function returns at once.
490
 
 *
491
 
 * Some drivers may not implement support for this mechanism.
492
 
 * On such displays, this function returns at once.
493
 
 *
494
 
 * Returns CGDisplayNoErr on success, and an error if display or upperScanLine and
495
 
 * lowerScanLine are invalid.
496
 
 *
497
 
 * The app should set the values of upperScanLine and lowerScanLine to allow enough lead time
498
 
 * for the drawing operation to complete.  A common strategy is to wait for the beam to pass
499
 
 * the bottom of the drawing area, allowing almost a full vertical sweep period to perform drawing.
500
 
 * To do this, set upperScanLine to 0, and set lowerScanLine to the bottom of the bounding box:
501
 
 *      lowerScanLine = (CGBeamPosition)(cgrect.origin.y + cgrect.size.height);
502
 
 *
503
 
 * IOKit may implement this as a spin-loop on the beam position call used for CGDisplayBeamPosition().
504
 
 * On such system the function is CPU bound, and subject to all the usual scheduling pre-emption.
505
 
 * In particular, attempting to wait for the beam to hit a specific scanline may be an exercise in frustration.
506
 
 *
507
 
 * These functions are advisary in nature, and depend on IOKit and hardware specific drivers to implement
508
 
 * support. If you need extremely precise timing, or access to vertical blanking interrupts,
509
 
 * you should consider writing a device driver to tie into hardware-specific capabilities.
510
 
 }
511
 
function CGDisplayWaitForBeamPositionOutsideLines( display: CGDirectDisplayID; upperScanLine: CGBeamPosition; lowerScanLine: CGBeamPosition ): CGDisplayErr; external name '_CGDisplayWaitForBeamPositionOutsideLines';
512
 
 
513
 
{
514
 
 * Returns the current beam position on the display.  If display is invalid,
515
 
 * or the display does not implement conventional video vertical and horizontal
516
 
 * sweep in painting, or the driver does not implement this functionality, 0 is returned.
517
 
 }
518
 
function CGDisplayBeamPosition( display: CGDirectDisplayID ): CGBeamPosition; external name '_CGDisplayBeamPosition';
519
 
 
520
 
{
521
 
 * Obtain a CGContextRef suitable for drawing to a captured display.
522
 
 *
523
 
 * Returns a drawing context suitable for use on the display device.
524
 
 * The context is owned by the device, and should not be released by
525
 
 * the caller.
526
 
 *
527
 
 * The context remains valid while the display is captured, and the
528
 
 * display configuration is unchanged.  Releasing the captured display
529
 
 * or reconfiguring the display invalidates the drawing context.
530
 
 *
531
 
 * An application may register a display reconfiguration callback to determine
532
 
 * when the display configuration is changing via CGRegisterDisplayReconfigurationProc().
533
 
 * 
534
 
 * After a display configuration change, or on capturing a display, call this
535
 
 * function to obtain a current drawing context.
536
 
 *
537
 
 * If the display has not been captured, this function returns NULL.
538
 
 }
539
 
function CGDisplayGetDrawingContext( display: CGDirectDisplayID ): CGContextRef; external name '_CGDisplayGetDrawingContext'; (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
540
 
 
541
 
 
542
 
end.