Commit 9d79990a authored by Jack Jansen's avatar Jack Jansen

Weaklink most toolbox modules, improving backward compatibility. Modules will...

Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.

Should finally fix 531398. 2.2.1 candidate.

Also blacklisted some constants with definitions that were not Python-compatible.
parent d69711cb
This diff is collapsed.
This diff is collapsed.
......@@ -118,12 +118,12 @@ object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
module.addobject(object)
ThemeDrawingState = OpaqueByValueType("ThemeDrawingState", "ThemeDrawingStateObj")
Method = MethodGenerator
Method = WeakLinkMethodGenerator
# Create the generator classes used to populate the lists
Function = OSErrFunctionGenerator
##Method = OSErrMethodGenerator
Function = OSErrWeakLinkFunctionGenerator
##Method = OSErrWeakLinkMethodGenerator
# Create and populate the lists
functions = []
......
......@@ -95,6 +95,7 @@ class MyScanner(Scanner_OSX):
"CFStringCreateMutableWithExternalCharactersNoCopy", # Not a clue...
"CFStringSetExternalCharactersNoCopy",
"CFStringGetCharacterAtIndex", # No format for single unichars yet.
"kCFStringEncodingInvalidId", # incompatible constant declaration
]
def makegreylist(self):
......
This diff is collapsed.
This diff is collapsed.
......@@ -33,6 +33,9 @@ static PyObject *Evt_GetMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point mouseLoc;
#ifndef GetMouse
PyMac_PRECHECK(GetMouse);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
GetMouse(&mouseLoc);
......@@ -45,6 +48,9 @@ static PyObject *Evt_Button(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef Button
PyMac_PRECHECK(Button);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = Button();
......@@ -57,6 +63,9 @@ static PyObject *Evt_StillDown(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef StillDown
PyMac_PRECHECK(StillDown);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = StillDown();
......@@ -69,6 +78,9 @@ static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef WaitMouseUp
PyMac_PRECHECK(WaitMouseUp);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = WaitMouseUp();
......@@ -81,6 +93,9 @@ static PyObject *Evt_GetCaretTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
#ifndef GetCaretTime
PyMac_PRECHECK(GetCaretTime);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetCaretTime();
......@@ -93,6 +108,9 @@ static PyObject *Evt_GetKeys(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
KeyMap theKeys__out__;
#ifndef GetKeys
PyMac_PRECHECK(GetKeys);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
GetKeys(theKeys__out__);
......@@ -105,6 +123,9 @@ static PyObject *Evt_GetDblTime(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
#ifndef GetDblTime
PyMac_PRECHECK(GetDblTime);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetDblTime();
......@@ -117,6 +138,9 @@ static PyObject *Evt_SetEventMask(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
EventMask value;
#ifndef SetEventMask
PyMac_PRECHECK(SetEventMask);
#endif
if (!PyArg_ParseTuple(_args, "H",
&value))
return NULL;
......@@ -132,6 +156,9 @@ static PyObject *Evt_GetNextEvent(PyObject *_self, PyObject *_args)
Boolean _rv;
EventMask eventMask;
EventRecord theEvent;
#ifndef GetNextEvent
PyMac_PRECHECK(GetNextEvent);
#endif
if (!PyArg_ParseTuple(_args, "H",
&eventMask))
return NULL;
......@@ -149,6 +176,9 @@ static PyObject *Evt_EventAvail(PyObject *_self, PyObject *_args)
Boolean _rv;
EventMask eventMask;
EventRecord theEvent;
#ifndef EventAvail
PyMac_PRECHECK(EventAvail);
#endif
if (!PyArg_ParseTuple(_args, "H",
&eventMask))
return NULL;
......@@ -166,6 +196,9 @@ static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args)
OSErr _err;
EventKind eventNum;
UInt32 eventMsg;
#ifndef PostEvent
PyMac_PRECHECK(PostEvent);
#endif
if (!PyArg_ParseTuple(_args, "Hl",
&eventNum,
&eventMsg))
......@@ -186,6 +219,9 @@ static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
Boolean _rv;
EventMask mask;
EventRecord theEvent;
#ifndef OSEventAvail
PyMac_PRECHECK(OSEventAvail);
#endif
if (!PyArg_ParseTuple(_args, "H",
&mask))
return NULL;
......@@ -206,6 +242,9 @@ static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
Boolean _rv;
EventMask mask;
EventRecord theEvent;
#ifndef GetOSEvent
PyMac_PRECHECK(GetOSEvent);
#endif
if (!PyArg_ParseTuple(_args, "H",
&mask))
return NULL;
......@@ -223,6 +262,9 @@ static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
EventMask whichMask;
EventMask stopMask;
#ifndef FlushEvents
PyMac_PRECHECK(FlushEvents);
#endif
if (!PyArg_ParseTuple(_args, "HH",
&whichMask,
&stopMask))
......@@ -241,6 +283,9 @@ static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
EventRecord theEvent;
WindowPtr theWindow;
#ifndef SystemClick
PyMac_PRECHECK(SystemClick);
#endif
if (!PyArg_ParseTuple(_args, "O&O&",
PyMac_GetEventRecord, &theEvent,
WinObj_Convert, &theWindow))
......@@ -258,6 +303,9 @@ static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
#ifndef SystemTask
PyMac_PRECHECK(SystemTask);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
SystemTask();
......@@ -274,6 +322,9 @@ static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
Boolean _rv;
EventRecord theEvent;
#ifndef SystemEvent
PyMac_PRECHECK(SystemEvent);
#endif
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetEventRecord, &theEvent))
return NULL;
......@@ -290,6 +341,9 @@ static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Point globalMouse;
#ifndef GetGlobalMouse
PyMac_PRECHECK(GetGlobalMouse);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
GetGlobalMouse(&globalMouse);
......@@ -305,6 +359,9 @@ static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
#ifndef GetCurrentKeyModifiers
PyMac_PRECHECK(GetCurrentKeyModifiers);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetCurrentKeyModifiers();
......@@ -320,6 +377,9 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef CheckEventQueueForUserCancel
PyMac_PRECHECK(CheckEventQueueForUserCancel);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = CheckEventQueueForUserCancel();
......@@ -333,6 +393,9 @@ static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short code;
#ifndef KeyScript
PyMac_PRECHECK(KeyScript);
#endif
if (!PyArg_ParseTuple(_args, "h",
&code))
return NULL;
......@@ -348,6 +411,9 @@ static PyObject *Evt_IsCmdChar(PyObject *_self, PyObject *_args)
Boolean _rv;
EventRecord event;
short test;
#ifndef IsCmdChar
PyMac_PRECHECK(IsCmdChar);
#endif
if (!PyArg_ParseTuple(_args, "O&h",
PyMac_GetEventRecord, &event,
&test))
......@@ -363,6 +429,9 @@ static PyObject *Evt_LMGetKeyThresh(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
#ifndef LMGetKeyThresh
PyMac_PRECHECK(LMGetKeyThresh);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = LMGetKeyThresh();
......@@ -375,6 +444,9 @@ static PyObject *Evt_LMSetKeyThresh(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 value;
#ifndef LMSetKeyThresh
PyMac_PRECHECK(LMSetKeyThresh);
#endif
if (!PyArg_ParseTuple(_args, "h",
&value))
return NULL;
......@@ -388,6 +460,9 @@ static PyObject *Evt_LMGetKeyRepThresh(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 _rv;
#ifndef LMGetKeyRepThresh
PyMac_PRECHECK(LMGetKeyRepThresh);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = LMGetKeyRepThresh();
......@@ -400,6 +475,9 @@ static PyObject *Evt_LMSetKeyRepThresh(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt16 value;
#ifndef LMSetKeyRepThresh
PyMac_PRECHECK(LMSetKeyRepThresh);
#endif
if (!PyArg_ParseTuple(_args, "h",
&value))
return NULL;
......@@ -413,6 +491,9 @@ static PyObject *Evt_LMGetKbdLast(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt8 _rv;
#ifndef LMGetKbdLast
PyMac_PRECHECK(LMGetKbdLast);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = LMGetKbdLast();
......@@ -425,6 +506,9 @@ static PyObject *Evt_LMSetKbdLast(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt8 value;
#ifndef LMSetKbdLast
PyMac_PRECHECK(LMSetKbdLast);
#endif
if (!PyArg_ParseTuple(_args, "b",
&value))
return NULL;
......@@ -438,6 +522,9 @@ static PyObject *Evt_LMGetKbdType(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt8 _rv;
#ifndef LMGetKbdType
PyMac_PRECHECK(LMGetKbdType);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = LMGetKbdType();
......@@ -450,6 +537,9 @@ static PyObject *Evt_LMSetKbdType(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt8 value;
#ifndef LMSetKbdType
PyMac_PRECHECK(LMSetKbdType);
#endif
if (!PyArg_ParseTuple(_args, "b",
&value))
return NULL;
......@@ -463,6 +553,9 @@ static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
UInt32 _rv;
#ifndef TickCount
PyMac_PRECHECK(TickCount);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = TickCount();
......
......@@ -64,6 +64,9 @@ static PyObject *Fm_Error;
static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
#ifndef InitFonts
PyMac_PRECHECK(InitFonts);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
InitFonts();
......@@ -78,6 +81,9 @@ static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
short familyID;
Str255 name;
#ifndef GetFontName
PyMac_PRECHECK(GetFontName);
#endif
if (!PyArg_ParseTuple(_args, "h",
&familyID))
return NULL;
......@@ -93,6 +99,9 @@ static PyObject *Fm_GetFNum(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
Str255 name;
short familyID;
#ifndef GetFNum
PyMac_PRECHECK(GetFNum);
#endif
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetStr255, name))
return NULL;
......@@ -109,6 +118,9 @@ static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args)
Boolean _rv;
short fontNum;
short size;
#ifndef RealFont
PyMac_PRECHECK(RealFont);
#endif
if (!PyArg_ParseTuple(_args, "hh",
&fontNum,
&size))
......@@ -126,6 +138,9 @@ static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean lockFlag;
#ifndef SetFontLock
PyMac_PRECHECK(SetFontLock);
#endif
if (!PyArg_ParseTuple(_args, "b",
&lockFlag))
return NULL;
......@@ -140,6 +155,9 @@ static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean fscaleDisable;
#ifndef SetFScaleDisable
PyMac_PRECHECK(SetFScaleDisable);
#endif
if (!PyArg_ParseTuple(_args, "b",
&fscaleDisable))
return NULL;
......@@ -153,6 +171,9 @@ static PyObject *Fm_FontMetrics(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
FMetricRec theMetrics;
#ifndef FontMetrics
PyMac_PRECHECK(FontMetrics);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
FontMetrics(&theMetrics);
......@@ -165,6 +186,9 @@ static PyObject *Fm_SetFractEnable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean fractEnable;
#ifndef SetFractEnable
PyMac_PRECHECK(SetFractEnable);
#endif
if (!PyArg_ParseTuple(_args, "b",
&fractEnable))
return NULL;
......@@ -178,6 +202,9 @@ static PyObject *Fm_GetDefFontSize(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
#ifndef GetDefFontSize
PyMac_PRECHECK(GetDefFontSize);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetDefFontSize();
......@@ -192,6 +219,9 @@ static PyObject *Fm_IsOutline(PyObject *_self, PyObject *_args)
Boolean _rv;
Point numer;
Point denom;
#ifndef IsOutline
PyMac_PRECHECK(IsOutline);
#endif
if (!PyArg_ParseTuple(_args, "O&O&",
PyMac_GetPoint, &numer,
PyMac_GetPoint, &denom))
......@@ -207,6 +237,9 @@ static PyObject *Fm_SetOutlinePreferred(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean outlinePreferred;
#ifndef SetOutlinePreferred
PyMac_PRECHECK(SetOutlinePreferred);
#endif
if (!PyArg_ParseTuple(_args, "b",
&outlinePreferred))
return NULL;
......@@ -220,6 +253,9 @@ static PyObject *Fm_GetOutlinePreferred(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef GetOutlinePreferred
PyMac_PRECHECK(GetOutlinePreferred);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetOutlinePreferred();
......@@ -232,6 +268,9 @@ static PyObject *Fm_SetPreserveGlyph(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean preserveGlyph;
#ifndef SetPreserveGlyph
PyMac_PRECHECK(SetPreserveGlyph);
#endif
if (!PyArg_ParseTuple(_args, "b",
&preserveGlyph))
return NULL;
......@@ -245,6 +284,9 @@ static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
#ifndef GetPreserveGlyph
PyMac_PRECHECK(GetPreserveGlyph);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetPreserveGlyph();
......@@ -259,6 +301,9 @@ static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
#ifndef FlushFonts
PyMac_PRECHECK(FlushFonts);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = FlushFonts();
......@@ -273,6 +318,9 @@ static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
#ifndef GetSysFont
PyMac_PRECHECK(GetSysFont);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetSysFont();
......@@ -285,6 +333,9 @@ static PyObject *Fm_GetAppFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
short _rv;
#ifndef GetAppFont
PyMac_PRECHECK(GetAppFont);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetAppFont();
......@@ -300,6 +351,9 @@ static PyObject *Fm_QDTextBounds(PyObject *_self, PyObject *_args)
int inText__len__;
int inText__in_len__;
Rect bounds;
#ifndef QDTextBounds
PyMac_PRECHECK(QDTextBounds);
#endif
if (!PyArg_ParseTuple(_args, "s#",
&inText__in__, &inText__in_len__))
return NULL;
......
This diff is collapsed.
This diff is collapsed.
......@@ -80,6 +80,9 @@ static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GDHandle _rv;
#ifndef GetGWorldDevice
PyMac_PRECHECK(GetGWorldDevice);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetGWorldDevice(_self->ob_itself);
......@@ -92,6 +95,9 @@ static PyObject *GWorldObj_GetGWorldPixMap(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle _rv;
#ifndef GetGWorldPixMap
PyMac_PRECHECK(GetGWorldPixMap);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetGWorldPixMap(_self->ob_itself);
......@@ -104,6 +110,9 @@ static PyObject *GWorldObj_as_GrafPtr(GWorldObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GrafPtr _rv;
#ifndef as_GrafPtr
PyMac_PRECHECK(as_GrafPtr);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = as_GrafPtr(_self->ob_itself);
......@@ -169,6 +178,9 @@ static PyObject *Qdoffs_NewGWorld(PyObject *_self, PyObject *_args)
CTabHandle cTable;
GDHandle aGDevice;
GWorldFlags flags;
#ifndef NewGWorld
PyMac_PRECHECK(NewGWorld);
#endif
if (!PyArg_ParseTuple(_args, "hO&O&O&l",
&PixelDepth,
PyMac_GetRect, &boundsRect,
......@@ -193,6 +205,9 @@ static PyObject *Qdoffs_LockPixels(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
Boolean _rv;
PixMapHandle pm;
#ifndef LockPixels
PyMac_PRECHECK(LockPixels);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -206,6 +221,9 @@ static PyObject *Qdoffs_UnlockPixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
#ifndef UnlockPixels
PyMac_PRECHECK(UnlockPixels);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -225,6 +243,9 @@ static PyObject *Qdoffs_UpdateGWorld(PyObject *_self, PyObject *_args)
CTabHandle cTable;
GDHandle aGDevice;
GWorldFlags flags;
#ifndef UpdateGWorld
PyMac_PRECHECK(UpdateGWorld);
#endif
if (!PyArg_ParseTuple(_args, "hO&O&O&l",
&pixelDepth,
PyMac_GetRect, &boundsRect,
......@@ -249,6 +270,9 @@ static PyObject *Qdoffs_GetGWorld(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
CGrafPtr port;
GDHandle gdh;
#ifndef GetGWorld
PyMac_PRECHECK(GetGWorld);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
GetGWorld(&port,
......@@ -264,6 +288,9 @@ static PyObject *Qdoffs_SetGWorld(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
CGrafPtr port;
GDHandle gdh;
#ifndef SetGWorld
PyMac_PRECHECK(SetGWorld);
#endif
if (!PyArg_ParseTuple(_args, "O&O&",
GrafObj_Convert, &port,
OptResObj_Convert, &gdh))
......@@ -279,6 +306,9 @@ static PyObject *Qdoffs_CTabChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CTabHandle ctab;
#ifndef CTabChanged
PyMac_PRECHECK(CTabChanged);
#endif
if (!PyArg_ParseTuple(_args, "O&",
OptResObj_Convert, &ctab))
return NULL;
......@@ -292,6 +322,9 @@ static PyObject *Qdoffs_PixPatChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixPatHandle ppat;
#ifndef PixPatChanged
PyMac_PRECHECK(PixPatChanged);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &ppat))
return NULL;
......@@ -305,6 +338,9 @@ static PyObject *Qdoffs_PortChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GrafPtr port;
#ifndef PortChanged
PyMac_PRECHECK(PortChanged);
#endif
if (!PyArg_ParseTuple(_args, "O&",
GrafObj_Convert, &port))
return NULL;
......@@ -318,6 +354,9 @@ static PyObject *Qdoffs_GDeviceChanged(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
GDHandle gdh;
#ifndef GDeviceChanged
PyMac_PRECHECK(GDeviceChanged);
#endif
if (!PyArg_ParseTuple(_args, "O&",
OptResObj_Convert, &gdh))
return NULL;
......@@ -331,6 +370,9 @@ static PyObject *Qdoffs_AllowPurgePixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
#ifndef AllowPurgePixels
PyMac_PRECHECK(AllowPurgePixels);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -344,6 +386,9 @@ static PyObject *Qdoffs_NoPurgePixels(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle pm;
#ifndef NoPurgePixels
PyMac_PRECHECK(NoPurgePixels);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -358,6 +403,9 @@ static PyObject *Qdoffs_GetPixelsState(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
GWorldFlags _rv;
PixMapHandle pm;
#ifndef GetPixelsState
PyMac_PRECHECK(GetPixelsState);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -372,6 +420,9 @@ static PyObject *Qdoffs_SetPixelsState(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
PixMapHandle pm;
GWorldFlags state;
#ifndef SetPixelsState
PyMac_PRECHECK(SetPixelsState);
#endif
if (!PyArg_ParseTuple(_args, "O&l",
ResObj_Convert, &pm,
&state))
......@@ -388,6 +439,9 @@ static PyObject *Qdoffs_GetPixRowBytes(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
long _rv;
PixMapHandle pm;
#ifndef GetPixRowBytes
PyMac_PRECHECK(GetPixRowBytes);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pm))
return NULL;
......@@ -405,6 +459,9 @@ static PyObject *Qdoffs_NewScreenBuffer(PyObject *_self, PyObject *_args)
Boolean purgeable;
GDHandle gdh;
PixMapHandle offscreenPixMap;
#ifndef NewScreenBuffer
PyMac_PRECHECK(NewScreenBuffer);
#endif
if (!PyArg_ParseTuple(_args, "O&b",
PyMac_GetRect, &globalRect,
&purgeable))
......@@ -424,6 +481,9 @@ static PyObject *Qdoffs_DisposeScreenBuffer(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PixMapHandle offscreenPixMap;
#ifndef DisposeScreenBuffer
PyMac_PRECHECK(DisposeScreenBuffer);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &offscreenPixMap))
return NULL;
......@@ -438,6 +498,9 @@ static PyObject *Qdoffs_QDDone(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
Boolean _rv;
GrafPtr port;
#ifndef QDDone
PyMac_PRECHECK(QDDone);
#endif
if (!PyArg_ParseTuple(_args, "O&",
GrafObj_Convert, &port))
return NULL;
......@@ -451,6 +514,9 @@ static PyObject *Qdoffs_OffscreenVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
#ifndef OffscreenVersion
PyMac_PRECHECK(OffscreenVersion);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = OffscreenVersion();
......@@ -467,6 +533,9 @@ static PyObject *Qdoffs_NewTempScreenBuffer(PyObject *_self, PyObject *_args)
Boolean purgeable;
GDHandle gdh;
PixMapHandle offscreenPixMap;
#ifndef NewTempScreenBuffer
PyMac_PRECHECK(NewTempScreenBuffer);
#endif
if (!PyArg_ParseTuple(_args, "O&b",
PyMac_GetRect, &globalRect,
&purgeable))
......@@ -487,6 +556,9 @@ static PyObject *Qdoffs_PixMap32Bit(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
Boolean _rv;
PixMapHandle pmHandle;
#ifndef PixMap32Bit
PyMac_PRECHECK(PixMap32Bit);
#endif
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &pmHandle))
return NULL;
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,6 +48,8 @@ class MyScanner(Scanner):
def writeinitialdefs(self):
self.defsfile.write("kPascalStackBased = None # workaround for header parsing\n")
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
def makeblacklistnames(self):
return [
"WEDispose",
......@@ -56,6 +58,22 @@ class MyScanner(Scanner):
"WEVersion", # Unfortunately...
"WEPut", # XXXX TBD: needs array of flavortypes.
"WEGetOneAttribute", # XXXX TBD: output buffer
# Incompatible constant definitions
"weDoAutoScroll",
"weDoOutlineHilite",
"weDoReadOnly",
"weDoUndo",
"weDoIntCutAndPaste",
"weDoDragAndDrop",
"weDoInhibitRecal",
"weDoUseTempMem",
"weDoDrawOffscreen",
"weDoInhibitRedraw",
"weDoMonoStyled",
"weDoMultipleUndo",
"weDoNoKeyboardSync",
"weDoInhibitICSupport",
"weDoInhibitColor",
]
def makeblacklisttypes(self):
......
......@@ -32,6 +32,8 @@ class MyScanner(Scanner):
def writeinitialdefs(self):
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
self.defsfile.write("false = 0\n")
self.defsfile.write("true = 1\n")
def makeblacklistnames(self):
return [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment