Commit 23be1ceb authored by Jack Jansen's avatar Jack Jansen

Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.

parent 44022414
This diff is collapsed.
......@@ -31,7 +31,7 @@ def main():
"CFDictionary.h",
## "CFNumber.h",
## "CFPlugIn.h",
## "CFPreferences.h",
"CFPreferences.h",
"CFPropertyList.h",
## "CFSet.h",
"CFString.h",
......@@ -54,7 +54,7 @@ class MyScanner(Scanner_OSX):
def destination(self, type, name, arglist):
classname = "Function"
listname = "functions"
if arglist:
if arglist and name[:13] != 'CFPreferences':
t, n, m = arglist[0]
if t in OBJECTS and m == "InMode":
classname = "Method"
......
......@@ -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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment