Commit a23976c4 authored by Jack Jansen's avatar Jack Jansen

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.
parent 4caea308
/*
** 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
...@@ -24,12 +24,10 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -24,12 +24,10 @@ PERFORMANCE OF THIS SOFTWARE.
#include <ColorPicker.h> #include <ColorPicker.h>
#include "Python.h" #include "Python.h"
#include "macglue.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__[] = static char cp_GetColor__doc__[] =
"GetColor(prompt, (r, g, b)) -> (r, g, b), ok" "GetColor(prompt, (r, g, b)) -> (r, g, b), ok"
; ;
......
...@@ -31,16 +31,9 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -31,16 +31,9 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Python.h" #include "Python.h"
#include "macglue.h" #include "macglue.h"
#include "pymactoolbox.h"
#include <Navigation.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 PyObject *ErrorObject;
static NavEventUPP my_eventProcUPP; static NavEventUPP my_eventProcUPP;
......
...@@ -23,15 +23,9 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -23,15 +23,9 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Python.h" #include "Python.h"
#include "macglue.h" #include "macglue.h"
#include "pymactoolbox.h"
#include <Printing.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; static PyObject *ErrorObject;
/* ----------------------------------------------------- */ /* ----------------------------------------------------- */
......
...@@ -5,42 +5,8 @@ ...@@ -5,42 +5,8 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <AppleEvents.h> #include <AppleEvents.h>
...@@ -1164,7 +1130,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long ...@@ -1164,7 +1130,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
PyObject *handler = (PyObject *)refcon; PyObject *handler = (PyObject *)refcon;
AEDescObject *requestObject, *replyObject; AEDescObject *requestObject, *replyObject;
PyObject *args, *res; PyObject *args, *res;
if ((requestObject = (AEDescObject *)AEDesc_New(request)) == NULL) { if ((requestObject = (AEDescObject *)AEDesc_New((AppleEvent *)request)) == NULL) {
return -1; return -1;
} }
if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) { if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) {
......
...@@ -131,7 +131,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long ...@@ -131,7 +131,7 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
PyObject *handler = (PyObject *)refcon; PyObject *handler = (PyObject *)refcon;
AEDescObject *requestObject, *replyObject; AEDescObject *requestObject, *replyObject;
PyObject *args, *res; PyObject *args, *res;
if ((requestObject = (AEDescObject *)AEDesc_New(request)) == NULL) { if ((requestObject = (AEDescObject *)AEDesc_New((AppleEvent *)request)) == NULL) {
return -1; return -1;
} }
if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) { if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) {
......
...@@ -5,51 +5,11 @@ ...@@ -5,51 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Appearance.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_Error;
static PyObject *App_RegisterAppearanceClient(_self, _args) static PyObject *App_RegisterAppearanceClient(_self, _args)
......
...@@ -69,12 +69,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") ...@@ -69,12 +69,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #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): ## class MyObjectDefinition(GlobalObjectDefinition):
......
...@@ -5,49 +5,16 @@ ...@@ -5,49 +5,16 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Components.h> #include <Components.h>
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
PyObject *CmpDesc_New(itself) static PyObject *
CmpDesc_New(itself)
ComponentDescription *itself; ComponentDescription *itself;
{ {
...@@ -58,6 +25,7 @@ PyObject *CmpDesc_New(itself) ...@@ -58,6 +25,7 @@ PyObject *CmpDesc_New(itself)
itself->componentFlags, itself->componentFlagsMask); itself->componentFlags, itself->componentFlagsMask);
} }
static int
CmpDesc_Convert(v, p_itself) CmpDesc_Convert(v, p_itself)
PyObject *v; PyObject *v;
ComponentDescription *p_itself; ComponentDescription *p_itself;
......
...@@ -26,7 +26,8 @@ includestuff = includestuff + """ ...@@ -26,7 +26,8 @@ includestuff = includestuff + """
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
PyObject *CmpDesc_New(itself) static PyObject *
CmpDesc_New(itself)
ComponentDescription *itself; ComponentDescription *itself;
{ {
...@@ -37,6 +38,7 @@ PyObject *CmpDesc_New(itself) ...@@ -37,6 +38,7 @@ PyObject *CmpDesc_New(itself)
itself->componentFlags, itself->componentFlagsMask); itself->componentFlags, itself->componentFlagsMask);
} }
static int
CmpDesc_Convert(v, p_itself) CmpDesc_Convert(v, p_itself)
PyObject *v; PyObject *v;
ComponentDescription *p_itself; ComponentDescription *p_itself;
......
...@@ -5,45 +5,13 @@ ...@@ -5,45 +5,13 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Controls.h> #include <Controls.h>
staticforward PyObject *CtlObj_WhichControl(ControlHandle);
#define as_Control(h) ((ControlHandle)h) #define as_Control(h) ((ControlHandle)h)
#define as_Resource(ctl) ((Handle)ctl) #define as_Resource(ctl) ((Handle)ctl)
#ifdef TARGET_API_MAC_CARBON #ifdef TARGET_API_MAC_CARBON
...@@ -51,17 +19,13 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); ...@@ -51,17 +19,13 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
#else #else
#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect)) #define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
#endif #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 ** Parse/generate ControlFontStyleRec records
*/ */
#if 0 /* Not needed */ #if 0 /* Not needed */
PyObject *ControlFontStyle_New(itself) static PyObject *
ControlFontStyle_New(itself)
ControlFontStyleRec *itself; ControlFontStyleRec *itself;
{ {
...@@ -71,6 +35,7 @@ PyObject *ControlFontStyle_New(itself) ...@@ -71,6 +35,7 @@ PyObject *ControlFontStyle_New(itself)
} }
#endif #endif
static int
ControlFontStyle_Convert(v, itself) ControlFontStyle_Convert(v, itself)
PyObject *v; PyObject *v;
ControlFontStyleRec *itself; ControlFontStyleRec *itself;
...@@ -854,6 +819,8 @@ static PyObject *CtlObj_SetControlColor(_self, _args) ...@@ -854,6 +819,8 @@ static PyObject *CtlObj_SetControlColor(_self, _args)
} }
#endif #endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args) static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args)
ControlObject *_self; ControlObject *_self;
PyObject *_args; PyObject *_args;
...@@ -870,6 +837,9 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args) ...@@ -870,6 +837,9 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args)
outValue); outValue);
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args) static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -888,6 +858,9 @@ static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args) ...@@ -888,6 +858,9 @@ static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args)
_res = Py_None; _res = Py_None;
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args) static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -905,6 +878,9 @@ static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args) ...@@ -905,6 +878,9 @@ static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args)
MenuObj_New, outHandle); MenuObj_New, outHandle);
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetBevelButtonTransform(_self, _args) static PyObject *CtlObj_SetBevelButtonTransform(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -923,6 +899,9 @@ static PyObject *CtlObj_SetBevelButtonTransform(_self, _args) ...@@ -923,6 +899,9 @@ static PyObject *CtlObj_SetBevelButtonTransform(_self, _args)
_res = Py_None; _res = Py_None;
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetImageWellTransform(_self, _args) static PyObject *CtlObj_SetImageWellTransform(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -941,6 +920,9 @@ static PyObject *CtlObj_SetImageWellTransform(_self, _args) ...@@ -941,6 +920,9 @@ static PyObject *CtlObj_SetImageWellTransform(_self, _args)
_res = Py_None; _res = Py_None;
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetTabContentRect(_self, _args) static PyObject *CtlObj_GetTabContentRect(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -958,6 +940,9 @@ static PyObject *CtlObj_GetTabContentRect(_self, _args) ...@@ -958,6 +940,9 @@ static PyObject *CtlObj_GetTabContentRect(_self, _args)
PyMac_BuildRect, &outContentRect); PyMac_BuildRect, &outContentRect);
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetTabEnabled(_self, _args) static PyObject *CtlObj_SetTabEnabled(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -979,6 +964,9 @@ static PyObject *CtlObj_SetTabEnabled(_self, _args) ...@@ -979,6 +964,9 @@ static PyObject *CtlObj_SetTabEnabled(_self, _args)
_res = Py_None; _res = Py_None;
return _res; return _res;
} }
#endif
#ifndef TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args) static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -997,6 +985,7 @@ static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args) ...@@ -997,6 +985,7 @@ static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args)
_res = Py_None; _res = Py_None;
return _res; return _res;
} }
#endif
static PyObject *CtlObj_SendControlMessage(_self, _args) static PyObject *CtlObj_SendControlMessage(_self, _args)
ControlObject *_self; ControlObject *_self;
...@@ -1611,22 +1600,46 @@ static PyMethodDef CtlObj_methods[] = { ...@@ -1611,22 +1600,46 @@ static PyMethodDef CtlObj_methods[] = {
{"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1, {"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1,
"(CCTabHandle newColorTable) -> None"}, "(CCTabHandle newColorTable) -> None"},
#endif #endif
#ifndef TARGET_API_MAC_CARBON
{"GetBevelButtonMenuValue", (PyCFunction)CtlObj_GetBevelButtonMenuValue, 1, {"GetBevelButtonMenuValue", (PyCFunction)CtlObj_GetBevelButtonMenuValue, 1,
"() -> (SInt16 outValue)"}, "() -> (SInt16 outValue)"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"SetBevelButtonMenuValue", (PyCFunction)CtlObj_SetBevelButtonMenuValue, 1, {"SetBevelButtonMenuValue", (PyCFunction)CtlObj_SetBevelButtonMenuValue, 1,
"(SInt16 inValue) -> None"}, "(SInt16 inValue) -> None"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"GetBevelButtonMenuHandle", (PyCFunction)CtlObj_GetBevelButtonMenuHandle, 1, {"GetBevelButtonMenuHandle", (PyCFunction)CtlObj_GetBevelButtonMenuHandle, 1,
"() -> (MenuHandle outHandle)"}, "() -> (MenuHandle outHandle)"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"SetBevelButtonTransform", (PyCFunction)CtlObj_SetBevelButtonTransform, 1, {"SetBevelButtonTransform", (PyCFunction)CtlObj_SetBevelButtonTransform, 1,
"(IconTransformType transform) -> None"}, "(IconTransformType transform) -> None"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"SetImageWellTransform", (PyCFunction)CtlObj_SetImageWellTransform, 1, {"SetImageWellTransform", (PyCFunction)CtlObj_SetImageWellTransform, 1,
"(IconTransformType inTransform) -> None"}, "(IconTransformType inTransform) -> None"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"GetTabContentRect", (PyCFunction)CtlObj_GetTabContentRect, 1, {"GetTabContentRect", (PyCFunction)CtlObj_GetTabContentRect, 1,
"() -> (Rect outContentRect)"}, "() -> (Rect outContentRect)"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"SetTabEnabled", (PyCFunction)CtlObj_SetTabEnabled, 1, {"SetTabEnabled", (PyCFunction)CtlObj_SetTabEnabled, 1,
"(SInt16 inTabToHilite, Boolean inEnabled) -> None"}, "(SInt16 inTabToHilite, Boolean inEnabled) -> None"},
#endif
#ifndef TARGET_API_MAC_CARBON
{"SetDisclosureTriangleLastValue", (PyCFunction)CtlObj_SetDisclosureTriangleLastValue, 1, {"SetDisclosureTriangleLastValue", (PyCFunction)CtlObj_SetDisclosureTriangleLastValue, 1,
"(SInt16 inValue) -> None"}, "(SInt16 inValue) -> None"},
#endif
{"SendControlMessage", (PyCFunction)CtlObj_SendControlMessage, 1, {"SendControlMessage", (PyCFunction)CtlObj_SendControlMessage, 1,
"(SInt16 inMessage, SInt32 inParam) -> (SInt32 _rv)"}, "(SInt16 inMessage, SInt32 inParam) -> (SInt32 _rv)"},
{"EmbedControl", (PyCFunction)CtlObj_EmbedControl, 1, {"EmbedControl", (PyCFunction)CtlObj_EmbedControl, 1,
...@@ -2098,7 +2111,8 @@ static PyMethodDef Ctl_methods[] = { ...@@ -2098,7 +2111,8 @@ static PyMethodDef Ctl_methods[] = {
PyObject *CtlObj_NewUnmanaged(itself) static PyObject *
CtlObj_NewUnmanaged(itself)
ControlHandle itself; ControlHandle itself;
{ {
ControlObject *it; ControlObject *it;
...@@ -2110,7 +2124,7 @@ PyObject *CtlObj_NewUnmanaged(itself) ...@@ -2110,7 +2124,7 @@ PyObject *CtlObj_NewUnmanaged(itself)
return (PyObject *)it; return (PyObject *)it;
} }
PyObject * static PyObject *
CtlObj_WhichControl(ControlHandle c) CtlObj_WhichControl(ControlHandle c)
{ {
PyObject *it; PyObject *it;
......
...@@ -84,6 +84,15 @@ class MyScanner(Scanner): ...@@ -84,6 +84,15 @@ class MyScanner(Scanner):
('#ifndef TARGET_API_MAC_CARBON', [ ('#ifndef TARGET_API_MAC_CARBON', [
'GetAuxiliaryControlRecord', 'GetAuxiliaryControlRecord',
'SetControlColor', 'SetControlColor',
# These have suddenly disappeared in UH 3.3.2...
'GetBevelButtonMenuValue',
'SetBevelButtonMenuValue',
'GetBevelButtonMenuHandle',
'SetBevelButtonTransform',
'SetImageWellTransform',
'GetTabContentRect',
'SetTabEnabled',
'SetDisclosureTriangleLastValue',
])] ])]
def makeblacklisttypes(self): def makeblacklisttypes(self):
......
...@@ -44,6 +44,8 @@ ControlFontStyleRec_ptr = ControlFontStyleRec ...@@ -44,6 +44,8 @@ ControlFontStyleRec_ptr = ControlFontStyleRec
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #include <%s>""" % MACHEADERFILE + """
staticforward PyObject *CtlObj_WhichControl(ControlHandle);
#define as_Control(h) ((ControlHandle)h) #define as_Control(h) ((ControlHandle)h)
#define as_Resource(ctl) ((Handle)ctl) #define as_Resource(ctl) ((Handle)ctl)
#ifdef TARGET_API_MAC_CARBON #ifdef TARGET_API_MAC_CARBON
...@@ -51,17 +53,13 @@ includestuff = includestuff + """ ...@@ -51,17 +53,13 @@ includestuff = includestuff + """
#else #else
#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect)) #define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
#endif #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 ** Parse/generate ControlFontStyleRec records
*/ */
#if 0 /* Not needed */ #if 0 /* Not needed */
PyObject *ControlFontStyle_New(itself) static PyObject *
ControlFontStyle_New(itself)
ControlFontStyleRec *itself; ControlFontStyleRec *itself;
{ {
...@@ -71,6 +69,7 @@ PyObject *ControlFontStyle_New(itself) ...@@ -71,6 +69,7 @@ PyObject *ControlFontStyle_New(itself)
} }
#endif #endif
static int
ControlFontStyle_Convert(v, itself) ControlFontStyle_Convert(v, itself)
PyObject *v; PyObject *v;
ControlFontStyleRec *itself; ControlFontStyleRec *itself;
...@@ -99,7 +98,8 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr * ...@@ -99,7 +98,8 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *
""" """
finalstuff = finalstuff + """ finalstuff = finalstuff + """
PyObject *CtlObj_NewUnmanaged(itself) static PyObject *
CtlObj_NewUnmanaged(itself)
ControlHandle itself; ControlHandle itself;
{ {
ControlObject *it; ControlObject *it;
...@@ -111,7 +111,7 @@ PyObject *CtlObj_NewUnmanaged(itself) ...@@ -111,7 +111,7 @@ PyObject *CtlObj_NewUnmanaged(itself)
return (PyObject *)it; return (PyObject *)it;
} }
PyObject * static PyObject *
CtlObj_WhichControl(ControlHandle c) CtlObj_WhichControl(ControlHandle c)
{ {
PyObject *it; PyObject *it;
......
...@@ -5,42 +5,8 @@ ...@@ -5,42 +5,8 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Dialogs.h> #include <Dialogs.h>
...@@ -48,13 +14,9 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); ...@@ -48,13 +14,9 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
#define NewModalFilterProc(x) (x) #define NewModalFilterProc(x) (x)
#endif #endif
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/* XXX Shouldn't this be a stack? */ /* XXX Shouldn't this be a stack? */
static PyObject *Dlg_FilterProc_callback = NULL; static PyObject *Dlg_FilterProc_callback = NULL;
static PyObject *DlgObj_New(DialogPtr); /* Forward */
static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog, static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog,
EventRecord *event, EventRecord *event,
short *itemHit) short *itemHit)
......
...@@ -35,13 +35,9 @@ includestuff = includestuff + """ ...@@ -35,13 +35,9 @@ includestuff = includestuff + """
#define NewModalFilterProc(x) (x) #define NewModalFilterProc(x) (x)
#endif #endif
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/* XXX Shouldn't this be a stack? */ /* XXX Shouldn't this be a stack? */
static PyObject *Dlg_FilterProc_callback = NULL; static PyObject *Dlg_FilterProc_callback = NULL;
static PyObject *DlgObj_New(DialogPtr); /* Forward */
static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog, static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog,
EventRecord *event, EventRecord *event,
short *itemHit) short *itemHit)
......
...@@ -5,55 +5,11 @@ ...@@ -5,55 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Drag.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 */ /* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP; DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP; DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP;
......
...@@ -56,16 +56,6 @@ DragTrackingMessage = Type("DragTrackingMessage", "h") ...@@ -56,16 +56,6 @@ DragTrackingMessage = Type("DragTrackingMessage", "h")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #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 */ /* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP; DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP; DragReceiveHandlerUPP dragglue_ReceiveHandlerUPP;
......
...@@ -5,47 +5,11 @@ ...@@ -5,47 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Events.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_Error;
static PyObject *Evt_GetMouse(_self, _args) static PyObject *Evt_GetMouse(_self, _args)
......
...@@ -36,8 +36,6 @@ EventKind = Type("EventKind", "H") ...@@ -36,8 +36,6 @@ EventKind = Type("EventKind", "H")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
""" """
class MyObjectDefinition(GlobalObjectDefinition): class MyObjectDefinition(GlobalObjectDefinition):
......
...@@ -5,49 +5,16 @@ ...@@ -5,49 +5,16 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Fonts.h> #include <Fonts.h>
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
PyObject *FMRec_New(itself) static PyObject *
FMRec_New(itself)
FMetricRec *itself; FMetricRec *itself;
{ {
...@@ -61,6 +28,7 @@ PyObject *FMRec_New(itself) ...@@ -61,6 +28,7 @@ PyObject *FMRec_New(itself)
#if 0 #if 0
/* Not needed... */ /* Not needed... */
static int
FMRec_Convert(v, p_itself) FMRec_Convert(v, p_itself)
PyObject *v; PyObject *v;
FMetricRec *p_itself; FMetricRec *p_itself;
......
...@@ -24,7 +24,8 @@ includestuff = includestuff + """ ...@@ -24,7 +24,8 @@ includestuff = includestuff + """
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
PyObject *FMRec_New(itself) static PyObject *
FMRec_New(itself)
FMetricRec *itself; FMetricRec *itself;
{ {
...@@ -38,6 +39,7 @@ PyObject *FMRec_New(itself) ...@@ -38,6 +39,7 @@ PyObject *FMRec_New(itself)
#if 0 #if 0
/* Not needed... */ /* Not needed... */
static int
FMRec_Convert(v, p_itself) FMRec_Convert(v, p_itself)
PyObject *v; PyObject *v;
FMetricRec *p_itself; FMetricRec *p_itself;
......
...@@ -5,47 +5,11 @@ ...@@ -5,47 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Balloons.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_Error;
static PyObject *Help_HMGetHelpMenuHandle(_self, _args) static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
......
...@@ -38,8 +38,6 @@ EventKind = Type("EventKind", "H") ...@@ -38,8 +38,6 @@ EventKind = Type("EventKind", "H")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
""" """
class MyObjectDefinition(GlobalObjectDefinition): class MyObjectDefinition(GlobalObjectDefinition):
......
...@@ -5,51 +5,11 @@ ...@@ -5,51 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Icons.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_Error;
static PyObject *Icn_GetCIcon(_self, _args) static PyObject *Icn_GetCIcon(_self, _args)
......
...@@ -47,12 +47,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") ...@@ -47,12 +47,6 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #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): class MyObjectDefinition(GlobalObjectDefinition):
......
...@@ -5,42 +5,8 @@ ...@@ -5,42 +5,8 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Lists.h> #include <Lists.h>
......
...@@ -854,6 +854,7 @@ mfs_RawAlias(self, args) ...@@ -854,6 +854,7 @@ mfs_RawAlias(self, args)
return (PyObject *)newmfsaobject((AliasHandle)h); return (PyObject *)newmfsaobject((AliasHandle)h);
} }
#ifndef TARGET_API_MAC_CARBON
static PyObject * static PyObject *
mfs_GetDirectory(self, args) mfs_GetDirectory(self, args)
PyObject *self; /* Not used */ PyObject *self; /* Not used */
...@@ -869,6 +870,7 @@ mfs_GetDirectory(self, args) ...@@ -869,6 +870,7 @@ mfs_GetDirectory(self, args)
ok = PyMac_GetDirectory(&fsdir, prompt); ok = PyMac_GetDirectory(&fsdir, prompt);
return Py_BuildValue("(Oi)", newmfssobject(&fsdir), ok); return Py_BuildValue("(Oi)", newmfssobject(&fsdir), ok);
} }
#endif
static PyObject * static PyObject *
mfs_FindFolder(self, args) mfs_FindFolder(self, args)
......
...@@ -5,48 +5,12 @@ ...@@ -5,48 +5,12 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Devices.h> /* Defines OpenDeskAcc in universal headers */ #include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <Menus.h> #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_Menu(h) ((MenuHandle)h)
#define as_Resource(h) ((Handle)h) #define as_Resource(h) ((Handle)h)
......
...@@ -32,8 +32,6 @@ includestuff = includestuff + """ ...@@ -32,8 +32,6 @@ includestuff = includestuff + """
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */ #include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <%s>""" % MACHEADERFILE + """ #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_Menu(h) ((MenuHandle)h)
#define as_Resource(h) ((Handle)h) #define as_Resource(h) ((Handle)h)
""" """
......
...@@ -5,47 +5,11 @@ ...@@ -5,47 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <QuickDraw.h> #include <QuickDraw.h>
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/* /*
** Parse/generate RGB records ** Parse/generate RGB records
*/ */
......
...@@ -58,8 +58,6 @@ PenState_ptr = StructInputBufferType('PenState') ...@@ -58,8 +58,6 @@ PenState_ptr = StructInputBufferType('PenState')
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/* /*
** Parse/generate RGB records ** Parse/generate RGB records
*/ */
......
...@@ -5,49 +5,13 @@ ...@@ -5,49 +5,13 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <QDOffscreen.h> #include <QDOffscreen.h>
#define as_GrafPtr(gworld) ((GrafPtr)(gworld)) #define as_GrafPtr(gworld) ((GrafPtr)(gworld))
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
static PyObject *Qdoffs_Error; static PyObject *Qdoffs_Error;
......
...@@ -38,8 +38,6 @@ includestuff = includestuff + """ ...@@ -38,8 +38,6 @@ includestuff = includestuff + """
#define as_GrafPtr(gworld) ((GrafPtr)(gworld)) #define as_GrafPtr(gworld) ((GrafPtr)(gworld))
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
""" """
......
...@@ -5,64 +5,11 @@ ...@@ -5,64 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Movies.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 */ /* Macro to allow us to GetNextInterestingTime without duration */
#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL) #define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
......
...@@ -26,25 +26,6 @@ from macsupport import * ...@@ -26,25 +26,6 @@ from macsupport import *
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #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 */ /* Macro to allow us to GetNextInterestingTime without duration */
#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) \ #define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) \
......
...@@ -5,48 +5,12 @@ ...@@ -5,48 +5,12 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Resources.h> #include <Resources.h>
#include <string.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 */ /* Function to dispose a resource, with a "normal" calling sequence */
static void static void
PyMac_AutoDisposeHandle(Handle h) PyMac_AutoDisposeHandle(Handle h)
......
...@@ -24,8 +24,6 @@ includestuff = includestuff + """ ...@@ -24,8 +24,6 @@ includestuff = includestuff + """
#include <Resources.h> #include <Resources.h>
#include <string.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 */ /* Function to dispose a resource, with a "normal" calling sequence */
static void static void
PyMac_AutoDisposeHandle(Handle h) PyMac_AutoDisposeHandle(Handle h)
......
...@@ -13,44 +13,15 @@ ...@@ -13,44 +13,15 @@
#include <Menus.h> #include <Menus.h>
#include <Controls.h> #include <Controls.h>
extern PyObject *ResObj_New(Handle); #include "pymactoolbox.h"
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 <Scrap.h> #include <Scrap.h>
/* /*
** Generate ScrapInfo records ** Generate ScrapInfo records
*/ */
PyObject *SCRRec_New(itself) static PyObject *
SCRRec_New(itself)
ScrapStuff *itself; ScrapStuff *itself;
{ {
......
...@@ -31,6 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -31,6 +31,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Python.h" #include "Python.h"
#include "macglue.h" #include "macglue.h"
#include "pymactoolbox.h"
#include <Sound.h> #include <Sound.h>
#pragma options align=mac68k #pragma options align=mac68k
...@@ -46,8 +47,6 @@ struct SampleSizeAvailable_arg { ...@@ -46,8 +47,6 @@ struct SampleSizeAvailable_arg {
#pragma options align=reset #pragma options align=reset
extern PyObject *ResObj_New(Handle);
static PyObject *ErrorObject; static PyObject *ErrorObject;
......
...@@ -5,42 +5,8 @@ ...@@ -5,42 +5,8 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Sound.h> #include <Sound.h>
......
...@@ -5,56 +5,19 @@ ...@@ -5,56 +5,19 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <TextEdit.h> #include <TextEdit.h>
#define as_TE(h) ((TEHandle)h) #define as_TE(h) ((TEHandle)h)
#define as_Resource(teh) ((Handle)teh) #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 ** Parse/generate TextStyle records
*/ */
PyObject *TextStyle_New(itself) static PyObject *
TextStyle_New(itself)
TextStylePtr itself; TextStylePtr itself;
{ {
...@@ -62,6 +25,7 @@ PyObject *TextStyle_New(itself) ...@@ -62,6 +25,7 @@ PyObject *TextStyle_New(itself)
&itself->tsColor); &itself->tsColor);
} }
static int
TextStyle_Convert(v, p_itself) TextStyle_Convert(v, p_itself)
PyObject *v; PyObject *v;
TextStylePtr p_itself; TextStylePtr p_itself;
......
...@@ -37,14 +37,11 @@ includestuff = includestuff + """ ...@@ -37,14 +37,11 @@ includestuff = includestuff + """
#define as_TE(h) ((TEHandle)h) #define as_TE(h) ((TEHandle)h)
#define as_Resource(teh) ((Handle)teh) #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 ** Parse/generate TextStyle records
*/ */
PyObject *TextStyle_New(itself) static PyObject *
TextStyle_New(itself)
TextStylePtr itself; TextStylePtr itself;
{ {
...@@ -52,6 +49,7 @@ PyObject *TextStyle_New(itself) ...@@ -52,6 +49,7 @@ PyObject *TextStyle_New(itself)
&itself->tsColor); &itself->tsColor);
} }
static int
TextStyle_Convert(v, p_itself) TextStyle_Convert(v, p_itself)
PyObject *v; PyObject *v;
TextStylePtr p_itself; TextStylePtr p_itself;
......
...@@ -5,42 +5,8 @@ ...@@ -5,42 +5,8 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <WASTE.h> #include <WASTE.h>
#include <WEObjectHandlers.h> #include <WEObjectHandlers.h>
...@@ -381,6 +347,12 @@ static PyObject *WEOObj_getattr(self, name) ...@@ -381,6 +347,12 @@ static PyObject *WEOObj_getattr(self, name)
#define WEOObj_setattr NULL #define WEOObj_setattr NULL
#define WEOObj_compare NULL
#define WEOObj_repr NULL
#define WEOObj_hash NULL
PyTypeObject WEO_Type = { PyTypeObject WEO_Type = {
PyObject_HEAD_INIT(&PyType_Type) PyObject_HEAD_INIT(&PyType_Type)
0, /*ob_size*/ 0, /*ob_size*/
...@@ -392,6 +364,12 @@ PyTypeObject WEO_Type = { ...@@ -392,6 +364,12 @@ PyTypeObject WEO_Type = {
0, /*tp_print*/ 0, /*tp_print*/
(getattrfunc) WEOObj_getattr, /*tp_getattr*/ (getattrfunc) WEOObj_getattr, /*tp_getattr*/
(setattrfunc) WEOObj_setattr, /*tp_setattr*/ (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 ----------------------- */ /* ---------------------- End object type WEO ----------------------- */
...@@ -682,7 +660,7 @@ static PyObject *wasteObj_WEGetClickCount(_self, _args) ...@@ -682,7 +660,7 @@ static PyObject *wasteObj_WEGetClickCount(_self, _args)
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_rv = WEGetClickCount(_self->ob_itself); _rv = WEGetClickCount(_self->ob_itself);
_res = Py_BuildValue("h", _res = Py_BuildValue("H",
_rv); _rv);
return _res; return _res;
} }
...@@ -746,13 +724,13 @@ static PyObject *wasteObj_WEContinuousStyle(_self, _args) ...@@ -746,13 +724,13 @@ static PyObject *wasteObj_WEContinuousStyle(_self, _args)
Boolean _rv; Boolean _rv;
WEStyleMode mode; WEStyleMode mode;
TextStyle ts; TextStyle ts;
if (!PyArg_ParseTuple(_args, "h", if (!PyArg_ParseTuple(_args, "H",
&mode)) &mode))
return NULL; return NULL;
_rv = WEContinuousStyle(&mode, _rv = WEContinuousStyle(&mode,
&ts, &ts,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("bhO&", _res = Py_BuildValue("bHO&",
_rv, _rv,
mode, mode,
TextStyle_New, &ts); TextStyle_New, &ts);
...@@ -1096,7 +1074,7 @@ static PyObject *wasteObj_WEKey(_self, _args) ...@@ -1096,7 +1074,7 @@ static PyObject *wasteObj_WEKey(_self, _args)
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 key; SInt16 key;
EventModifiers modifiers; EventModifiers modifiers;
if (!PyArg_ParseTuple(_args, "hh", if (!PyArg_ParseTuple(_args, "hH",
&key, &key,
&modifiers)) &modifiers))
return NULL; return NULL;
...@@ -1116,7 +1094,7 @@ static PyObject *wasteObj_WEClick(_self, _args) ...@@ -1116,7 +1094,7 @@ static PyObject *wasteObj_WEClick(_self, _args)
Point hitPt; Point hitPt;
EventModifiers modifiers; EventModifiers modifiers;
UInt32 clickTime; UInt32 clickTime;
if (!PyArg_ParseTuple(_args, "O&hl", if (!PyArg_ParseTuple(_args, "O&Hl",
PyMac_GetPoint, &hitPt, PyMac_GetPoint, &hitPt,
&modifiers, &modifiers,
&clickTime)) &clickTime))
...@@ -1216,7 +1194,7 @@ static PyObject *wasteObj_WESetStyle(_self, _args) ...@@ -1216,7 +1194,7 @@ static PyObject *wasteObj_WESetStyle(_self, _args)
OSErr _err; OSErr _err;
WEStyleMode mode; WEStyleMode mode;
TextStyle ts; TextStyle ts;
if (!PyArg_ParseTuple(_args, "hO&", if (!PyArg_ParseTuple(_args, "HO&",
&mode, &mode,
TextStyle_Convert, &ts)) TextStyle_Convert, &ts))
return NULL; return NULL;
...@@ -1889,6 +1867,12 @@ static PyObject *wasteObj_getattr(self, name) ...@@ -1889,6 +1867,12 @@ static PyObject *wasteObj_getattr(self, name)
#define wasteObj_setattr NULL #define wasteObj_setattr NULL
#define wasteObj_compare NULL
#define wasteObj_repr NULL
#define wasteObj_hash NULL
PyTypeObject waste_Type = { PyTypeObject waste_Type = {
PyObject_HEAD_INIT(&PyType_Type) PyObject_HEAD_INIT(&PyType_Type)
0, /*ob_size*/ 0, /*ob_size*/
...@@ -1900,6 +1884,12 @@ PyTypeObject waste_Type = { ...@@ -1900,6 +1884,12 @@ PyTypeObject waste_Type = {
0, /*tp_print*/ 0, /*tp_print*/
(getattrfunc) wasteObj_getattr, /*tp_getattr*/ (getattrfunc) wasteObj_getattr, /*tp_getattr*/
(setattrfunc) wasteObj_setattr, /*tp_setattr*/ (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 ---------------------- */ /* --------------------- End object type waste ---------------------- */
......
...@@ -5,51 +5,11 @@ ...@@ -5,51 +5,11 @@
#define SystemSevenOrLater 1
#include "macglue.h" #include "macglue.h"
#include <Memory.h> #include "pymactoolbox.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 <Windows.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; static PyObject *Win_Error;
/* ----------------------- Object type Window ----------------------- */ /* ----------------------- Object type Window ----------------------- */
......
...@@ -49,12 +49,6 @@ PropertyTag = OSTypeType("PropertyTag") ...@@ -49,12 +49,6 @@ PropertyTag = OSTypeType("PropertyTag")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #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 + """ finalstuff = finalstuff + """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment