symbian-qemu-0.9.1-12/python-2.6.1/Mac/Modules/ibcarbon/IBCarbonsupport.py
author Gareth Stockwell <gareth.stockwell@accenture.com>
Fri, 24 Sep 2010 12:07:03 +0100
branchgraphics-phase-3
changeset 115 7fc47a6656f3
parent 1 2fb8b9db1c86
permissions -rw-r--r--
Removed syborg-graphicswrapper model library This has been moved to the adapt/graphics.simulator package - see changeset 563aa0c4cea3.

# IBCarbonsupport.py

from macsupport import *

IBNibRef = OpaqueByValueType('IBNibRef', 'IBNibRefObj')
#CFBundleRef = OpaqueByValueType('CFBundleRef')

IBCarbonFunction = OSErrFunctionGenerator
IBCarbonMethod = OSErrMethodGenerator

includestuff = """
#include <Carbon/Carbon.h>
#include "pymactoolbox.h"

#ifdef USE_TOOLBOX_OBJECT_GLUE
extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
#endif

"""

initstuff = """

"""

module = MacModule('_IBCarbon', 'IBCarbon', includestuff, finalstuff, initstuff)

class CFReleaserObject(PEP253Mixin, GlobalObjectDefinition):
    def outputFreeIt(self, name):
        Output("CFRelease(%s);" % name)

class CFNibDesc(PEP253Mixin, GlobalObjectDefinition):
    def outputFreeIt(self, name):
        Output("DisposeNibReference(%s);" % name)

#cfstringobject = CFReleaserObject("CFStringRef")
#module.addobject(cfstringobject)
#cfbundleobject = CFReleaserObject("CFBundleRef")
#module.addobject(cfbundleobject)
ibnibobject = CFNibDesc("IBNibRef", "IBNibRefObj")
module.addobject(ibnibobject)

functions = []
methods = []

execfile('IBCarbongen.py')

for f in functions: module.add(f)
for m in methods: ibnibobject.add(m)

SetOutputFileName('_IBCarbon.c')
module.generate()