diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1998-02-20 16:02:09 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1998-02-20 16:02:09 (GMT) |
commit | 21f96872f20080d5f07a72ea4141fac137ac9b15 (patch) | |
tree | 5a300f0e769bddbc7795b7bc955f9f84f3bc1f2e /Mac/Modules/win/Winmodule.c | |
parent | cbe6a53d1ffe76702a2873429f2c57f9609a7f48 (diff) | |
download | cpython-21f96872f20080d5f07a72ea4141fac137ac9b15.zip cpython-21f96872f20080d5f07a72ea4141fac137ac9b15.tar.gz cpython-21f96872f20080d5f07a72ea4141fac137ac9b15.tar.bz2 |
Regenerated from Universal Headers 3.0.1. Some new calls are
blacklisted, because they are not available in classic 68k programs,
and bgen doesn't have a way to put #ifdef/#endif in the generated
code. For now we only implement calls that work on all three models.
Diffstat (limited to 'Mac/Modules/win/Winmodule.c')
-rw-r--r-- | Mac/Modules/win/Winmodule.c | 812 |
1 files changed, 461 insertions, 351 deletions
diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c index eb5b046..ea24d62 100644 --- a/Mac/Modules/win/Winmodule.c +++ b/Mac/Modules/win/Winmodule.c @@ -102,220 +102,201 @@ static void WinObj_dealloc(self) PyMem_DEL(self); } -static PyObject *WinObj_GetWTitle(_self, _args) - WindowObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - Str255 title; - if (!PyArg_ParseTuple(_args, "")) - return NULL; - GetWTitle(_self->ob_itself, - title); - _res = Py_BuildValue("O&", - PyMac_BuildStr255, title); - return _res; -} - -static PyObject *WinObj_SelectWindow(_self, _args) +static PyObject *WinObj_SetWinColor(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) + WCTabHandle newColorTable; + if (!PyArg_ParseTuple(_args, "O&", + ResObj_Convert, &newColorTable)) return NULL; - SelectWindow(_self->ob_itself); + SetWinColor(_self->ob_itself, + newColorTable); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_HideWindow(_self, _args) +static PyObject *WinObj_ClipAbove(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; if (!PyArg_ParseTuple(_args, "")) return NULL; - HideWindow(_self->ob_itself); + ClipAbove(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_ShowWindow(_self, _args) +static PyObject *WinObj_SaveOld(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; if (!PyArg_ParseTuple(_args, "")) return NULL; - ShowWindow(_self->ob_itself); + SaveOld(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_ShowHide(_self, _args) +static PyObject *WinObj_DrawNew(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Boolean showFlag; + Boolean update; if (!PyArg_ParseTuple(_args, "b", - &showFlag)) + &update)) return NULL; - ShowHide(_self->ob_itself, - showFlag); + DrawNew(_self->ob_itself, + update); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_HiliteWindow(_self, _args) +static PyObject *WinObj_PaintOne(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Boolean fHilite; - if (!PyArg_ParseTuple(_args, "b", - &fHilite)) + RgnHandle clobberedRgn; + if (!PyArg_ParseTuple(_args, "O&", + ResObj_Convert, &clobberedRgn)) return NULL; - HiliteWindow(_self->ob_itself, - fHilite); + PaintOne(_self->ob_itself, + clobberedRgn); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_BringToFront(_self, _args) +static PyObject *WinObj_PaintBehind(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) + RgnHandle clobberedRgn; + if (!PyArg_ParseTuple(_args, "O&", + ResObj_Convert, &clobberedRgn)) return NULL; - BringToFront(_self->ob_itself); + PaintBehind(_self->ob_itself, + clobberedRgn); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_SendBehind(_self, _args) +static PyObject *WinObj_CalcVis(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - WindowPtr behindWindow; - if (!PyArg_ParseTuple(_args, "O&", - WinObj_Convert, &behindWindow)) + if (!PyArg_ParseTuple(_args, "")) return NULL; - SendBehind(_self->ob_itself, - behindWindow); + CalcVis(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_DrawGrowIcon(_self, _args) +static PyObject *WinObj_CalcVisBehind(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) + RgnHandle clobberedRgn; + if (!PyArg_ParseTuple(_args, "O&", + ResObj_Convert, &clobberedRgn)) return NULL; - DrawGrowIcon(_self->ob_itself); + CalcVisBehind(_self->ob_itself, + clobberedRgn); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_MoveWindow(_self, _args) +static PyObject *WinObj_BringToFront(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - short hGlobal; - short vGlobal; - Boolean front; - if (!PyArg_ParseTuple(_args, "hhb", - &hGlobal, - &vGlobal, - &front)) + if (!PyArg_ParseTuple(_args, "")) return NULL; - MoveWindow(_self->ob_itself, - hGlobal, - vGlobal, - front); + BringToFront(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_SizeWindow(_self, _args) +static PyObject *WinObj_SendBehind(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - short w; - short h; - Boolean fUpdate; - if (!PyArg_ParseTuple(_args, "hhb", - &w, - &h, - &fUpdate)) + WindowPtr behindWindow; + if (!PyArg_ParseTuple(_args, "O&", + WinObj_Convert, &behindWindow)) return NULL; - SizeWindow(_self->ob_itself, - w, - h, - fUpdate); + SendBehind(_self->ob_itself, + behindWindow); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_ZoomWindow(_self, _args) +static PyObject *WinObj_SelectWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - short partCode; - Boolean front; - if (!PyArg_ParseTuple(_args, "hb", - &partCode, - &front)) + if (!PyArg_ParseTuple(_args, "")) return NULL; - ZoomWindow(_self->ob_itself, - partCode, - front); + SelectWindow(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_BeginUpdate(_self, _args) +static PyObject *WinObj_GetWindowFeatures(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; + OSStatus _rv; + UInt32 outFeatures; if (!PyArg_ParseTuple(_args, "")) return NULL; - BeginUpdate(_self->ob_itself); - Py_INCREF(Py_None); - _res = Py_None; + _rv = GetWindowFeatures(_self->ob_itself, + &outFeatures); + _res = Py_BuildValue("ll", + _rv, + outFeatures); return _res; } -static PyObject *WinObj_EndUpdate(_self, _args) +static PyObject *WinObj_GetWindowRegion(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) + OSStatus _rv; + WindowRegionCode inRegionCode; + RgnHandle ioWinRgn; + if (!PyArg_ParseTuple(_args, "hO&", + &inRegionCode, + ResObj_Convert, &ioWinRgn)) return NULL; - EndUpdate(_self->ob_itself); - Py_INCREF(Py_None); - _res = Py_None; + _rv = GetWindowRegion(_self->ob_itself, + inRegionCode, + ioWinRgn); + _res = Py_BuildValue("l", + _rv); return _res; } @@ -379,104 +360,209 @@ static PyObject *WinObj_GetWindowPic(_self, _args) return _res; } -static PyObject *WinObj_ClipAbove(_self, _args) +static PyObject *WinObj_GetWVariant(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; + short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; - ClipAbove(_self->ob_itself); + _rv = GetWVariant(_self->ob_itself); + _res = Py_BuildValue("h", + _rv); + return _res; +} + +static PyObject *WinObj_BeginUpdate(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + BeginUpdate(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_SaveOld(_self, _args) +static PyObject *WinObj_EndUpdate(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; if (!PyArg_ParseTuple(_args, "")) return NULL; - SaveOld(_self->ob_itself); + EndUpdate(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_DrawNew(_self, _args) +static PyObject *WinObj_DrawGrowIcon(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Boolean update; - if (!PyArg_ParseTuple(_args, "b", - &update)) + if (!PyArg_ParseTuple(_args, "")) return NULL; - DrawNew(_self->ob_itself, - update); + DrawGrowIcon(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_PaintOne(_self, _args) +static PyObject *WinObj_HiliteWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - RgnHandle clobberedRgn; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &clobberedRgn)) + Boolean fHilite; + if (!PyArg_ParseTuple(_args, "b", + &fHilite)) return NULL; - PaintOne(_self->ob_itself, - clobberedRgn); + HiliteWindow(_self->ob_itself, + fHilite); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_PaintBehind(_self, _args) +static PyObject *WinObj_SetWTitle(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - RgnHandle clobberedRgn; + Str255 title; if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &clobberedRgn)) + PyMac_GetStr255, title)) return NULL; - PaintBehind(_self->ob_itself, - clobberedRgn); + SetWTitle(_self->ob_itself, + title); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_CalcVis(_self, _args) +static PyObject *WinObj_GetWTitle(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; + Str255 title; if (!PyArg_ParseTuple(_args, "")) return NULL; - CalcVis(_self->ob_itself); + GetWTitle(_self->ob_itself, + title); + _res = Py_BuildValue("O&", + PyMac_BuildStr255, title); + return _res; +} + +static PyObject *WinObj_IsWindowCollapsable(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + Boolean _rv; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + _rv = IsWindowCollapsable(_self->ob_itself); + _res = Py_BuildValue("b", + _rv); + return _res; +} + +static PyObject *WinObj_IsWindowCollapsed(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + Boolean _rv; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + _rv = IsWindowCollapsed(_self->ob_itself); + _res = Py_BuildValue("b", + _rv); + return _res; +} + +static PyObject *WinObj_CollapseWindow(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + OSStatus _rv; + Boolean inCollapseIt; + if (!PyArg_ParseTuple(_args, "b", + &inCollapseIt)) + return NULL; + _rv = CollapseWindow(_self->ob_itself, + inCollapseIt); + _res = Py_BuildValue("l", + _rv); + return _res; +} + +static PyObject *WinObj_MoveWindow(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short hGlobal; + short vGlobal; + Boolean front; + if (!PyArg_ParseTuple(_args, "hhb", + &hGlobal, + &vGlobal, + &front)) + return NULL; + MoveWindow(_self->ob_itself, + hGlobal, + vGlobal, + front); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_CalcVisBehind(_self, _args) +static PyObject *WinObj_SizeWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - RgnHandle clobberedRgn; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &clobberedRgn)) + short w; + short h; + Boolean fUpdate; + if (!PyArg_ParseTuple(_args, "hhb", + &w, + &h, + &fUpdate)) return NULL; - CalcVisBehind(_self->ob_itself, - clobberedRgn); + SizeWindow(_self->ob_itself, + w, + h, + fUpdate); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *WinObj_ZoomWindow(_self, _args) + WindowObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short partCode; + Boolean front; + if (!PyArg_ParseTuple(_args, "hb", + &partCode, + &front)) + return NULL; + ZoomWindow(_self->ob_itself, + partCode, + front); Py_INCREF(Py_None); _res = Py_None; return _res; @@ -502,105 +588,101 @@ static PyObject *WinObj_GrowWindow(_self, _args) return _res; } -static PyObject *WinObj_TrackBox(_self, _args) +static PyObject *WinObj_DragWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Boolean _rv; - Point thePt; - short partCode; - if (!PyArg_ParseTuple(_args, "O&h", - PyMac_GetPoint, &thePt, - &partCode)) + Point startPt; + Rect boundsRect; + if (!PyArg_ParseTuple(_args, "O&O&", + PyMac_GetPoint, &startPt, + PyMac_GetRect, &boundsRect)) return NULL; - _rv = TrackBox(_self->ob_itself, - thePt, - partCode); - _res = Py_BuildValue("b", - _rv); + DragWindow(_self->ob_itself, + startPt, + &boundsRect); + Py_INCREF(Py_None); + _res = Py_None; return _res; } -static PyObject *WinObj_SetWinColor(_self, _args) +static PyObject *WinObj_HideWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - WCTabHandle newColorTable; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &newColorTable)) + if (!PyArg_ParseTuple(_args, "")) return NULL; - SetWinColor(_self->ob_itself, - newColorTable); + HideWindow(_self->ob_itself); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_GetWVariant(_self, _args) +static PyObject *WinObj_ShowWindow(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; - _rv = GetWVariant(_self->ob_itself); - _res = Py_BuildValue("h", - _rv); + ShowWindow(_self->ob_itself); + Py_INCREF(Py_None); + _res = Py_None; return _res; } -static PyObject *WinObj_SetWTitle(_self, _args) +static PyObject *WinObj_ShowHide(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Str255 title; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetStr255, title)) + Boolean showFlag; + if (!PyArg_ParseTuple(_args, "b", + &showFlag)) return NULL; - SetWTitle(_self->ob_itself, - title); + ShowHide(_self->ob_itself, + showFlag); Py_INCREF(Py_None); _res = Py_None; return _res; } -static PyObject *WinObj_TrackGoAway(_self, _args) +static PyObject *WinObj_TrackBox(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; Boolean _rv; Point thePt; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetPoint, &thePt)) + short partCode; + if (!PyArg_ParseTuple(_args, "O&h", + PyMac_GetPoint, &thePt, + &partCode)) return NULL; - _rv = TrackGoAway(_self->ob_itself, - thePt); + _rv = TrackBox(_self->ob_itself, + thePt, + partCode); _res = Py_BuildValue("b", _rv); return _res; } -static PyObject *WinObj_DragWindow(_self, _args) +static PyObject *WinObj_TrackGoAway(_self, _args) WindowObject *_self; PyObject *_args; { PyObject *_res = NULL; - Point startPt; - Rect boundsRect; - if (!PyArg_ParseTuple(_args, "O&O&", - PyMac_GetPoint, &startPt, - PyMac_GetRect, &boundsRect)) + Boolean _rv; + Point thePt; + if (!PyArg_ParseTuple(_args, "O&", + PyMac_GetPoint, &thePt)) return NULL; - DragWindow(_self->ob_itself, - startPt, - &boundsRect); - Py_INCREF(Py_None); - _res = Py_None; + _rv = TrackGoAway(_self->ob_itself, + thePt); + _res = Py_BuildValue("b", + _rv); return _res; } @@ -873,34 +955,32 @@ static PyObject *WinObj_SetWindowUserState(_self, _args) } static PyMethodDef WinObj_methods[] = { - {"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1, - "() -> (Str255 title)"}, - {"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1, + {"SetWinColor", (PyCFunction)WinObj_SetWinColor, 1, + "(WCTabHandle newColorTable) -> None"}, + {"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1, "() -> None"}, - {"HideWindow", (PyCFunction)WinObj_HideWindow, 1, + {"SaveOld", (PyCFunction)WinObj_SaveOld, 1, "() -> None"}, - {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1, + {"DrawNew", (PyCFunction)WinObj_DrawNew, 1, + "(Boolean update) -> None"}, + {"PaintOne", (PyCFunction)WinObj_PaintOne, 1, + "(RgnHandle clobberedRgn) -> None"}, + {"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1, + "(RgnHandle clobberedRgn) -> None"}, + {"CalcVis", (PyCFunction)WinObj_CalcVis, 1, "() -> None"}, - {"ShowHide", (PyCFunction)WinObj_ShowHide, 1, - "(Boolean showFlag) -> None"}, - {"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1, - "(Boolean fHilite) -> None"}, + {"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1, + "(RgnHandle clobberedRgn) -> None"}, {"BringToFront", (PyCFunction)WinObj_BringToFront, 1, "() -> None"}, {"SendBehind", (PyCFunction)WinObj_SendBehind, 1, "(WindowPtr behindWindow) -> None"}, - {"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1, - "() -> None"}, - {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1, - "(short hGlobal, short vGlobal, Boolean front) -> None"}, - {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1, - "(short w, short h, Boolean fUpdate) -> None"}, - {"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1, - "(short partCode, Boolean front) -> None"}, - {"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1, - "() -> None"}, - {"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1, + {"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1, "() -> None"}, + {"GetWindowFeatures", (PyCFunction)WinObj_GetWindowFeatures, 1, + "() -> (OSStatus _rv, UInt32 outFeatures)"}, + {"GetWindowRegion", (PyCFunction)WinObj_GetWindowRegion, 1, + "(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> (OSStatus _rv)"}, {"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1, "(long data) -> None"}, {"GetWRefCon", (PyCFunction)WinObj_GetWRefCon, 1, @@ -909,34 +989,46 @@ static PyMethodDef WinObj_methods[] = { "(PicHandle pic) -> None"}, {"GetWindowPic", (PyCFunction)WinObj_GetWindowPic, 1, "() -> (PicHandle _rv)"}, - {"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1, + {"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1, + "() -> (short _rv)"}, + {"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1, "() -> None"}, - {"SaveOld", (PyCFunction)WinObj_SaveOld, 1, + {"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1, "() -> None"}, - {"DrawNew", (PyCFunction)WinObj_DrawNew, 1, - "(Boolean update) -> None"}, - {"PaintOne", (PyCFunction)WinObj_PaintOne, 1, - "(RgnHandle clobberedRgn) -> None"}, - {"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1, - "(RgnHandle clobberedRgn) -> None"}, - {"CalcVis", (PyCFunction)WinObj_CalcVis, 1, + {"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1, "() -> None"}, - {"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1, - "(RgnHandle clobberedRgn) -> None"}, + {"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1, + "(Boolean fHilite) -> None"}, + {"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1, + "(Str255 title) -> None"}, + {"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1, + "() -> (Str255 title)"}, + {"IsWindowCollapsable", (PyCFunction)WinObj_IsWindowCollapsable, 1, + "() -> (Boolean _rv)"}, + {"IsWindowCollapsed", (PyCFunction)WinObj_IsWindowCollapsed, 1, + "() -> (Boolean _rv)"}, + {"CollapseWindow", (PyCFunction)WinObj_CollapseWindow, 1, + "(Boolean inCollapseIt) -> (OSStatus _rv)"}, + {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1, + "(short hGlobal, short vGlobal, Boolean front) -> None"}, + {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1, + "(short w, short h, Boolean fUpdate) -> None"}, + {"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1, + "(short partCode, Boolean front) -> None"}, {"GrowWindow", (PyCFunction)WinObj_GrowWindow, 1, "(Point startPt, Rect bBox) -> (long _rv)"}, + {"DragWindow", (PyCFunction)WinObj_DragWindow, 1, + "(Point startPt, Rect boundsRect) -> None"}, + {"HideWindow", (PyCFunction)WinObj_HideWindow, 1, + "() -> None"}, + {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1, + "() -> None"}, + {"ShowHide", (PyCFunction)WinObj_ShowHide, 1, + "(Boolean showFlag) -> None"}, {"TrackBox", (PyCFunction)WinObj_TrackBox, 1, "(Point thePt, short partCode) -> (Boolean _rv)"}, - {"SetWinColor", (PyCFunction)WinObj_SetWinColor, 1, - "(WCTabHandle newColorTable) -> None"}, - {"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1, - "() -> (short _rv)"}, - {"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1, - "(Str255 title) -> None"}, {"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1, "(Point thePt) -> (Boolean _rv)"}, - {"DragWindow", (PyCFunction)WinObj_DragWindow, 1, - "(Point startPt, Rect boundsRect) -> None"}, {"GetAuxWin", (PyCFunction)WinObj_GetAuxWin, 1, "() -> (Boolean _rv, AuxWinHandle awHndl)"}, {"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1, @@ -1003,44 +1095,23 @@ PyTypeObject Window_Type = { /* --------------------- End object type Window --------------------- */ -static PyObject *Win_GetGrayRgn(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - RgnHandle _rv; - if (!PyArg_ParseTuple(_args, "")) - return NULL; - _rv = GetGrayRgn(); - _res = Py_BuildValue("O&", - ResObj_New, _rv); - return _res; -} - -static PyObject *Win_InitWindows(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) - return NULL; - InitWindows(); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Win_GetWMgrPort(_self, _args) +static PyObject *Win_GetNewCWindow(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; - GrafPtr wPort; - if (!PyArg_ParseTuple(_args, "")) + WindowPtr _rv; + short windowID; + WindowPtr behind; + if (!PyArg_ParseTuple(_args, "hO&", + &windowID, + WinObj_Convert, &behind)) return NULL; - GetWMgrPort(&wPort); + _rv = GetNewCWindow(windowID, + (void *)0, + behind); _res = Py_BuildValue("O&", - GrafObj_New, wPort); + WinObj_New, _rv); return _res; } @@ -1099,6 +1170,91 @@ static PyObject *Win_GetNewWindow(_self, _args) return _res; } +static PyObject *Win_NewCWindow(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + WindowPtr _rv; + Rect boundsRect; + Str255 title; + Boolean visible; + short procID; + WindowPtr behind; + Boolean goAwayFlag; + long refCon; + if (!PyArg_ParseTuple(_args, "O&O&bhO&bl", + PyMac_GetRect, &boundsRect, + PyMac_GetStr255, title, + &visible, + &procID, + WinObj_Convert, &behind, + &goAwayFlag, + &refCon)) + return NULL; + _rv = NewCWindow((void *)0, + &boundsRect, + title, + visible, + procID, + behind, + goAwayFlag, + refCon); + _res = Py_BuildValue("O&", + WinObj_New, _rv); + return _res; +} + +static PyObject *Win_SetDeskCPat(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + PixPatHandle deskPixPat; + if (!PyArg_ParseTuple(_args, "O&", + ResObj_Convert, &deskPixPat)) + return NULL; + SetDeskCPat(deskPixPat); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Win_CheckUpdate(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + Boolean _rv; + EventRecord theEvent; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + _rv = CheckUpdate(&theEvent); + _res = Py_BuildValue("bO&", + _rv, + PyMac_BuildEventRecord, &theEvent); + return _res; +} + +static PyObject *Win_FindWindow(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short _rv; + Point thePoint; + WindowPtr theWindow; + if (!PyArg_ParseTuple(_args, "O&", + PyMac_GetPoint, &thePoint)) + return NULL; + _rv = FindWindow(thePoint, + &theWindow); + _res = Py_BuildValue("hO&", + _rv, + WinObj_WhichWindow, theWindow); + return _res; +} + static PyObject *Win_FrontWindow(_self, _args) PyObject *_self; PyObject *_args; @@ -1113,6 +1269,47 @@ static PyObject *Win_FrontWindow(_self, _args) return _res; } +static PyObject *Win_InitWindows(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + InitWindows(); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Win_GetWMgrPort(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + GrafPtr wPort; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + GetWMgrPort(&wPort); + _res = Py_BuildValue("O&", + GrafObj_New, wPort); + return _res; +} + +static PyObject *Win_GetCWMgrPort(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + CGrafPtr wMgrCPort; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + GetCWMgrPort(&wMgrCPort); + _res = Py_BuildValue("O&", + GrafObj_New, wMgrCPort); + return _res; +} + static PyObject *Win_InvalRect(_self, _args) PyObject *_self; PyObject *_args; @@ -1173,38 +1370,19 @@ static PyObject *Win_ValidRgn(_self, _args) return _res; } -static PyObject *Win_CheckUpdate(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - Boolean _rv; - EventRecord theEvent; - if (!PyArg_ParseTuple(_args, "")) - return NULL; - _rv = CheckUpdate(&theEvent); - _res = Py_BuildValue("bO&", - _rv, - PyMac_BuildEventRecord, &theEvent); - return _res; -} - -static PyObject *Win_FindWindow(_self, _args) +static PyObject *Win_CollapseAllWindows(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; - short _rv; - Point thePoint; - WindowPtr theWindow; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetPoint, &thePoint)) + OSStatus _rv; + Boolean inCollapseEm; + if (!PyArg_ParseTuple(_args, "b", + &inCollapseEm)) return NULL; - _rv = FindWindow(thePoint, - &theWindow); - _res = Py_BuildValue("hO&", - _rv, - WinObj_WhichWindow, theWindow); + _rv = CollapseAllWindows(inCollapseEm); + _res = Py_BuildValue("l", + _rv); return _res; } @@ -1227,87 +1405,17 @@ static PyObject *Win_PinRect(_self, _args) return _res; } -static PyObject *Win_GetCWMgrPort(_self, _args) +static PyObject *Win_GetGrayRgn(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; - CGrafPtr wMgrCPort; + RgnHandle _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; - GetCWMgrPort(&wMgrCPort); - _res = Py_BuildValue("O&", - GrafObj_New, wMgrCPort); - return _res; -} - -static PyObject *Win_SetDeskCPat(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - PixPatHandle deskPixPat; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &deskPixPat)) - return NULL; - SetDeskCPat(deskPixPat); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Win_NewCWindow(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - WindowPtr _rv; - Rect boundsRect; - Str255 title; - Boolean visible; - short procID; - WindowPtr behind; - Boolean goAwayFlag; - long refCon; - if (!PyArg_ParseTuple(_args, "O&O&bhO&bl", - PyMac_GetRect, &boundsRect, - PyMac_GetStr255, title, - &visible, - &procID, - WinObj_Convert, &behind, - &goAwayFlag, - &refCon)) - return NULL; - _rv = NewCWindow((void *)0, - &boundsRect, - title, - visible, - procID, - behind, - goAwayFlag, - refCon); - _res = Py_BuildValue("O&", - WinObj_New, _rv); - return _res; -} - -static PyObject *Win_GetNewCWindow(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - WindowPtr _rv; - short windowID; - WindowPtr behind; - if (!PyArg_ParseTuple(_args, "hO&", - &windowID, - WinObj_Convert, &behind)) - return NULL; - _rv = GetNewCWindow(windowID, - (void *)0, - behind); + _rv = GetGrayRgn(); _res = Py_BuildValue("O&", - WinObj_New, _rv); + ResObj_New, _rv); return _res; } @@ -1326,18 +1434,28 @@ static PyObject *Win_WhichWindow(_self, _args) } static PyMethodDef Win_methods[] = { - {"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1, - "() -> (RgnHandle _rv)"}, - {"InitWindows", (PyCFunction)Win_InitWindows, 1, - "() -> None"}, - {"GetWMgrPort", (PyCFunction)Win_GetWMgrPort, 1, - "() -> (GrafPtr wPort)"}, + {"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1, + "(short windowID, WindowPtr behind) -> (WindowPtr _rv)"}, {"NewWindow", (PyCFunction)Win_NewWindow, 1, "(Rect boundsRect, Str255 title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)"}, {"GetNewWindow", (PyCFunction)Win_GetNewWindow, 1, "(short windowID, WindowPtr behind) -> (WindowPtr _rv)"}, + {"NewCWindow", (PyCFunction)Win_NewCWindow, 1, + "(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)"}, + {"SetDeskCPat", (PyCFunction)Win_SetDeskCPat, 1, + "(PixPatHandle deskPixPat) -> None"}, + {"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1, + "() -> (Boolean _rv, EventRecord theEvent)"}, + {"FindWindow", (PyCFunction)Win_FindWindow, 1, + "(Point thePoint) -> (short _rv, WindowPtr theWindow)"}, {"FrontWindow", (PyCFunction)Win_FrontWindow, 1, "() -> (WindowPtr _rv)"}, + {"InitWindows", (PyCFunction)Win_InitWindows, 1, + "() -> None"}, + {"GetWMgrPort", (PyCFunction)Win_GetWMgrPort, 1, + "() -> (GrafPtr wPort)"}, + {"GetCWMgrPort", (PyCFunction)Win_GetCWMgrPort, 1, + "() -> (CGrafPtr wMgrCPort)"}, {"InvalRect", (PyCFunction)Win_InvalRect, 1, "(Rect badRect) -> None"}, {"InvalRgn", (PyCFunction)Win_InvalRgn, 1, @@ -1346,20 +1464,12 @@ static PyMethodDef Win_methods[] = { "(Rect goodRect) -> None"}, {"ValidRgn", (PyCFunction)Win_ValidRgn, 1, "(RgnHandle goodRgn) -> None"}, - {"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1, - "() -> (Boolean _rv, EventRecord theEvent)"}, - {"FindWindow", (PyCFunction)Win_FindWindow, 1, - "(Point thePoint) -> (short _rv, WindowPtr theWindow)"}, + {"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1, + "(Boolean inCollapseEm) -> (OSStatus _rv)"}, {"PinRect", (PyCFunction)Win_PinRect, 1, "(Rect theRect, Point thePt) -> (long _rv)"}, - {"GetCWMgrPort", (PyCFunction)Win_GetCWMgrPort, 1, - "() -> (CGrafPtr wMgrCPort)"}, - {"SetDeskCPat", (PyCFunction)Win_SetDeskCPat, 1, - "(PixPatHandle deskPixPat) -> None"}, - {"NewCWindow", (PyCFunction)Win_NewCWindow, 1, - "(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)"}, - {"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1, - "(short windowID, WindowPtr behind) -> (WindowPtr _rv)"}, + {"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1, + "() -> (RgnHandle _rv)"}, {"WhichWindow", (PyCFunction)Win_WhichWindow, 1, "Resolve an integer WindowPtr address to a Window object"}, {NULL, NULL, 0} |