~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{       CFPreferences.h
 
2
        Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
 
3
}
 
4
{   Pascal Translation Updated:  Peter N Lewis, <peter@stairways.com.au>, September 2005 }
 
5
{
 
6
    Modified for use with Free Pascal
 
7
    Version 200
 
8
    Please report any bugs to <gpc@microbizz.nl>
 
9
}
 
10
 
 
11
{$mode macpas}
 
12
{$packenum 1}
 
13
{$macro on}
 
14
{$inline on}
 
15
{$CALLING MWPASCAL}
 
16
 
 
17
unit CFPreferences;
 
18
interface
 
19
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
 
20
{$setc GAP_INTERFACES_VERSION := $0200}
 
21
 
 
22
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
 
23
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
 
24
{$endc}
 
25
 
 
26
{$ifc defined CPUPOWERPC and defined CPUI386}
 
27
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
 
28
{$endc}
 
29
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
 
30
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 
31
{$endc}
 
32
 
 
33
{$ifc not defined __ppc__ and defined CPUPOWERPC}
 
34
        {$setc __ppc__ := 1}
 
35
{$elsec}
 
36
        {$setc __ppc__ := 0}
 
37
{$endc}
 
38
{$ifc not defined __i386__ and defined CPUI386}
 
39
        {$setc __i386__ := 1}
 
40
{$elsec}
 
41
        {$setc __i386__ := 0}
 
42
{$endc}
 
43
 
 
44
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 
45
        {$error Conflicting definitions for __ppc__ and __i386__}
 
46
{$endc}
 
47
 
 
48
{$ifc defined __ppc__ and __ppc__}
 
49
        {$setc TARGET_CPU_PPC := TRUE}
 
50
        {$setc TARGET_CPU_X86 := FALSE}
 
51
{$elifc defined __i386__ and __i386__}
 
52
        {$setc TARGET_CPU_PPC := FALSE}
 
53
        {$setc TARGET_CPU_X86 := TRUE}
 
54
{$elsec}
 
55
        {$error Neither __ppc__ nor __i386__ is defined.}
 
56
{$endc}
 
57
{$setc TARGET_CPU_PPC_64 := FALSE}
 
58
 
 
59
{$ifc defined FPC_BIG_ENDIAN}
 
60
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
 
61
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
 
62
{$elifc defined FPC_LITTLE_ENDIAN}
 
63
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
 
64
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
 
65
{$elsec}
 
66
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
 
67
{$endc}
 
68
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
 
69
{$setc CALL_NOT_IN_CARBON := FALSE}
 
70
{$setc OLDROUTINENAMES := FALSE}
 
71
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
 
72
{$setc OPAQUE_UPP_TYPES := TRUE}
 
73
{$setc OTCARBONAPPLICATION := TRUE}
 
74
{$setc OTKERNEL := FALSE}
 
75
{$setc PM_USE_SESSION_APIS := TRUE}
 
76
{$setc TARGET_API_MAC_CARBON := TRUE}
 
77
{$setc TARGET_API_MAC_OS8 := FALSE}
 
78
{$setc TARGET_API_MAC_OSX := TRUE}
 
79
{$setc TARGET_CARBON := TRUE}
 
80
{$setc TARGET_CPU_68K := FALSE}
 
81
{$setc TARGET_CPU_MIPS := FALSE}
 
82
{$setc TARGET_CPU_SPARC := FALSE}
 
83
{$setc TARGET_OS_MAC := TRUE}
 
84
{$setc TARGET_OS_UNIX := FALSE}
 
85
{$setc TARGET_OS_WIN32 := FALSE}
 
86
{$setc TARGET_RT_MAC_68881 := FALSE}
 
87
{$setc TARGET_RT_MAC_CFM := FALSE}
 
88
{$setc TARGET_RT_MAC_MACHO := TRUE}
 
89
{$setc TYPED_FUNCTION_POINTERS := TRUE}
 
90
{$setc TYPE_BOOL := FALSE}
 
91
{$setc TYPE_EXTENDED := FALSE}
 
92
{$setc TYPE_LONGLONG := TRUE}
 
93
uses MacTypes,CFDictionary,CFBase,CFArray,CFPropertyList,CFString;
 
94
{$ALIGN POWER}
 
95
 
 
96
 
 
97
var kCFPreferencesAnyApplication: CFStringRef; external name '_kCFPreferencesAnyApplication'; (* attribute const *)
 
98
var kCFPreferencesCurrentApplication: CFStringRef; external name '_kCFPreferencesCurrentApplication'; (* attribute const *)
 
99
var kCFPreferencesAnyHost: CFStringRef; external name '_kCFPreferencesAnyHost'; (* attribute const *)
 
100
var kCFPreferencesCurrentHost: CFStringRef; external name '_kCFPreferencesCurrentHost'; (* attribute const *)
 
101
var kCFPreferencesAnyUser: CFStringRef; external name '_kCFPreferencesAnyUser'; (* attribute const *)
 
102
var kCFPreferencesCurrentUser: CFStringRef; external name '_kCFPreferencesCurrentUser'; (* attribute const *)
 
103
 
 
104
{ NOTE: All CFPropertyListRef values returned from
 
105
         CFPreferences API should be assumed to be immutable.
 
106
}
 
107
 
 
108
{       The "App" functions search the various sources of defaults that
 
109
        apply to the given application, and should never be called with
 
110
        kCFPreferencesAnyApplication - only kCFPreferencesCurrentApplication
 
111
        or an application's ID (its bundle identifier).
 
112
}
 
113
 
 
114
{ Searches the various sources of application defaults to find the
 
115
value for the given key. key must not be NULL.  If a value is found,
 
116
it returns it; otherwise returns NULL.  Caller must release the
 
117
returned value }
 
118
function CFPreferencesCopyAppValue( key: CFStringRef; applicationID: CFStringRef ): CFPropertyListRef; external name '_CFPreferencesCopyAppValue';
 
119
 
 
120
{ Convenience to interpret a preferences value as a boolean directly.
 
121
Returns false if the key doesn't exist, or has an improper format; under
 
122
those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false }
 
123
function CFPreferencesGetAppBooleanValue( key: CFStringRef; applicationID: CFStringRef; var keyExistsAndHasValidFormat: Boolean ): Boolean; external name '_CFPreferencesGetAppBooleanValue';
 
124
 
 
125
{ Convenience to interpret a preferences value as an integer directly.
 
126
Returns 0 if the key doesn't exist, or has an improper format; under
 
127
those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false }
 
128
function CFPreferencesGetAppIntegerValue( key: CFStringRef; applicationID: CFStringRef; var keyExistsAndHasValidFormat: Boolean ): CFIndex; external name '_CFPreferencesGetAppIntegerValue';
 
129
 
 
130
{ Sets the given value for the given key in the "normal" place for
 
131
application preferences.  key must not be NULL.  If value is NULL,
 
132
key is removed instead. }
 
133
procedure CFPreferencesSetAppValue( key: CFStringRef; value: CFPropertyListRef; applicationID: CFStringRef ); external name '_CFPreferencesSetAppValue';
 
134
 
 
135
{ Adds the preferences for the given suite to the app preferences for
 
136
   the specified application.  To write to the suite domain, use
 
137
   CFPreferencesSetValue(), below, using the suiteName in place
 
138
   of the appName }
 
139
procedure CFPreferencesAddSuitePreferencesToApp( applicationID: CFStringRef; suiteID: CFStringRef ); external name '_CFPreferencesAddSuitePreferencesToApp';
 
140
 
 
141
procedure CFPreferencesRemoveSuitePreferencesFromApp( applicationID: CFStringRef; suiteID: CFStringRef ); external name '_CFPreferencesRemoveSuitePreferencesFromApp';
 
142
 
 
143
{ Writes all changes in all sources of application defaults.
 
144
Returns success or failure. }
 
145
function CFPreferencesAppSynchronize( applicationID: CFStringRef ): Boolean; external name '_CFPreferencesAppSynchronize';
 
146
 
 
147
{ The primitive get mechanism; all arguments must be non-NULL
 
148
(use the constants above for common values).  Only the exact
 
149
location specified by app-user-host is searched.  The returned
 
150
CFType must be released by the caller when it is finished with it. }
 
151
function CFPreferencesCopyValue( key: CFStringRef; applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ): CFPropertyListRef; external name '_CFPreferencesCopyValue';
 
152
 
 
153
{ Convenience to fetch multiple keys at once.  Keys in 
 
154
keysToFetch that are not present in the returned dictionary
 
155
are not present in the domain.  If keysToFetch is NULL, all
 
156
keys are fetched. }
 
157
function CFPreferencesCopyMultiple( keysToFetch: CFArrayRef; applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ): CFDictionaryRef; external name '_CFPreferencesCopyMultiple';
 
158
 
 
159
{ The primitive set function; all arguments except value must be
 
160
non-NULL.  If value is NULL, the given key is removed }
 
161
procedure CFPreferencesSetValue( key: CFStringRef; value: CFPropertyListRef; applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ); external name '_CFPreferencesSetValue';
 
162
 
 
163
{ Convenience to set multiple values at once.  Behavior is undefined
 
164
if a key is in both keysToSet and keysToRemove }
 
165
procedure CFPreferencesSetMultiple( keysToSet: CFDictionaryRef; keysToRemove: CFArrayRef; applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ); external name '_CFPreferencesSetMultiple';
 
166
 
 
167
function CFPreferencesSynchronize( applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ): Boolean; external name '_CFPreferencesSynchronize';
 
168
 
 
169
{ Constructs and returns the list of the name of all applications
 
170
which have preferences in the scope of the given user and host.
 
171
The returned value must be released by the caller; neither argument
 
172
may be NULL. }
 
173
function CFPreferencesCopyApplicationList( userName: CFStringRef; hostName: CFStringRef ): CFArrayRef; external name '_CFPreferencesCopyApplicationList';
 
174
 
 
175
{ Constructs and returns the list of all keys set in the given
 
176
location.  The returned value must be released by the caller;
 
177
all arguments must be non-NULL }
 
178
function CFPreferencesCopyKeyList( applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ): CFArrayRef; external name '_CFPreferencesCopyKeyList';
 
179
 
 
180
{#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
 
181
 
 
182
{ Function to determine whether or not a given key has been imposed on the
 
183
user - In cases where machines and/or users are under some kind of management,
 
184
callers should use this function to determine whether or not to disable UI elements
 
185
corresponding to those preference keys. }
 
186
function CFPreferencesAppValueIsForced( key: CFStringRef; applicationID: CFStringRef ): Boolean; external name '_CFPreferencesAppValueIsForced';
 
187
 
 
188
{#endif}
 
189
 
 
190
 
 
191
end.