summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/mlte
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-07-16 21:58:44 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-07-16 21:58:44 (GMT)
commite85e4e43bd582c795a4055d6bc3b9aca3fc691ba (patch)
tree555a8fa33161db44dd8ab42ac166a27eab115ff1 /Mac/Modules/mlte
parente160fe13dac28a2df1452dd53047592606944413 (diff)
downloadcpython-e85e4e43bd582c795a4055d6bc3b9aca3fc691ba.zip
cpython-e85e4e43bd582c795a4055d6bc3b9aca3fc691ba.tar.gz
cpython-e85e4e43bd582c795a4055d6bc3b9aca3fc691ba.tar.bz2
The TNXDraw gworld argument is optional.
Diffstat (limited to 'Mac/Modules/mlte')
-rw-r--r--Mac/Modules/mlte/Mltemodule.c16
-rw-r--r--Mac/Modules/mlte/mltescan.py6
-rw-r--r--Mac/Modules/mlte/mltesupport.py15
3 files changed, 35 insertions, 2 deletions
diff --git a/Mac/Modules/mlte/Mltemodule.c b/Mac/Modules/mlte/Mltemodule.c
index 27bd121..d2aaec4 100644
--- a/Mac/Modules/mlte/Mltemodule.c
+++ b/Mac/Modules/mlte/Mltemodule.c
@@ -70,6 +70,20 @@ OptRectPtr_Convert(PyObject *v, Rect **p_itself)
return PyMac_GetRect(v, *p_itself);
}
+/*
+** Parse an optional GWorld
+*/
+static int
+OptGWorldObj_Convert(PyObject *v, GWorldPtr *p_itself)
+{
+ if (v == Py_None)
+ {
+ *p_itself = NULL;
+ return 1;
+ }
+ return GWorldObj_Convert(v, p_itself);
+}
+
static PyObject *Mlte_Error;
@@ -276,7 +290,7 @@ static PyObject *TXNObj_TXNDraw(TXNObjectObject *_self, PyObject *_args)
GWorldPtr iDrawPort;
PyMac_PRECHECK(TXNDraw);
if (!PyArg_ParseTuple(_args, "O&",
- GWorldObj_Convert, &iDrawPort))
+ OptGWorldObj_Convert, &iDrawPort))
return NULL;
TXNDraw(_self->ob_itself,
iDrawPort);
diff --git a/Mac/Modules/mlte/mltescan.py b/Mac/Modules/mlte/mltescan.py
index 6da7267..f9c5a6e 100644
--- a/Mac/Modules/mlte/mltescan.py
+++ b/Mac/Modules/mlte/mltescan.py
@@ -116,7 +116,11 @@ MovieFileType = FOUR_CHAR_CODE('moov')
# The AdjustCursor region handle is optional
([("RgnHandle", "ioCursorRgn", "InMode")],
- [("OptRgnHandle", "*", "*")])
+ [("OptRgnHandle", "*", "*")]),
+
+ # The GWorld for TXNDraw is optional
+ ([('GWorldPtr', 'iDrawPort', 'InMode')],
+ [('OptGWorldPtr', '*', '*')]),
]
if __name__ == "__main__":
diff --git a/Mac/Modules/mlte/mltesupport.py b/Mac/Modules/mlte/mltesupport.py
index a7969e7..a1152be 100644
--- a/Mac/Modules/mlte/mltesupport.py
+++ b/Mac/Modules/mlte/mltesupport.py
@@ -74,6 +74,20 @@ OptRectPtr_Convert(PyObject *v, Rect **p_itself)
return PyMac_GetRect(v, *p_itself);
}
+/*
+** Parse an optional GWorld
+*/
+static int
+OptGWorldObj_Convert(PyObject *v, GWorldPtr *p_itself)
+{
+ if (v == Py_None)
+ {
+ *p_itself = NULL;
+ return 1;
+ }
+ return GWorldObj_Convert(v, p_itself);
+}
+
"""
initstuff = initstuff + """
@@ -109,6 +123,7 @@ DragTrackingMessage = Type("DragTrackingMessage", "h")
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
OptRgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj")
+OptGWorldPtr = OpaqueByValueType("GWorldPtr", "OptGWorldObj")
MlteInBuffer = VarInputBufferType('void *', 'ByteCount', 'l')
OptFSSpecPtr = OpaqueByValueType("FSSpec *", "OptFSSpecPtr")