diff options
Diffstat (limited to 'Mac/Modules/cf/cfsupport.py')
-rw-r--r-- | Mac/Modules/cf/cfsupport.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py index ebfe717..5da71d5 100644 --- a/Mac/Modules/cf/cfsupport.py +++ b/Mac/Modules/cf/cfsupport.py @@ -17,11 +17,38 @@ OUTPUTFILE = MODNAME + "module.c" # The file generated by this program from macsupport import * +# Special case generator for the functions that have an AllocatorRef first argument, +# which we skip anyway, and the object as the second arg. +class MethodSkipArg1(MethodGenerator): + """Similar to MethodGenerator, but has self as last argument""" + + def parseArgumentList(self, args): + if len(args) < 2: + raise ValueError, "MethodSkipArg1 expects at least 2 args" + a0, a1, args = args[0], args[1], args[2:] + t0, n0, m0 = a0 + if t0 != "CFAllocatorRef" and m0 != InMode: + raise ValueError, "MethodSkipArg1 should have dummy AllocatorRef first arg" + t1, n1, m1 = a1 + if m1 != InMode: + raise ValueError, "method's 'self' must be 'InMode'" + dummy = Variable(t0, n0, m0) + self.argumentList.append(dummy) + self.itself = Variable(t1, "_self->ob_itself", SelfMode) + self.argumentList.append(self.itself) + FunctionGenerator.parseArgumentList(self, args) + + # Create the type objects includestuff = includestuff + """ #ifdef WITHOUT_FRAMEWORKS -#include <CoreFoundation.h> +#include <CFBase.h> +#include <CFArray.h> +#include <CFData.h> +#include <CFDictionary.h> +#include <CFString.h> +#include <CFURL.h> #else #include <CoreFoundation.h> #endif @@ -31,6 +58,8 @@ staticforward PyObject *CFTypeRefObj_New(CFTypeRef); staticforward int CFTypeRefObj_Convert(PyObject *, CFTypeRef *); staticforward PyObject *CFStringRefObj_New(CFStringRef); staticforward int CFStringRefObj_Convert(PyObject *, CFStringRef *); +staticforward PyObject *CFURLRefObj_New(CFURLRef); +staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); |