5
* Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
8
{ Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
10
Modified for use with Free Pascal
12
Please report any bugs to <gpc@microbizz.nl>
23
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
24
{$setc GAP_INTERFACES_VERSION := $0200}
26
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
27
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
30
{$ifc defined CPUPOWERPC and defined CPUI386}
31
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
33
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
34
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
37
{$ifc not defined __ppc__ and defined CPUPOWERPC}
42
{$ifc not defined __i386__ and defined CPUI386}
48
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
49
{$error Conflicting definitions for __ppc__ and __i386__}
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}
59
{$error Neither __ppc__ nor __i386__ is defined.}
61
{$setc TARGET_CPU_PPC_64 := FALSE}
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}
70
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
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,CFDictionary,CGBase;
102
* Fetch the current session's dictionary
103
* Returns NULL if the caller is not within a GUI session, as when the caller is a UNIX daemon,
104
* or if a system is configured to not run a Quartz GUI (window server disabled)
106
function CGSessionCopyCurrentDictionary: CFDictionaryRef; external name '_CGSessionCopyCurrentDictionary';
109
* Predefined keys for the Session dictionaries
110
* Values are provided as CFSTR() macros rather than extern C data for PEF/CFM support.
111
* Constant values will remain unchanged in future releases for PEF/CFM compatibility.
113
* These keys are guaranteed by the system to be present in a session dictionary.
114
* Additional keys and values may be defined and added to the dictionary by
115
* other system components as needed.
117
{$ifc USE_CFSTR_CONSTANT_MACROS}
118
{$definec kCGSessionUserIDKey CFSTRP('kCGSSessionUserIDKey')}
120
{ value is a CFNumber encoding a uid_t for the session's current user. }
122
{$ifc USE_CFSTR_CONSTANT_MACROS}
123
{$definec kCGSessionUserNameKey CFSTRP('kCGSSessionUserNameKey')}
125
{ value is a CFString encoding the session's short user name as set by loginwindow }
127
{$ifc USE_CFSTR_CONSTANT_MACROS}
128
{$definec kCGSessionConsoleSetKey CFSTRP('kCGSSessionConsoleSetKey')}
130
{ value is a CFNumber encoding a 32 bit unsigned integer value representing a set of hardware composing a console }
132
{$ifc USE_CFSTR_CONSTANT_MACROS}
133
{$definec kCGSessionOnConsoleKey CFSTRP('kCGSSessionOnConsoleKey')}
135
{ value is a CFBoolean, kCFBooleanTrue if the session is on a console, otherwise kCFBooleanFalse }
137
{$ifc USE_CFSTR_CONSTANT_MACROS}
138
{$definec kCGSessionLoginDoneKey CFSTRP('kCGSessionLoginDoneKey')}
140
{ value is a CFBoolean, kCFBooleanTrue if login operation has been done, otherwise kCFBooleanFalse }
143
* When the GUI session on a console changes, a notification
144
* is posted via the notify_post() API. See notify (3) and
145
* notify.h for details.
148
kCGNotifyGUIConsoleSessionChanged = 'com.apple.coregraphics.GUIConsoleSessionChanged';
149
{ When a user logs in or out of a session we post a notification via notify_post() }
151
kCGNotifyGUISessionUserChanged = 'com.apple.coregraphics.GUISessionUserChanged';