diff options
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/ctl/Ctlmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/ctl/ctlgen.py | 2 | ||||
-rw-r--r-- | Mac/Modules/dlg/Dlgmodule.c | 3 | ||||
-rw-r--r-- | Mac/Modules/dlg/dlggen.py | 4 | ||||
-rw-r--r-- | Mac/Modules/evt/Evtmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/evt/evtgen.py | 2 | ||||
-rw-r--r-- | Mac/Modules/list/Listmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/menu/Menumodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/menu/menugen.py | 2 | ||||
-rw-r--r-- | Mac/Modules/qd/Qdmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/qd/qdgen.py | 4 | ||||
-rw-r--r-- | Mac/Modules/res/Resmodule.c | 14 | ||||
-rw-r--r-- | Mac/Modules/res/resgen.py | 2 | ||||
-rw-r--r-- | Mac/Modules/snd/Sndmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/snd/sndgen.py | 2 | ||||
-rw-r--r-- | Mac/Modules/win/Winmodule.c | 17 | ||||
-rw-r--r-- | Mac/Modules/win/wingen.py | 2 |
17 files changed, 49 insertions, 11 deletions
diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index 7267cd7..c89d461 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/ctl/ctlgen.py b/Mac/Modules/ctl/ctlgen.py index 683e26b..9873ca4 100644 --- a/Mac/Modules/ctl/ctlgen.py +++ b/Mac/Modules/ctl/ctlgen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Controls.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Controls.h' f = Function(ControlRef, 'NewControl', (WindowRef, 'theWindow', InMode), diff --git a/Mac/Modules/dlg/Dlgmodule.c b/Mac/Modules/dlg/Dlgmodule.c index f1010a2..49f6553 100644 --- a/Mac/Modules/dlg/Dlgmodule.c +++ b/Mac/Modules/dlg/Dlgmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); @@ -191,7 +192,7 @@ static PyObject *DlgObj_GetDialogItem(_self, _args) &box); _res = Py_BuildValue("hO&O&", itemType, - ResObj_New, item, + ResObj_OptNew, item, PyMac_BuildRect, &box); return _res; } diff --git a/Mac/Modules/dlg/dlggen.py b/Mac/Modules/dlg/dlggen.py index 80650fd..4319520 100644 --- a/Mac/Modules/dlg/dlggen.py +++ b/Mac/Modules/dlg/dlggen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Dialogs.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Dialogs.h' f = Function(DialogRef, 'NewDialog', (NullStorage, 'wStorage', InMode), @@ -85,7 +85,7 @@ f = Method(void, 'GetDialogItem', (DialogRef, 'theDialog', InMode), (short, 'itemNo', InMode), (short, 'itemType', OutMode), - (Handle, 'item', OutMode), + (OptHandle, 'item', OutMode), (Rect, 'box', OutMode), ) methods.append(f) diff --git a/Mac/Modules/evt/Evtmodule.c b/Mac/Modules/evt/Evtmodule.c index 7732d09..139e5d8 100644 --- a/Mac/Modules/evt/Evtmodule.c +++ b/Mac/Modules/evt/Evtmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/evt/evtgen.py b/Mac/Modules/evt/evtgen.py index 1ca2962..47ac307 100644 --- a/Mac/Modules/evt/evtgen.py +++ b/Mac/Modules/evt/evtgen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Events.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Events.h' f = Function(UInt32, 'GetCaretTime', ) diff --git a/Mac/Modules/list/Listmodule.c b/Mac/Modules/list/Listmodule.c index 928a9a5..747b477 100644 --- a/Mac/Modules/list/Listmodule.c +++ b/Mac/Modules/list/Listmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/menu/Menumodule.c b/Mac/Modules/menu/Menumodule.c index c016460..6c855cd 100644 --- a/Mac/Modules/menu/Menumodule.c +++ b/Mac/Modules/menu/Menumodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/menu/menugen.py b/Mac/Modules/menu/menugen.py index 2445d1e..30e43e2 100644 --- a/Mac/Modules/menu/menugen.py +++ b/Mac/Modules/menu/menugen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Menus.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Menus.h' f = Function(short, 'GetMBarHeight', ) diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c index c1e5c8e..442a628 100644 --- a/Mac/Modules/qd/Qdmodule.c +++ b/Mac/Modules/qd/Qdmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/qd/qdgen.py b/Mac/Modules/qd/qdgen.py index cc12de4..d7976f1 100644 --- a/Mac/Modules/qd/qdgen.py +++ b/Mac/Modules/qd/qdgen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDraw.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDraw.h' f = Function(void, 'OpenPort', (GrafPtr, 'port', InMode), @@ -713,7 +713,7 @@ f = Function(short, 'QDError', ) functions.append(f) -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDrawText.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDrawText.h' f = Function(void, 'TextFont', (short, 'font', InMode), diff --git a/Mac/Modules/res/Resmodule.c b/Mac/Modules/res/Resmodule.c index d3ec0ea..4e8ed8f 100644 --- a/Mac/Modules/res/Resmodule.c +++ b/Mac/Modules/res/Resmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); @@ -1331,6 +1332,19 @@ static PyMethodDef Res_methods[] = { +/* Alternative version of ResObj_New, which returns None for null argument */ +PyObject *ResObj_OptNew(itself) + Handle itself; +{ + ResourceObject *it; + if (itself == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + return ResObj_New(itself); +} + + void initRes() { diff --git a/Mac/Modules/res/resgen.py b/Mac/Modules/res/resgen.py index 28b9015..6300d5c 100644 --- a/Mac/Modules/res/resgen.py +++ b/Mac/Modules/res/resgen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Resources.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Resources.h' f = ResFunction(short, 'InitResources', ) diff --git a/Mac/Modules/snd/Sndmodule.c b/Mac/Modules/snd/Sndmodule.c index fbc8ff2..447f75d 100644 --- a/Mac/Modules/snd/Sndmodule.c +++ b/Mac/Modules/snd/Sndmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); diff --git a/Mac/Modules/snd/sndgen.py b/Mac/Modules/snd/sndgen.py index 827b263..c3a71c1 100644 --- a/Mac/Modules/snd/sndgen.py +++ b/Mac/Modules/snd/sndgen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Sound.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Sound.h' f = SndFunction(void, 'SetSoundVol', (short, 'level', InMode), diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c index 7d6de73..8691501 100644 --- a/Mac/Modules/win/Winmodule.c +++ b/Mac/Modules/win/Winmodule.c @@ -14,6 +14,7 @@ #include <Controls.h> extern PyObject *ResObj_New(Handle); +extern PyObject *ResObj_OptNew(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *WinObj_New(WindowPtr); @@ -804,6 +805,20 @@ static PyObject *Win_GetNewCWindow(_self, _args) return _res; } +static PyObject *Win_WhichWindow(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + + long ptr; + + if ( !PyArg_ParseTuple(_args, "i", &ptr) ) + return NULL; + return WinObj_WhichWindow((WindowPtr)ptr); + +} + static PyMethodDef Win_methods[] = { {"InitWindows", (PyCFunction)Win_InitWindows, 1, "() -> None"}, @@ -827,6 +842,8 @@ static PyMethodDef Win_methods[] = { "(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)"}, + {"WhichWindow", (PyCFunction)Win_WhichWindow, 1, + "Resolve an integer WindowPtr address to a Window object"}, {NULL, NULL, 0} }; diff --git a/Mac/Modules/win/wingen.py b/Mac/Modules/win/wingen.py index 25931e8..4735952 100644 --- a/Mac/Modules/win/wingen.py +++ b/Mac/Modules/win/wingen.py @@ -1,4 +1,4 @@ -# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Windows.h' +# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Windows.h' f = Function(void, 'InitWindows', ) |