From: Jack Jansen Date: Fri, 14 Jul 2000 22:16:45 +0000 (+0000) Subject: pymactoolbox.h contains protoypes for all externally visible toolbox module X-Git-Tag: v2.0b1~825 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d8b96c8507644811ba92ead8f131060aafac19f;p=thirdparty%2FPython%2Fcpython.git pymactoolbox.h contains protoypes for all externally visible toolbox module functions. Include it in stead of duplicating the declarations everywhere. Also cleaned up toolbox module exports, and got rid of resNotFound error. --- diff --git a/Mac/Include/pymactoolbox.h b/Mac/Include/pymactoolbox.h new file mode 100644 index 000000000000..79b8f0e37c86 --- /dev/null +++ b/Mac/Include/pymactoolbox.h @@ -0,0 +1,92 @@ +/* +** pymactoolbox.h - global routines exported by the toolbox modules +*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +/* AE exports */ +extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ +extern int AEDesc_Convert(PyObject *, AppleEvent *); + +/* Cm exports */ +extern PyObject *CmpObj_New(Component); +extern int CmpObj_Convert(PyObject *, Component *); +extern PyObject *CmpInstObj_New(ComponentInstance); +extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); + +/* Ctl exports */ +extern PyObject *CtlObj_New(ControlHandle); +extern int CtlObj_Convert(PyObject *, ControlHandle *); + +/* Dlg exports */ +extern PyObject *DlgObj_New(DialogPtr); +extern int DlgObj_Convert(PyObject *, DialogPtr *); +extern PyTypeObject Dialog_Type; +#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) + +/* Drag exports */ +extern PyObject *DragObj_New(DragReference); +extern int DragObj_Convert(PyObject *, DragReference *); + +/* List exports */ +extern PyObject *ListObj_New(ListHandle); +extern int ListObj_Convert(PyObject *, ListHandle *); + +/* Menu exports */ +extern PyObject *MenuObj_New(MenuHandle); +extern int MenuObj_Convert(PyObject *, MenuHandle *); + +/* Qd exports */ +extern PyObject *GrafObj_New(GrafPtr); +extern int GrafObj_Convert(PyObject *, GrafPtr *); +extern PyObject *BMObj_New(BitMapPtr); +extern int BMObj_Convert(PyObject *, BitMapPtr *); +extern PyObject *QdRGB_New(RGBColor *); +extern int QdRGB_Convert(PyObject *, RGBColor *); + +/* Qt exports */ +extern PyObject *TrackObj_New(Track); +extern int TrackObj_Convert(PyObject *, Track *); +extern PyObject *MovieObj_New(Movie); +extern int MovieObj_Convert(PyObject *, Movie *); +extern PyObject *MovieCtlObj_New(MovieController); +extern int MovieCtlObj_Convert(PyObject *, TimeBase *); +extern PyObject *TimeBaseObj_New(TimeBase); +extern int TimeBaseObj_Convert(PyObject *, TimeBase *); +extern PyObject *UserDataObj_New(UserData); +extern int UserDataObj_Convert(PyObject *, UserData *); +extern PyObject *MediaObj_New(Media); +extern int MediaObj_Convert(PyObject *, Media *); + +/* Res exports */ +extern PyObject *ResObj_New(Handle); +extern int ResObj_Convert(PyObject *, Handle *); +extern PyObject *OptResObj_New(Handle); +extern int OptResObj_Convert(PyObject *, Handle *); + +/* TE exports */ +extern PyObject *TEObj_New(TEHandle); +extern int TEObj_Convert(PyObject *, TEHandle *); + +/* Win exports */ +extern PyObject *WinObj_New(WindowPtr); +extern int WinObj_Convert(PyObject *, WindowPtr *); +extern PyObject *WinObj_WhichWindow(WindowPtr); +extern PyTypeObject Window_Type; +#define WinObj_Check(x) ((x)->ob_type == &Window_Type) + + +#ifdef __cplusplus + } +#endif diff --git a/Mac/Modules/ColorPickermodule.c b/Mac/Modules/ColorPickermodule.c index d9370b593acb..3878093377b9 100644 --- a/Mac/Modules/ColorPickermodule.c +++ b/Mac/Modules/ColorPickermodule.c @@ -24,12 +24,10 @@ PERFORMANCE OF THIS SOFTWARE. #include #include "Python.h" #include "macglue.h" +#include "pymactoolbox.h" /* ----------------------------------------------------- */ -extern QdRGB_Convert(PyObject *v, RGBColorPtr p_itself); -extern PyObject *QdRGB_New(RGBColorPtr itself); - static char cp_GetColor__doc__[] = "GetColor(prompt, (r, g, b)) -> (r, g, b), ok" ; diff --git a/Mac/Modules/Nav.c b/Mac/Modules/Nav.c index 85fae415c5e4..c86a5ef0045b 100644 --- a/Mac/Modules/Nav.c +++ b/Mac/Modules/Nav.c @@ -31,16 +31,9 @@ PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #include "macglue.h" +#include "pymactoolbox.h" #include -/* Exported by AEModule.c: */ -extern PyObject *AEDesc_New(AppleEvent *); -extern int AEDesc_Convert(PyObject *, AppleEvent *); -/* Exported by Resmodule.c */ -extern PyObject *ResObj_New(Handle); -extern PyObject *OptResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); - static PyObject *ErrorObject; static NavEventUPP my_eventProcUPP; diff --git a/Mac/Modules/Printingmodule.c b/Mac/Modules/Printingmodule.c index 94d05a6b2fe8..5f1ac5783bc1 100644 --- a/Mac/Modules/Printingmodule.c +++ b/Mac/Modules/Printingmodule.c @@ -23,15 +23,9 @@ PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #include "macglue.h" +#include "pymactoolbox.h" #include -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *DlgObj_New(DialogPtr); -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); -extern PyObject *ResObj_New(Handle); - - static PyObject *ErrorObject; /* ----------------------------------------------------- */ diff --git a/Mac/Modules/ae/AEmodule.c b/Mac/Modules/ae/AEmodule.c index d5401975eee5..aee36fa6113c 100644 --- a/Mac/Modules/ae/AEmodule.c +++ b/Mac/Modules/ae/AEmodule.c @@ -5,42 +5,8 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include @@ -1164,7 +1130,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long PyObject *handler = (PyObject *)refcon; AEDescObject *requestObject, *replyObject; PyObject *args, *res; - if ((requestObject = (AEDescObject *)AEDesc_New(request)) == NULL) { + if ((requestObject = (AEDescObject *)AEDesc_New((AppleEvent *)request)) == NULL) { return -1; } if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) { diff --git a/Mac/Modules/ae/aesupport.py b/Mac/Modules/ae/aesupport.py index 953b490c86d8..5ca2c48a0446 100644 --- a/Mac/Modules/ae/aesupport.py +++ b/Mac/Modules/ae/aesupport.py @@ -131,7 +131,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long PyObject *handler = (PyObject *)refcon; AEDescObject *requestObject, *replyObject; PyObject *args, *res; - if ((requestObject = (AEDescObject *)AEDesc_New(request)) == NULL) { + if ((requestObject = (AEDescObject *)AEDesc_New((AppleEvent *)request)) == NULL) { return -1; } if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) { diff --git a/Mac/Modules/app/Appmodule.c b/Mac/Modules/app/Appmodule.c index 06f573da13b5..fd1213548699 100644 --- a/Mac/Modules/app/Appmodule.c +++ b/Mac/Modules/app/Appmodule.c @@ -5,51 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - static PyObject *App_Error; static PyObject *App_RegisterAppearanceClient(_self, _args) diff --git a/Mac/Modules/app/appsupport.py b/Mac/Modules/app/appsupport.py index 3bf5912493e4..11b6d2fe0730 100644 --- a/Mac/Modules/app/appsupport.py +++ b/Mac/Modules/app/appsupport.py @@ -69,12 +69,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ - -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ """ ## class MyObjectDefinition(GlobalObjectDefinition): diff --git a/Mac/Modules/cm/Cmmodule.c b/Mac/Modules/cm/Cmmodule.c index de00241906a5..b8a62161b1cf 100644 --- a/Mac/Modules/cm/Cmmodule.c +++ b/Mac/Modules/cm/Cmmodule.c @@ -5,49 +5,16 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include /* ** Parse/generate ComponentDescriptor records */ -PyObject *CmpDesc_New(itself) +static PyObject * +CmpDesc_New(itself) ComponentDescription *itself; { @@ -58,6 +25,7 @@ PyObject *CmpDesc_New(itself) itself->componentFlags, itself->componentFlagsMask); } +static int CmpDesc_Convert(v, p_itself) PyObject *v; ComponentDescription *p_itself; diff --git a/Mac/Modules/cm/cmsupport.py b/Mac/Modules/cm/cmsupport.py index 0a1915f3cf99..598b51de2fac 100644 --- a/Mac/Modules/cm/cmsupport.py +++ b/Mac/Modules/cm/cmsupport.py @@ -26,7 +26,8 @@ includestuff = includestuff + """ /* ** Parse/generate ComponentDescriptor records */ -PyObject *CmpDesc_New(itself) +static PyObject * +CmpDesc_New(itself) ComponentDescription *itself; { @@ -37,6 +38,7 @@ PyObject *CmpDesc_New(itself) itself->componentFlags, itself->componentFlagsMask); } +static int CmpDesc_Convert(v, p_itself) PyObject *v; ComponentDescription *p_itself; diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index 863276773b26..6944fb31b422 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -5,45 +5,13 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include +staticforward PyObject *CtlObj_WhichControl(ControlHandle); + #define as_Control(h) ((ControlHandle)h) #define as_Resource(ctl) ((Handle)ctl) #ifdef TARGET_API_MAC_CARBON @@ -51,17 +19,13 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); #else #define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect)) #endif -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - -extern PyObject *CtlObj_WhichControl(ControlHandle); /* Forward */ -extern PyObject *QdRGB_New(RGBColorPtr); -extern QdRGB_Convert(PyObject *, RGBColorPtr); /* ** Parse/generate ControlFontStyleRec records */ #if 0 /* Not needed */ -PyObject *ControlFontStyle_New(itself) +static PyObject * +ControlFontStyle_New(itself) ControlFontStyleRec *itself; { @@ -71,6 +35,7 @@ PyObject *ControlFontStyle_New(itself) } #endif +static int ControlFontStyle_Convert(v, itself) PyObject *v; ControlFontStyleRec *itself; @@ -854,6 +819,8 @@ static PyObject *CtlObj_SetControlColor(_self, _args) } #endif +#ifndef TARGET_API_MAC_CARBON + static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args) ControlObject *_self; PyObject *_args; @@ -870,6 +837,9 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args) outValue); return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args) ControlObject *_self; @@ -888,6 +858,9 @@ static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args) _res = Py_None; return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args) ControlObject *_self; @@ -905,6 +878,9 @@ static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args) MenuObj_New, outHandle); return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_SetBevelButtonTransform(_self, _args) ControlObject *_self; @@ -923,6 +899,9 @@ static PyObject *CtlObj_SetBevelButtonTransform(_self, _args) _res = Py_None; return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_SetImageWellTransform(_self, _args) ControlObject *_self; @@ -941,6 +920,9 @@ static PyObject *CtlObj_SetImageWellTransform(_self, _args) _res = Py_None; return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_GetTabContentRect(_self, _args) ControlObject *_self; @@ -958,6 +940,9 @@ static PyObject *CtlObj_GetTabContentRect(_self, _args) PyMac_BuildRect, &outContentRect); return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_SetTabEnabled(_self, _args) ControlObject *_self; @@ -979,6 +964,9 @@ static PyObject *CtlObj_SetTabEnabled(_self, _args) _res = Py_None; return _res; } +#endif + +#ifndef TARGET_API_MAC_CARBON static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args) ControlObject *_self; @@ -997,6 +985,7 @@ static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args) _res = Py_None; return _res; } +#endif static PyObject *CtlObj_SendControlMessage(_self, _args) ControlObject *_self; @@ -1611,22 +1600,46 @@ static PyMethodDef CtlObj_methods[] = { {"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1, "(CCTabHandle newColorTable) -> None"}, #endif + +#ifndef TARGET_API_MAC_CARBON {"GetBevelButtonMenuValue", (PyCFunction)CtlObj_GetBevelButtonMenuValue, 1, "() -> (SInt16 outValue)"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"SetBevelButtonMenuValue", (PyCFunction)CtlObj_SetBevelButtonMenuValue, 1, "(SInt16 inValue) -> None"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"GetBevelButtonMenuHandle", (PyCFunction)CtlObj_GetBevelButtonMenuHandle, 1, "() -> (MenuHandle outHandle)"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"SetBevelButtonTransform", (PyCFunction)CtlObj_SetBevelButtonTransform, 1, "(IconTransformType transform) -> None"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"SetImageWellTransform", (PyCFunction)CtlObj_SetImageWellTransform, 1, "(IconTransformType inTransform) -> None"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"GetTabContentRect", (PyCFunction)CtlObj_GetTabContentRect, 1, "() -> (Rect outContentRect)"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"SetTabEnabled", (PyCFunction)CtlObj_SetTabEnabled, 1, "(SInt16 inTabToHilite, Boolean inEnabled) -> None"}, +#endif + +#ifndef TARGET_API_MAC_CARBON {"SetDisclosureTriangleLastValue", (PyCFunction)CtlObj_SetDisclosureTriangleLastValue, 1, "(SInt16 inValue) -> None"}, +#endif {"SendControlMessage", (PyCFunction)CtlObj_SendControlMessage, 1, "(SInt16 inMessage, SInt32 inParam) -> (SInt32 _rv)"}, {"EmbedControl", (PyCFunction)CtlObj_EmbedControl, 1, @@ -2098,7 +2111,8 @@ static PyMethodDef Ctl_methods[] = { -PyObject *CtlObj_NewUnmanaged(itself) +static PyObject * +CtlObj_NewUnmanaged(itself) ControlHandle itself; { ControlObject *it; @@ -2110,7 +2124,7 @@ PyObject *CtlObj_NewUnmanaged(itself) return (PyObject *)it; } -PyObject * +static PyObject * CtlObj_WhichControl(ControlHandle c) { PyObject *it; diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index 0f46c0e43c3f..dc7d7608ed91 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -84,6 +84,15 @@ class MyScanner(Scanner): ('#ifndef TARGET_API_MAC_CARBON', [ 'GetAuxiliaryControlRecord', 'SetControlColor', + # These have suddenly disappeared in UH 3.3.2... + 'GetBevelButtonMenuValue', + 'SetBevelButtonMenuValue', + 'GetBevelButtonMenuHandle', + 'SetBevelButtonTransform', + 'SetImageWellTransform', + 'GetTabContentRect', + 'SetTabEnabled', + 'SetDisclosureTriangleLastValue', ])] def makeblacklisttypes(self): diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py index 30c44912d1a3..25cd520674bb 100644 --- a/Mac/Modules/ctl/ctlsupport.py +++ b/Mac/Modules/ctl/ctlsupport.py @@ -44,6 +44,8 @@ ControlFontStyleRec_ptr = ControlFontStyleRec includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ +staticforward PyObject *CtlObj_WhichControl(ControlHandle); + #define as_Control(h) ((ControlHandle)h) #define as_Resource(ctl) ((Handle)ctl) #ifdef TARGET_API_MAC_CARBON @@ -51,17 +53,13 @@ includestuff = includestuff + """ #else #define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect)) #endif -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - -extern PyObject *CtlObj_WhichControl(ControlHandle); /* Forward */ -extern PyObject *QdRGB_New(RGBColorPtr); -extern QdRGB_Convert(PyObject *, RGBColorPtr); /* ** Parse/generate ControlFontStyleRec records */ #if 0 /* Not needed */ -PyObject *ControlFontStyle_New(itself) +static PyObject * +ControlFontStyle_New(itself) ControlFontStyleRec *itself; { @@ -71,6 +69,7 @@ PyObject *ControlFontStyle_New(itself) } #endif +static int ControlFontStyle_Convert(v, itself) PyObject *v; ControlFontStyleRec *itself; @@ -99,7 +98,8 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr * """ finalstuff = finalstuff + """ -PyObject *CtlObj_NewUnmanaged(itself) +static PyObject * +CtlObj_NewUnmanaged(itself) ControlHandle itself; { ControlObject *it; @@ -111,7 +111,7 @@ PyObject *CtlObj_NewUnmanaged(itself) return (PyObject *)it; } -PyObject * +static PyObject * CtlObj_WhichControl(ControlHandle c) { PyObject *it; diff --git a/Mac/Modules/dlg/Dlgmodule.c b/Mac/Modules/dlg/Dlgmodule.c index 1b46cfccd0d6..eb9efab62dd6 100644 --- a/Mac/Modules/dlg/Dlgmodule.c +++ b/Mac/Modules/dlg/Dlgmodule.c @@ -5,42 +5,8 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include @@ -48,13 +14,9 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); #define NewModalFilterProc(x) (x) #endif -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* XXX Shouldn't this be a stack? */ static PyObject *Dlg_FilterProc_callback = NULL; -static PyObject *DlgObj_New(DialogPtr); /* Forward */ - static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog, EventRecord *event, short *itemHit) diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py index e00b66220938..11873cf30707 100644 --- a/Mac/Modules/dlg/dlgsupport.py +++ b/Mac/Modules/dlg/dlgsupport.py @@ -35,13 +35,9 @@ includestuff = includestuff + """ #define NewModalFilterProc(x) (x) #endif -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* XXX Shouldn't this be a stack? */ static PyObject *Dlg_FilterProc_callback = NULL; -static PyObject *DlgObj_New(DialogPtr); /* Forward */ - static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog, EventRecord *event, short *itemHit) diff --git a/Mac/Modules/drag/Dragmodule.c b/Mac/Modules/drag/Dragmodule.c index 9fcc125ffeeb..716d2d5ff7c3 100644 --- a/Mac/Modules/drag/Dragmodule.c +++ b/Mac/Modules/drag/Dragmodule.c @@ -5,55 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - - -/* Exported by AEModule.c: */ -extern PyObject *AEDesc_New(AppleEvent *); -extern int AEDesc_Convert(PyObject *, AppleEvent *); - /* Callback glue routines */ DragTrackingHandlerUPP dragglue_TrackingHandlerUPP; DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP; diff --git a/Mac/Modules/drag/dragsupport.py b/Mac/Modules/drag/dragsupport.py index 64274a6fdf77..af8a25534eb2 100644 --- a/Mac/Modules/drag/dragsupport.py +++ b/Mac/Modules/drag/dragsupport.py @@ -56,16 +56,6 @@ DragTrackingMessage = Type("DragTrackingMessage", "h") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - - -/* Exported by AEModule.c: */ -extern PyObject *AEDesc_New(AppleEvent *); -extern int AEDesc_Convert(PyObject *, AppleEvent *); - /* Callback glue routines */ DragTrackingHandlerUPP dragglue_TrackingHandlerUPP; DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP; diff --git a/Mac/Modules/evt/Evtmodule.c b/Mac/Modules/evt/Evtmodule.c index 7d5d2f207eb3..b825cbf6f993 100644 --- a/Mac/Modules/evt/Evtmodule.c +++ b/Mac/Modules/evt/Evtmodule.c @@ -5,47 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - static PyObject *Evt_Error; static PyObject *Evt_GetMouse(_self, _args) diff --git a/Mac/Modules/evt/evtsupport.py b/Mac/Modules/evt/evtsupport.py index 6021a29b09e4..d4fb5953b139 100644 --- a/Mac/Modules/evt/evtsupport.py +++ b/Mac/Modules/evt/evtsupport.py @@ -36,8 +36,6 @@ EventKind = Type("EventKind", "H") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ """ class MyObjectDefinition(GlobalObjectDefinition): diff --git a/Mac/Modules/fm/Fmmodule.c b/Mac/Modules/fm/Fmmodule.c index 37d47e8a3dcb..3b30218533bc 100644 --- a/Mac/Modules/fm/Fmmodule.c +++ b/Mac/Modules/fm/Fmmodule.c @@ -5,49 +5,16 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include /* ** Parse/generate ComponentDescriptor records */ -PyObject *FMRec_New(itself) +static PyObject * +FMRec_New(itself) FMetricRec *itself; { @@ -61,6 +28,7 @@ PyObject *FMRec_New(itself) #if 0 /* Not needed... */ +static int FMRec_Convert(v, p_itself) PyObject *v; FMetricRec *p_itself; diff --git a/Mac/Modules/fm/fmsupport.py b/Mac/Modules/fm/fmsupport.py index f0b1e292626d..1afc8b85222c 100644 --- a/Mac/Modules/fm/fmsupport.py +++ b/Mac/Modules/fm/fmsupport.py @@ -24,7 +24,8 @@ includestuff = includestuff + """ /* ** Parse/generate ComponentDescriptor records */ -PyObject *FMRec_New(itself) +static PyObject * +FMRec_New(itself) FMetricRec *itself; { @@ -38,6 +39,7 @@ PyObject *FMRec_New(itself) #if 0 /* Not needed... */ +static int FMRec_Convert(v, p_itself) PyObject *v; FMetricRec *p_itself; diff --git a/Mac/Modules/help/Helpmodule.c b/Mac/Modules/help/Helpmodule.c index 6faf26f3bf5c..fac21b6db2b7 100644 --- a/Mac/Modules/help/Helpmodule.c +++ b/Mac/Modules/help/Helpmodule.c @@ -5,47 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - static PyObject *Help_Error; static PyObject *Help_HMGetHelpMenuHandle(_self, _args) diff --git a/Mac/Modules/help/helpsupport.py b/Mac/Modules/help/helpsupport.py index ce0975457b5a..3eeb06ae5b1d 100644 --- a/Mac/Modules/help/helpsupport.py +++ b/Mac/Modules/help/helpsupport.py @@ -38,8 +38,6 @@ EventKind = Type("EventKind", "H") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ """ class MyObjectDefinition(GlobalObjectDefinition): diff --git a/Mac/Modules/icn/Icnmodule.c b/Mac/Modules/icn/Icnmodule.c index 37aa6ffa3a4a..6ed20dd0911d 100644 --- a/Mac/Modules/icn/Icnmodule.c +++ b/Mac/Modules/icn/Icnmodule.c @@ -5,51 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - static PyObject *Icn_Error; static PyObject *Icn_GetCIcon(_self, _args) diff --git a/Mac/Modules/icn/icnsupport.py b/Mac/Modules/icn/icnsupport.py index 4345d9d5174b..5ea6a455630a 100644 --- a/Mac/Modules/icn/icnsupport.py +++ b/Mac/Modules/icn/icnsupport.py @@ -47,12 +47,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ - -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ """ class MyObjectDefinition(GlobalObjectDefinition): diff --git a/Mac/Modules/list/Listmodule.c b/Mac/Modules/list/Listmodule.c index 0993ad9c66c0..f5360f23c101 100644 --- a/Mac/Modules/list/Listmodule.c +++ b/Mac/Modules/list/Listmodule.c @@ -5,42 +5,8 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c index 048b243023ec..fa832f32e4bf 100644 --- a/Mac/Modules/macfsmodule.c +++ b/Mac/Modules/macfsmodule.c @@ -854,6 +854,7 @@ mfs_RawAlias(self, args) return (PyObject *)newmfsaobject((AliasHandle)h); } +#ifndef TARGET_API_MAC_CARBON static PyObject * mfs_GetDirectory(self, args) PyObject *self; /* Not used */ @@ -869,6 +870,7 @@ mfs_GetDirectory(self, args) ok = PyMac_GetDirectory(&fsdir, prompt); return Py_BuildValue("(Oi)", newmfssobject(&fsdir), ok); } +#endif static PyObject * mfs_FindFolder(self, args) diff --git a/Mac/Modules/menu/Menumodule.c b/Mac/Modules/menu/Menumodule.c index 11bc6c7288d3..23803e8ff43e 100644 --- a/Mac/Modules/menu/Menumodule.c +++ b/Mac/Modules/menu/Menumodule.c @@ -5,48 +5,12 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include /* Defines OpenDeskAcc in universal headers */ #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - #define as_Menu(h) ((MenuHandle)h) #define as_Resource(h) ((Handle)h) diff --git a/Mac/Modules/menu/menusupport.py b/Mac/Modules/menu/menusupport.py index b706a36e94d9..1325e10779d1 100644 --- a/Mac/Modules/menu/menusupport.py +++ b/Mac/Modules/menu/menusupport.py @@ -32,8 +32,6 @@ includestuff = includestuff + """ #include /* Defines OpenDeskAcc in universal headers */ #include <%s>""" % MACHEADERFILE + """ -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - #define as_Menu(h) ((MenuHandle)h) #define as_Resource(h) ((Handle)h) """ diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c index d4f91d44f3fc..9d844b8c15e7 100644 --- a/Mac/Modules/qd/Qdmodule.c +++ b/Mac/Modules/qd/Qdmodule.c @@ -5,47 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* ** Parse/generate RGB records */ diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py index 3be0b0c711d5..1c0f6c3405ed 100644 --- a/Mac/Modules/qd/qdsupport.py +++ b/Mac/Modules/qd/qdsupport.py @@ -58,8 +58,6 @@ PenState_ptr = StructInputBufferType('PenState') includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* ** Parse/generate RGB records */ diff --git a/Mac/Modules/qdoffs/Qdoffsmodule.c b/Mac/Modules/qdoffs/Qdoffsmodule.c index 37c774ee0ae6..c0e05cdf01a8 100644 --- a/Mac/Modules/qdoffs/Qdoffsmodule.c +++ b/Mac/Modules/qdoffs/Qdoffsmodule.c @@ -5,49 +5,13 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include #define as_GrafPtr(gworld) ((GrafPtr)(gworld)) -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - static PyObject *Qdoffs_Error; diff --git a/Mac/Modules/qdoffs/qdoffssupport.py b/Mac/Modules/qdoffs/qdoffssupport.py index e569feaea45f..7f4a043cc034 100644 --- a/Mac/Modules/qdoffs/qdoffssupport.py +++ b/Mac/Modules/qdoffs/qdoffssupport.py @@ -38,8 +38,6 @@ includestuff = includestuff + """ #define as_GrafPtr(gworld) ((GrafPtr)(gworld)) -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - """ diff --git a/Mac/Modules/qt/Qtmodule.c b/Mac/Modules/qt/Qtmodule.c index f382f9fe624d..489971598836 100644 --- a/Mac/Modules/qt/Qtmodule.c +++ b/Mac/Modules/qt/Qtmodule.c @@ -5,64 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -/* Exported by Cmmodule.c: */ -extern PyObject *CmpObj_New(Component); -extern int CmpObj_Convert(PyObject *, Component *); -extern PyObject *CmpInstObj_New(ComponentInstance); -extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); - -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -/* Our own, used before defined: */ -staticforward PyObject *TrackObj_New(Track); -staticforward int TrackObj_Convert(PyObject *, Track *); -staticforward PyObject *MovieObj_New(Movie); -staticforward int MovieObj_Convert(PyObject *, Movie *); -staticforward PyObject *MovieCtlObj_New(MovieController); -staticforward int MovieCtlObj_Convert(PyObject *, TimeBase *); -staticforward PyObject *TimeBaseObj_New(TimeBase); -staticforward int TimeBaseObj_Convert(PyObject *, TimeBase *); /* Macro to allow us to GetNextInterestingTime without duration */ #define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL) diff --git a/Mac/Modules/qt/qtsupport.py b/Mac/Modules/qt/qtsupport.py index f7b8e2e10155..fd2169d3230f 100644 --- a/Mac/Modules/qt/qtsupport.py +++ b/Mac/Modules/qt/qtsupport.py @@ -26,25 +26,6 @@ from macsupport import * includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ -/* Exported by Cmmodule.c: */ -extern PyObject *CmpObj_New(Component); -extern int CmpObj_Convert(PyObject *, Component *); -extern PyObject *CmpInstObj_New(ComponentInstance); -extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); - -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -/* Our own, used before defined: */ -staticforward PyObject *TrackObj_New(Track); -staticforward int TrackObj_Convert(PyObject *, Track *); -staticforward PyObject *MovieObj_New(Movie); -staticforward int MovieObj_Convert(PyObject *, Movie *); -staticforward PyObject *MovieCtlObj_New(MovieController); -staticforward int MovieCtlObj_Convert(PyObject *, TimeBase *); -staticforward PyObject *TimeBaseObj_New(TimeBase); -staticforward int TimeBaseObj_Convert(PyObject *, TimeBase *); /* Macro to allow us to GetNextInterestingTime without duration */ #define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) \ diff --git a/Mac/Modules/res/Resmodule.c b/Mac/Modules/res/Resmodule.c index 6db002fd4986..95a82e256c70 100644 --- a/Mac/Modules/res/Resmodule.c +++ b/Mac/Modules/res/Resmodule.c @@ -5,48 +5,12 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* Function to dispose a resource, with a "normal" calling sequence */ static void PyMac_AutoDisposeHandle(Handle h) diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py index 10e2724d47c1..b19c10df007d 100644 --- a/Mac/Modules/res/ressupport.py +++ b/Mac/Modules/res/ressupport.py @@ -24,8 +24,6 @@ includestuff = includestuff + """ #include #include -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - /* Function to dispose a resource, with a "normal" calling sequence */ static void PyMac_AutoDisposeHandle(Handle h) diff --git a/Mac/Modules/scrap/Scrapmodule.c b/Mac/Modules/scrap/Scrapmodule.c index b44e7cd89f6b..5dd5c5ab4d03 100644 --- a/Mac/Modules/scrap/Scrapmodule.c +++ b/Mac/Modules/scrap/Scrapmodule.c @@ -13,44 +13,15 @@ #include #include -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *PMObj_New(PixMapHandle); -extern int PMObj_Convert(PyObject *, PixMapHandle *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include /* ** Generate ScrapInfo records */ -PyObject *SCRRec_New(itself) +static PyObject * +SCRRec_New(itself) ScrapStuff *itself; { diff --git a/Mac/Modules/snd/Sndihooks.c b/Mac/Modules/snd/Sndihooks.c index 5c152d736470..a4aa609d03d2 100644 --- a/Mac/Modules/snd/Sndihooks.c +++ b/Mac/Modules/snd/Sndihooks.c @@ -31,6 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #include "macglue.h" +#include "pymactoolbox.h" #include #pragma options align=mac68k @@ -46,8 +47,6 @@ struct SampleSizeAvailable_arg { #pragma options align=reset -extern PyObject *ResObj_New(Handle); - static PyObject *ErrorObject; diff --git a/Mac/Modules/snd/Sndmodule.c b/Mac/Modules/snd/Sndmodule.c index 2e4eae5621e7..bbd58cdd8285 100644 --- a/Mac/Modules/snd/Sndmodule.c +++ b/Mac/Modules/snd/Sndmodule.c @@ -5,42 +5,8 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include diff --git a/Mac/Modules/te/TEmodule.c b/Mac/Modules/te/TEmodule.c index 98b8de8585b5..789b157a44a1 100644 --- a/Mac/Modules/te/TEmodule.c +++ b/Mac/Modules/te/TEmodule.c @@ -5,56 +5,19 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include #define as_TE(h) ((TEHandle)h) #define as_Resource(teh) ((Handle)teh) -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - /* ** Parse/generate TextStyle records */ -PyObject *TextStyle_New(itself) +static PyObject * +TextStyle_New(itself) TextStylePtr itself; { @@ -62,6 +25,7 @@ PyObject *TextStyle_New(itself) &itself->tsColor); } +static int TextStyle_Convert(v, p_itself) PyObject *v; TextStylePtr p_itself; diff --git a/Mac/Modules/te/tesupport.py b/Mac/Modules/te/tesupport.py index b33d0bd2f7ad..337ac2ba520b 100644 --- a/Mac/Modules/te/tesupport.py +++ b/Mac/Modules/te/tesupport.py @@ -37,14 +37,11 @@ includestuff = includestuff + """ #define as_TE(h) ((TEHandle)h) #define as_Resource(teh) ((Handle)teh) -/* Exported by Qdmodule.c: */ -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - /* ** Parse/generate TextStyle records */ -PyObject *TextStyle_New(itself) +static PyObject * +TextStyle_New(itself) TextStylePtr itself; { @@ -52,6 +49,7 @@ PyObject *TextStyle_New(itself) &itself->tsColor); } +static int TextStyle_Convert(v, p_itself) PyObject *v; TextStylePtr p_itself; diff --git a/Mac/Modules/waste/wastemodule.c b/Mac/Modules/waste/wastemodule.c index ffb39c3f7498..14aac9c318fe 100644 --- a/Mac/Modules/waste/wastemodule.c +++ b/Mac/Modules/waste/wastemodule.c @@ -5,42 +5,8 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include #include @@ -381,6 +347,12 @@ static PyObject *WEOObj_getattr(self, name) #define WEOObj_setattr NULL +#define WEOObj_compare NULL + +#define WEOObj_repr NULL + +#define WEOObj_hash NULL + PyTypeObject WEO_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ @@ -392,6 +364,12 @@ PyTypeObject WEO_Type = { 0, /*tp_print*/ (getattrfunc) WEOObj_getattr, /*tp_getattr*/ (setattrfunc) WEOObj_setattr, /*tp_setattr*/ + (cmpfunc) WEOObj_compare, /*tp_compare*/ + (reprfunc) WEOObj_repr, /*tp_repr*/ + (PyNumberMethods *)0, /* tp_as_number */ + (PySequenceMethods *)0, /* tp_as_sequence */ + (PyMappingMethods *)0, /* tp_as_mapping */ + (hashfunc) WEOObj_hash, /*tp_hash*/ }; /* ---------------------- End object type WEO ----------------------- */ @@ -682,7 +660,7 @@ static PyObject *wasteObj_WEGetClickCount(_self, _args) if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = WEGetClickCount(_self->ob_itself); - _res = Py_BuildValue("h", + _res = Py_BuildValue("H", _rv); return _res; } @@ -746,13 +724,13 @@ static PyObject *wasteObj_WEContinuousStyle(_self, _args) Boolean _rv; WEStyleMode mode; TextStyle ts; - if (!PyArg_ParseTuple(_args, "h", + if (!PyArg_ParseTuple(_args, "H", &mode)) return NULL; _rv = WEContinuousStyle(&mode, &ts, _self->ob_itself); - _res = Py_BuildValue("bhO&", + _res = Py_BuildValue("bHO&", _rv, mode, TextStyle_New, &ts); @@ -1096,7 +1074,7 @@ static PyObject *wasteObj_WEKey(_self, _args) PyObject *_res = NULL; SInt16 key; EventModifiers modifiers; - if (!PyArg_ParseTuple(_args, "hh", + if (!PyArg_ParseTuple(_args, "hH", &key, &modifiers)) return NULL; @@ -1116,7 +1094,7 @@ static PyObject *wasteObj_WEClick(_self, _args) Point hitPt; EventModifiers modifiers; UInt32 clickTime; - if (!PyArg_ParseTuple(_args, "O&hl", + if (!PyArg_ParseTuple(_args, "O&Hl", PyMac_GetPoint, &hitPt, &modifiers, &clickTime)) @@ -1216,7 +1194,7 @@ static PyObject *wasteObj_WESetStyle(_self, _args) OSErr _err; WEStyleMode mode; TextStyle ts; - if (!PyArg_ParseTuple(_args, "hO&", + if (!PyArg_ParseTuple(_args, "HO&", &mode, TextStyle_Convert, &ts)) return NULL; @@ -1889,6 +1867,12 @@ static PyObject *wasteObj_getattr(self, name) #define wasteObj_setattr NULL +#define wasteObj_compare NULL + +#define wasteObj_repr NULL + +#define wasteObj_hash NULL + PyTypeObject waste_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ @@ -1900,6 +1884,12 @@ PyTypeObject waste_Type = { 0, /*tp_print*/ (getattrfunc) wasteObj_getattr, /*tp_getattr*/ (setattrfunc) wasteObj_setattr, /*tp_setattr*/ + (cmpfunc) wasteObj_compare, /*tp_compare*/ + (reprfunc) wasteObj_repr, /*tp_repr*/ + (PyNumberMethods *)0, /* tp_as_number */ + (PySequenceMethods *)0, /* tp_as_sequence */ + (PyMappingMethods *)0, /* tp_as_mapping */ + (hashfunc) wasteObj_hash, /*tp_hash*/ }; /* --------------------- End object type waste ---------------------- */ diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c index 2ad1d601f34f..033dd4b331e6 100644 --- a/Mac/Modules/win/Winmodule.c +++ b/Mac/Modules/win/Winmodule.c @@ -5,51 +5,11 @@ -#define SystemSevenOrLater 1 - #include "macglue.h" -#include -#include -#include -#include - -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyTypeObject Window_Type; -#define WinObj_Check(x) ((x)->ob_type == &Window_Type) - -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyTypeObject Dialog_Type; -#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) - -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); - -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); - -extern PyObject *WinObj_WhichWindow(WindowPtr); +#include "pymactoolbox.h" #include -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - - static PyObject *Win_Error; /* ----------------------- Object type Window ----------------------- */ diff --git a/Mac/Modules/win/winsupport.py b/Mac/Modules/win/winsupport.py index 5ee6cf331369..8737894d93a2 100644 --- a/Mac/Modules/win/winsupport.py +++ b/Mac/Modules/win/winsupport.py @@ -49,12 +49,6 @@ PropertyTag = OSTypeType("PropertyTag") includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ - -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -#define resNotFound -192 /* Can't include because of Python's "errors.h" */ - """ finalstuff = finalstuff + """