]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
pymactoolbox.h contains protoypes for all externally visible toolbox module
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 14 Jul 2000 22:16:45 +0000 (22:16 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 14 Jul 2000 22:16:45 +0000 (22:16 +0000)
functions. Include it in stead of duplicating the declarations everywhere. Also
cleaned up toolbox module exports, and got rid of resNotFound error.

45 files changed:
Mac/Include/pymactoolbox.h [new file with mode: 0644]
Mac/Modules/ColorPickermodule.c
Mac/Modules/Nav.c
Mac/Modules/Printingmodule.c
Mac/Modules/ae/AEmodule.c
Mac/Modules/ae/aesupport.py
Mac/Modules/app/Appmodule.c
Mac/Modules/app/appsupport.py
Mac/Modules/cm/Cmmodule.c
Mac/Modules/cm/cmsupport.py
Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/ctlscan.py
Mac/Modules/ctl/ctlsupport.py
Mac/Modules/dlg/Dlgmodule.c
Mac/Modules/dlg/dlgsupport.py
Mac/Modules/drag/Dragmodule.c
Mac/Modules/drag/dragsupport.py
Mac/Modules/evt/Evtmodule.c
Mac/Modules/evt/evtsupport.py
Mac/Modules/fm/Fmmodule.c
Mac/Modules/fm/fmsupport.py
Mac/Modules/help/Helpmodule.c
Mac/Modules/help/helpsupport.py
Mac/Modules/icn/Icnmodule.c
Mac/Modules/icn/icnsupport.py
Mac/Modules/list/Listmodule.c
Mac/Modules/macfsmodule.c
Mac/Modules/menu/Menumodule.c
Mac/Modules/menu/menusupport.py
Mac/Modules/qd/Qdmodule.c
Mac/Modules/qd/qdsupport.py
Mac/Modules/qdoffs/Qdoffsmodule.c
Mac/Modules/qdoffs/qdoffssupport.py
Mac/Modules/qt/Qtmodule.c
Mac/Modules/qt/qtsupport.py
Mac/Modules/res/Resmodule.c
Mac/Modules/res/ressupport.py
Mac/Modules/scrap/Scrapmodule.c
Mac/Modules/snd/Sndihooks.c
Mac/Modules/snd/Sndmodule.c
Mac/Modules/te/TEmodule.c
Mac/Modules/te/tesupport.py
Mac/Modules/waste/wastemodule.c
Mac/Modules/win/Winmodule.c
Mac/Modules/win/winsupport.py

diff --git a/Mac/Include/pymactoolbox.h b/Mac/Include/pymactoolbox.h
new file mode 100644 (file)
index 0000000..79b8f0e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+** pymactoolbox.h - global routines exported by the toolbox modules
+*/
+
+#ifdef __cplusplus
+       extern "C" {
+#endif
+
+#include <Memory.h>
+#include <Dialogs.h>
+#include <Menus.h>
+#include <Controls.h>
+#include <Components.h>
+#include <Lists.h>
+#include <Movies.h>
+#include <Errors.h>
+
+/* 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
index d9370b593acb89965709e9a4276e8ae4c56a3050..3878093377b9fb3d5ccbdcb238884a017dce3884 100644 (file)
@@ -24,12 +24,10 @@ PERFORMANCE OF THIS SOFTWARE.
 #include <ColorPicker.h>
 #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"
 ;
index 85fae415c5e4dde2a6d54c105d4b5f967defeadd..c86a5ef0045b26bae4f4c74a4a2f91ebc0f95b1a 100644 (file)
@@ -31,16 +31,9 @@ PERFORMANCE OF THIS SOFTWARE.
 
 #include "Python.h"
 #include "macglue.h"
+#include "pymactoolbox.h"
 #include <Navigation.h>
 
-/* 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;
index 94d05a6b2fe8337c329d7a960271f7c438dfa642..5f1ac5783bc109eb9feb6b9e3d13a04219f1c1cd 100644 (file)
@@ -23,15 +23,9 @@ PERFORMANCE OF THIS SOFTWARE.
 
 #include "Python.h"
 #include "macglue.h"
+#include "pymactoolbox.h"
 #include <Printing.h>
 
-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;
 
 /* ----------------------------------------------------- */
index d5401975eee52cd6a455db236b6ce8fcfcf1cd57..aee36fa6113c1f54e0a609c93ee16177d67c28f4 100644 (file)
@@ -5,42 +5,8 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <AppleEvents.h>
 
@@ -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) {
index 953b490c86d8fe4cfe9f3e11d360d67b206dedaa..5ca2c48a0446f98224d0251c65aed6ef5c13b360 100644 (file)
@@ -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) {
index 06f573da13b50eb74e6acf788f994bf5d93115e5..fd1213548699683c2490303ca6ca3f5cb58114ed 100644 (file)
@@ -5,51 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Appearance.h>
 
-/* Exported by Qdmodule.c: */
-extern PyObject *QdRGB_New(RGBColor *);
-extern int QdRGB_Convert(PyObject *, RGBColor *);
-
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 static PyObject *App_Error;
 
 static PyObject *App_RegisterAppearanceClient(_self, _args)
index 3bf5912493e4c13a8f6a27f9a2c2ad19894d80bb..11b6d2fe073086d06ed010c435ca447ee45200fb 100644 (file)
@@ -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 <Errors.h> because of Python's "errors.h" */
 """
 
 ## class MyObjectDefinition(GlobalObjectDefinition):
index de00241906a5599a2c73f1fb36d9645c98cfd452..b8a62161b1cf1fb75ca1e6cf22a6e656fd13cf84 100644 (file)
@@ -5,49 +5,16 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Components.h>
 
 /*
 ** 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;
index 0a1915f3cf99618436788d3c0437c8144e0681ac..598b51de2facce33d5f6bf0fba93db154fc9cbf7 100644 (file)
@@ -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;
index 863276773b266feef0d9fd63e4681c647a6fcca0..6944fb31b422f98bddcecf56554c2651a9832c19 100644 (file)
@@ -5,45 +5,13 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Controls.h>
 
+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 <Errors.h> 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;
index 0f46c0e43c3fabfb99aae61aabe20ac2e3afcc94..dc7d7608ed918bde010d9fe744da6eec7a1f0a39 100644 (file)
@@ -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):
index 30c44912d1a3ad48640d57994bfe11aff7ada7c7..25cd520674bb6d7e22d2dec3fb34a5dceef31350 100644 (file)
@@ -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 <Errors.h> 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;
index 1b46cfccd0d6fcae842403ae3c9805197f937fc1..eb9efab62dd685499293a873ccd267706ae3c9ea 100644 (file)
@@ -5,42 +5,8 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Dialogs.h>
 
@@ -48,13 +14,9 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
 #define NewModalFilterProc(x) (x)
 #endif
 
-#define resNotFound -192 /* Can't include <Errors.h> 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)
index e00b662209383e31941cbd72f831b997549357d9..11873cf30707b8b3950c6a51939977a0c3b195c1 100644 (file)
@@ -35,13 +35,9 @@ includestuff = includestuff + """
 #define NewModalFilterProc(x) (x)
 #endif
 
-#define resNotFound -192 /* Can't include <Errors.h> 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)
index 9fcc125ffeeb64295e8f5c53888ddec2ffa629eb..716d2d5ff7c38a44ec3f1e4ae94d398443b3f96b 100644 (file)
@@ -5,55 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Drag.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> 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;
index 64274a6fdf776c30488fe1c8c981ad782b102f94..af8a25534eb2d18c74f8450d4226dd1eb6ba9f48 100644 (file)
@@ -56,16 +56,6 @@ DragTrackingMessage = Type("DragTrackingMessage", "h")
 includestuff = includestuff + """
 #include <%s>""" % MACHEADERFILE + """
 
-#define resNotFound -192 /* Can't include <Errors.h> 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;
index 7d5d2f207eb338c5ae2f00bae6fc220dc0f75b8b..b825cbf6f993d9fb7f22bccc5bac56cf73a636a0 100644 (file)
@@ -5,47 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Events.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 static PyObject *Evt_Error;
 
 static PyObject *Evt_GetMouse(_self, _args)
index 6021a29b09e406dd10766298aa649ffaa4650129..d4fb5953b1397bb6308c0b40dea1722c5790cb62 100644 (file)
@@ -36,8 +36,6 @@ EventKind = Type("EventKind", "H")
 
 includestuff = includestuff + """
 #include <%s>""" % MACHEADERFILE + """
-
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
 """
 
 class MyObjectDefinition(GlobalObjectDefinition):
index 37d47e8a3dcb7434cc2c28fe1b4e1920916e0149..3b30218533bc8a16cf4cd2fa98890e00ea0ad090 100644 (file)
@@ -5,49 +5,16 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Fonts.h>
 
 /*
 ** 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;
index f0b1e292626df42e319bc12434180521fe31a257..1afc8b85222cd5b9f288b067a2ba818d28ce3fbf 100644 (file)
@@ -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;
index 6faf26f3bf5c5096c2b8569a45267126d23d2756..fac21b6db2b758ac2bdc9432c7971790e5b3eb32 100644 (file)
@@ -5,47 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Balloons.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 static PyObject *Help_Error;
 
 static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
index ce0975457b5aeaa79d60b7d1e7ed102077e7a78b..3eeb06ae5b1d42117720de4a656cabb700e47931 100644 (file)
@@ -38,8 +38,6 @@ EventKind = Type("EventKind", "H")
 
 includestuff = includestuff + """
 #include <%s>""" % MACHEADERFILE + """
-
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
 """
 
 class MyObjectDefinition(GlobalObjectDefinition):
index 37aa6ffa3a4a8f9883608058efb49b4dcefbbb9e..6ed20dd0911d4b7c22b546895300e625753b6f35 100644 (file)
@@ -5,51 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Icons.h>
 
-/* Exported by Qdmodule.c: */
-extern PyObject *QdRGB_New(RGBColor *);
-extern int QdRGB_Convert(PyObject *, RGBColor *);
-
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 static PyObject *Icn_Error;
 
 static PyObject *Icn_GetCIcon(_self, _args)
index 4345d9d5174b5ccfa71426244ae0e5b123a07333..5ea6a455630a9d355fffb772f88fffede5593c2c 100644 (file)
@@ -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 <Errors.h> because of Python's "errors.h" */
 """
 
 class MyObjectDefinition(GlobalObjectDefinition):
index 0993ad9c66c04d4532fbe804e596a4e257d4967e..f5360f23c1019df2bbc3381a2c955ce8dddb3d48 100644 (file)
@@ -5,42 +5,8 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Lists.h>
 
index 048b243023eca8f005fde9a3baeb6c62be4f388a..fa832f32e4bf4980ecd0094a909d33fcf8dfa79d 100644 (file)
@@ -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)
index 11bc6c7288d33c6d1e46eb9862b67d268a15ae7e..23803e8ff43e5bc3340edad90ff4e0d3263425bf 100644 (file)
@@ -5,48 +5,12 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Devices.h> /* Defines OpenDeskAcc in universal headers */
 #include <Menus.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 #define as_Menu(h) ((MenuHandle)h)
 #define as_Resource(h) ((Handle)h)
 
index b706a36e94d94b7f54855674ca5b971f43aa6164..1325e10779d1bb8000aa7f968c95001b62e74c19 100644 (file)
@@ -32,8 +32,6 @@ includestuff = includestuff + """
 #include <Devices.h> /* Defines OpenDeskAcc in universal headers */
 #include <%s>""" % MACHEADERFILE + """
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 #define as_Menu(h) ((MenuHandle)h)
 #define as_Resource(h) ((Handle)h)
 """
index d4f91d44f3fcf76e3e860c507dfa5b515e85b4f1..9d844b8c15e7da9583fd566f3be11baa1dde0566 100644 (file)
@@ -5,47 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <QuickDraw.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 /*
 ** Parse/generate RGB records
 */
index 3be0b0c711d520bb95c4e4c0fdaf82194d1ac4d6..1c0f6c3405ed78145609208fa88420bb35c08b47 100644 (file)
@@ -58,8 +58,6 @@ PenState_ptr = StructInputBufferType('PenState')
 includestuff = includestuff + """
 #include <%s>""" % MACHEADERFILE + """
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 /*
 ** Parse/generate RGB records
 */
index 37c774ee0ae63305ec26984ecf696aef533a2510..c0e05cdf01a868bcb7f3ca8358a9022772d37903 100644 (file)
@@ -5,49 +5,13 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <QDOffscreen.h>
 
 #define as_GrafPtr(gworld) ((GrafPtr)(gworld))
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 
 static PyObject *Qdoffs_Error;
 
index e569feaea45fe389420eed9134652d30f5abd36f..7f4a043cc03461a5094a68966ae01645560b8ae3 100644 (file)
@@ -38,8 +38,6 @@ includestuff = includestuff + """
 
 #define as_GrafPtr(gworld) ((GrafPtr)(gworld))
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 """
 
 
index f382f9fe624d639d89f31c4c193ff8b23099ea25..4899715988369ae795019855d17f2a45aa01fcb7 100644 (file)
@@ -5,64 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Movies.h>
 
-/* 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)
index f7b8e2e10155fe37d02986ac78c8a3217bf48ced..fd2169d3230f2c9e24cfa21a607b72d21988b8cd 100644 (file)
@@ -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) \
index 6db002fd49862c1f74e80c581de08c998fc6170c..95a82e256c705c06f82d03d1a199d2125df97817 100644 (file)
@@ -5,48 +5,12 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Resources.h>
 #include <string.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 /* Function to dispose a resource, with a "normal" calling sequence */
 static void
 PyMac_AutoDisposeHandle(Handle h)
index 10e2724d47c1a1ec98c746dc6bc159042f9d8058..b19c10df007d0831f9938e5866115d2d060bc83a 100644 (file)
@@ -24,8 +24,6 @@ includestuff = includestuff + """
 #include <Resources.h>
 #include <string.h>
 
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
 /* Function to dispose a resource, with a "normal" calling sequence */
 static void
 PyMac_AutoDisposeHandle(Handle h)
index b44e7cd89f6b652183ae6f765f31583be1eea859..5dd5c5ab4d03308b556ee5706297faf67fff7d19 100644 (file)
 #include <Menus.h>
 #include <Controls.h>
 
-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 <Scrap.h>
 
 /*
 ** Generate ScrapInfo records
 */
-PyObject *SCRRec_New(itself)
+static PyObject *
+SCRRec_New(itself)
        ScrapStuff *itself;
 {
 
index 5c152d736470325432b0c7da15bc04d0848c9c5a..a4aa609d03d239195b52c4fc45061e67c4e3a943 100644 (file)
@@ -31,6 +31,7 @@ PERFORMANCE OF THIS SOFTWARE.
 
 #include "Python.h"
 #include "macglue.h"
+#include "pymactoolbox.h"
 #include <Sound.h>
 
 #pragma options align=mac68k
@@ -46,8 +47,6 @@ struct SampleSizeAvailable_arg {
 
 #pragma options align=reset
 
-extern PyObject *ResObj_New(Handle);
-
 static PyObject *ErrorObject;
 
 
index 2e4eae5621e76223089742f51d0da992b794e23a..bbd58cdd8285b793b941e736376d6b037c8e80fc 100644 (file)
@@ -5,42 +5,8 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Sound.h>
 
index 98b8de8585b5679f75fbb0d02bd5bf6c89552ce6..789b157a44a1640f5c00008150a342604c93a64e 100644 (file)
@@ -5,56 +5,19 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <TextEdit.h>
 
 #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;
index b33d0bd2f7ad50f1b6ede9ae1e957043994e420e..337ac2ba520bb7be438e719cda158a3792b6fc91 100644 (file)
@@ -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;
index ffb39c3f74982b42ace14077066536efb0c14e93..14aac9c318feadfb7babb2ca54c7f851531c3f9e 100644 (file)
@@ -5,42 +5,8 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <WASTE.h>
 #include <WEObjectHandlers.h>
@@ -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 ---------------------- */
index 2ad1d601f34f1aa990679c15d9593a0319679207..033dd4b331e62f291ef10a30d380e6b25ab4e9f0 100644 (file)
@@ -5,51 +5,11 @@
 
 
 
-#define SystemSevenOrLater 1
-
 #include "macglue.h"
-#include <Memory.h>
-#include <Dialogs.h>
-#include <Menus.h>
-#include <Controls.h>
-
-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 <Windows.h>
 
-extern PyObject *QdRGB_New(RGBColor *);
-extern int QdRGB_Convert(PyObject *, RGBColor *);
-
-#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-
-
 static PyObject *Win_Error;
 
 /* ----------------------- Object type Window ----------------------- */
index 5ee6cf331369fc20041e405c98d3573fa3f7b7c4..8737894d93a2fdf187a65df36d9560dd5f7fdaaf 100644 (file)
@@ -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 <Errors.h> because of Python's "errors.h" */
-
 """
 
 finalstuff = finalstuff + """