[Python-checkins] CVS: python/dist/src/Mac/Modules/fm _Fmmodule.c,1.5,1.6
Jack Jansen
jackjansen@users.sourceforge.net
Sun, 24 Mar 2002 15:03:32 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/fm
In directory usw-pr-cvs1:/tmp/cvs-serv362/Python/Mac/Modules/fm
Modified Files:
_Fmmodule.c
Log Message:
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.
Index: _Fmmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/fm/_Fmmodule.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** _Fmmodule.c 7 Jan 2002 14:15:02 -0000 1.5
--- _Fmmodule.c 24 Mar 2002 23:03:30 -0000 1.6
***************
*** 65,68 ****
--- 65,71 ----
{
PyObject *_res = NULL;
+ #ifndef InitFonts
+ PyMac_PRECHECK(InitFonts);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 79,82 ****
--- 82,88 ----
short familyID;
Str255 name;
+ #ifndef GetFontName
+ PyMac_PRECHECK(GetFontName);
+ #endif
if (!PyArg_ParseTuple(_args, "h",
&familyID))
***************
*** 94,97 ****
--- 100,106 ----
Str255 name;
short familyID;
+ #ifndef GetFNum
+ PyMac_PRECHECK(GetFNum);
+ #endif
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetStr255, name))
***************
*** 110,113 ****
--- 119,125 ----
short fontNum;
short size;
+ #ifndef RealFont
+ PyMac_PRECHECK(RealFont);
+ #endif
if (!PyArg_ParseTuple(_args, "hh",
&fontNum,
***************
*** 127,130 ****
--- 139,145 ----
PyObject *_res = NULL;
Boolean lockFlag;
+ #ifndef SetFontLock
+ PyMac_PRECHECK(SetFontLock);
+ #endif
if (!PyArg_ParseTuple(_args, "b",
&lockFlag))
***************
*** 141,144 ****
--- 156,162 ----
PyObject *_res = NULL;
Boolean fscaleDisable;
+ #ifndef SetFScaleDisable
+ PyMac_PRECHECK(SetFScaleDisable);
+ #endif
if (!PyArg_ParseTuple(_args, "b",
&fscaleDisable))
***************
*** 154,157 ****
--- 172,178 ----
PyObject *_res = NULL;
FMetricRec theMetrics;
+ #ifndef FontMetrics
+ PyMac_PRECHECK(FontMetrics);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 166,169 ****
--- 187,193 ----
PyObject *_res = NULL;
Boolean fractEnable;
+ #ifndef SetFractEnable
+ PyMac_PRECHECK(SetFractEnable);
+ #endif
if (!PyArg_ParseTuple(_args, "b",
&fractEnable))
***************
*** 179,182 ****
--- 203,209 ----
PyObject *_res = NULL;
short _rv;
+ #ifndef GetDefFontSize
+ PyMac_PRECHECK(GetDefFontSize);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 193,196 ****
--- 220,226 ----
Point numer;
Point denom;
+ #ifndef IsOutline
+ PyMac_PRECHECK(IsOutline);
+ #endif
if (!PyArg_ParseTuple(_args, "O&O&",
PyMac_GetPoint, &numer,
***************
*** 208,211 ****
--- 238,244 ----
PyObject *_res = NULL;
Boolean outlinePreferred;
+ #ifndef SetOutlinePreferred
+ PyMac_PRECHECK(SetOutlinePreferred);
+ #endif
if (!PyArg_ParseTuple(_args, "b",
&outlinePreferred))
***************
*** 221,224 ****
--- 254,260 ----
PyObject *_res = NULL;
Boolean _rv;
+ #ifndef GetOutlinePreferred
+ PyMac_PRECHECK(GetOutlinePreferred);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 233,236 ****
--- 269,275 ----
PyObject *_res = NULL;
Boolean preserveGlyph;
+ #ifndef SetPreserveGlyph
+ PyMac_PRECHECK(SetPreserveGlyph);
+ #endif
if (!PyArg_ParseTuple(_args, "b",
&preserveGlyph))
***************
*** 246,249 ****
--- 285,291 ----
PyObject *_res = NULL;
Boolean _rv;
+ #ifndef GetPreserveGlyph
+ PyMac_PRECHECK(GetPreserveGlyph);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 260,263 ****
--- 302,308 ----
PyObject *_res = NULL;
OSErr _err;
+ #ifndef FlushFonts
+ PyMac_PRECHECK(FlushFonts);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 274,277 ****
--- 319,325 ----
PyObject *_res = NULL;
short _rv;
+ #ifndef GetSysFont
+ PyMac_PRECHECK(GetSysFont);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 286,289 ****
--- 334,340 ----
PyObject *_res = NULL;
short _rv;
+ #ifndef GetAppFont
+ PyMac_PRECHECK(GetAppFont);
+ #endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
***************
*** 301,304 ****
--- 352,358 ----
int inText__in_len__;
Rect bounds;
+ #ifndef QDTextBounds
+ PyMac_PRECHECK(QDTextBounds);
+ #endif
if (!PyArg_ParseTuple(_args, "s#",
&inText__in__, &inText__in_len__))