mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
This commit is contained in:
parent
4402241450
commit
23be1ceb51
3 changed files with 372 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue