move sections
[python/dscho.git] / Mac / Modules / ibcarbon / IBCarbonsupport.py
blob5f4132840e2279e0fd54a40279328efb715f34cb
1 # IBCarbonsupport.py
3 from macsupport import *
5 IBNibRef = OpaqueByValueType('IBNibRef', 'IBNibRefObj')
6 #CFBundleRef = OpaqueByValueType('CFBundleRef')
8 IBCarbonFunction = OSErrFunctionGenerator
9 IBCarbonMethod = OSErrMethodGenerator
11 includestuff = """
12 #include <Carbon/Carbon.h>
13 #include "pymactoolbox.h"
15 #ifdef USE_TOOLBOX_OBJECT_GLUE
16 extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
17 #endif
19 """
21 initstuff = """
23 """
25 module = MacModule('_IBCarbon', 'IBCarbon', includestuff, finalstuff, initstuff)
27 class CFReleaserObject(PEP253Mixin, GlobalObjectDefinition):
28 def outputFreeIt(self, name):
29 Output("CFRelease(%s);" % name)
31 class CFNibDesc(PEP253Mixin, GlobalObjectDefinition):
32 def outputFreeIt(self, name):
33 Output("DisposeNibReference(%s);" % name)
35 #cfstringobject = CFReleaserObject("CFStringRef")
36 #module.addobject(cfstringobject)
37 #cfbundleobject = CFReleaserObject("CFBundleRef")
38 #module.addobject(cfbundleobject)
39 ibnibobject = CFNibDesc("IBNibRef", "IBNibRefObj")
40 module.addobject(ibnibobject)
42 functions = []
43 methods = []
45 execfile('IBCarbongen.py')
47 for f in functions: module.add(f)
48 for m in methods: ibnibobject.add(m)
50 SetOutputFileName('_IBCarbon.c')
51 module.generate()