| 1 |
|
| 2 |
|
| 3 |
from macsupport import * |
| 4 |
|
| 5 |
IBNibRef = OpaqueByValueType('IBNibRef', 'IBNibRefObj') |
| 6 |
|
| 7 |
|
| 8 |
IBCarbonFunction = OSErrFunctionGenerator |
| 9 |
IBCarbonMethod = OSErrMethodGenerator |
| 10 |
|
| 11 |
includestuff = """ |
| 12 |
#include <Carbon/Carbon.h> |
| 13 |
#include "pymactoolbox.h" |
| 14 |
|
| 15 |
#ifdef USE_TOOLBOX_OBJECT_GLUE |
| 16 |
extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *); |
| 17 |
#endif |
| 18 |
|
| 19 |
""" |
| 20 |
|
| 21 |
initstuff = """ |
| 22 |
|
| 23 |
""" |
| 24 |
|
| 25 |
module = MacModule('_IBCarbon', 'IBCarbon', includestuff, finalstuff, initstuff) |
| 26 |
|
| 27 |
class CFReleaserObject(PEP253Mixin, GlobalObjectDefinition): |
| 28 |
def outputFreeIt(self, name): |
| 29 |
Output("CFRelease(%s);" % name) |
| 30 |
|
| 31 |
class CFNibDesc(PEP253Mixin, GlobalObjectDefinition): |
| 32 |
def outputFreeIt(self, name): |
| 33 |
Output("DisposeNibReference(%s);" % name) |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
ibnibobject = CFNibDesc("IBNibRef", "IBNibRefObj") |
| 40 |
module.addobject(ibnibobject) |
| 41 |
|
| 42 |
functions = [] |
| 43 |
methods = [] |
| 44 |
|
| 45 |
execfile('IBCarbongen.py') |
| 46 |
|
| 47 |
for f in functions: module.add(f) |
| 48 |
for m in methods: ibnibobject.add(m) |
| 49 |
|
| 50 |
SetOutputFileName('_IBCarbon.c') |
| 51 |
module.generate() |