Kaydet (Commit) e85e4e43 authored tarafından Jack Jansen's avatar Jack Jansen

The TNXDraw gworld argument is optional.

üst e160fe13
......@@ -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);
......
......@@ -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__":
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment