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.
This commit is contained in:
Jack Jansen 2000-07-14 22:16:45 +00:00
parent 41e25cc317
commit 9d8b96c850
45 changed files with 244 additions and 916 deletions

View file

@ -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

View 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"
;

View 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;

View 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;
/* ----------------------------------------------------- */

View 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) {

View file

@ -131,7 +131,7 @@ def passInput(self, name):
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) {

View 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)

View file

@ -69,12 +69,6 @@
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):

View 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;

View file

@ -26,7 +26,8 @@
/*
** Parse/generate ComponentDescriptor records
*/
PyObject *CmpDesc_New(itself)
static PyObject *
CmpDesc_New(itself)
ComponentDescription *itself;
{
@ -37,6 +38,7 @@
itself->componentFlags, itself->componentFlagsMask);
}
static int
CmpDesc_Convert(v, p_itself)
PyObject *v;
ComponentDescription *p_itself;

View 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;

View file

@ -84,6 +84,15 @@ def makegreylist(self):
('#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):

View file

@ -44,6 +44,8 @@
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 @@
#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 @@
}
#endif
static int
ControlFontStyle_Convert(v, itself)
PyObject *v;
ControlFontStyleRec *itself;
@ -99,7 +98,8 @@
"""
finalstuff = finalstuff + """
PyObject *CtlObj_NewUnmanaged(itself)
static PyObject *
CtlObj_NewUnmanaged(itself)
ControlHandle itself;
{
ControlObject *it;
@ -111,7 +111,7 @@
return (PyObject *)it;
}
PyObject *
static PyObject *
CtlObj_WhichControl(ControlHandle c)
{
PyObject *it;

View 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)

View file

@ -35,13 +35,9 @@
#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)

View 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;

View file

@ -56,16 +56,6 @@
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;

View 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)

View file

@ -36,8 +36,6 @@
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
"""
class MyObjectDefinition(GlobalObjectDefinition):

View 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;

View file

@ -24,7 +24,8 @@
/*
** Parse/generate ComponentDescriptor records
*/
PyObject *FMRec_New(itself)
static PyObject *
FMRec_New(itself)
FMetricRec *itself;
{
@ -38,6 +39,7 @@
#if 0
/* Not needed... */
static int
FMRec_Convert(v, p_itself)
PyObject *v;
FMetricRec *p_itself;

View 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)

View file

@ -38,8 +38,6 @@
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
"""
class MyObjectDefinition(GlobalObjectDefinition):

View 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)

View file

@ -47,12 +47,6 @@
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):

View 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>

View 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)

View 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)

View file

@ -32,8 +32,6 @@
#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)
"""

View 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
*/

View file

@ -58,8 +58,6 @@ def getargsCheck(self, name):
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/*
** Parse/generate RGB records
*/

View 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;

View file

@ -38,8 +38,6 @@
#define as_GrafPtr(gworld) ((GrafPtr)(gworld))
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
"""

View 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)

View file

@ -26,25 +26,6 @@
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) \

View 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)

View file

@ -24,8 +24,6 @@ class ResMethod(ResMixIn, MethodGenerator): pass
#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)

View file

@ -13,44 +13,15 @@
#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;
{

View 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;

View 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>

View 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;

View file

@ -37,14 +37,11 @@
#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 @@
&itself->tsColor);
}
static int
TextStyle_Convert(v, p_itself)
PyObject *v;
TextStylePtr p_itself;

View 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 ---------------------- */

View 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 ----------------------- */

View file

@ -49,12 +49,6 @@
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 + """