diff options
Diffstat (limited to 'Mac/Modules/te/tesupport.py')
-rw-r--r-- | Mac/Modules/te/tesupport.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Mac/Modules/te/tesupport.py b/Mac/Modules/te/tesupport.py index 7802ae9..b078649 100644 --- a/Mac/Modules/te/tesupport.py +++ b/Mac/Modules/te/tesupport.py @@ -23,7 +23,7 @@ from macsupport import * # Create the type objects TEHandle = OpaqueByValueType("TEHandle", "TEObj") CharsHandle = OpaqueByValueType("CharsHandle", "ResObj") -##Handle = OpaqueByValueType("Handle", "ResObj") +Handle = OpaqueByValueType("Handle", "ResObj") StScrpHandle = OpaqueByValueType("StScrpHandle", "ResObj") TEStyleHandle = OpaqueByValueType("TEStyleHandle", "ResObj") RgnHandle = OpaqueByValueType("RgnHandle", "ResObj") @@ -34,6 +34,9 @@ TextStyle_ptr = TextStyle includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ +#define as_TE(h) ((TEHandle)h) +#define as_Resource(teh) ((Handle)teh) + /* Exported by Qdmodule.c: */ extern PyObject *QdRGB_New(RGBColor *); extern int QdRGB_Convert(PyObject *, RGBColor *); @@ -143,6 +146,12 @@ functions = [] methods = [] execfile(INPUTFILE) +# Converter from/to handle +f = Function(TEHandle, 'as_TE', (Handle, 'h', InMode)) +functions.append(f) +f = Method(Handle, 'as_Resource', (TEHandle, 'teh', InMode)) +methods.append(f) + # add the populated lists to the generator groups # (in a different wordl the scan program would generate this) for f in functions: module.add(f) |