Lots more Carbon/Carbon.h includes, new UPP routine names, function prototypes. Most toolbox modules now compile, link and import in MacOSX-MachO python.

This commit is contained in:
Jack Jansen 2001-05-22 21:56:42 +00:00
parent 1129671350
commit fa77e1a1b1
41 changed files with 2230 additions and 5765 deletions

View File

@ -8,8 +8,12 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <AppleEvents.h>
#include <AEObjects.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_AEDesc_New(AEDesc *);
@ -49,8 +53,7 @@ typedef struct AEDescObject {
AEDesc ob_itself;
} AEDescObject;
PyObject *AEDesc_New(itself)
AEDesc *itself;
PyObject *AEDesc_New(AEDesc *itself)
{
AEDescObject *it;
it = PyObject_NEW(AEDescObject, &AEDesc_Type);
@ -58,9 +61,7 @@ PyObject *AEDesc_New(itself)
it->ob_itself = *itself;
return (PyObject *)it;
}
AEDesc_Convert(v, p_itself)
PyObject *v;
AEDesc *p_itself;
AEDesc_Convert(PyObject *v, AEDesc *p_itself)
{
if (!AEDesc_Check(v))
{
@ -71,16 +72,13 @@ AEDesc_Convert(v, p_itself)
return 1;
}
static void AEDesc_dealloc(self)
AEDescObject *self;
static void AEDesc_dealloc(AEDescObject *self)
{
AEDisposeDesc(&self->ob_itself);
PyMem_DEL(self);
}
static PyObject *AEDesc_AECoerceDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AECoerceDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -98,9 +96,7 @@ static PyObject *AEDesc_AECoerceDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AEDuplicateDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEDuplicateDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -115,9 +111,7 @@ static PyObject *AEDesc_AEDuplicateDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AECountItems(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AECountItems(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -132,9 +126,7 @@ static PyObject *AEDesc_AECountItems(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutPtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutPtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -160,9 +152,7 @@ static PyObject *AEDesc_AEPutPtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -181,9 +171,7 @@ static PyObject *AEDesc_AEPutDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetNthPtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetNthPtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -221,9 +209,7 @@ static PyObject *AEDesc_AEGetNthPtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetNthDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetNthDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -247,9 +233,7 @@ static PyObject *AEDesc_AEGetNthDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AESizeOfNthItem(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESizeOfNthItem(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -270,9 +254,7 @@ static PyObject *AEDesc_AESizeOfNthItem(_self, _args)
return _res;
}
static PyObject *AEDesc_AEDeleteItem(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEDeleteItem(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -288,9 +270,7 @@ static PyObject *AEDesc_AEDeleteItem(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutParamPtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutParamPtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -316,9 +296,7 @@ static PyObject *AEDesc_AEPutParamPtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutParamDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutParamDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -337,9 +315,7 @@ static PyObject *AEDesc_AEPutParamDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetParamPtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetParamPtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -374,9 +350,7 @@ static PyObject *AEDesc_AEGetParamPtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetParamDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetParamDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -397,9 +371,7 @@ static PyObject *AEDesc_AEGetParamDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AESizeOfParam(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESizeOfParam(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -420,9 +392,7 @@ static PyObject *AEDesc_AESizeOfParam(_self, _args)
return _res;
}
static PyObject *AEDesc_AEDeleteParam(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEDeleteParam(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -438,9 +408,7 @@ static PyObject *AEDesc_AEDeleteParam(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetAttributePtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetAttributePtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -475,9 +443,7 @@ static PyObject *AEDesc_AEGetAttributePtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetAttributeDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetAttributeDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -498,9 +464,7 @@ static PyObject *AEDesc_AEGetAttributeDesc(_self, _args)
return _res;
}
static PyObject *AEDesc_AESizeOfAttribute(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESizeOfAttribute(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -521,9 +485,7 @@ static PyObject *AEDesc_AESizeOfAttribute(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutAttributePtr(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutAttributePtr(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -549,9 +511,7 @@ static PyObject *AEDesc_AEPutAttributePtr(_self, _args)
return _res;
}
static PyObject *AEDesc_AEPutAttributeDesc(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEPutAttributeDesc(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -572,9 +532,7 @@ static PyObject *AEDesc_AEPutAttributeDesc(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *AEDesc_AEGetDescDataSize(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Size _rv;
@ -587,9 +545,7 @@ static PyObject *AEDesc_AEGetDescDataSize(_self, _args)
}
#endif
static PyObject *AEDesc_AESend(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESend(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -615,9 +571,7 @@ static PyObject *AEDesc_AESend(_self, _args)
return _res;
}
static PyObject *AEDesc_AEResetTimer(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEResetTimer(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -630,9 +584,7 @@ static PyObject *AEDesc_AEResetTimer(_self, _args)
return _res;
}
static PyObject *AEDesc_AESuspendTheCurrentEvent(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESuspendTheCurrentEvent(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -645,9 +597,7 @@ static PyObject *AEDesc_AESuspendTheCurrentEvent(_self, _args)
return _res;
}
static PyObject *AEDesc_AEResumeTheCurrentEvent(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEResumeTheCurrentEvent(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -668,9 +618,7 @@ static PyObject *AEDesc_AEResumeTheCurrentEvent(_self, _args)
return _res;
}
static PyObject *AEDesc_AEGetTheCurrentEvent(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEGetTheCurrentEvent(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -683,9 +631,7 @@ static PyObject *AEDesc_AEGetTheCurrentEvent(_self, _args)
return _res;
}
static PyObject *AEDesc_AESetTheCurrentEvent(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AESetTheCurrentEvent(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -698,9 +644,7 @@ static PyObject *AEDesc_AESetTheCurrentEvent(_self, _args)
return _res;
}
static PyObject *AEDesc_AEResolve(_self, _args)
AEDescObject *_self;
PyObject *_args;
static PyObject *AEDesc_AEResolve(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -783,9 +727,7 @@ static PyMethodDef AEDesc_methods[] = {
PyMethodChain AEDesc_chain = { AEDesc_methods, NULL };
static PyObject *AEDesc_getattr(self, name)
AEDescObject *self;
char *name;
static PyObject *AEDesc_getattr(AEDescObject *self, char *name)
{
if (strcmp(name, "type") == 0)
@ -852,9 +794,7 @@ PyTypeObject AEDesc_Type = {
/* --------------------- End object type AEDesc --------------------- */
static PyObject *AE_AECoercePtr(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AECoercePtr(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -881,9 +821,7 @@ static PyObject *AE_AECoercePtr(_self, _args)
return _res;
}
static PyObject *AE_AECreateDesc(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AECreateDesc(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -907,9 +845,7 @@ static PyObject *AE_AECreateDesc(_self, _args)
return _res;
}
static PyObject *AE_AECreateList(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AECreateList(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -933,9 +869,7 @@ static PyObject *AE_AECreateList(_self, _args)
return _res;
}
static PyObject *AE_AECreateAppleEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AECreateAppleEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -966,9 +900,7 @@ static PyObject *AE_AECreateAppleEvent(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *AE_AEReplaceDescData(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -993,9 +925,7 @@ static PyObject *AE_AEReplaceDescData(_self, _args)
}
#endif
static PyObject *AE_AEProcessAppleEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEProcessAppleEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1010,9 +940,7 @@ static PyObject *AE_AEProcessAppleEvent(_self, _args)
return _res;
}
static PyObject *AE_AEGetInteractionAllowed(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEGetInteractionAllowed(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1026,9 +954,7 @@ static PyObject *AE_AEGetInteractionAllowed(_self, _args)
return _res;
}
static PyObject *AE_AESetInteractionAllowed(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AESetInteractionAllowed(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1043,9 +969,7 @@ static PyObject *AE_AESetInteractionAllowed(_self, _args)
return _res;
}
static PyObject *AE_AEInteractWithUser(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEInteractWithUser(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1062,9 +986,7 @@ static PyObject *AE_AEInteractWithUser(_self, _args)
return _res;
}
static PyObject *AE_AEInstallEventHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEInstallEventHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1088,9 +1010,7 @@ static PyObject *AE_AEInstallEventHandler(_self, _args)
return _res;
}
static PyObject *AE_AERemoveEventHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AERemoveEventHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1110,9 +1030,7 @@ static PyObject *AE_AERemoveEventHandler(_self, _args)
return _res;
}
static PyObject *AE_AEGetEventHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEGetEventHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1135,9 +1053,7 @@ static PyObject *AE_AEGetEventHandler(_self, _args)
return _res;
}
static PyObject *AE_AEInstallSpecialHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEInstallSpecialHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1154,9 +1070,7 @@ static PyObject *AE_AEInstallSpecialHandler(_self, _args)
return _res;
}
static PyObject *AE_AERemoveSpecialHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AERemoveSpecialHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1173,9 +1087,7 @@ static PyObject *AE_AERemoveSpecialHandler(_self, _args)
return _res;
}
static PyObject *AE_AEManagerInfo(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEManagerInfo(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1192,9 +1104,7 @@ static PyObject *AE_AEManagerInfo(_self, _args)
return _res;
}
static PyObject *AE_AEObjectInit(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEObjectInit(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1207,9 +1117,7 @@ static PyObject *AE_AEObjectInit(_self, _args)
return _res;
}
static PyObject *AE_AEDisposeToken(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AEDisposeToken(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1223,9 +1131,7 @@ static PyObject *AE_AEDisposeToken(_self, _args)
return _res;
}
static PyObject *AE_AECallObjectAccessor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *AE_AECallObjectAccessor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1330,17 +1236,17 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
}
void initAE()
void initAE(void)
{
PyObject *m;
PyObject *d;
upp_AEIdleProc = NewAEIdleProc(AEIdleProc);
upp_GenericEventHandler = NewAEEventHandlerProc(GenericEventHandler);
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc_Convert);
upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
m = Py_InitModule("AE", AE_methods);

View File

@ -82,8 +82,12 @@ AEMethod = OSErrMethodGenerator
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <AppleEvents.h>
#include <AEObjects.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_AEDesc_New(AEDesc *);
@ -144,10 +148,10 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
"""
initstuff = initstuff + """
upp_AEIdleProc = NewAEIdleProc(AEIdleProc);
upp_GenericEventHandler = NewAEEventHandlerProc(GenericEventHandler);
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc_Convert);
upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
"""
module = MacModule('AE', 'AE', includestuff, finalstuff, initstuff)

View File

@ -8,13 +8,16 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *App_Error;
static PyObject *App_RegisterAppearanceClient(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -27,9 +30,7 @@ static PyObject *App_RegisterAppearanceClient(_self, _args)
return _res;
}
static PyObject *App_UnregisterAppearanceClient(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_UnregisterAppearanceClient(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -42,9 +43,7 @@ static PyObject *App_UnregisterAppearanceClient(_self, _args)
return _res;
}
static PyObject *App_SetThemePen(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemePen(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -65,9 +64,7 @@ static PyObject *App_SetThemePen(_self, _args)
return _res;
}
static PyObject *App_SetThemeBackground(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemeBackground(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -88,9 +85,7 @@ static PyObject *App_SetThemeBackground(_self, _args)
return _res;
}
static PyObject *App_SetThemeTextColor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemeTextColor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -111,9 +106,7 @@ static PyObject *App_SetThemeTextColor(_self, _args)
return _res;
}
static PyObject *App_SetThemeWindowBackground(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemeWindowBackground(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -134,9 +127,7 @@ static PyObject *App_SetThemeWindowBackground(_self, _args)
return _res;
}
static PyObject *App_DrawThemeWindowHeader(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeWindowHeader(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -154,9 +145,7 @@ static PyObject *App_DrawThemeWindowHeader(_self, _args)
return _res;
}
static PyObject *App_DrawThemeWindowListViewHeader(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeWindowListViewHeader(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -174,9 +163,7 @@ static PyObject *App_DrawThemeWindowListViewHeader(_self, _args)
return _res;
}
static PyObject *App_DrawThemePlacard(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemePlacard(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -194,9 +181,7 @@ static PyObject *App_DrawThemePlacard(_self, _args)
return _res;
}
static PyObject *App_DrawThemeEditTextFrame(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeEditTextFrame(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -214,9 +199,7 @@ static PyObject *App_DrawThemeEditTextFrame(_self, _args)
return _res;
}
static PyObject *App_DrawThemeListBoxFrame(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeListBoxFrame(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -234,9 +217,7 @@ static PyObject *App_DrawThemeListBoxFrame(_self, _args)
return _res;
}
static PyObject *App_DrawThemeFocusRect(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeFocusRect(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -254,9 +235,7 @@ static PyObject *App_DrawThemeFocusRect(_self, _args)
return _res;
}
static PyObject *App_DrawThemePrimaryGroup(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemePrimaryGroup(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -274,9 +253,7 @@ static PyObject *App_DrawThemePrimaryGroup(_self, _args)
return _res;
}
static PyObject *App_DrawThemeSecondaryGroup(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeSecondaryGroup(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -294,9 +271,7 @@ static PyObject *App_DrawThemeSecondaryGroup(_self, _args)
return _res;
}
static PyObject *App_DrawThemeSeparator(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeSeparator(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -314,9 +289,7 @@ static PyObject *App_DrawThemeSeparator(_self, _args)
return _res;
}
static PyObject *App_DrawThemeModelessDialogFrame(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeModelessDialogFrame(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -334,9 +307,7 @@ static PyObject *App_DrawThemeModelessDialogFrame(_self, _args)
return _res;
}
static PyObject *App_DrawThemeGenericWell(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeGenericWell(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -357,9 +328,7 @@ static PyObject *App_DrawThemeGenericWell(_self, _args)
return _res;
}
static PyObject *App_DrawThemeFocusRegion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeFocusRegion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -375,9 +344,7 @@ static PyObject *App_DrawThemeFocusRegion(_self, _args)
return _res;
}
static PyObject *App_IsThemeInColor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_IsThemeInColor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -394,9 +361,7 @@ static PyObject *App_IsThemeInColor(_self, _args)
return _res;
}
static PyObject *App_GetThemeAccentColors(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeAccentColors(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -410,9 +375,7 @@ static PyObject *App_GetThemeAccentColors(_self, _args)
return _res;
}
static PyObject *App_DrawThemeMenuBarBackground(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeMenuBarBackground(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -433,9 +396,7 @@ static PyObject *App_DrawThemeMenuBarBackground(_self, _args)
return _res;
}
static PyObject *App_GetThemeMenuBarHeight(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMenuBarHeight(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -449,9 +410,7 @@ static PyObject *App_GetThemeMenuBarHeight(_self, _args)
return _res;
}
static PyObject *App_DrawThemeMenuBackground(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeMenuBackground(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -469,9 +428,7 @@ static PyObject *App_DrawThemeMenuBackground(_self, _args)
return _res;
}
static PyObject *App_GetThemeMenuBackgroundRegion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMenuBackgroundRegion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -490,9 +447,7 @@ static PyObject *App_GetThemeMenuBackgroundRegion(_self, _args)
return _res;
}
static PyObject *App_DrawThemeMenuSeparator(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeMenuSeparator(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -507,9 +462,7 @@ static PyObject *App_DrawThemeMenuSeparator(_self, _args)
return _res;
}
static PyObject *App_GetThemeMenuSeparatorHeight(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMenuSeparatorHeight(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -523,9 +476,7 @@ static PyObject *App_GetThemeMenuSeparatorHeight(_self, _args)
return _res;
}
static PyObject *App_GetThemeMenuItemExtra(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMenuItemExtra(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -545,9 +496,7 @@ static PyObject *App_GetThemeMenuItemExtra(_self, _args)
return _res;
}
static PyObject *App_GetThemeMenuTitleExtra(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMenuTitleExtra(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -564,9 +513,7 @@ static PyObject *App_GetThemeMenuTitleExtra(_self, _args)
return _res;
}
static PyObject *App_DrawThemeTabPane(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeTabPane(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -584,9 +531,7 @@ static PyObject *App_DrawThemeTabPane(_self, _args)
return _res;
}
static PyObject *App_GetThemeTabRegion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeTabRegion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -608,9 +553,7 @@ static PyObject *App_GetThemeTabRegion(_self, _args)
return _res;
}
static PyObject *App_SetThemeCursor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemeCursor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -625,9 +568,7 @@ static PyObject *App_SetThemeCursor(_self, _args)
return _res;
}
static PyObject *App_SetAnimatedThemeCursor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetAnimatedThemeCursor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -645,9 +586,7 @@ static PyObject *App_SetAnimatedThemeCursor(_self, _args)
return _res;
}
static PyObject *App_GetThemeScrollBarThumbStyle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeScrollBarThumbStyle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -661,9 +600,7 @@ static PyObject *App_GetThemeScrollBarThumbStyle(_self, _args)
return _res;
}
static PyObject *App_GetThemeScrollBarArrowStyle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeScrollBarArrowStyle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -677,9 +614,7 @@ static PyObject *App_GetThemeScrollBarArrowStyle(_self, _args)
return _res;
}
static PyObject *App_GetThemeCheckBoxStyle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeCheckBoxStyle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -693,9 +628,7 @@ static PyObject *App_GetThemeCheckBoxStyle(_self, _args)
return _res;
}
static PyObject *App_UseThemeFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -713,9 +646,7 @@ static PyObject *App_UseThemeFont(_self, _args)
return _res;
}
static PyObject *App_DrawThemeScrollBarArrows(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -741,9 +672,7 @@ static PyObject *App_DrawThemeScrollBarArrows(_self, _args)
return _res;
}
static PyObject *App_GetThemeScrollBarTrackRect(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeScrollBarTrackRect(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -769,9 +698,7 @@ static PyObject *App_GetThemeScrollBarTrackRect(_self, _args)
return _res;
}
static PyObject *App_HitTestThemeScrollBarArrows(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_HitTestThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -803,9 +730,7 @@ static PyObject *App_HitTestThemeScrollBarArrows(_self, _args)
return _res;
}
static PyObject *App_DrawThemeScrollBarDelimiters(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -829,9 +754,7 @@ static PyObject *App_DrawThemeScrollBarDelimiters(_self, _args)
return _res;
}
static PyObject *App_PlayThemeSound(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -846,9 +769,7 @@ static PyObject *App_PlayThemeSound(_self, _args)
return _res;
}
static PyObject *App_BeginThemeDragSound(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_BeginThemeDragSound(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -863,9 +784,7 @@ static PyObject *App_BeginThemeDragSound(_self, _args)
return _res;
}
static PyObject *App_EndThemeDragSound(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_EndThemeDragSound(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -878,9 +797,7 @@ static PyObject *App_EndThemeDragSound(_self, _args)
return _res;
}
static PyObject *App_DrawThemeTickMark(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -898,9 +815,7 @@ static PyObject *App_DrawThemeTickMark(_self, _args)
return _res;
}
static PyObject *App_DrawThemeStandaloneGrowBox(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -924,9 +839,7 @@ static PyObject *App_DrawThemeStandaloneGrowBox(_self, _args)
return _res;
}
static PyObject *App_DrawThemeStandaloneNoGrowBox(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_DrawThemeStandaloneNoGrowBox(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -950,9 +863,7 @@ static PyObject *App_DrawThemeStandaloneNoGrowBox(_self, _args)
return _res;
}
static PyObject *App_GetThemeStandaloneGrowBoxBounds(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeStandaloneGrowBoxBounds(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -975,9 +886,7 @@ static PyObject *App_GetThemeStandaloneGrowBoxBounds(_self, _args)
return _res;
}
static PyObject *App_NormalizeThemeDrawingState(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -990,9 +899,7 @@ static PyObject *App_NormalizeThemeDrawingState(_self, _args)
return _res;
}
static PyObject *App_ApplyThemeBackground(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -1019,9 +926,7 @@ static PyObject *App_ApplyThemeBackground(_self, _args)
return _res;
}
static PyObject *App_SetThemeTextColorForWindow(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_SetThemeTextColorForWindow(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -1045,9 +950,7 @@ static PyObject *App_SetThemeTextColorForWindow(_self, _args)
return _res;
}
static PyObject *App_IsValidAppearanceFileType(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_IsValidAppearanceFileType(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1061,9 +964,7 @@ static PyObject *App_IsValidAppearanceFileType(_self, _args)
return _res;
}
static PyObject *App_GetThemeBrushAsColor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeBrushAsColor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -1086,9 +987,7 @@ static PyObject *App_GetThemeBrushAsColor(_self, _args)
return _res;
}
static PyObject *App_GetThemeTextColor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -1113,9 +1012,7 @@ static PyObject *App_GetThemeTextColor(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeMetric(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -1251,7 +1148,7 @@ static PyMethodDef App_methods[] = {
void initApp()
void initApp(void)
{
PyObject *m;
PyObject *d;

View File

@ -69,7 +69,12 @@ ThemeMetric = Type("ThemeMetric", "l")
RGBColor = OpaqueType("RGBColor", "QdRGB")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif
"""
## class MyObjectDefinition(GlobalObjectDefinition):

View File

@ -8,7 +8,12 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Components.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component);
extern int _CmpObj_Convert(PyObject *, Component *);
@ -25,8 +30,7 @@ extern int _CmpInstObj_Convert(PyObject *, ComponentInstance *);
** Parse/generate ComponentDescriptor records
*/
static PyObject *
CmpDesc_New(itself)
ComponentDescription *itself;
CmpDesc_New(ComponentDescription *itself)
{
return Py_BuildValue("O&O&O&ll",
@ -37,9 +41,7 @@ CmpDesc_New(itself)
}
static int
CmpDesc_Convert(v, p_itself)
PyObject *v;
ComponentDescription *p_itself;
CmpDesc_Convert(PyObject *v, ComponentDescription *p_itself)
{
return PyArg_ParseTuple(v, "O&O&O&ll",
PyMac_GetOSType, &p_itself->componentType,
@ -62,8 +64,7 @@ typedef struct ComponentInstanceObject {
ComponentInstance ob_itself;
} ComponentInstanceObject;
PyObject *CmpInstObj_New(itself)
ComponentInstance itself;
PyObject *CmpInstObj_New(ComponentInstance itself)
{
ComponentInstanceObject *it;
if (itself == NULL) {
@ -75,9 +76,7 @@ PyObject *CmpInstObj_New(itself)
it->ob_itself = itself;
return (PyObject *)it;
}
CmpInstObj_Convert(v, p_itself)
PyObject *v;
ComponentInstance *p_itself;
CmpInstObj_Convert(PyObject *v, ComponentInstance *p_itself)
{
if (!CmpInstObj_Check(v))
{
@ -88,16 +87,13 @@ CmpInstObj_Convert(v, p_itself)
return 1;
}
static void CmpInstObj_dealloc(self)
ComponentInstanceObject *self;
static void CmpInstObj_dealloc(ComponentInstanceObject *self)
{
/* Cleanup of self->ob_itself goes here */
PyMem_DEL(self);
}
static PyObject *CmpInstObj_CloseComponent(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_CloseComponent(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -110,9 +106,7 @@ static PyObject *CmpInstObj_CloseComponent(_self, _args)
return _res;
}
static PyObject *CmpInstObj_GetComponentInstanceError(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_GetComponentInstanceError(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -125,9 +119,7 @@ static PyObject *CmpInstObj_GetComponentInstanceError(_self, _args)
return _res;
}
static PyObject *CmpInstObj_SetComponentInstanceError(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_SetComponentInstanceError(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr theError;
@ -141,9 +133,7 @@ static PyObject *CmpInstObj_SetComponentInstanceError(_self, _args)
return _res;
}
static PyObject *CmpInstObj_GetComponentInstanceStorage(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_GetComponentInstanceStorage(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -155,9 +145,7 @@ static PyObject *CmpInstObj_GetComponentInstanceStorage(_self, _args)
return _res;
}
static PyObject *CmpInstObj_SetComponentInstanceStorage(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_SetComponentInstanceStorage(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle theStorage;
@ -173,9 +161,7 @@ static PyObject *CmpInstObj_SetComponentInstanceStorage(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *CmpInstObj_GetComponentInstanceA5(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_GetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -190,9 +176,7 @@ static PyObject *CmpInstObj_GetComponentInstanceA5(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *CmpInstObj_SetComponentInstanceA5(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_SetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long theA5;
@ -207,9 +191,7 @@ static PyObject *CmpInstObj_SetComponentInstanceA5(_self, _args)
}
#endif
static PyObject *CmpInstObj_ComponentFunctionImplemented(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_ComponentFunctionImplemented(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -224,9 +206,7 @@ static PyObject *CmpInstObj_ComponentFunctionImplemented(_self, _args)
return _res;
}
static PyObject *CmpInstObj_GetComponentVersion(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_GetComponentVersion(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -238,9 +218,7 @@ static PyObject *CmpInstObj_GetComponentVersion(_self, _args)
return _res;
}
static PyObject *CmpInstObj_ComponentSetTarget(_self, _args)
ComponentInstanceObject *_self;
PyObject *_args;
static PyObject *CmpInstObj_ComponentSetTarget(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -287,9 +265,7 @@ static PyMethodDef CmpInstObj_methods[] = {
PyMethodChain CmpInstObj_chain = { CmpInstObj_methods, NULL };
static PyObject *CmpInstObj_getattr(self, name)
ComponentInstanceObject *self;
char *name;
static PyObject *CmpInstObj_getattr(ComponentInstanceObject *self, char *name)
{
return Py_FindMethodInChain(&CmpInstObj_chain, (PyObject *)self, name);
}
@ -335,8 +311,7 @@ typedef struct ComponentObject {
Component ob_itself;
} ComponentObject;
PyObject *CmpObj_New(itself)
Component itself;
PyObject *CmpObj_New(Component itself)
{
ComponentObject *it;
if (itself == NULL) {
@ -349,9 +324,7 @@ PyObject *CmpObj_New(itself)
it->ob_itself = itself;
return (PyObject *)it;
}
CmpObj_Convert(v, p_itself)
PyObject *v;
Component *p_itself;
CmpObj_Convert(PyObject *v, Component *p_itself)
{
if ( v == Py_None ) {
*p_itself = 0;
@ -366,16 +339,13 @@ CmpObj_Convert(v, p_itself)
return 1;
}
static void CmpObj_dealloc(self)
ComponentObject *self;
static void CmpObj_dealloc(ComponentObject *self)
{
/* Cleanup of self->ob_itself goes here */
PyMem_DEL(self);
}
static PyObject *CmpObj_UnregisterComponent(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -388,9 +358,7 @@ static PyObject *CmpObj_UnregisterComponent(_self, _args)
return _res;
}
static PyObject *CmpObj_GetComponentInfo(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_GetComponentInfo(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -414,9 +382,7 @@ static PyObject *CmpObj_GetComponentInfo(_self, _args)
return _res;
}
static PyObject *CmpObj_OpenComponent(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_OpenComponent(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ComponentInstance _rv;
@ -428,9 +394,7 @@ static PyObject *CmpObj_OpenComponent(_self, _args)
return _res;
}
static PyObject *CmpObj_GetComponentRefcon(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_GetComponentRefcon(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -442,9 +406,7 @@ static PyObject *CmpObj_GetComponentRefcon(_self, _args)
return _res;
}
static PyObject *CmpObj_SetComponentRefcon(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_SetComponentRefcon(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long theRefcon;
@ -458,9 +420,7 @@ static PyObject *CmpObj_SetComponentRefcon(_self, _args)
return _res;
}
static PyObject *CmpObj_OpenComponentResFile(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_OpenComponentResFile(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -472,9 +432,7 @@ static PyObject *CmpObj_OpenComponentResFile(_self, _args)
return _res;
}
static PyObject *CmpObj_GetComponentResource(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_GetComponentResource(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -495,9 +453,7 @@ static PyObject *CmpObj_GetComponentResource(_self, _args)
return _res;
}
static PyObject *CmpObj_GetComponentIndString(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_GetComponentIndString(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -519,9 +475,7 @@ static PyObject *CmpObj_GetComponentIndString(_self, _args)
return _res;
}
static PyObject *CmpObj_ResolveComponentAlias(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_ResolveComponentAlias(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Component _rv;
@ -533,9 +487,7 @@ static PyObject *CmpObj_ResolveComponentAlias(_self, _args)
return _res;
}
static PyObject *CmpObj_CountComponentInstances(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_CountComponentInstances(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -547,9 +499,7 @@ static PyObject *CmpObj_CountComponentInstances(_self, _args)
return _res;
}
static PyObject *CmpObj_SetDefaultComponent(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_SetDefaultComponent(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -565,9 +515,7 @@ static PyObject *CmpObj_SetDefaultComponent(_self, _args)
return _res;
}
static PyObject *CmpObj_CaptureComponent(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_CaptureComponent(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Component _rv;
@ -582,9 +530,7 @@ static PyObject *CmpObj_CaptureComponent(_self, _args)
return _res;
}
static PyObject *CmpObj_UncaptureComponent(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_UncaptureComponent(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -597,9 +543,7 @@ static PyObject *CmpObj_UncaptureComponent(_self, _args)
return _res;
}
static PyObject *CmpObj_GetComponentIconSuite(_self, _args)
ComponentObject *_self;
PyObject *_args;
static PyObject *CmpObj_GetComponentIconSuite(ComponentObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -648,9 +592,7 @@ static PyMethodDef CmpObj_methods[] = {
PyMethodChain CmpObj_chain = { CmpObj_methods, NULL };
static PyObject *CmpObj_getattr(self, name)
ComponentObject *self;
char *name;
static PyObject *CmpObj_getattr(ComponentObject *self, char *name)
{
return Py_FindMethodInChain(&CmpObj_chain, (PyObject *)self, name);
}
@ -685,9 +627,7 @@ PyTypeObject Component_Type = {
/* ------------------- End object type Component -------------------- */
static PyObject *Cm_RegisterComponentResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_RegisterComponentResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Component _rv;
@ -704,9 +644,7 @@ static PyObject *Cm_RegisterComponentResource(_self, _args)
return _res;
}
static PyObject *Cm_FindNextComponent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_FindNextComponent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Component _rv;
@ -723,9 +661,7 @@ static PyObject *Cm_FindNextComponent(_self, _args)
return _res;
}
static PyObject *Cm_CountComponents(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_CountComponents(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -739,9 +675,7 @@ static PyObject *Cm_CountComponents(_self, _args)
return _res;
}
static PyObject *Cm_GetComponentListModSeed(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_GetComponentListModSeed(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -753,9 +687,7 @@ static PyObject *Cm_GetComponentListModSeed(_self, _args)
return _res;
}
static PyObject *Cm_CloseComponentResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_CloseComponentResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -770,9 +702,7 @@ static PyObject *Cm_CloseComponentResFile(_self, _args)
return _res;
}
static PyObject *Cm_OpenDefaultComponent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_OpenDefaultComponent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ComponentInstance _rv;
@ -789,9 +719,7 @@ static PyObject *Cm_OpenDefaultComponent(_self, _args)
return _res;
}
static PyObject *Cm_RegisterComponentResourceFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Cm_RegisterComponentResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -829,17 +757,17 @@ static PyMethodDef Cm_methods[] = {
void initCm()
void initCm(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpInstObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpInstObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Component, CmpObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Component, CmpObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, CmpInstObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, CmpInstObj_Convert);
m = Py_InitModule("Cm", Cm_methods);

View File

@ -21,7 +21,12 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Components.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component);
extern int _CmpObj_Convert(PyObject *, Component *);
@ -38,8 +43,7 @@ extern int _CmpInstObj_Convert(PyObject *, ComponentInstance *);
** Parse/generate ComponentDescriptor records
*/
static PyObject *
CmpDesc_New(itself)
ComponentDescription *itself;
CmpDesc_New(ComponentDescription *itself)
{
return Py_BuildValue("O&O&O&ll",
@ -50,9 +54,7 @@ CmpDesc_New(itself)
}
static int
CmpDesc_Convert(v, p_itself)
PyObject *v;
ComponentDescription *p_itself;
CmpDesc_Convert(PyObject *v, ComponentDescription *p_itself)
{
return PyArg_ParseTuple(v, "O&O&O&ll",
PyMac_GetOSType, &p_itself->componentType,
@ -64,10 +66,10 @@ CmpDesc_Convert(v, p_itself)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpInstObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpInstObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Component, CmpObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Component, CmpObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, CmpInstObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, CmpInstObj_Convert);
"""
ComponentDescription = OpaqueType('ComponentDescription', 'CmpDesc')

File diff suppressed because it is too large Load Diff

View File

@ -49,9 +49,11 @@ DragTrackingMessage = Type("DragTrackingMessage", "h")
DragReference = OpaqueByValueType("DragReference", "DragObj")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifndef kControlCheckBoxUncheckedValue
#ifdef WITHOUT_FRAMEWORKS
#include <Controls.h>
#include <ControlDefinitions.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
@ -77,8 +79,7 @@ staticforward PyObject *CtlObj_WhichControl(ControlHandle);
*/
#if 0 /* Not needed */
static PyObject *
ControlFontStyle_New(itself)
ControlFontStyleRec *itself;
ControlFontStyle_New(ControlFontStyleRec *itself)
{
return Py_BuildValue("hhhhhhO&O&", itself->flags, itself->font,
@ -88,9 +89,7 @@ ControlFontStyle_New(itself)
#endif
static int
ControlFontStyle_Convert(v, itself)
PyObject *v;
ControlFontStyleRec *itself;
ControlFontStyle_Convert(PyObject *v, ControlFontStyleRec *itself)
{
return PyArg_ParseTuple(v, "hhhhhhO&O&", &itself->flags,
&itself->font, &itself->size, &itself->style, &itself->mode,
@ -102,17 +101,14 @@ ControlFontStyle_Convert(v, itself)
** Parse/generate ControlID records
*/
static PyObject *
PyControlID_New(itself)
ControlID *itself;
PyControlID_New(ControlID *itself)
{
return Py_BuildValue("O&l", PyMac_BuildOSType, itself->signature, itself->id);
}
static int
PyControlID_Convert(v, itself)
PyObject *v;
ControlID *itself;
PyControlID_Convert(PyObject *v, ControlID *itself)
{
return PyArg_ParseTuple(v, "O&l", PyMac_GetOSType, &itself->signature, &itself->id);
}
@ -133,8 +129,7 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *
finalstuff = finalstuff + """
static PyObject *
CtlObj_NewUnmanaged(itself)
ControlHandle itself;
CtlObj_NewUnmanaged(ControlHandle itself)
{
ControlObject *it;
if (itself == NULL) return PyMac_Error(resNotFound);
@ -166,8 +161,7 @@ CtlObj_WhichControl(ControlHandle c)
}
static int
settrackfunc(obj)
PyObject *obj;
settrackfunc(PyObject *obj)
{
if (tracker) {
PyErr_SetString(Ctl_Error, "Tracker function in use");
@ -178,7 +172,7 @@ settrackfunc(obj)
}
static void
clrtrackfunc()
clrtrackfunc(void)
{
Py_XDECREF(tracker);
tracker = 0;
@ -201,11 +195,7 @@ mytracker(ControlHandle ctl, short part)
}
static int
setcallback(myself, which, callback, uppp)
PyObject *myself;
OSType which;
PyObject *callback;
UniversalProcPtr *uppp;
setcallback(PyObject *myself, OSType which, PyObject *callback, UniversalProcPtr *uppp)
{
ControlObject *self = (ControlObject *)myself;
char keybuf[9];
@ -235,10 +225,7 @@ setcallback(myself, which, callback, uppp)
}
static PyObject *
callcallback(self, which, arglist)
ControlObject *self;
OSType which;
PyObject *arglist;
callcallback(ControlObject *self, OSType which, PyObject *arglist)
{
char keybuf[9];
PyObject *func, *rv;
@ -319,13 +306,13 @@ mytrackingproc(ControlHandle control, Point startPt, ControlActionUPP actionProc
"""
initstuff = initstuff + """
mytracker_upp = NewControlActionProc(mytracker);
mydrawproc_upp = NewControlUserPaneDrawProc(mydrawproc);
myidleproc_upp = NewControlUserPaneIdleProc(myidleproc);
myhittestproc_upp = NewControlUserPaneHitTestProc(myhittestproc);
mytrackingproc_upp = NewControlUserPaneTrackingProc(mytrackingproc);
PyMac_INIT_TOOLBOX_OBJECT_NEW(CtlObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CtlObj_Convert);
mytracker_upp = NewControlActionUPP(mytracker);
mydrawproc_upp = NewControlUserPaneDrawUPP(mydrawproc);
myidleproc_upp = NewControlUserPaneIdleUPP(myidleproc);
myhittestproc_upp = NewControlUserPaneHitTestUPP(myhittestproc);
mytrackingproc_upp = NewControlUserPaneTrackingUPP(mytrackingproc);
PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle, CtlObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert);
"""
class MyObjectDefinition(ObjectIdentityMixin, GlobalObjectDefinition):

View File

@ -8,7 +8,12 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Dialogs.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef);
extern PyObject *_DlgObj_WhichDialog(DialogRef);
@ -135,8 +140,7 @@ typedef struct DialogObject {
DialogPtr ob_itself;
} DialogObject;
PyObject *DlgObj_New(itself)
DialogPtr itself;
PyObject *DlgObj_New(DialogPtr itself)
{
DialogObject *it;
if (itself == NULL) return Py_None;
@ -146,9 +150,7 @@ PyObject *DlgObj_New(itself)
SetWRefCon(GetDialogWindow(itself), (long)it);
return (PyObject *)it;
}
DlgObj_Convert(v, p_itself)
PyObject *v;
DialogPtr *p_itself;
DlgObj_Convert(PyObject *v, DialogPtr *p_itself)
{
if (v == Py_None) { *p_itself = NULL; return 1; }
if (PyInt_Check(v)) { *p_itself = (DialogPtr)PyInt_AsLong(v);
@ -162,16 +164,13 @@ DlgObj_Convert(v, p_itself)
return 1;
}
static void DlgObj_dealloc(self)
DialogObject *self;
static void DlgObj_dealloc(DialogObject *self)
{
DisposeDialog(self->ob_itself);
PyMem_DEL(self);
}
static PyObject *DlgObj_DrawDialog(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_DrawDialog(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -182,9 +181,7 @@ static PyObject *DlgObj_DrawDialog(_self, _args)
return _res;
}
static PyObject *DlgObj_UpdateDialog(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_UpdateDialog(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
RgnHandle updateRgn;
@ -198,9 +195,7 @@ static PyObject *DlgObj_UpdateDialog(_self, _args)
return _res;
}
static PyObject *DlgObj_HideDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_HideDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex itemNo;
@ -214,9 +209,7 @@ static PyObject *DlgObj_HideDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_ShowDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_ShowDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex itemNo;
@ -230,9 +223,7 @@ static PyObject *DlgObj_ShowDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_FindDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_FindDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndexZeroBased _rv;
@ -247,9 +238,7 @@ static PyObject *DlgObj_FindDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_DialogCut(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_DialogCut(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -260,9 +249,7 @@ static PyObject *DlgObj_DialogCut(_self, _args)
return _res;
}
static PyObject *DlgObj_DialogPaste(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_DialogPaste(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -273,9 +260,7 @@ static PyObject *DlgObj_DialogPaste(_self, _args)
return _res;
}
static PyObject *DlgObj_DialogCopy(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_DialogCopy(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -286,9 +271,7 @@ static PyObject *DlgObj_DialogCopy(_self, _args)
return _res;
}
static PyObject *DlgObj_DialogDelete(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_DialogDelete(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -299,9 +282,7 @@ static PyObject *DlgObj_DialogDelete(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex itemNo;
@ -323,9 +304,7 @@ static PyObject *DlgObj_GetDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SetDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex itemNo;
@ -348,9 +327,7 @@ static PyObject *DlgObj_SetDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SelectDialogItemText(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SelectDialogItemText(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex itemNo;
@ -370,9 +347,7 @@ static PyObject *DlgObj_SelectDialogItemText(_self, _args)
return _res;
}
static PyObject *DlgObj_AppendDITL(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_AppendDITL(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle theHandle;
@ -389,9 +364,7 @@ static PyObject *DlgObj_AppendDITL(_self, _args)
return _res;
}
static PyObject *DlgObj_CountDITL(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_CountDITL(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex _rv;
@ -403,9 +376,7 @@ static PyObject *DlgObj_CountDITL(_self, _args)
return _res;
}
static PyObject *DlgObj_ShortenDITL(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_ShortenDITL(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex numberItems;
@ -421,9 +392,7 @@ static PyObject *DlgObj_ShortenDITL(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *DlgObj_InsertDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -451,9 +420,7 @@ static PyObject *DlgObj_InsertDialogItem(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *DlgObj_RemoveDialogItems(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -476,9 +443,7 @@ static PyObject *DlgObj_RemoveDialogItems(_self, _args)
}
#endif
static PyObject *DlgObj_StdFilterProc(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_StdFilterProc(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -496,9 +461,7 @@ static PyObject *DlgObj_StdFilterProc(_self, _args)
return _res;
}
static PyObject *DlgObj_SetDialogDefaultItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetDialogDefaultItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -514,9 +477,7 @@ static PyObject *DlgObj_SetDialogDefaultItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SetDialogCancelItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetDialogCancelItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -532,9 +493,7 @@ static PyObject *DlgObj_SetDialogCancelItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SetDialogTracksCursor(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetDialogTracksCursor(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -550,9 +509,7 @@ static PyObject *DlgObj_SetDialogTracksCursor(_self, _args)
return _res;
}
static PyObject *DlgObj_AutoSizeDialog(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_AutoSizeDialog(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -565,9 +522,7 @@ static PyObject *DlgObj_AutoSizeDialog(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogItemAsControl(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogItemAsControl(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -585,9 +540,7 @@ static PyObject *DlgObj_GetDialogItemAsControl(_self, _args)
return _res;
}
static PyObject *DlgObj_MoveDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_MoveDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -609,9 +562,7 @@ static PyObject *DlgObj_MoveDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SizeDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SizeDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -633,9 +584,7 @@ static PyObject *DlgObj_SizeDialogItem(_self, _args)
return _res;
}
static PyObject *DlgObj_AppendDialogItemList(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_AppendDialogItemList(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -654,9 +603,7 @@ static PyObject *DlgObj_AppendDialogItemList(_self, _args)
return _res;
}
static PyObject *DlgObj_SetDialogTimeout(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetDialogTimeout(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -675,9 +622,7 @@ static PyObject *DlgObj_SetDialogTimeout(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogTimeout(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogTimeout(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -698,9 +643,7 @@ static PyObject *DlgObj_GetDialogTimeout(_self, _args)
return _res;
}
static PyObject *DlgObj_SetModalDialogEventMask(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetModalDialogEventMask(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -716,9 +659,7 @@ static PyObject *DlgObj_SetModalDialogEventMask(_self, _args)
return _res;
}
static PyObject *DlgObj_GetModalDialogEventMask(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetModalDialogEventMask(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -733,9 +674,7 @@ static PyObject *DlgObj_GetModalDialogEventMask(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogWindow(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogWindow(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WindowPtr _rv;
@ -747,9 +686,7 @@ static PyObject *DlgObj_GetDialogWindow(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogTextEditHandle(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogTextEditHandle(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEHandle _rv;
@ -761,9 +698,7 @@ static PyObject *DlgObj_GetDialogTextEditHandle(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogDefaultItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogDefaultItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
@ -775,9 +710,7 @@ static PyObject *DlgObj_GetDialogDefaultItem(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogCancelItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogCancelItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
@ -789,9 +722,7 @@ static PyObject *DlgObj_GetDialogCancelItem(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogKeyboardFocusItem(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogKeyboardFocusItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
@ -803,9 +734,7 @@ static PyObject *DlgObj_GetDialogKeyboardFocusItem(_self, _args)
return _res;
}
static PyObject *DlgObj_SetPortDialogPort(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetPortDialogPort(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -816,9 +745,7 @@ static PyObject *DlgObj_SetPortDialogPort(_self, _args)
return _res;
}
static PyObject *DlgObj_GetDialogPort(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_GetDialogPort(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CGrafPtr _rv;
@ -832,9 +759,7 @@ static PyObject *DlgObj_GetDialogPort(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *DlgObj_SetGrafPortOfDialog(_self, _args)
DialogObject *_self;
PyObject *_args;
static PyObject *DlgObj_SetGrafPortOfDialog(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -937,17 +862,14 @@ static PyMethodDef DlgObj_methods[] = {
PyMethodChain DlgObj_chain = { DlgObj_methods, NULL };
static PyObject *DlgObj_getattr(self, name)
DialogObject *self;
char *name;
static PyObject *DlgObj_getattr(DialogObject *self, char *name)
{
return Py_FindMethodInChain(&DlgObj_chain, (PyObject *)self, name);
}
#define DlgObj_setattr NULL
static int DlgObj_compare(self, other)
DialogObject *self, *other;
static int DlgObj_compare(DialogObject *self, DialogObject *other)
{
if ( self->ob_itself > other->ob_itself ) return 1;
if ( self->ob_itself < other->ob_itself ) return -1;
@ -956,8 +878,7 @@ static int DlgObj_compare(self, other)
#define DlgObj_repr NULL
static int DlgObj_hash(self)
DialogObject *self;
static int DlgObj_hash(DialogObject *self)
{
return (int)self->ob_itself;
}
@ -984,9 +905,7 @@ PyTypeObject Dialog_Type = {
/* --------------------- End object type Dialog --------------------- */
static PyObject *Dlg_NewDialog(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_NewDialog(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogPtr _rv;
@ -1022,9 +941,7 @@ static PyObject *Dlg_NewDialog(_self, _args)
return _res;
}
static PyObject *Dlg_GetNewDialog(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_GetNewDialog(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogPtr _rv;
@ -1042,9 +959,7 @@ static PyObject *Dlg_GetNewDialog(_self, _args)
return _res;
}
static PyObject *Dlg_NewColorDialog(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_NewColorDialog(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogPtr _rv;
@ -1080,9 +995,7 @@ static PyObject *Dlg_NewColorDialog(_self, _args)
return _res;
}
static PyObject *Dlg_ModalDialog(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_ModalDialog(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyObject* modalFilter;
@ -1097,9 +1010,7 @@ static PyObject *Dlg_ModalDialog(_self, _args)
return _res;
}
static PyObject *Dlg_IsDialogEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_IsDialogEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1113,9 +1024,7 @@ static PyObject *Dlg_IsDialogEvent(_self, _args)
return _res;
}
static PyObject *Dlg_DialogSelect(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_DialogSelect(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1135,9 +1044,7 @@ static PyObject *Dlg_DialogSelect(_self, _args)
return _res;
}
static PyObject *Dlg_Alert(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_Alert(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex _rv;
@ -1154,9 +1061,7 @@ static PyObject *Dlg_Alert(_self, _args)
return _res;
}
static PyObject *Dlg_StopAlert(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_StopAlert(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex _rv;
@ -1173,9 +1078,7 @@ static PyObject *Dlg_StopAlert(_self, _args)
return _res;
}
static PyObject *Dlg_NoteAlert(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_NoteAlert(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex _rv;
@ -1192,9 +1095,7 @@ static PyObject *Dlg_NoteAlert(_self, _args)
return _res;
}
static PyObject *Dlg_CautionAlert(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_CautionAlert(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogItemIndex _rv;
@ -1211,9 +1112,7 @@ static PyObject *Dlg_CautionAlert(_self, _args)
return _res;
}
static PyObject *Dlg_ParamText(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_ParamText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Str255 param0;
@ -1235,9 +1134,7 @@ static PyObject *Dlg_ParamText(_self, _args)
return _res;
}
static PyObject *Dlg_GetDialogItemText(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_GetDialogItemText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle item;
@ -1252,9 +1149,7 @@ static PyObject *Dlg_GetDialogItemText(_self, _args)
return _res;
}
static PyObject *Dlg_SetDialogItemText(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_SetDialogItemText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle item;
@ -1270,9 +1165,7 @@ static PyObject *Dlg_SetDialogItemText(_self, _args)
return _res;
}
static PyObject *Dlg_GetAlertStage(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_GetAlertStage(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
@ -1284,9 +1177,7 @@ static PyObject *Dlg_GetAlertStage(_self, _args)
return _res;
}
static PyObject *Dlg_SetDialogFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_SetDialogFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 fontNum;
@ -1299,9 +1190,7 @@ static PyObject *Dlg_SetDialogFont(_self, _args)
return _res;
}
static PyObject *Dlg_ResetAlertStage(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_ResetAlertStage(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -1314,9 +1203,7 @@ static PyObject *Dlg_ResetAlertStage(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Dlg_GetParamText(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Str255 param0;
@ -1339,9 +1226,7 @@ static PyObject *Dlg_GetParamText(_self, _args)
}
#endif
static PyObject *Dlg_NewFeaturesDialog(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_NewFeaturesDialog(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogPtr _rv;
@ -1380,9 +1265,7 @@ static PyObject *Dlg_NewFeaturesDialog(_self, _args)
return _res;
}
static PyObject *Dlg_GetDialogFromWindow(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_GetDialogFromWindow(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DialogPtr _rv;
@ -1396,9 +1279,7 @@ static PyObject *Dlg_GetDialogFromWindow(_self, _args)
return _res;
}
static PyObject *Dlg_SetUserItemHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Dlg_SetUserItemHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -1419,7 +1300,7 @@ static PyObject *Dlg_SetUserItemHandler(_self, _args)
Py_INCREF(Py_None);
} else {
Py_INCREF(new);
_res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemProc(Dlg_UnivUserItemProc));
_res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemUPP(Dlg_UnivUserItemProc));
}
Dlg_UserItemProc_callback = new;
@ -1479,8 +1360,7 @@ static PyMethodDef Dlg_methods[] = {
/* Return the WindowPtr corresponding to a DialogObject */
#if 0
WindowPtr
DlgObj_ConvertToWindow(self)
PyObject *self;
DlgObj_ConvertToWindow(PyObject *self)
{
if ( DlgObj_Check(self) )
return GetDialogWindow(((DialogObject *)self)->ob_itself);
@ -1490,8 +1370,7 @@ DlgObj_ConvertToWindow(self)
/* Return the object corresponding to the dialog, or None */
PyObject *
DlgObj_WhichDialog(d)
DialogPtr d;
DlgObj_WhichDialog(DialogPtr d)
{
PyObject *it;
@ -1519,16 +1398,16 @@ DlgObj_WhichDialog(d)
}
void initDlg()
void initDlg(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_WhichDialog);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DlgObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_WhichDialog);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DialogPtr, DlgObj_Convert);
m = Py_InitModule("Dlg", Dlg_methods);

View File

@ -31,7 +31,12 @@ StringPtr = Str255
EventMask = Type("EventMask", "H")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Dialogs.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef);
extern PyObject *_DlgObj_WhichDialog(DialogRef);
@ -150,8 +155,7 @@ finalstuff = finalstuff + """
/* Return the WindowPtr corresponding to a DialogObject */
#if 0
WindowPtr
DlgObj_ConvertToWindow(self)
PyObject *self;
DlgObj_ConvertToWindow(PyObject *self)
{
if ( DlgObj_Check(self) )
return GetDialogWindow(((DialogObject *)self)->ob_itself);
@ -161,8 +165,7 @@ DlgObj_ConvertToWindow(self)
/* Return the object corresponding to the dialog, or None */
PyObject *
DlgObj_WhichDialog(d)
DialogPtr d;
DlgObj_WhichDialog(DialogPtr d)
{
PyObject *it;
@ -191,9 +194,9 @@ DlgObj_WhichDialog(d)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_WhichDialog);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DlgObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_WhichDialog);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DialogPtr, DlgObj_Convert);
"""
@ -219,10 +222,7 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputCompare(self):
Output()
Output("static int %s_compare(self, other)", self.prefix)
IndentLevel()
Output("%s *self, *other;", self.objecttype)
DedentLevel()
Output("static int %s_compare(%s *self, %s *other)", self.prefix, self.objecttype, self.objecttype)
OutLbrace()
Output("if ( self->ob_itself > other->ob_itself ) return 1;")
Output("if ( self->ob_itself < other->ob_itself ) return -1;")
@ -231,10 +231,7 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputHash(self):
Output()
Output("static int %s_hash(self)", self.prefix)
IndentLevel()
Output("%s *self;", self.objecttype)
DedentLevel()
Output("static int %s_hash(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("return (int)self->ob_itself;")
OutRbrace()
@ -293,7 +290,7 @@ setuseritembody = """
Py_INCREF(Py_None);
} else {
Py_INCREF(new);
_res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemProc(Dlg_UnivUserItemProc));
_res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemUPP(Dlg_UnivUserItemProc));
}
Dlg_UserItemProc_callback = new;

View File

@ -8,7 +8,11 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Drag.h>
#else
#include <Carbon/Carbon.h>
#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
@ -41,8 +45,7 @@ typedef struct DragObjObject {
PyObject *sendproc;
} DragObjObject;
PyObject *DragObj_New(itself)
DragRef itself;
PyObject *DragObj_New(DragRef itself)
{
DragObjObject *it;
if (itself == NULL) {
@ -55,9 +58,7 @@ PyObject *DragObj_New(itself)
it->sendproc = NULL;
return (PyObject *)it;
}
DragObj_Convert(v, p_itself)
PyObject *v;
DragRef *p_itself;
DragObj_Convert(PyObject *v, DragRef *p_itself)
{
if (!DragObj_Check(v))
{
@ -68,16 +69,13 @@ DragObj_Convert(v, p_itself)
return 1;
}
static void DragObj_dealloc(self)
DragObjObject *self;
static void DragObj_dealloc(DragObjObject *self)
{
Py_XDECREF(self->sendproc);
PyMem_DEL(self);
}
static PyObject *DragObj_DisposeDrag(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_DisposeDrag(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -90,9 +88,7 @@ static PyObject *DragObj_DisposeDrag(_self, _args)
return _res;
}
static PyObject *DragObj_AddDragItemFlavor(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_AddDragItemFlavor(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -121,9 +117,7 @@ static PyObject *DragObj_AddDragItemFlavor(_self, _args)
return _res;
}
static PyObject *DragObj_SetDragItemFlavorData(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_SetDragItemFlavorData(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -152,9 +146,7 @@ static PyObject *DragObj_SetDragItemFlavorData(_self, _args)
return _res;
}
static PyObject *DragObj_SetDragImage(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_SetDragImage(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -179,9 +171,7 @@ static PyObject *DragObj_SetDragImage(_self, _args)
return _res;
}
static PyObject *DragObj_ChangeDragBehaviors(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_ChangeDragBehaviors(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -200,9 +190,7 @@ static PyObject *DragObj_ChangeDragBehaviors(_self, _args)
return _res;
}
static PyObject *DragObj_TrackDrag(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_TrackDrag(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -221,9 +209,7 @@ static PyObject *DragObj_TrackDrag(_self, _args)
return _res;
}
static PyObject *DragObj_CountDragItems(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_CountDragItems(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -238,9 +224,7 @@ static PyObject *DragObj_CountDragItems(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragItemReferenceNumber(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragItemReferenceNumber(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -258,9 +242,7 @@ static PyObject *DragObj_GetDragItemReferenceNumber(_self, _args)
return _res;
}
static PyObject *DragObj_CountDragItemFlavors(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_CountDragItemFlavors(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -278,9 +260,7 @@ static PyObject *DragObj_CountDragItemFlavors(_self, _args)
return _res;
}
static PyObject *DragObj_GetFlavorType(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetFlavorType(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -301,9 +281,7 @@ static PyObject *DragObj_GetFlavorType(_self, _args)
return _res;
}
static PyObject *DragObj_GetFlavorFlags(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetFlavorFlags(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -324,9 +302,7 @@ static PyObject *DragObj_GetFlavorFlags(_self, _args)
return _res;
}
static PyObject *DragObj_GetFlavorDataSize(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetFlavorDataSize(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -347,9 +323,7 @@ static PyObject *DragObj_GetFlavorDataSize(_self, _args)
return _res;
}
static PyObject *DragObj_GetFlavorData(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetFlavorData(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -384,9 +358,7 @@ static PyObject *DragObj_GetFlavorData(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragItemBounds(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragItemBounds(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -404,9 +376,7 @@ static PyObject *DragObj_GetDragItemBounds(_self, _args)
return _res;
}
static PyObject *DragObj_SetDragItemBounds(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_SetDragItemBounds(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -425,9 +395,7 @@ static PyObject *DragObj_SetDragItemBounds(_self, _args)
return _res;
}
static PyObject *DragObj_GetDropLocation(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDropLocation(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -442,9 +410,7 @@ static PyObject *DragObj_GetDropLocation(_self, _args)
return _res;
}
static PyObject *DragObj_SetDropLocation(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_SetDropLocation(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -460,9 +426,7 @@ static PyObject *DragObj_SetDropLocation(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragAttributes(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragAttributes(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -477,9 +441,7 @@ static PyObject *DragObj_GetDragAttributes(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragMouse(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragMouse(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -497,9 +459,7 @@ static PyObject *DragObj_GetDragMouse(_self, _args)
return _res;
}
static PyObject *DragObj_SetDragMouse(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_SetDragMouse(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -515,9 +475,7 @@ static PyObject *DragObj_SetDragMouse(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragOrigin(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragOrigin(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -532,9 +490,7 @@ static PyObject *DragObj_GetDragOrigin(_self, _args)
return _res;
}
static PyObject *DragObj_GetDragModifiers(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_GetDragModifiers(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -555,9 +511,7 @@ static PyObject *DragObj_GetDragModifiers(_self, _args)
return _res;
}
static PyObject *DragObj_ShowDragHilite(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_ShowDragHilite(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -576,9 +530,7 @@ static PyObject *DragObj_ShowDragHilite(_self, _args)
return _res;
}
static PyObject *DragObj_HideDragHilite(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_HideDragHilite(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -591,9 +543,7 @@ static PyObject *DragObj_HideDragHilite(_self, _args)
return _res;
}
static PyObject *DragObj_DragPreScroll(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_DragPreScroll(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -612,9 +562,7 @@ static PyObject *DragObj_DragPreScroll(_self, _args)
return _res;
}
static PyObject *DragObj_DragPostScroll(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_DragPostScroll(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -627,9 +575,7 @@ static PyObject *DragObj_DragPostScroll(_self, _args)
return _res;
}
static PyObject *DragObj_UpdateDragHilite(_self, _args)
DragObjObject *_self;
PyObject *_args;
static PyObject *DragObj_UpdateDragHilite(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -705,9 +651,7 @@ static PyMethodDef DragObj_methods[] = {
PyMethodChain DragObj_chain = { DragObj_methods, NULL };
static PyObject *DragObj_getattr(self, name)
DragObjObject *self;
char *name;
static PyObject *DragObj_getattr(DragObjObject *self, char *name)
{
return Py_FindMethodInChain(&DragObj_chain, (PyObject *)self, name);
}
@ -742,9 +686,7 @@ PyTypeObject DragObj_Type = {
/* -------------------- End object type DragObj --------------------- */
static PyObject *Drag_NewDrag(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_NewDrag(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -758,9 +700,7 @@ static PyObject *Drag_NewDrag(_self, _args)
return _res;
}
static PyObject *Drag_GetDragHiliteColor(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_GetDragHiliteColor(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -777,9 +717,7 @@ static PyObject *Drag_GetDragHiliteColor(_self, _args)
return _res;
}
static PyObject *Drag_WaitMouseMoved(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_WaitMouseMoved(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -793,9 +731,7 @@ static PyObject *Drag_WaitMouseMoved(_self, _args)
return _res;
}
static PyObject *Drag_ZoomRects(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_ZoomRects(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -819,9 +755,7 @@ static PyObject *Drag_ZoomRects(_self, _args)
return _res;
}
static PyObject *Drag_ZoomRegion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_ZoomRegion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -845,9 +779,7 @@ static PyObject *Drag_ZoomRegion(_self, _args)
return _res;
}
static PyObject *Drag_InstallTrackingHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_InstallTrackingHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -865,9 +797,7 @@ static PyObject *Drag_InstallTrackingHandler(_self, _args)
}
static PyObject *Drag_InstallReceiveHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_InstallReceiveHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -885,9 +815,7 @@ static PyObject *Drag_InstallReceiveHandler(_self, _args)
}
static PyObject *Drag_RemoveTrackingHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_RemoveTrackingHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -903,9 +831,7 @@ static PyObject *Drag_RemoveTrackingHandler(_self, _args)
}
static PyObject *Drag_RemoveReceiveHandler(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Drag_RemoveReceiveHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -1041,15 +967,15 @@ dragglue_Drawing(xxxx
void initDrag()
void initDrag(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(DragObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DragRef, DragObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragRef, DragObj_Convert);
m = Py_InitModule("Drag", Drag_methods);
@ -1063,12 +989,12 @@ void initDrag()
if (PyDict_SetItemString(d, "DragObjType", (PyObject *)&DragObj_Type) != 0)
Py_FatalError("can't initialize DragObjType");
dragglue_TrackingHandlerUPP = NewDragTrackingHandlerProc(dragglue_TrackingHandler);
dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerProc(dragglue_ReceiveHandler);
dragglue_SendDataUPP = NewDragSendDataProc(dragglue_SendData);
dragglue_TrackingHandlerUPP = NewDragTrackingHandlerUPP(dragglue_TrackingHandler);
dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerUPP(dragglue_ReceiveHandler);
dragglue_SendDataUPP = NewDragSendDataUPP(dragglue_SendData);
#if 0
dragglue_InputUPP = NewDragInputProc(dragglue_Input);
dragglue_DrawingUPP = NewDragDrawingProc(dragglue_Drawing);
dragglue_InputUPP = NewDragInputUPP(dragglue_Input);
dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing);
#endif

View File

@ -44,7 +44,11 @@ FlavorFlags = Type("FlavorFlags", "l")
DragTrackingMessage = Type("DragTrackingMessage", "h")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Drag.h>
#else
#include <Carbon/Carbon.h>
#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
@ -162,17 +166,17 @@ dragglue_Drawing(xxxx
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(DragObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DragRef, DragObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragRef, DragObj_Convert);
"""
variablestuff = """
dragglue_TrackingHandlerUPP = NewDragTrackingHandlerProc(dragglue_TrackingHandler);
dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerProc(dragglue_ReceiveHandler);
dragglue_SendDataUPP = NewDragSendDataProc(dragglue_SendData);
dragglue_TrackingHandlerUPP = NewDragTrackingHandlerUPP(dragglue_TrackingHandler);
dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerUPP(dragglue_ReceiveHandler);
dragglue_SendDataUPP = NewDragSendDataUPP(dragglue_SendData);
#if 0
dragglue_InputUPP = NewDragInputProc(dragglue_Input);
dragglue_DrawingUPP = NewDragDrawingProc(dragglue_Drawing);
dragglue_InputUPP = NewDragInputUPP(dragglue_Input);
dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing);
#endif
"""

View File

@ -8,13 +8,16 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Evt_Error;
static PyObject *Evt_GetMouse(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point mouseLoc;
@ -26,9 +29,7 @@ static PyObject *Evt_GetMouse(_self, _args)
return _res;
}
static PyObject *Evt_Button(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_Button(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -40,9 +41,7 @@ static PyObject *Evt_Button(_self, _args)
return _res;
}
static PyObject *Evt_StillDown(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_StillDown(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -54,9 +53,7 @@ static PyObject *Evt_StillDown(_self, _args)
return _res;
}
static PyObject *Evt_WaitMouseUp(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -68,9 +65,7 @@ static PyObject *Evt_WaitMouseUp(_self, _args)
return _res;
}
static PyObject *Evt_TickCount(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
@ -82,9 +77,7 @@ static PyObject *Evt_TickCount(_self, _args)
return _res;
}
static PyObject *Evt_GetCaretTime(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetCaretTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
@ -96,9 +89,7 @@ static PyObject *Evt_GetCaretTime(_self, _args)
return _res;
}
static PyObject *Evt_GetKeys(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetKeys(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
KeyMap theKeys__out__;
@ -111,9 +102,7 @@ static PyObject *Evt_GetKeys(_self, _args)
return _res;
}
static PyObject *Evt_GetDblTime(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetDblTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
@ -125,9 +114,7 @@ static PyObject *Evt_GetDblTime(_self, _args)
return _res;
}
static PyObject *Evt_SetEventMask(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_SetEventMask(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
EventMask value;
@ -140,9 +127,7 @@ static PyObject *Evt_SetEventMask(_self, _args)
return _res;
}
static PyObject *Evt_GetNextEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetNextEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -159,9 +144,7 @@ static PyObject *Evt_GetNextEvent(_self, _args)
return _res;
}
static PyObject *Evt_EventAvail(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_EventAvail(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -178,9 +161,7 @@ static PyObject *Evt_EventAvail(_self, _args)
return _res;
}
static PyObject *Evt_PostEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -200,9 +181,7 @@ static PyObject *Evt_PostEvent(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_OSEventAvail(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -222,9 +201,7 @@ static PyObject *Evt_OSEventAvail(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_GetOSEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -242,9 +219,7 @@ static PyObject *Evt_GetOSEvent(_self, _args)
}
#endif
static PyObject *Evt_FlushEvents(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
EventMask whichMask;
@ -262,9 +237,7 @@ static PyObject *Evt_FlushEvents(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemClick(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
EventRecord theEvent;
@ -283,9 +256,7 @@ static PyObject *Evt_SystemClick(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemTask(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -299,9 +270,7 @@ static PyObject *Evt_SystemTask(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -318,9 +287,7 @@ static PyObject *Evt_SystemEvent(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Evt_GetGlobalMouse(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point globalMouse;
@ -335,9 +302,7 @@ static PyObject *Evt_GetGlobalMouse(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Evt_GetCurrentKeyModifiers(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
@ -352,9 +317,7 @@ static PyObject *Evt_GetCurrentKeyModifiers(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -367,9 +330,7 @@ static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args)
}
#endif
static PyObject *Evt_WaitNextEvent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -470,7 +431,7 @@ static PyMethodDef Evt_methods[] = {
void initEvt()
void initEvt(void)
{
PyObject *m;
PyObject *d;

View File

@ -35,7 +35,12 @@ EventMask = Type("EventMask", "H")
EventKind = Type("EventKind", "H")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
"""
class MyObjectDefinition(GlobalObjectDefinition):

View File

@ -8,14 +8,18 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/*
** Parse/generate ComponentDescriptor records
*/
static PyObject *
FMRec_New(itself)
FMetricRec *itself;
FMRec_New(FMetricRec *itself)
{
return Py_BuildValue("O&O&O&O&O&",
@ -29,9 +33,7 @@ FMRec_New(itself)
#if 0
/* Not needed... */
static int
FMRec_Convert(v, p_itself)
PyObject *v;
FMetricRec *p_itself;
FMRec_Convert(PyObject *v, FMetricRec *p_itself)
{
return PyArg_ParseTuple(v, "O&O&O&O&O&",
PyMac_GetFixed, &itself->ascent,
@ -47,9 +49,7 @@ static PyObject *Fm_Error;
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_InitFonts(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -61,9 +61,7 @@ static PyObject *Fm_InitFonts(_self, _args)
}
#endif
static PyObject *Fm_GetFontName(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short familyID;
@ -78,9 +76,7 @@ static PyObject *Fm_GetFontName(_self, _args)
return _res;
}
static PyObject *Fm_GetFNum(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetFNum(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Str255 name;
@ -95,9 +91,7 @@ static PyObject *Fm_GetFNum(_self, _args)
return _res;
}
static PyObject *Fm_RealFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -116,9 +110,7 @@ static PyObject *Fm_RealFont(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_SetFontLock(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean lockFlag;
@ -132,9 +124,7 @@ static PyObject *Fm_SetFontLock(_self, _args)
}
#endif
static PyObject *Fm_SetFScaleDisable(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean fscaleDisable;
@ -147,9 +137,7 @@ static PyObject *Fm_SetFScaleDisable(_self, _args)
return _res;
}
static PyObject *Fm_FontMetrics(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_FontMetrics(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
FMetricRec theMetrics;
@ -161,9 +149,7 @@ static PyObject *Fm_FontMetrics(_self, _args)
return _res;
}
static PyObject *Fm_SetFractEnable(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetFractEnable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean fractEnable;
@ -176,9 +162,7 @@ static PyObject *Fm_SetFractEnable(_self, _args)
return _res;
}
static PyObject *Fm_GetDefFontSize(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetDefFontSize(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -190,9 +174,7 @@ static PyObject *Fm_GetDefFontSize(_self, _args)
return _res;
}
static PyObject *Fm_IsOutline(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_IsOutline(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -209,9 +191,7 @@ static PyObject *Fm_IsOutline(_self, _args)
return _res;
}
static PyObject *Fm_SetOutlinePreferred(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetOutlinePreferred(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean outlinePreferred;
@ -224,9 +204,7 @@ static PyObject *Fm_SetOutlinePreferred(_self, _args)
return _res;
}
static PyObject *Fm_GetOutlinePreferred(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetOutlinePreferred(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -238,9 +216,7 @@ static PyObject *Fm_GetOutlinePreferred(_self, _args)
return _res;
}
static PyObject *Fm_SetPreserveGlyph(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetPreserveGlyph(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean preserveGlyph;
@ -253,9 +229,7 @@ static PyObject *Fm_SetPreserveGlyph(_self, _args)
return _res;
}
static PyObject *Fm_GetPreserveGlyph(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -269,9 +243,7 @@ static PyObject *Fm_GetPreserveGlyph(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_FlushFonts(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -285,9 +257,7 @@ static PyObject *Fm_FlushFonts(_self, _args)
}
#endif
static PyObject *Fm_GetSysFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -299,9 +269,7 @@ static PyObject *Fm_GetSysFont(_self, _args)
return _res;
}
static PyObject *Fm_GetAppFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_GetAppFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -313,9 +281,7 @@ static PyObject *Fm_GetAppFont(_self, _args)
return _res;
}
static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_SetAntiAliasedTextEnabled(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
@ -333,9 +299,7 @@ static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args)
return _res;
}
static PyObject *Fm_IsAntiAliasedTextEnabled(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Fm_IsAntiAliasedTextEnabled(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -403,7 +367,7 @@ static PyMethodDef Fm_methods[] = {
void initFm()
void initFm(void)
{
PyObject *m;
PyObject *d;

View File

@ -19,14 +19,18 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/*
** Parse/generate ComponentDescriptor records
*/
static PyObject *
FMRec_New(itself)
FMetricRec *itself;
FMRec_New(FMetricRec *itself)
{
return Py_BuildValue("O&O&O&O&O&",
@ -40,9 +44,7 @@ FMRec_New(itself)
#if 0
/* Not needed... */
static int
FMRec_Convert(v, p_itself)
PyObject *v;
FMetricRec *p_itself;
FMRec_Convert(PyObject *v, FMetricRec *p_itself)
{
return PyArg_ParseTuple(v, "O&O&O&O&O&",
PyMac_GetFixed, &itself->ascent,

View File

@ -12,9 +12,7 @@
static PyObject *Help_Error;
static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -28,9 +26,7 @@ static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
return _res;
}
static PyObject *Help_HMRemoveBalloon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMRemoveBalloon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -43,9 +39,7 @@ static PyObject *Help_HMRemoveBalloon(_self, _args)
return _res;
}
static PyObject *Help_HMIsBalloon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMIsBalloon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -57,9 +51,7 @@ static PyObject *Help_HMIsBalloon(_self, _args)
return _res;
}
static PyObject *Help_HMGetBalloons(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetBalloons(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -71,9 +63,7 @@ static PyObject *Help_HMGetBalloons(_self, _args)
return _res;
}
static PyObject *Help_HMSetBalloons(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMSetBalloons(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -88,9 +78,7 @@ static PyObject *Help_HMSetBalloons(_self, _args)
return _res;
}
static PyObject *Help_HMSetFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMSetFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -105,9 +93,7 @@ static PyObject *Help_HMSetFont(_self, _args)
return _res;
}
static PyObject *Help_HMSetFontSize(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMSetFontSize(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -122,9 +108,7 @@ static PyObject *Help_HMSetFontSize(_self, _args)
return _res;
}
static PyObject *Help_HMGetFont(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -138,9 +122,7 @@ static PyObject *Help_HMGetFont(_self, _args)
return _res;
}
static PyObject *Help_HMGetFontSize(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetFontSize(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -154,9 +136,7 @@ static PyObject *Help_HMGetFontSize(_self, _args)
return _res;
}
static PyObject *Help_HMSetDialogResID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMSetDialogResID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -171,9 +151,7 @@ static PyObject *Help_HMSetDialogResID(_self, _args)
return _res;
}
static PyObject *Help_HMSetMenuResID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMSetMenuResID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -191,9 +169,7 @@ static PyObject *Help_HMSetMenuResID(_self, _args)
return _res;
}
static PyObject *Help_HMScanTemplateItems(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMScanTemplateItems(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -214,9 +190,7 @@ static PyObject *Help_HMScanTemplateItems(_self, _args)
return _res;
}
static PyObject *Help_HMGetDialogResID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetDialogResID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -230,9 +204,7 @@ static PyObject *Help_HMGetDialogResID(_self, _args)
return _res;
}
static PyObject *Help_HMGetMenuResID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetMenuResID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -249,9 +221,7 @@ static PyObject *Help_HMGetMenuResID(_self, _args)
return _res;
}
static PyObject *Help_HMGetBalloonWindow(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -302,7 +272,7 @@ static PyMethodDef Help_methods[] = {
void initHelp()
void initHelp(void)
{
PyObject *m;
PyObject *d;

View File

@ -8,13 +8,16 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Icons.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Icn_Error;
static PyObject *Icn_GetCIcon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetCIcon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CIconHandle _rv;
@ -28,9 +31,7 @@ static PyObject *Icn_GetCIcon(_self, _args)
return _res;
}
static PyObject *Icn_PlotCIcon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotCIcon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Rect theRect;
@ -46,9 +47,7 @@ static PyObject *Icn_PlotCIcon(_self, _args)
return _res;
}
static PyObject *Icn_DisposeCIcon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_DisposeCIcon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CIconHandle theIcon;
@ -61,9 +60,7 @@ static PyObject *Icn_DisposeCIcon(_self, _args)
return _res;
}
static PyObject *Icn_GetIcon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIcon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -77,9 +74,7 @@ static PyObject *Icn_GetIcon(_self, _args)
return _res;
}
static PyObject *Icn_PlotIcon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotIcon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Rect theRect;
@ -95,9 +90,7 @@ static PyObject *Icn_PlotIcon(_self, _args)
return _res;
}
static PyObject *Icn_PlotIconID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotIconID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -121,9 +114,7 @@ static PyObject *Icn_PlotIconID(_self, _args)
return _res;
}
static PyObject *Icn_NewIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_NewIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -137,9 +128,7 @@ static PyObject *Icn_NewIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_AddIconToSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_AddIconToSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -160,9 +149,7 @@ static PyObject *Icn_AddIconToSuite(_self, _args)
return _res;
}
static PyObject *Icn_GetIconFromSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconFromSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -182,9 +169,7 @@ static PyObject *Icn_GetIconFromSuite(_self, _args)
return _res;
}
static PyObject *Icn_GetIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -204,9 +189,7 @@ static PyObject *Icn_GetIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_DisposeIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_DisposeIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -224,9 +207,7 @@ static PyObject *Icn_DisposeIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_PlotIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -250,9 +231,7 @@ static PyObject *Icn_PlotIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_LoadIconCache(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_LoadIconCache(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -276,9 +255,7 @@ static PyObject *Icn_LoadIconCache(_self, _args)
return _res;
}
static PyObject *Icn_GetLabel(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetLabel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -298,9 +275,7 @@ static PyObject *Icn_GetLabel(_self, _args)
return _res;
}
static PyObject *Icn_PtInIconID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PtInIconID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -323,9 +298,7 @@ static PyObject *Icn_PtInIconID(_self, _args)
return _res;
}
static PyObject *Icn_PtInIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PtInIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -348,9 +321,7 @@ static PyObject *Icn_PtInIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_RectInIconID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RectInIconID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -373,9 +344,7 @@ static PyObject *Icn_RectInIconID(_self, _args)
return _res;
}
static PyObject *Icn_RectInIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RectInIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -398,9 +367,7 @@ static PyObject *Icn_RectInIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_IconIDToRgn(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconIDToRgn(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -424,9 +391,7 @@ static PyObject *Icn_IconIDToRgn(_self, _args)
return _res;
}
static PyObject *Icn_IconSuiteToRgn(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconSuiteToRgn(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -450,9 +415,7 @@ static PyObject *Icn_IconSuiteToRgn(_self, _args)
return _res;
}
static PyObject *Icn_SetSuiteLabel(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_SetSuiteLabel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -470,9 +433,7 @@ static PyObject *Icn_SetSuiteLabel(_self, _args)
return _res;
}
static PyObject *Icn_GetSuiteLabel(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetSuiteLabel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
@ -486,9 +447,7 @@ static PyObject *Icn_GetSuiteLabel(_self, _args)
return _res;
}
static PyObject *Icn_PlotIconHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotIconHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -512,9 +471,7 @@ static PyObject *Icn_PlotIconHandle(_self, _args)
return _res;
}
static PyObject *Icn_PlotSICNHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotSICNHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -538,9 +495,7 @@ static PyObject *Icn_PlotSICNHandle(_self, _args)
return _res;
}
static PyObject *Icn_PlotCIconHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotCIconHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -566,9 +521,7 @@ static PyObject *Icn_PlotCIconHandle(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Icn_IconServicesTerminate(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconServicesTerminate(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -580,9 +533,7 @@ static PyObject *Icn_IconServicesTerminate(_self, _args)
}
#endif
static PyObject *Icn_IconRefToIconFamily(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconRefToIconFamily(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -602,9 +553,7 @@ static PyObject *Icn_IconRefToIconFamily(_self, _args)
return _res;
}
static PyObject *Icn_IconFamilyToIconSuite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconFamilyToIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -624,9 +573,7 @@ static PyObject *Icn_IconFamilyToIconSuite(_self, _args)
return _res;
}
static PyObject *Icn_IconSuiteToIconFamily(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconSuiteToIconFamily(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -646,9 +593,7 @@ static PyObject *Icn_IconSuiteToIconFamily(_self, _args)
return _res;
}
static PyObject *Icn_SetIconFamilyData(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_SetIconFamilyData(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -669,9 +614,7 @@ static PyObject *Icn_SetIconFamilyData(_self, _args)
return _res;
}
static PyObject *Icn_GetIconFamilyData(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconFamilyData(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -692,9 +635,7 @@ static PyObject *Icn_GetIconFamilyData(_self, _args)
return _res;
}
static PyObject *Icn_GetIconRefOwners(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconRefOwners(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -711,9 +652,7 @@ static PyObject *Icn_GetIconRefOwners(_self, _args)
return _res;
}
static PyObject *Icn_AcquireIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_AcquireIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -728,9 +667,7 @@ static PyObject *Icn_AcquireIconRef(_self, _args)
return _res;
}
static PyObject *Icn_ReleaseIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_ReleaseIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -745,9 +682,7 @@ static PyObject *Icn_ReleaseIconRef(_self, _args)
return _res;
}
static PyObject *Icn_GetIconRefFromFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconRefFromFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -767,9 +702,7 @@ static PyObject *Icn_GetIconRefFromFile(_self, _args)
return _res;
}
static PyObject *Icn_GetIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -792,9 +725,7 @@ static PyObject *Icn_GetIconRef(_self, _args)
return _res;
}
static PyObject *Icn_GetIconRefFromFolder(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconRefFromFolder(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -823,9 +754,7 @@ static PyObject *Icn_GetIconRefFromFolder(_self, _args)
return _res;
}
static PyObject *Icn_RegisterIconRefFromIconFamily(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RegisterIconRefFromIconFamily(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -848,9 +777,7 @@ static PyObject *Icn_RegisterIconRefFromIconFamily(_self, _args)
return _res;
}
static PyObject *Icn_RegisterIconRefFromResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RegisterIconRefFromResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -876,9 +803,7 @@ static PyObject *Icn_RegisterIconRefFromResource(_self, _args)
return _res;
}
static PyObject *Icn_UnregisterIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_UnregisterIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -896,9 +821,7 @@ static PyObject *Icn_UnregisterIconRef(_self, _args)
return _res;
}
static PyObject *Icn_UpdateIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_UpdateIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -913,9 +836,7 @@ static PyObject *Icn_UpdateIconRef(_self, _args)
return _res;
}
static PyObject *Icn_OverrideIconRefFromResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_OverrideIconRefFromResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -936,9 +857,7 @@ static PyObject *Icn_OverrideIconRefFromResource(_self, _args)
return _res;
}
static PyObject *Icn_OverrideIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_OverrideIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -956,9 +875,7 @@ static PyObject *Icn_OverrideIconRef(_self, _args)
return _res;
}
static PyObject *Icn_RemoveIconRefOverride(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RemoveIconRefOverride(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -973,9 +890,7 @@ static PyObject *Icn_RemoveIconRefOverride(_self, _args)
return _res;
}
static PyObject *Icn_CompositeIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_CompositeIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -995,9 +910,7 @@ static PyObject *Icn_CompositeIconRef(_self, _args)
return _res;
}
static PyObject *Icn_IsIconRefComposite(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IsIconRefComposite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1017,9 +930,7 @@ static PyObject *Icn_IsIconRefComposite(_self, _args)
return _res;
}
static PyObject *Icn_IsValidIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IsValidIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1033,9 +944,7 @@ static PyObject *Icn_IsValidIconRef(_self, _args)
return _res;
}
static PyObject *Icn_PlotIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PlotIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1062,9 +971,7 @@ static PyObject *Icn_PlotIconRef(_self, _args)
return _res;
}
static PyObject *Icn_PtInIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_PtInIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1090,9 +997,7 @@ static PyObject *Icn_PtInIconRef(_self, _args)
return _res;
}
static PyObject *Icn_RectInIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RectInIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1118,9 +1023,7 @@ static PyObject *Icn_RectInIconRef(_self, _args)
return _res;
}
static PyObject *Icn_IconRefToRgn(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IconRefToRgn(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1147,9 +1050,7 @@ static PyObject *Icn_IconRefToRgn(_self, _args)
return _res;
}
static PyObject *Icn_GetIconSizesFromIconRef(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconSizesFromIconRef(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1172,9 +1073,7 @@ static PyObject *Icn_GetIconSizesFromIconRef(_self, _args)
return _res;
}
static PyObject *Icn_FlushIconRefs(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_FlushIconRefs(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1192,9 +1091,7 @@ static PyObject *Icn_FlushIconRefs(_self, _args)
return _res;
}
static PyObject *Icn_FlushIconRefsByVolume(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_FlushIconRefsByVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1209,9 +1106,7 @@ static PyObject *Icn_FlushIconRefsByVolume(_self, _args)
return _res;
}
static PyObject *Icn_SetCustomIconsEnabled(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_SetCustomIconsEnabled(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1229,9 +1124,7 @@ static PyObject *Icn_SetCustomIconsEnabled(_self, _args)
return _res;
}
static PyObject *Icn_GetCustomIconsEnabled(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetCustomIconsEnabled(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1248,9 +1141,7 @@ static PyObject *Icn_GetCustomIconsEnabled(_self, _args)
return _res;
}
static PyObject *Icn_IsIconRefMaskEmpty(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_IsIconRefMaskEmpty(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1266,9 +1157,7 @@ static PyObject *Icn_IsIconRefMaskEmpty(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Icn_GetIconRefVariant(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
IconRef _rv;
@ -1291,9 +1180,7 @@ static PyObject *Icn_GetIconRefVariant(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Icn_RegisterIconRefFromIconFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1319,9 +1206,7 @@ static PyObject *Icn_RegisterIconRefFromIconFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Icn_ReadIconFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1341,9 +1226,7 @@ static PyObject *Icn_ReadIconFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Icn_WriteIconFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1506,7 +1389,7 @@ static PyMethodDef Icn_methods[] = {
void initIcn()
void initIcn(void)
{
PyObject *m;
PyObject *d;

View File

@ -46,7 +46,12 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
#EventKind = Type("EventKind", "H")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Icons.h>
#else
#include <Carbon/Carbon.h>
#endif
"""
class MyObjectDefinition(GlobalObjectDefinition):

View File

@ -8,8 +8,11 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Lists.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ListObj_New(ListHandle);
@ -61,8 +64,7 @@ typedef struct ListObject {
int ob_must_be_disposed;
} ListObject;
PyObject *ListObj_New(itself)
ListHandle itself;
PyObject *ListObj_New(ListHandle itself)
{
ListObject *it;
if (itself == NULL) {
@ -75,9 +77,7 @@ PyObject *ListObj_New(itself)
it->ob_must_be_disposed = 1;
return (PyObject *)it;
}
ListObj_Convert(v, p_itself)
PyObject *v;
ListHandle *p_itself;
ListObj_Convert(PyObject *v, ListHandle *p_itself)
{
if (!ListObj_Check(v))
{
@ -88,16 +88,13 @@ ListObj_Convert(v, p_itself)
return 1;
}
static void ListObj_dealloc(self)
ListObject *self;
static void ListObj_dealloc(ListObject *self)
{
if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
PyMem_DEL(self);
}
static PyObject *ListObj_LAddColumn(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LAddColumn(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -115,9 +112,7 @@ static PyObject *ListObj_LAddColumn(_self, _args)
return _res;
}
static PyObject *ListObj_LAddRow(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LAddRow(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -135,9 +130,7 @@ static PyObject *ListObj_LAddRow(_self, _args)
return _res;
}
static PyObject *ListObj_LDelColumn(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LDelColumn(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short count;
@ -154,9 +147,7 @@ static PyObject *ListObj_LDelColumn(_self, _args)
return _res;
}
static PyObject *ListObj_LDelRow(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LDelRow(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short count;
@ -173,9 +164,7 @@ static PyObject *ListObj_LDelRow(_self, _args)
return _res;
}
static PyObject *ListObj_LGetSelect(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LGetSelect(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -194,9 +183,7 @@ static PyObject *ListObj_LGetSelect(_self, _args)
return _res;
}
static PyObject *ListObj_LLastClick(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LLastClick(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point _rv;
@ -208,9 +195,7 @@ static PyObject *ListObj_LLastClick(_self, _args)
return _res;
}
static PyObject *ListObj_LNextCell(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LNextCell(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -232,9 +217,7 @@ static PyObject *ListObj_LNextCell(_self, _args)
return _res;
}
static PyObject *ListObj_LSize(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LSize(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short listWidth;
@ -251,9 +234,7 @@ static PyObject *ListObj_LSize(_self, _args)
return _res;
}
static PyObject *ListObj_LSetDrawingMode(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LSetDrawingMode(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean drawIt;
@ -267,9 +248,7 @@ static PyObject *ListObj_LSetDrawingMode(_self, _args)
return _res;
}
static PyObject *ListObj_LScroll(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LScroll(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short dCols;
@ -286,9 +265,7 @@ static PyObject *ListObj_LScroll(_self, _args)
return _res;
}
static PyObject *ListObj_LAutoScroll(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LAutoScroll(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -299,9 +276,7 @@ static PyObject *ListObj_LAutoScroll(_self, _args)
return _res;
}
static PyObject *ListObj_LUpdate(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LUpdate(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
RgnHandle theRgn;
@ -315,9 +290,7 @@ static PyObject *ListObj_LUpdate(_self, _args)
return _res;
}
static PyObject *ListObj_LActivate(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LActivate(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean act;
@ -331,9 +304,7 @@ static PyObject *ListObj_LActivate(_self, _args)
return _res;
}
static PyObject *ListObj_LCellSize(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LCellSize(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point cSize;
@ -347,9 +318,7 @@ static PyObject *ListObj_LCellSize(_self, _args)
return _res;
}
static PyObject *ListObj_LClick(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LClick(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -367,9 +336,7 @@ static PyObject *ListObj_LClick(_self, _args)
return _res;
}
static PyObject *ListObj_LAddToCell(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LAddToCell(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *dataPtr__in__;
@ -390,9 +357,7 @@ static PyObject *ListObj_LAddToCell(_self, _args)
return _res;
}
static PyObject *ListObj_LClrCell(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LClrCell(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point theCell;
@ -406,9 +371,7 @@ static PyObject *ListObj_LClrCell(_self, _args)
return _res;
}
static PyObject *ListObj_LGetCell(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LGetCell(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *dataPtr__out__;
@ -435,9 +398,7 @@ static PyObject *ListObj_LGetCell(_self, _args)
return _res;
}
static PyObject *ListObj_LRect(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LRect(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Rect cellRect;
@ -453,9 +414,7 @@ static PyObject *ListObj_LRect(_self, _args)
return _res;
}
static PyObject *ListObj_LSetCell(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LSetCell(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *dataPtr__in__;
@ -476,9 +435,7 @@ static PyObject *ListObj_LSetCell(_self, _args)
return _res;
}
static PyObject *ListObj_LSetSelect(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LSetSelect(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean setIt;
@ -495,9 +452,7 @@ static PyObject *ListObj_LSetSelect(_self, _args)
return _res;
}
static PyObject *ListObj_LDraw(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_LDraw(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point theCell;
@ -511,9 +466,7 @@ static PyObject *ListObj_LDraw(_self, _args)
return _res;
}
static PyObject *ListObj_as_Resource(_self, _args)
ListObject *_self;
PyObject *_args;
static PyObject *ListObj_as_Resource(ListObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -577,9 +530,7 @@ static PyMethodDef ListObj_methods[] = {
PyMethodChain ListObj_chain = { ListObj_methods, NULL };
static PyObject *ListObj_getattr(self, name)
ListObject *self;
char *name;
static PyObject *ListObj_getattr(ListObject *self, char *name)
{
{
/* XXXX Should we HLock() here?? */
@ -592,10 +543,7 @@ static PyObject *ListObj_getattr(self, name)
}
static int
ListObj_setattr(self, name, value)
ListObject *self;
char *name;
PyObject *value;
ListObj_setattr(ListObject *self, char *name, PyObject *value)
{
long intval;
@ -643,9 +591,7 @@ PyTypeObject List_Type = {
/* ---------------------- End object type List ---------------------- */
static PyObject *List_LNew(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_LNew(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle _rv;
@ -683,9 +629,7 @@ static PyObject *List_LNew(_self, _args)
return _res;
}
static PyObject *List_GetListPort(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListPort(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CGrafPtr _rv;
@ -699,9 +643,7 @@ static PyObject *List_GetListPort(_self, _args)
return _res;
}
static PyObject *List_GetListVerticalScrollBar(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListVerticalScrollBar(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ControlHandle _rv;
@ -715,9 +657,7 @@ static PyObject *List_GetListVerticalScrollBar(_self, _args)
return _res;
}
static PyObject *List_GetListHorizontalScrollBar(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListHorizontalScrollBar(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ControlHandle _rv;
@ -731,9 +671,7 @@ static PyObject *List_GetListHorizontalScrollBar(_self, _args)
return _res;
}
static PyObject *List_GetListActive(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListActive(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -747,9 +685,7 @@ static PyObject *List_GetListActive(_self, _args)
return _res;
}
static PyObject *List_GetListClickTime(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListClickTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 _rv;
@ -763,9 +699,7 @@ static PyObject *List_GetListClickTime(_self, _args)
return _res;
}
static PyObject *List_GetListRefCon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListRefCon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 _rv;
@ -779,9 +713,7 @@ static PyObject *List_GetListRefCon(_self, _args)
return _res;
}
static PyObject *List_GetListDefinition(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListDefinition(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -795,9 +727,7 @@ static PyObject *List_GetListDefinition(_self, _args)
return _res;
}
static PyObject *List_GetListUserHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListUserHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -811,9 +741,7 @@ static PyObject *List_GetListUserHandle(_self, _args)
return _res;
}
static PyObject *List_GetListDataHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListDataHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
DataHandle _rv;
@ -827,9 +755,7 @@ static PyObject *List_GetListDataHandle(_self, _args)
return _res;
}
static PyObject *List_GetListFlags(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListFlags(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OptionBits _rv;
@ -843,9 +769,7 @@ static PyObject *List_GetListFlags(_self, _args)
return _res;
}
static PyObject *List_GetListSelectionFlags(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_GetListSelectionFlags(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OptionBits _rv;
@ -859,9 +783,7 @@ static PyObject *List_GetListSelectionFlags(_self, _args)
return _res;
}
static PyObject *List_SetListViewBounds(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListViewBounds(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -877,9 +799,7 @@ static PyObject *List_SetListViewBounds(_self, _args)
return _res;
}
static PyObject *List_SetListPort(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListPort(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -895,9 +815,7 @@ static PyObject *List_SetListPort(_self, _args)
return _res;
}
static PyObject *List_SetListCellIndent(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListCellIndent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -913,9 +831,7 @@ static PyObject *List_SetListCellIndent(_self, _args)
return _res;
}
static PyObject *List_SetListClickTime(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListClickTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -931,9 +847,7 @@ static PyObject *List_SetListClickTime(_self, _args)
return _res;
}
static PyObject *List_SetListRefCon(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListRefCon(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -949,9 +863,7 @@ static PyObject *List_SetListRefCon(_self, _args)
return _res;
}
static PyObject *List_SetListUserHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListUserHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -967,9 +879,7 @@ static PyObject *List_SetListUserHandle(_self, _args)
return _res;
}
static PyObject *List_SetListFlags(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListFlags(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -985,9 +895,7 @@ static PyObject *List_SetListFlags(_self, _args)
return _res;
}
static PyObject *List_SetListSelectionFlags(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_SetListSelectionFlags(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ListHandle list;
@ -1003,9 +911,7 @@ static PyObject *List_SetListSelectionFlags(_self, _args)
return _res;
}
static PyObject *List_as_List(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *List_as_List(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -1068,15 +974,15 @@ static PyMethodDef List_methods[] = {
void initList()
void initList(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(ListObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert);
m = Py_InitModule("List", List_methods);

View File

@ -35,8 +35,11 @@ Handle = OpaqueByValueType("Handle", "ResObj")
CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Lists.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ListObj_New(ListHandle);
@ -76,8 +79,8 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(ListObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert);
"""
class ListMethodGenerator(MethodGenerator):
@ -102,10 +105,7 @@ getattrHookCode = """{
setattrCode = """
static int
ListObj_setattr(self, name, value)
ListObject *self;
char *name;
PyObject *value;
ListObj_setattr(ListObject *self, char *name, PyObject *value)
{
long intval;

File diff suppressed because it is too large Load Diff

View File

@ -36,8 +36,13 @@ FMFontFamily = Type("FMFontFamily", "h")
FMFontStyle = Type("FMFontStyle", "h")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <%s>""" % MACHEADERFILE + """
#include <Menus.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
@ -63,8 +68,8 @@ extern int _MenuObj_Convert(PyObject *, MenuHandle *);
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
"""
class MyObjectDefinition(GlobalObjectDefinition):

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,11 @@ PenState = StructOutputBufferType('PenState')
PenState_ptr = StructInputBufferType('PenState')
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <QuickDraw.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GrafObj_New(GrafPtr);
@ -153,16 +157,13 @@ staticforward PyObject *BMObj_NewCopied(BitMapPtr);
/*
** Parse/generate RGB records
*/
PyObject *QdRGB_New(itself)
RGBColorPtr itself;
PyObject *QdRGB_New(RGBColorPtr itself)
{
return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue);
}
QdRGB_Convert(v, p_itself)
PyObject *v;
RGBColorPtr p_itself;
QdRGB_Convert(PyObject *v, RGBColorPtr p_itself)
{
long red, green, blue;
@ -178,8 +179,7 @@ QdRGB_Convert(v, p_itself)
** Generate FontInfo records
*/
static
PyObject *QdFI_New(itself)
FontInfo *itself;
PyObject *QdFI_New(FontInfo *itself)
{
return Py_BuildValue("hhhh", itself->ascent, itself->descent,
@ -191,8 +191,7 @@ finalstuff = finalstuff + """
/* Like BMObj_New, but the original bitmap data structure is copied (and
** released when the object is released)
*/
PyObject *BMObj_NewCopied(itself)
BitMapPtr itself;
PyObject *BMObj_NewCopied(BitMapPtr itself)
{
BitMapObject *it;
BitMapPtr itself_copy;
@ -218,12 +217,12 @@ variablestuff = """
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(BMObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(BMObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(GrafObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GrafObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(QdRGB_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(QdRGB_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr, BMObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(BitMapPtr, BMObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(GrafPtr, GrafObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GrafPtr, GrafObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr, QdRGB_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColorPtr, QdRGB_Convert);
"""
## not yet...

View File

@ -8,7 +8,11 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <QDOffscreen.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GWorldObj_New(GWorldPtr);
@ -34,8 +38,7 @@ typedef struct GWorldObject {
GWorldPtr ob_itself;
} GWorldObject;
PyObject *GWorldObj_New(itself)
GWorldPtr itself;
PyObject *GWorldObj_New(GWorldPtr itself)
{
GWorldObject *it;
if (itself == NULL) return PyMac_Error(resNotFound);
@ -44,9 +47,7 @@ PyObject *GWorldObj_New(itself)
it->ob_itself = itself;
return (PyObject *)it;
}
GWorldObj_Convert(v, p_itself)
PyObject *v;
GWorldPtr *p_itself;
GWorldObj_Convert(PyObject *v, GWorldPtr *p_itself)
{
if (!GWorldObj_Check(v))
{
@ -57,16 +58,13 @@ GWorldObj_Convert(v, p_itself)
return 1;
}
static void GWorldObj_dealloc(self)
GWorldObject *self;
static void GWorldObj_dealloc(GWorldObject *self)
{
DisposeGWorld(self->ob_itself);
PyMem_DEL(self);
}
static PyObject *GWorldObj_GetGWorldDevice(_self, _args)
GWorldObject *_self;
PyObject *_args;
static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GDHandle _rv;
@ -78,9 +76,7 @@ static PyObject *GWorldObj_GetGWorldDevice(_self, _args)
return _res;
}
static PyObject *GWorldObj_GetGWorldPixMap(_self, _args)
GWorldObject *_self;
PyObject *_args;
static PyObject *GWorldObj_GetGWorldPixMap(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle _rv;
@ -92,9 +88,7 @@ static PyObject *GWorldObj_GetGWorldPixMap(_self, _args)
return _res;
}
static PyObject *GWorldObj_as_GrafPtr(_self, _args)
GWorldObject *_self;
PyObject *_args;
static PyObject *GWorldObj_as_GrafPtr(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GrafPtr _rv;
@ -118,9 +112,7 @@ static PyMethodDef GWorldObj_methods[] = {
PyMethodChain GWorldObj_chain = { GWorldObj_methods, NULL };
static PyObject *GWorldObj_getattr(self, name)
GWorldObject *self;
char *name;
static PyObject *GWorldObj_getattr(GWorldObject *self, char *name)
{
return Py_FindMethodInChain(&GWorldObj_chain, (PyObject *)self, name);
}
@ -155,9 +147,7 @@ PyTypeObject GWorld_Type = {
/* --------------------- End object type GWorld --------------------- */
static PyObject *Qdoffs_NewGWorld(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_NewGWorld(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
QDErr _err;
@ -186,9 +176,7 @@ static PyObject *Qdoffs_NewGWorld(_self, _args)
return _res;
}
static PyObject *Qdoffs_LockPixels(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_LockPixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -202,9 +190,7 @@ static PyObject *Qdoffs_LockPixels(_self, _args)
return _res;
}
static PyObject *Qdoffs_UnlockPixels(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_UnlockPixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
@ -217,9 +203,7 @@ static PyObject *Qdoffs_UnlockPixels(_self, _args)
return _res;
}
static PyObject *Qdoffs_UpdateGWorld(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_UpdateGWorld(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GWorldFlags _rv;
@ -248,9 +232,7 @@ static PyObject *Qdoffs_UpdateGWorld(_self, _args)
return _res;
}
static PyObject *Qdoffs_GetGWorld(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_GetGWorld(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CGrafPtr port;
@ -265,9 +247,7 @@ static PyObject *Qdoffs_GetGWorld(_self, _args)
return _res;
}
static PyObject *Qdoffs_SetGWorld(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_SetGWorld(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CGrafPtr port;
@ -283,9 +263,7 @@ static PyObject *Qdoffs_SetGWorld(_self, _args)
return _res;
}
static PyObject *Qdoffs_CTabChanged(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_CTabChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CTabHandle ctab;
@ -298,9 +276,7 @@ static PyObject *Qdoffs_CTabChanged(_self, _args)
return _res;
}
static PyObject *Qdoffs_PixPatChanged(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_PixPatChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixPatHandle ppat;
@ -313,9 +289,7 @@ static PyObject *Qdoffs_PixPatChanged(_self, _args)
return _res;
}
static PyObject *Qdoffs_PortChanged(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_PortChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GrafPtr port;
@ -328,9 +302,7 @@ static PyObject *Qdoffs_PortChanged(_self, _args)
return _res;
}
static PyObject *Qdoffs_GDeviceChanged(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_GDeviceChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GDHandle gdh;
@ -343,9 +315,7 @@ static PyObject *Qdoffs_GDeviceChanged(_self, _args)
return _res;
}
static PyObject *Qdoffs_AllowPurgePixels(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_AllowPurgePixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
@ -358,9 +328,7 @@ static PyObject *Qdoffs_AllowPurgePixels(_self, _args)
return _res;
}
static PyObject *Qdoffs_NoPurgePixels(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_NoPurgePixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
@ -373,9 +341,7 @@ static PyObject *Qdoffs_NoPurgePixels(_self, _args)
return _res;
}
static PyObject *Qdoffs_GetPixelsState(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_GetPixelsState(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GWorldFlags _rv;
@ -389,9 +355,7 @@ static PyObject *Qdoffs_GetPixelsState(_self, _args)
return _res;
}
static PyObject *Qdoffs_SetPixelsState(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_SetPixelsState(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
@ -407,9 +371,7 @@ static PyObject *Qdoffs_SetPixelsState(_self, _args)
return _res;
}
static PyObject *Qdoffs_GetPixRowBytes(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_GetPixRowBytes(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -423,9 +385,7 @@ static PyObject *Qdoffs_GetPixRowBytes(_self, _args)
return _res;
}
static PyObject *Qdoffs_NewScreenBuffer(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_NewScreenBuffer(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
QDErr _err;
@ -448,9 +408,7 @@ static PyObject *Qdoffs_NewScreenBuffer(_self, _args)
return _res;
}
static PyObject *Qdoffs_DisposeScreenBuffer(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_DisposeScreenBuffer(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle offscreenPixMap;
@ -463,9 +421,7 @@ static PyObject *Qdoffs_DisposeScreenBuffer(_self, _args)
return _res;
}
static PyObject *Qdoffs_QDDone(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_QDDone(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -479,9 +435,7 @@ static PyObject *Qdoffs_QDDone(_self, _args)
return _res;
}
static PyObject *Qdoffs_OffscreenVersion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_OffscreenVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -493,9 +447,7 @@ static PyObject *Qdoffs_OffscreenVersion(_self, _args)
return _res;
}
static PyObject *Qdoffs_NewTempScreenBuffer(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_NewTempScreenBuffer(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
QDErr _err;
@ -518,9 +470,7 @@ static PyObject *Qdoffs_NewTempScreenBuffer(_self, _args)
return _res;
}
static PyObject *Qdoffs_PixMap32Bit(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_PixMap32Bit(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -534,9 +484,7 @@ static PyObject *Qdoffs_PixMap32Bit(_self, _args)
return _res;
}
static PyObject *Qdoffs_GetPixMapBytes(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_GetPixMapBytes(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -551,9 +499,7 @@ static PyObject *Qdoffs_GetPixMapBytes(_self, _args)
}
static PyObject *Qdoffs_PutPixMapBytes(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Qdoffs_PutPixMapBytes(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -623,15 +569,15 @@ static PyMethodDef Qdoffs_methods[] = {
void initQdoffs()
void initQdoffs(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
m = Py_InitModule("Qdoffs", Qdoffs_methods);

View File

@ -34,7 +34,11 @@ GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
QDErr = OSErrType("QDErr", 'h')
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <QDOffscreen.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GWorldObj_New(GWorldPtr);
@ -49,8 +53,8 @@ extern int _GWorldObj_Convert(PyObject *, GWorldPtr *);
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
"""
class MyObjectDefinition(GlobalObjectDefinition):

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,13 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Movies.h>
#else
/* #include <Carbon/Carbon.h> */
#include <QuickTime/QuickTime.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TrackObj_New(Track);
@ -62,8 +68,7 @@ extern int _MediaObj_Convert(PyObject *, Media *);
** Parse/generate time records
*/
static PyObject *
QtTimeRecord_New(itself)
TimeRecord *itself;
QtTimeRecord_New(TimeRecord *itself)
{
if (itself->base)
return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
@ -74,9 +79,7 @@ QtTimeRecord_New(itself)
}
static int
QtTimeRecord_Convert(v, p_itself)
PyObject *v;
TimeRecord *p_itself;
QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself)
{
PyObject *base = NULL;
if( !PyArg_ParseTuple(v, "O&l|O", PyMac_Getwide, &p_itself->value, &p_itself->scale,
@ -95,18 +98,18 @@ QtTimeRecord_Convert(v, p_itself)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(TrackObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TrackObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieCtlObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieCtlObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(TimeBaseObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TimeBaseObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(UserDataObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserDataObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(MediaObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MediaObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Movie, MovieObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Movie, MovieObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieController, MovieCtlObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieController, MovieCtlObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(TimeBase, TimeBaseObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TimeBase, TimeBaseObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(UserData, UserDataObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserData, UserDataObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Media, MediaObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Media, MediaObj_Convert);
"""
# Our (opaque) objects

View File

@ -8,8 +8,12 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Resources.h>
#include <string.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ResObj_New(Handle);
@ -43,8 +47,7 @@ typedef struct ResourceObject {
void (*ob_freeit)(Handle ptr);
} ResourceObject;
PyObject *ResObj_New(itself)
Handle itself;
PyObject *ResObj_New(Handle itself)
{
ResourceObject *it;
if (itself == NULL) return PyMac_Error(resNotFound);
@ -54,9 +57,7 @@ PyObject *ResObj_New(itself)
it->ob_freeit = NULL;
return (PyObject *)it;
}
ResObj_Convert(v, p_itself)
PyObject *v;
Handle *p_itself;
ResObj_Convert(PyObject *v, Handle *p_itself)
{
if (!ResObj_Check(v))
{
@ -78,8 +79,7 @@ ResObj_Convert(v, p_itself)
return 1;
}
static void ResObj_dealloc(self)
ResourceObject *self;
static void ResObj_dealloc(ResourceObject *self)
{
if (self->ob_freeit && self->ob_itself)
{
@ -89,9 +89,7 @@ static void ResObj_dealloc(self)
PyMem_DEL(self);
}
static PyObject *ResObj_HomeResFile(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -107,9 +105,7 @@ static PyObject *ResObj_HomeResFile(_self, _args)
return _res;
}
static PyObject *ResObj_MacLoadResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_MacLoadResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -124,9 +120,7 @@ static PyObject *ResObj_MacLoadResource(_self, _args)
return _res;
}
static PyObject *ResObj_ReleaseResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_ReleaseResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -141,9 +135,7 @@ static PyObject *ResObj_ReleaseResource(_self, _args)
return _res;
}
static PyObject *ResObj_DetachResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_DetachResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -158,9 +150,7 @@ static PyObject *ResObj_DetachResource(_self, _args)
return _res;
}
static PyObject *ResObj_GetResAttrs(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_GetResAttrs(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -176,9 +166,7 @@ static PyObject *ResObj_GetResAttrs(_self, _args)
return _res;
}
static PyObject *ResObj_GetResInfo(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_GetResInfo(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short theID;
@ -201,9 +189,7 @@ static PyObject *ResObj_GetResInfo(_self, _args)
return _res;
}
static PyObject *ResObj_SetResInfo(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_SetResInfo(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short theID;
@ -224,9 +210,7 @@ static PyObject *ResObj_SetResInfo(_self, _args)
return _res;
}
static PyObject *ResObj_AddResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_AddResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ResType theType;
@ -250,9 +234,7 @@ static PyObject *ResObj_AddResource(_self, _args)
return _res;
}
static PyObject *ResObj_GetResourceSizeOnDisk(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_GetResourceSizeOnDisk(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -268,9 +250,7 @@ static PyObject *ResObj_GetResourceSizeOnDisk(_self, _args)
return _res;
}
static PyObject *ResObj_GetMaxResourceSize(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_GetMaxResourceSize(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -286,11 +266,9 @@ static PyObject *ResObj_GetMaxResourceSize(_self, _args)
return _res;
}
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *ResObj_RsrcMapEntry(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_RsrcMapEntry(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -307,9 +285,7 @@ static PyObject *ResObj_RsrcMapEntry(_self, _args)
}
#endif
static PyObject *ResObj_SetResAttrs(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_SetResAttrs(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short attrs;
@ -327,9 +303,7 @@ static PyObject *ResObj_SetResAttrs(_self, _args)
return _res;
}
static PyObject *ResObj_ChangedResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_ChangedResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -344,9 +318,7 @@ static PyObject *ResObj_ChangedResource(_self, _args)
return _res;
}
static PyObject *ResObj_RemoveResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_RemoveResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -361,9 +333,7 @@ static PyObject *ResObj_RemoveResource(_self, _args)
return _res;
}
static PyObject *ResObj_WriteResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_WriteResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -378,9 +348,7 @@ static PyObject *ResObj_WriteResource(_self, _args)
return _res;
}
static PyObject *ResObj_SetResourceSize(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_SetResourceSize(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long newSize;
@ -398,9 +366,7 @@ static PyObject *ResObj_SetResourceSize(_self, _args)
return _res;
}
static PyObject *ResObj_GetNextFOND(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_GetNextFOND(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -416,9 +382,7 @@ static PyObject *ResObj_GetNextFOND(_self, _args)
return _res;
}
static PyObject *ResObj_as_Control(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -426,9 +390,7 @@ static PyObject *ResObj_as_Control(_self, _args)
}
static PyObject *ResObj_as_Menu(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_as_Menu(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -436,9 +398,7 @@ static PyObject *ResObj_as_Menu(_self, _args)
}
static PyObject *ResObj_LoadResource(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -453,9 +413,7 @@ static PyObject *ResObj_LoadResource(_self, _args)
return _res;
}
static PyObject *ResObj_AutoDispose(_self, _args)
ResourceObject *_self;
PyObject *_args;
static PyObject *ResObj_AutoDispose(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -494,7 +452,7 @@ static PyMethodDef ResObj_methods[] = {
{"GetMaxResourceSize", (PyCFunction)ResObj_GetMaxResourceSize, 1,
"() -> (long _rv)"},
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"RsrcMapEntry", (PyCFunction)ResObj_RsrcMapEntry, 1,
"() -> (long _rv)"},
#endif
@ -523,9 +481,7 @@ static PyMethodDef ResObj_methods[] = {
PyMethodChain ResObj_chain = { ResObj_methods, NULL };
static PyObject *ResObj_getattr(self, name)
ResourceObject *self;
char *name;
static PyObject *ResObj_getattr(ResourceObject *self, char *name)
{
if (strcmp(name, "size") == 0)
@ -549,10 +505,7 @@ static PyObject *ResObj_getattr(self, name)
}
static int
ResObj_setattr(self, name, value)
ResourceObject *self;
char *name;
PyObject *value;
ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
{
char *data;
long size;
@ -603,11 +556,9 @@ PyTypeObject Resource_Type = {
/* -------------------- End object type Resource -------------------- */
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *Res_InitResources(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_InitResources(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -624,11 +575,9 @@ static PyObject *Res_InitResources(_self, _args)
}
#endif
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *Res_RsrcZoneInit(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_RsrcZoneInit(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -644,9 +593,7 @@ static PyObject *Res_RsrcZoneInit(_self, _args)
}
#endif
static PyObject *Res_CloseResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_CloseResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short refNum;
@ -663,9 +610,7 @@ static PyObject *Res_CloseResFile(_self, _args)
return _res;
}
static PyObject *Res_ResError(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_ResError(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -681,9 +626,7 @@ static PyObject *Res_ResError(_self, _args)
return _res;
}
static PyObject *Res_CurResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_CurResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -699,11 +642,9 @@ static PyObject *Res_CurResFile(_self, _args)
return _res;
}
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *Res_CreateResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_CreateResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Str255 fileName;
@ -721,11 +662,9 @@ static PyObject *Res_CreateResFile(_self, _args)
}
#endif
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *Res_OpenResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_OpenResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -744,9 +683,7 @@ static PyObject *Res_OpenResFile(_self, _args)
}
#endif
static PyObject *Res_UseResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_UseResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short refNum;
@ -763,9 +700,7 @@ static PyObject *Res_UseResFile(_self, _args)
return _res;
}
static PyObject *Res_CountTypes(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_CountTypes(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -781,9 +716,7 @@ static PyObject *Res_CountTypes(_self, _args)
return _res;
}
static PyObject *Res_Count1Types(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Count1Types(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -799,9 +732,7 @@ static PyObject *Res_Count1Types(_self, _args)
return _res;
}
static PyObject *Res_GetIndType(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetIndType(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ResType theType;
@ -820,9 +751,7 @@ static PyObject *Res_GetIndType(_self, _args)
return _res;
}
static PyObject *Res_Get1IndType(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Get1IndType(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ResType theType;
@ -841,9 +770,7 @@ static PyObject *Res_Get1IndType(_self, _args)
return _res;
}
static PyObject *Res_SetResLoad(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_SetResLoad(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean load;
@ -860,9 +787,7 @@ static PyObject *Res_SetResLoad(_self, _args)
return _res;
}
static PyObject *Res_CountResources(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_CountResources(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -880,9 +805,7 @@ static PyObject *Res_CountResources(_self, _args)
return _res;
}
static PyObject *Res_Count1Resources(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Count1Resources(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -900,9 +823,7 @@ static PyObject *Res_Count1Resources(_self, _args)
return _res;
}
static PyObject *Res_GetIndResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetIndResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -923,9 +844,7 @@ static PyObject *Res_GetIndResource(_self, _args)
return _res;
}
static PyObject *Res_Get1IndResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Get1IndResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -946,9 +865,7 @@ static PyObject *Res_Get1IndResource(_self, _args)
return _res;
}
static PyObject *Res_GetResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -969,9 +886,7 @@ static PyObject *Res_GetResource(_self, _args)
return _res;
}
static PyObject *Res_Get1Resource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Get1Resource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -992,9 +907,7 @@ static PyObject *Res_Get1Resource(_self, _args)
return _res;
}
static PyObject *Res_GetNamedResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetNamedResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -1015,9 +928,7 @@ static PyObject *Res_GetNamedResource(_self, _args)
return _res;
}
static PyObject *Res_Get1NamedResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Get1NamedResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -1038,9 +949,7 @@ static PyObject *Res_Get1NamedResource(_self, _args)
return _res;
}
static PyObject *Res_UniqueID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_UniqueID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1058,9 +967,7 @@ static PyObject *Res_UniqueID(_self, _args)
return _res;
}
static PyObject *Res_Unique1ID(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Unique1ID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1078,9 +985,7 @@ static PyObject *Res_Unique1ID(_self, _args)
return _res;
}
static PyObject *Res_UpdateResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_UpdateResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short refNum;
@ -1097,9 +1002,7 @@ static PyObject *Res_UpdateResFile(_self, _args)
return _res;
}
static PyObject *Res_SetResPurge(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_SetResPurge(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean install;
@ -1116,9 +1019,7 @@ static PyObject *Res_SetResPurge(_self, _args)
return _res;
}
static PyObject *Res_GetResFileAttrs(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetResFileAttrs(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1136,9 +1037,7 @@ static PyObject *Res_GetResFileAttrs(_self, _args)
return _res;
}
static PyObject *Res_SetResFileAttrs(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_SetResFileAttrs(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short refNum;
@ -1158,9 +1057,7 @@ static PyObject *Res_SetResFileAttrs(_self, _args)
return _res;
}
static PyObject *Res_OpenRFPerm(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1184,11 +1081,9 @@ static PyObject *Res_OpenRFPerm(_self, _args)
return _res;
}
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
static PyObject *Res_RGetResource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_RGetResource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -1210,9 +1105,7 @@ static PyObject *Res_RGetResource(_self, _args)
}
#endif
static PyObject *Res_HOpenResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_HOpenResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1239,9 +1132,7 @@ static PyObject *Res_HOpenResFile(_self, _args)
return _res;
}
static PyObject *Res_HCreateResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_HCreateResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short vRefNum;
@ -1264,9 +1155,7 @@ static PyObject *Res_HCreateResFile(_self, _args)
return _res;
}
static PyObject *Res_FSpOpenResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_FSpOpenResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -1287,9 +1176,7 @@ static PyObject *Res_FSpOpenResFile(_self, _args)
return _res;
}
static PyObject *Res_FSpCreateResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_FSpCreateResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
FSSpec spec;
@ -1317,9 +1204,7 @@ static PyObject *Res_FSpCreateResFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_InsertResourceFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -1343,9 +1228,7 @@ static PyObject *Res_InsertResourceFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_DetachResourceFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_DetachResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -1366,9 +1249,7 @@ static PyObject *Res_DetachResourceFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_FSpResourceFileAlreadyOpen(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -1395,9 +1276,7 @@ static PyObject *Res_FSpResourceFileAlreadyOpen(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_FSpOpenOrphanResFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_FSpOpenOrphanResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -1424,9 +1303,7 @@ static PyObject *Res_FSpOpenOrphanResFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_GetTopResourceFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetTopResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -1447,9 +1324,7 @@ static PyObject *Res_GetTopResourceFile(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *Res_GetNextResourceFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _rv;
@ -1471,9 +1346,7 @@ static PyObject *Res_GetNextResourceFile(_self, _args)
}
#endif
static PyObject *Res_Resource(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Resource(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -1495,9 +1368,7 @@ static PyObject *Res_Resource(_self, _args)
}
static PyObject *Res_Handle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Res_Handle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@ -1524,12 +1395,12 @@ static PyObject *Res_Handle(_self, _args)
static PyMethodDef Res_methods[] = {
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"InitResources", (PyCFunction)Res_InitResources, 1,
"() -> (short _rv)"},
#endif
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"RsrcZoneInit", (PyCFunction)Res_RsrcZoneInit, 1,
"() -> None"},
#endif
@ -1540,12 +1411,12 @@ static PyMethodDef Res_methods[] = {
{"CurResFile", (PyCFunction)Res_CurResFile, 1,
"() -> (short _rv)"},
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"CreateResFile", (PyCFunction)Res_CreateResFile, 1,
"(Str255 fileName) -> None"},
#endif
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"OpenResFile", (PyCFunction)Res_OpenResFile, 1,
"(Str255 fileName) -> (short _rv)"},
#endif
@ -1592,7 +1463,7 @@ static PyMethodDef Res_methods[] = {
{"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
"(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)"},
#if !TARGET_API_MAC_CARBON
#if TARGET_API_MAC_OS8
{"RGetResource", (PyCFunction)Res_RGetResource, 1,
"(ResType theType, short theID) -> (Handle _rv)"},
#endif
@ -1645,8 +1516,7 @@ static PyMethodDef Res_methods[] = {
/* Alternative version of ResObj_New, which returns None for null argument */
PyObject *OptResObj_New(itself)
Handle itself;
PyObject *OptResObj_New(Handle itself)
{
if (itself == NULL) {
Py_INCREF(Py_None);
@ -1655,9 +1525,7 @@ PyObject *OptResObj_New(itself)
return ResObj_New(itself);
}
OptResObj_Convert(v, p_itself)
PyObject *v;
Handle *p_itself;
OptResObj_Convert(PyObject *v, Handle *p_itself)
{
PyObject *tmp;
@ -1682,17 +1550,17 @@ OptResObj_Convert(v, p_itself)
}
void initRes()
void initRes(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(ResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(OptResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(OptResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, ResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, ResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, OptResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, OptResObj_Convert);
m = Py_InitModule("Res", Res_methods);

View File

@ -49,7 +49,7 @@ class ResourcesScanner(Scanner):
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
('#if TARGET_API_MAC_OS8', [
'RGetResource',
'OpenResFile',
'CreateResFile',

View File

@ -23,8 +23,12 @@ RsrcChainLocation = Type("RsrcChainLocation", "h")
# includestuff etc. are imported from macsupport
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Resources.h>
#include <string.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ResObj_New(Handle);
@ -48,8 +52,7 @@ PyMac_AutoDisposeHandle(Handle h)
finalstuff = finalstuff + """
/* Alternative version of ResObj_New, which returns None for null argument */
PyObject *OptResObj_New(itself)
Handle itself;
PyObject *OptResObj_New(Handle itself)
{
if (itself == NULL) {
Py_INCREF(Py_None);
@ -58,9 +61,7 @@ PyObject *OptResObj_New(itself)
return ResObj_New(itself);
}
OptResObj_Convert(v, p_itself)
PyObject *v;
Handle *p_itself;
OptResObj_Convert(PyObject *v, Handle *p_itself)
{
PyObject *tmp;
@ -86,10 +87,10 @@ OptResObj_Convert(v, p_itself)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(ResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(OptResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(OptResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, ResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, ResObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, OptResObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, OptResObj_Convert);
"""
module = MacModule('Res', 'Res', includestuff, finalstuff, initstuff)
@ -115,10 +116,7 @@ if (strcmp(name, "__members__") == 0)
setattrCode = """
static int
ResObj_setattr(self, name, value)
ResourceObject *self;
char *name;
PyObject *value;
ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
{
char *data;
long size;

View File

@ -8,7 +8,11 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Scrap.h>
#else
#include <Carbon/Carbon.h>
#endif
/*
** Generate ScrapInfo records

View File

@ -22,7 +22,11 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Scrap.h>
#else
#include <Carbon/Carbon.h>
#endif
/*
** Generate ScrapInfo records

View File

@ -8,9 +8,13 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Sound.h>
#include <OSUtils.h> /* for Set(Current)A5 */
#else
#include <Carbon/Carbon.h>
#endif
/* Create a SndCommand object (an (int, int, int) tuple) */
static PyObject *
@ -58,8 +62,7 @@ typedef struct SndChannelObject {
SndCommand ob_cmd;
} SndChannelObject;
static PyObject *SndCh_New(itself)
SndChannelPtr itself;
static PyObject *SndCh_New(SndChannelPtr itself)
{
SndChannelObject *it;
it = PyObject_NEW(SndChannelObject, &SndChannel_Type);
@ -69,9 +72,7 @@ static PyObject *SndCh_New(itself)
it->ob_A5 = SetCurrentA5();
return (PyObject *)it;
}
static SndCh_Convert(v, p_itself)
PyObject *v;
SndChannelPtr *p_itself;
static SndCh_Convert(PyObject *v, SndChannelPtr *p_itself)
{
if (!SndCh_Check(v))
{
@ -82,17 +83,14 @@ static SndCh_Convert(v, p_itself)
return 1;
}
static void SndCh_dealloc(self)
SndChannelObject *self;
static void SndCh_dealloc(SndChannelObject *self)
{
SndDisposeChannel(self->ob_itself, 1);
Py_XDECREF(self->ob_callback);
PyMem_DEL(self);
}
static PyObject *SndCh_SndDoCommand(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndDoCommand(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -111,9 +109,7 @@ static PyObject *SndCh_SndDoCommand(_self, _args)
return _res;
}
static PyObject *SndCh_SndDoImmediate(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndDoImmediate(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -129,9 +125,7 @@ static PyObject *SndCh_SndDoImmediate(_self, _args)
return _res;
}
static PyObject *SndCh_SndPlay(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndPlay(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -152,9 +146,7 @@ static PyObject *SndCh_SndPlay(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *SndCh_SndStartFilePlay(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndStartFilePlay(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -185,9 +177,7 @@ static PyObject *SndCh_SndStartFilePlay(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *SndCh_SndPauseFilePlay(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndPauseFilePlay(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -203,9 +193,7 @@ static PyObject *SndCh_SndPauseFilePlay(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *SndCh_SndStopFilePlay(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndStopFilePlay(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -222,9 +210,7 @@ static PyObject *SndCh_SndStopFilePlay(_self, _args)
}
#endif
static PyObject *SndCh_SndChannelStatus(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndChannelStatus(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -243,9 +229,7 @@ static PyObject *SndCh_SndChannelStatus(_self, _args)
return _res;
}
static PyObject *SndCh_SndGetInfo(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndGetInfo(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -264,9 +248,7 @@ static PyObject *SndCh_SndGetInfo(_self, _args)
return _res;
}
static PyObject *SndCh_SndSetInfo(_self, _args)
SndChannelObject *_self;
PyObject *_args;
static PyObject *SndCh_SndSetInfo(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -318,9 +300,7 @@ static PyMethodDef SndCh_methods[] = {
static PyMethodChain SndCh_chain = { SndCh_methods, NULL };
static PyObject *SndCh_getattr(self, name)
SndChannelObject *self;
char *name;
static PyObject *SndCh_getattr(SndChannelObject *self, char *name)
{
return Py_FindMethodInChain(&SndCh_chain, (PyObject *)self, name);
}
@ -384,9 +364,7 @@ static PyObject *SPBObj_New()
it->ob_spb.userLong = (long)it;
return (PyObject *)it;
}
static SPBObj_Convert(v, p_itself)
PyObject *v;
SPBPtr *p_itself;
static SPBObj_Convert(PyObject *v, SPBPtr *p_itself)
{
if (!SPBObj_Check(v))
{
@ -397,8 +375,7 @@ static SPBObj_Convert(v, p_itself)
return 1;
}
static void SPBObj_dealloc(self)
SPBObject *self;
static void SPBObj_dealloc(SPBObject *self)
{
/* Cleanup of self->ob_itself goes here */
self->ob_spb.userLong = 0;
@ -414,9 +391,7 @@ static PyMethodDef SPBObj_methods[] = {
static PyMethodChain SPBObj_chain = { SPBObj_methods, NULL };
static PyObject *SPBObj_getattr(self, name)
SPBObject *self;
char *name;
static PyObject *SPBObj_getattr(SPBObject *self, char *name)
{
if (strcmp(name, "inRefNum") == 0)
@ -430,10 +405,7 @@ static PyObject *SPBObj_getattr(self, name)
return Py_FindMethodInChain(&SPBObj_chain, (PyObject *)self, name);
}
static int SPBObj_setattr(self, name, value)
SPBObject *self;
char *name;
PyObject *value;
static int SPBObj_setattr(SPBObject *self, char *name, PyObject *value)
{
int rv = 0;
@ -447,13 +419,13 @@ static int SPBObj_setattr(self, name, value)
else if (strcmp(name, "buffer") == 0)
rv = PyArg_Parse(value, "w#", &self->ob_spb.bufferPtr, &self->ob_spb.bufferLength);
else if (strcmp(name, "completionRoutine") == 0) {
self->ob_spb.completionRoutine = NewSICompletionProc(SPB_completion);
self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
self->ob_completion = value;
Py_INCREF(value);
rv = 1;
#if !TARGET_API_MAC_CARBON
} else if (strcmp(name, "interruptRoutine") == 0) {
self->ob_spb.completionRoutine = NewSIInterruptProc(SPB_interrupt);
self->ob_spb.completionRoutine = NewSIInterruptUPP(SPB_interrupt);
self->ob_interrupt = value;
Py_INCREF(value);
rv = 1;
@ -491,17 +463,13 @@ staticforward PyTypeObject SPB_Type = {
/* ---------------------- End object type SPB ----------------------- */
static PyObject *Snd_SPB(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPB(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return SPBObj_New();
}
static PyObject *Snd_SysBeep(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SysBeep(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short duration;
@ -514,9 +482,7 @@ static PyObject *Snd_SysBeep(_self, _args)
return _res;
}
static PyObject *Snd_SndNewChannel(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndNewChannel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -537,7 +503,7 @@ static PyObject *Snd_SndNewChannel(_self, _args)
_err = SndNewChannel(&chan,
synth,
init,
NewSndCallBackProc(SndCh_UserRoutine));
NewSndCallBackUPP(SndCh_UserRoutine));
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
SndCh_New, chan);
@ -554,9 +520,7 @@ static PyObject *Snd_SndNewChannel(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_SndControl(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -574,9 +538,7 @@ static PyObject *Snd_SndControl(_self, _args)
}
#endif
static PyObject *Snd_SndSoundManagerVersion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndSoundManagerVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
NumVersion _rv;
@ -588,9 +550,7 @@ static PyObject *Snd_SndSoundManagerVersion(_self, _args)
return _res;
}
static PyObject *Snd_SndManagerStatus(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndManagerStatus(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -608,9 +568,7 @@ static PyObject *Snd_SndManagerStatus(_self, _args)
return _res;
}
static PyObject *Snd_SndGetSysBeepState(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndGetSysBeepState(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short sysBeepState;
@ -622,9 +580,7 @@ static PyObject *Snd_SndGetSysBeepState(_self, _args)
return _res;
}
static PyObject *Snd_SndSetSysBeepState(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SndSetSysBeepState(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -641,9 +597,7 @@ static PyObject *Snd_SndSetSysBeepState(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_MACEVersion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_MACEVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
NumVersion _rv;
@ -658,9 +612,7 @@ static PyObject *Snd_MACEVersion(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_Comp3to1(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_Comp3to1(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *buffer__in__;
@ -705,9 +657,7 @@ static PyObject *Snd_Comp3to1(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_Exp1to3(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_Exp1to3(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *buffer__in__;
@ -752,9 +702,7 @@ static PyObject *Snd_Exp1to3(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_Comp6to1(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_Comp6to1(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *buffer__in__;
@ -799,9 +747,7 @@ static PyObject *Snd_Comp6to1(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_Exp1to6(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_Exp1to6(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *buffer__in__;
@ -844,9 +790,7 @@ static PyObject *Snd_Exp1to6(_self, _args)
}
#endif
static PyObject *Snd_GetSysBeepVolume(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetSysBeepVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -860,9 +804,7 @@ static PyObject *Snd_GetSysBeepVolume(_self, _args)
return _res;
}
static PyObject *Snd_SetSysBeepVolume(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SetSysBeepVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -877,9 +819,7 @@ static PyObject *Snd_SetSysBeepVolume(_self, _args)
return _res;
}
static PyObject *Snd_GetDefaultOutputVolume(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetDefaultOutputVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -893,9 +833,7 @@ static PyObject *Snd_GetDefaultOutputVolume(_self, _args)
return _res;
}
static PyObject *Snd_SetDefaultOutputVolume(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SetDefaultOutputVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -910,9 +848,7 @@ static PyObject *Snd_SetDefaultOutputVolume(_self, _args)
return _res;
}
static PyObject *Snd_GetSoundHeaderOffset(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetSoundHeaderOffset(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -929,9 +865,7 @@ static PyObject *Snd_GetSoundHeaderOffset(_self, _args)
return _res;
}
static PyObject *Snd_GetCompressionInfo(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetCompressionInfo(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -958,9 +892,7 @@ static PyObject *Snd_GetCompressionInfo(_self, _args)
return _res;
}
static PyObject *Snd_SetSoundPreference(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SetSoundPreference(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -980,9 +912,7 @@ static PyObject *Snd_SetSoundPreference(_self, _args)
return _res;
}
static PyObject *Snd_GetSoundPreference(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetSoundPreference(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1002,9 +932,7 @@ static PyObject *Snd_GetSoundPreference(_self, _args)
return _res;
}
static PyObject *Snd_GetCompressionName(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_GetCompressionName(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1021,9 +949,7 @@ static PyObject *Snd_GetCompressionName(_self, _args)
return _res;
}
static PyObject *Snd_SPBVersion(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
NumVersion _rv;
@ -1035,9 +961,7 @@ static PyObject *Snd_SPBVersion(_self, _args)
return _res;
}
static PyObject *Snd_SPBSignInDevice(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBSignInDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1055,9 +979,7 @@ static PyObject *Snd_SPBSignInDevice(_self, _args)
return _res;
}
static PyObject *Snd_SPBSignOutDevice(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBSignOutDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1072,9 +994,7 @@ static PyObject *Snd_SPBSignOutDevice(_self, _args)
return _res;
}
static PyObject *Snd_SPBGetIndexedDevice(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBGetIndexedDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1094,9 +1014,7 @@ static PyObject *Snd_SPBGetIndexedDevice(_self, _args)
return _res;
}
static PyObject *Snd_SPBOpenDevice(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBOpenDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1116,9 +1034,7 @@ static PyObject *Snd_SPBOpenDevice(_self, _args)
return _res;
}
static PyObject *Snd_SPBCloseDevice(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBCloseDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1133,9 +1049,7 @@ static PyObject *Snd_SPBCloseDevice(_self, _args)
return _res;
}
static PyObject *Snd_SPBRecord(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBRecord(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1155,9 +1069,7 @@ static PyObject *Snd_SPBRecord(_self, _args)
#if !TARGET_API_MAC_CARBON
static PyObject *Snd_SPBRecordToFile(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBRecordToFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1179,9 +1091,7 @@ static PyObject *Snd_SPBRecordToFile(_self, _args)
}
#endif
static PyObject *Snd_SPBPauseRecording(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBPauseRecording(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1196,9 +1106,7 @@ static PyObject *Snd_SPBPauseRecording(_self, _args)
return _res;
}
static PyObject *Snd_SPBResumeRecording(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBResumeRecording(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1213,9 +1121,7 @@ static PyObject *Snd_SPBResumeRecording(_self, _args)
return _res;
}
static PyObject *Snd_SPBStopRecording(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBStopRecording(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1230,9 +1136,7 @@ static PyObject *Snd_SPBStopRecording(_self, _args)
return _res;
}
static PyObject *Snd_SPBGetRecordingStatus(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBGetRecordingStatus(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1264,9 +1168,7 @@ static PyObject *Snd_SPBGetRecordingStatus(_self, _args)
return _res;
}
static PyObject *Snd_SPBGetDeviceInfo(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBGetDeviceInfo(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1287,9 +1189,7 @@ static PyObject *Snd_SPBGetDeviceInfo(_self, _args)
return _res;
}
static PyObject *Snd_SPBSetDeviceInfo(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBSetDeviceInfo(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1310,9 +1210,7 @@ static PyObject *Snd_SPBSetDeviceInfo(_self, _args)
return _res;
}
static PyObject *Snd_SPBMillisecondsToBytes(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBMillisecondsToBytes(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1329,9 +1227,7 @@ static PyObject *Snd_SPBMillisecondsToBytes(_self, _args)
return _res;
}
static PyObject *Snd_SPBBytesToMilliseconds(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *Snd_SPBBytesToMilliseconds(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1453,8 +1349,7 @@ static PyMethodDef Snd_methods[] = {
/* Routine passed to Py_AddPendingCall -- call the Python callback */
static int
SndCh_CallCallBack(arg)
void *arg;
SndCh_CallCallBack(void *arg)
{
SndChannelObject *p = (SndChannelObject *)arg;
PyObject *args;
@ -1484,8 +1379,7 @@ SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd)
/* SPB callbacks - Schedule callbacks to Python */
static int
SPB_CallCallBack(arg)
void *arg;
SPB_CallCallBack(void *arg)
{
SPBObject *p = (SPBObject *)arg;
PyObject *args;
@ -1531,7 +1425,7 @@ SPB_interrupt(SPBPtr my_spb)
#endif
void initSnd()
void initSnd(void)
{
PyObject *m;
PyObject *d;

View File

@ -17,7 +17,12 @@ class SndMethod(SndMixIn, OSErrMethodGenerator): pass
# includestuff etc. are imported from macsupport
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Sound.h>
#include <OSUtils.h> /* for Set(Current)A5 */
#else
#include <Carbon/Carbon.h>
#endif
"""
initstuff = initstuff + """
@ -57,7 +62,7 @@ class SndCallBackType(InputOnlyType):
Output("goto %s__error__;", name)
OutRbrace()
def passInput(self, name):
return "NewSndCallBackProc(SndCh_UserRoutine)"
return "NewSndCallBackUPP(SndCh_UserRoutine)"
def cleanup(self, name):
# XXX This knows it is executing inside the SndNewChannel wrapper
Output("if (_res != NULL && %s != Py_None)", name)
@ -90,7 +95,6 @@ SMStatus = StructOutputBufferType('SMStatus')
CompressionInfo = StructOutputBufferType('CompressionInfo')
includestuff = includestuff + """
#include <OSUtils.h> /* for Set(Current)A5 */
/* Create a SndCommand object (an (int, int, int) tuple) */
static PyObject *
@ -126,8 +130,7 @@ static pascal void SPB_interrupt(SPBPtr my_spb); /* Forward */
finalstuff = finalstuff + """
/* Routine passed to Py_AddPendingCall -- call the Python callback */
static int
SndCh_CallCallBack(arg)
void *arg;
SndCh_CallCallBack(void *arg)
{
SndChannelObject *p = (SndChannelObject *)arg;
PyObject *args;
@ -157,8 +160,7 @@ SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd)
/* SPB callbacks - Schedule callbacks to Python */
static int
SPB_CallCallBack(arg)
void *arg;
SPB_CallCallBack(void *arg)
{
SPBObject *p = (SPBObject *)arg;
PyObject *args;
@ -268,11 +270,7 @@ class SpbObjectDefinition(ObjectDefinition):
Output("Py_XDECREF(self->ob_interrupt);")
def outputConvert(self):
Output("%s%s_Convert(v, p_itself)", self.static, self.prefix)
IndentLevel()
Output("PyObject *v;")
Output("%s *p_itself;", self.itselftype)
DedentLevel()
Output("%s%s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix, self.itselftype)
OutLbrace()
self.outputCheckConvertArg()
Output("if (!%s_Check(v))", self.prefix)
@ -286,12 +284,8 @@ class SpbObjectDefinition(ObjectDefinition):
def outputSetattr(self):
Output()
Output("static int %s_setattr(self, name, value)", self.prefix)
IndentLevel()
Output("%s *self;", self.objecttype)
Output("char *name;")
Output("PyObject *value;")
DedentLevel()
Output("static int %s_setattr(%s *self, char *name, PyObject *value)",
self.prefix, self.objecttype)
OutLbrace()
self.outputSetattrBody()
OutRbrace()
@ -309,13 +303,13 @@ class SpbObjectDefinition(ObjectDefinition):
else if (strcmp(name, "buffer") == 0)
rv = PyArg_Parse(value, "w#", &self->ob_spb.bufferPtr, &self->ob_spb.bufferLength);
else if (strcmp(name, "completionRoutine") == 0) {
self->ob_spb.completionRoutine = NewSICompletionProc(SPB_completion);
self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
self->ob_completion = value;
Py_INCREF(value);
rv = 1;
#if !TARGET_API_MAC_CARBON
} else if (strcmp(name, "interruptRoutine") == 0) {
self->ob_spb.completionRoutine = NewSIInterruptProc(SPB_interrupt);
self->ob_spb.completionRoutine = NewSIInterruptUPP(SPB_interrupt);
self->ob_interrupt = value;
Py_INCREF(value);
rv = 1;

View File

@ -8,7 +8,11 @@
#include "macglue.h"
#include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <TextEdit.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TEObj_New(TEHandle);
@ -25,8 +29,7 @@ extern int _TEObj_Convert(PyObject *, TEHandle *);
** Parse/generate TextStyle records
*/
static PyObject *
TextStyle_New(itself)
TextStylePtr itself;
TextStyle_New(TextStylePtr itself)
{
return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
@ -34,9 +37,7 @@ TextStyle_New(itself)
}
static int
TextStyle_Convert(v, p_itself)
PyObject *v;
TextStylePtr p_itself;
TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
{
long font, face, size;
@ -61,8 +62,7 @@ typedef struct TEObject {
TEHandle ob_itself;
} TEObject;
PyObject *TEObj_New(itself)
TEHandle itself;
PyObject *TEObj_New(TEHandle itself)
{
TEObject *it;
if (itself == NULL) {
@ -74,9 +74,7 @@ PyObject *TEObj_New(itself)
it->ob_itself = itself;
return (PyObject *)it;
}
TEObj_Convert(v, p_itself)
PyObject *v;
TEHandle *p_itself;
TEObj_Convert(PyObject *v, TEHandle *p_itself)
{
if (!TEObj_Check(v))
{
@ -87,16 +85,13 @@ TEObj_Convert(v, p_itself)
return 1;
}
static void TEObj_dealloc(self)
TEObject *self;
static void TEObj_dealloc(TEObject *self)
{
TEDispose(self->ob_itself);
PyMem_DEL(self);
}
static PyObject *TEObj_TESetText(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *text__in__;
@ -114,9 +109,7 @@ static PyObject *TEObj_TESetText(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetText(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetText(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CharsHandle _rv;
@ -128,9 +121,7 @@ static PyObject *TEObj_TEGetText(_self, _args)
return _res;
}
static PyObject *TEObj_TEIdle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEIdle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -141,9 +132,7 @@ static PyObject *TEObj_TEIdle(_self, _args)
return _res;
}
static PyObject *TEObj_TESetSelect(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESetSelect(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long selStart;
@ -160,9 +149,7 @@ static PyObject *TEObj_TESetSelect(_self, _args)
return _res;
}
static PyObject *TEObj_TEActivate(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEActivate(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -173,9 +160,7 @@ static PyObject *TEObj_TEActivate(_self, _args)
return _res;
}
static PyObject *TEObj_TEDeactivate(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEDeactivate(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -186,9 +171,7 @@ static PyObject *TEObj_TEDeactivate(_self, _args)
return _res;
}
static PyObject *TEObj_TEKey(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEKey(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CharParameter key;
@ -202,9 +185,7 @@ static PyObject *TEObj_TEKey(_self, _args)
return _res;
}
static PyObject *TEObj_TECut(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TECut(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -215,9 +196,7 @@ static PyObject *TEObj_TECut(_self, _args)
return _res;
}
static PyObject *TEObj_TECopy(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TECopy(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -228,9 +207,7 @@ static PyObject *TEObj_TECopy(_self, _args)
return _res;
}
static PyObject *TEObj_TEPaste(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEPaste(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -241,9 +218,7 @@ static PyObject *TEObj_TEPaste(_self, _args)
return _res;
}
static PyObject *TEObj_TEDelete(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEDelete(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -254,9 +229,7 @@ static PyObject *TEObj_TEDelete(_self, _args)
return _res;
}
static PyObject *TEObj_TEInsert(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEInsert(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *text__in__;
@ -274,9 +247,7 @@ static PyObject *TEObj_TEInsert(_self, _args)
return _res;
}
static PyObject *TEObj_TESetAlignment(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESetAlignment(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short just;
@ -290,9 +261,7 @@ static PyObject *TEObj_TESetAlignment(_self, _args)
return _res;
}
static PyObject *TEObj_TEUpdate(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEUpdate(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Rect rUpdate;
@ -306,9 +275,7 @@ static PyObject *TEObj_TEUpdate(_self, _args)
return _res;
}
static PyObject *TEObj_TEScroll(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEScroll(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short dh;
@ -325,9 +292,7 @@ static PyObject *TEObj_TEScroll(_self, _args)
return _res;
}
static PyObject *TEObj_TESelView(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESelView(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -338,9 +303,7 @@ static PyObject *TEObj_TESelView(_self, _args)
return _res;
}
static PyObject *TEObj_TEPinScroll(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEPinScroll(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short dh;
@ -357,9 +320,7 @@ static PyObject *TEObj_TEPinScroll(_self, _args)
return _res;
}
static PyObject *TEObj_TEAutoView(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEAutoView(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean fAuto;
@ -373,9 +334,7 @@ static PyObject *TEObj_TEAutoView(_self, _args)
return _res;
}
static PyObject *TEObj_TECalText(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TECalText(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -386,9 +345,7 @@ static PyObject *TEObj_TECalText(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetOffset(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetOffset(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -403,9 +360,7 @@ static PyObject *TEObj_TEGetOffset(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetPoint(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetPoint(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point _rv;
@ -420,9 +375,7 @@ static PyObject *TEObj_TEGetPoint(_self, _args)
return _res;
}
static PyObject *TEObj_TEClick(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEClick(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point pt;
@ -439,9 +392,7 @@ static PyObject *TEObj_TEClick(_self, _args)
return _res;
}
static PyObject *TEObj_TESetStyleHandle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESetStyleHandle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEStyleHandle theHandle;
@ -455,9 +406,7 @@ static PyObject *TEObj_TESetStyleHandle(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetStyleHandle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetStyleHandle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEStyleHandle _rv;
@ -469,9 +418,7 @@ static PyObject *TEObj_TEGetStyleHandle(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetStyle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetStyle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short offset;
@ -493,9 +440,7 @@ static PyObject *TEObj_TEGetStyle(_self, _args)
return _res;
}
static PyObject *TEObj_TEStylePaste(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEStylePaste(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
@ -506,9 +451,7 @@ static PyObject *TEObj_TEStylePaste(_self, _args)
return _res;
}
static PyObject *TEObj_TESetStyle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TESetStyle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short mode;
@ -528,9 +471,7 @@ static PyObject *TEObj_TESetStyle(_self, _args)
return _res;
}
static PyObject *TEObj_TEReplaceStyle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEReplaceStyle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short mode;
@ -553,9 +494,7 @@ static PyObject *TEObj_TEReplaceStyle(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetStyleScrapHandle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetStyleScrapHandle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
StScrpHandle _rv;
@ -567,9 +506,7 @@ static PyObject *TEObj_TEGetStyleScrapHandle(_self, _args)
return _res;
}
static PyObject *TEObj_TEStyleInsert(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEStyleInsert(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *text__in__;
@ -590,9 +527,7 @@ static PyObject *TEObj_TEStyleInsert(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetHeight(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetHeight(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -610,9 +545,7 @@ static PyObject *TEObj_TEGetHeight(_self, _args)
return _res;
}
static PyObject *TEObj_TEContinuousStyle(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEContinuousStyle(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
@ -632,9 +565,7 @@ static PyObject *TEObj_TEContinuousStyle(_self, _args)
return _res;
}
static PyObject *TEObj_TEUseStyleScrap(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEUseStyleScrap(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long rangeStart;
@ -657,9 +588,7 @@ static PyObject *TEObj_TEUseStyleScrap(_self, _args)
return _res;
}
static PyObject *TEObj_TENumStyles(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TENumStyles(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -677,9 +606,7 @@ static PyObject *TEObj_TENumStyles(_self, _args)
return _res;
}
static PyObject *TEObj_TEFeatureFlag(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEFeatureFlag(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
@ -697,9 +624,7 @@ static PyObject *TEObj_TEFeatureFlag(_self, _args)
return _res;
}
static PyObject *TEObj_TEGetHiliteRgn(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_TEGetHiliteRgn(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -715,9 +640,7 @@ static PyObject *TEObj_TEGetHiliteRgn(_self, _args)
return _res;
}
static PyObject *TEObj_as_Resource(_self, _args)
TEObject *_self;
PyObject *_args;
static PyObject *TEObj_as_Resource(TEObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -809,9 +732,7 @@ static PyMethodDef TEObj_methods[] = {
PyMethodChain TEObj_chain = { TEObj_methods, NULL };
static PyObject *TEObj_getattr(self, name)
TEObject *self;
char *name;
static PyObject *TEObj_getattr(TEObject *self, char *name)
{
if( strcmp(name, "destRect") == 0 )
@ -884,9 +805,7 @@ PyTypeObject TE_Type = {
/* ----------------------- End object type TE ----------------------- */
static PyObject *TE_TEScrapHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEScrapHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -898,9 +817,7 @@ static PyObject *TE_TEScrapHandle(_self, _args)
return _res;
}
static PyObject *TE_TEGetScrapLength(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEGetScrapLength(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
@ -912,9 +829,7 @@ static PyObject *TE_TEGetScrapLength(_self, _args)
return _res;
}
static PyObject *TE_TENew(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TENew(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEHandle _rv;
@ -931,9 +846,7 @@ static PyObject *TE_TENew(_self, _args)
return _res;
}
static PyObject *TE_TETextBox(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TETextBox(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *text__in__;
@ -956,9 +869,7 @@ static PyObject *TE_TETextBox(_self, _args)
return _res;
}
static PyObject *TE_TEStyleNew(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEStyleNew(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEHandle _rv;
@ -975,9 +886,7 @@ static PyObject *TE_TEStyleNew(_self, _args)
return _res;
}
static PyObject *TE_TESetScrapLength(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TESetScrapLength(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long length;
@ -990,9 +899,7 @@ static PyObject *TE_TESetScrapLength(_self, _args)
return _res;
}
static PyObject *TE_TEFromScrap(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEFromScrap(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1005,9 +912,7 @@ static PyObject *TE_TEFromScrap(_self, _args)
return _res;
}
static PyObject *TE_TEToScrap(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEToScrap(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
@ -1022,9 +927,7 @@ static PyObject *TE_TEToScrap(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *TE_TEGetScrapHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TEGetScrapHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle _rv;
@ -1039,9 +942,7 @@ static PyObject *TE_TEGetScrapHandle(_self, _args)
#if TARGET_API_MAC_CARBON
static PyObject *TE_TESetScrapHandle(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Handle value;
@ -1055,9 +956,7 @@ static PyObject *TE_TESetScrapHandle(_self, _args)
}
#endif
static PyObject *TE_as_TE(_self, _args)
PyObject *_self;
PyObject *_args;
static PyObject *TE_as_TE(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
TEHandle _rv;
@ -1106,15 +1005,15 @@ static PyMethodDef TE_methods[] = {
void initTE()
void initTE(void)
{
PyObject *m;
PyObject *d;
PyMac_INIT_TOOLBOX_OBJECT_NEW(TEObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert);
m = Py_InitModule("TE", TE_methods);

View File

@ -32,7 +32,11 @@ TextStyle = OpaqueType("TextStyle", "TextStyle")
TextStyle_ptr = TextStyle
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <TextEdit.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TEObj_New(TEHandle);
@ -49,8 +53,7 @@ extern int _TEObj_Convert(PyObject *, TEHandle *);
** Parse/generate TextStyle records
*/
static PyObject *
TextStyle_New(itself)
TextStylePtr itself;
TextStyle_New(TextStylePtr itself)
{
return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
@ -58,9 +61,7 @@ TextStyle_New(itself)
}
static int
TextStyle_Convert(v, p_itself)
PyObject *v;
TextStylePtr p_itself;
TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
{
long font, face, size;
@ -74,8 +75,8 @@ TextStyle_Convert(v, p_itself)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(TEObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert);
"""
class TEMethodGenerator(OSErrMethodGenerator):

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,11 @@ PropertyCreator = OSTypeType("PropertyCreator")
PropertyTag = OSTypeType("PropertyTag")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#ifdef WITHOUT_FRAMEWORKS
#include <Windows.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_WinObj_New(WindowRef);
@ -92,8 +96,7 @@ finalstuff = finalstuff + """
/* Return the object corresponding to the window, or NULL */
PyObject *
WinObj_WhichWindow(w)
WindowPtr w;
WinObj_WhichWindow(WindowPtr w)
{
PyObject *it;
@ -114,9 +117,9 @@ WinObj_WhichWindow(w)
"""
initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(WinObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(WinObj_WhichWindow);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WinObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
"""
class MyObjectDefinition(GlobalObjectDefinition):
@ -164,10 +167,7 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputCompare(self):
Output()
Output("static int %s_compare(self, other)", self.prefix)
IndentLevel()
Output("%s *self, *other;", self.objecttype)
DedentLevel()
Output("static int %s_compare(%s *self, %s *other)", self.prefix, self.objecttype, self.objecttype)
OutLbrace()
Output("if ( self->ob_itself > other->ob_itself ) return 1;")
Output("if ( self->ob_itself < other->ob_itself ) return -1;")
@ -176,20 +176,14 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputHash(self):
Output()
Output("static int %s_hash(self)", self.prefix)
IndentLevel()
Output("%s *self;", self.objecttype)
DedentLevel()
Output("static int %s_hash(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("return (int)self->ob_itself;")
OutRbrace()
def outputRepr(self):
Output()
Output("static PyObject * %s_repr(self)", self.prefix)
IndentLevel()
Output("%s *self;", self.objecttype)
DedentLevel()
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
Output("""sprintf(buf, "<Window object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")