From f0ded2f0bc1bb295aaab0b4385a576a99088c18c Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sat, 14 Jul 2001 14:00:50 +0000 Subject: [PATCH] Various small fixes. The demo now starts to limp along. --- Mac/Modules/mlte/Mltemodule.c | 2 +- Mac/Modules/mlte/mltescan.py | 35 ++++++++++++++++++++++++++++++++- Mac/Modules/mlte/mltesupport.py | 1 + 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Mac/Modules/mlte/Mltemodule.c b/Mac/Modules/mlte/Mltemodule.c index a25c6f7ab45..27bd12106dd 100644 --- a/Mac/Modules/mlte/Mltemodule.c +++ b/Mac/Modules/mlte/Mltemodule.c @@ -191,7 +191,7 @@ static PyObject *TXNObj_TXNAdjustCursor(TXNObjectObject *_self, PyObject *_args) RgnHandle ioCursorRgn; PyMac_PRECHECK(TXNAdjustCursor); if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &ioCursorRgn)) + OptResObj_Convert, &ioCursorRgn)) return NULL; TXNAdjustCursor(_self->ob_itself, ioCursorRgn); diff --git a/Mac/Modules/mlte/mltescan.py b/Mac/Modules/mlte/mltescan.py index 25e7d62ed28..6da7267ac4c 100644 --- a/Mac/Modules/mlte/mltescan.py +++ b/Mac/Modules/mlte/mltescan.py @@ -37,13 +37,42 @@ class MyScanner(Scanner_OSX): return classname, listname def writeinitialdefs(self): - self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") + self.defsfile.write(""" +def FOUR_CHAR_CODE(x): return x +false = 0 +true = 1 +kTXNClearThisControl = 0xFFFFFFFF +kTXNClearTheseFontFeatures = 0x80000000 +kTXNDontCareTypeSize = 0xFFFFFFFF +kTXNDecrementTypeSize = 0x80000000 +kTXNUseCurrentSelection = 0xFFFFFFFF +kTXNStartOffset = 0 +kTXNEndOffset = 0x7FFFFFFF +MovieFileType = FOUR_CHAR_CODE('moov') +""") def makeblacklistnames(self): return [ "TXNGetFontDefaults", # Arg is too difficult "TXNSetFontDefaults", # Arg is too difficult "TXNInitTextension", # done manually + + # Constants with funny definitions + "kTXNClearThisControl", + "kTXNClearTheseFontFeatures", + "kTXNDontCareTypeSize", + "kTXNDecrementTypeSize", + "kTXNUseCurrentSelection", + "kTXNStartOffset", + "kTXNEndOffset", + "kTXNQDFontNameAttributeSize", + "kTXNQDFontFamilyIDAttributeSize", + "kTXNQDFontSizeAttributeSize", + "kTXNQDFontStyleAttributeSize", + "kTXNQDFontColorAttributeSize", + "kTXNTextEncodingAttributeSize", + "status", + "justification", ] def makegreylist(self): @@ -84,6 +113,10 @@ class MyScanner(Scanner_OSX): # In buffers are passed as void * ([("void", "*", "OutMode"), ("ByteCount", "*", "InMode")], [("MlteInBuffer", "*", "InMode")]), + + # The AdjustCursor region handle is optional + ([("RgnHandle", "ioCursorRgn", "InMode")], + [("OptRgnHandle", "*", "*")]) ] if __name__ == "__main__": diff --git a/Mac/Modules/mlte/mltesupport.py b/Mac/Modules/mlte/mltesupport.py index e33d49dbbdb..a7969e77bea 100644 --- a/Mac/Modules/mlte/mltesupport.py +++ b/Mac/Modules/mlte/mltesupport.py @@ -107,6 +107,7 @@ TXNBackgroundType = Type("TXNBackgroundType", "l") DragReference = OpaqueByValueType("DragReference", "DragObj") DragTrackingMessage = Type("DragTrackingMessage", "h") RgnHandle = OpaqueByValueType("RgnHandle", "ResObj") +OptRgnHandle = OpaqueByValueType("RgnHandle", "OptResObj") GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj") MlteInBuffer = VarInputBufferType('void *', 'ByteCount', 'l')