summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cf/cfsupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/cf/cfsupport.py')
-rw-r--r--Mac/Modules/cf/cfsupport.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py
index 23dbbac..8aed6c2 100644
--- a/Mac/Modules/cf/cfsupport.py
+++ b/Mac/Modules/cf/cfsupport.py
@@ -50,6 +50,7 @@ includestuff = includestuff + """
#include <CFString.h>
#include <CFURL.h>
#include <CFPropertyList.h>
+#include <CFPreferences.h>
#else
#include <CoreServices/CoreServices.h>
#endif
@@ -165,6 +166,17 @@ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert);
"""
+variablestuff="""
+#define _STRINGCONST(name) PyModule_AddObject(m, #name, CFStringRefObj_New(name))
+_STRINGCONST(kCFPreferencesAnyApplication);
+_STRINGCONST(kCFPreferencesCurrentApplication);
+_STRINGCONST(kCFPreferencesAnyHost);
+_STRINGCONST(kCFPreferencesCurrentHost);
+_STRINGCONST(kCFPreferencesAnyUser);
+_STRINGCONST(kCFPreferencesCurrentUser);
+
+"""
+
Boolean = Type("Boolean", "l")
CFTypeID = Type("CFTypeID", "l") # XXXX a guess, seems better than OSTypeType.
CFHashCode = Type("CFHashCode", "l")
@@ -405,7 +417,7 @@ class CFURLRefObjectDefinition(MyGlobalObjectDefinition):
# From here on it's basically all boiler plate...
# Create the generator groups and link them
-module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
+module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, variablestuff)
CFTypeRef_object = CFTypeRefObjectDefinition('CFTypeRef', 'CFTypeRefObj', 'CFTypeRef')
CFArrayRef_object = CFArrayRefObjectDefinition('CFArrayRef', 'CFArrayRefObj', 'CFArrayRef')
CFMutableArrayRef_object = CFMutableArrayRefObjectDefinition('CFMutableArrayRef', 'CFMutableArrayRefObj', 'CFMutableArrayRef')