]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport of _Appmodule.c 1.10, appsupport.py 1.14:
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 25 Mar 2002 10:30:36 +0000 (10:30 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 25 Mar 2002 10:30:36 +0000 (10:30 +0000)
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.

Mac/Modules/app/_Appmodule.c
Mac/Modules/app/appsupport.py

index 86441e341cea6bf1f5f7ed209f9086354004ddae..7105c7cf0a08365d0e14836e14dba6c6f4735e70 100644 (file)
@@ -77,6 +77,9 @@ static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObje
        PyObject *_res = NULL;
        OSStatus _rv;
        Boolean inDisposeNow;
+#ifndef SetThemeDrawingState
+       PyMac_PRECHECK(SetThemeDrawingState);
+#endif
        if (!PyArg_ParseTuple(_args, "b",
                              &inDisposeNow))
                return NULL;
@@ -91,6 +94,9 @@ static PyObject *ThemeDrawingStateObj_DisposeThemeDrawingState(ThemeDrawingState
 {
        PyObject *_res = NULL;
        OSStatus _rv;
+#ifndef DisposeThemeDrawingState
+       PyMac_PRECHECK(DisposeThemeDrawingState);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _rv = DisposeThemeDrawingState(_self->ob_itself);
@@ -148,6 +154,9 @@ static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        OSStatus _err;
+#ifndef RegisterAppearanceClient
+       PyMac_PRECHECK(RegisterAppearanceClient);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = RegisterAppearanceClient();
@@ -161,6 +170,9 @@ static PyObject *App_UnregisterAppearanceClient(PyObject *_self, PyObject *_args
 {
        PyObject *_res = NULL;
        OSStatus _err;
+#ifndef UnregisterAppearanceClient
+       PyMac_PRECHECK(UnregisterAppearanceClient);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = UnregisterAppearanceClient();
@@ -177,6 +189,9 @@ static PyObject *App_SetThemePen(PyObject *_self, PyObject *_args)
        ThemeBrush inBrush;
        SInt16 inDepth;
        Boolean inIsColorDevice;
+#ifndef SetThemePen
+       PyMac_PRECHECK(SetThemePen);
+#endif
        if (!PyArg_ParseTuple(_args, "hhb",
                              &inBrush,
                              &inDepth,
@@ -198,6 +213,9 @@ static PyObject *App_SetThemeBackground(PyObject *_self, PyObject *_args)
        ThemeBrush inBrush;
        SInt16 inDepth;
        Boolean inIsColorDevice;
+#ifndef SetThemeBackground
+       PyMac_PRECHECK(SetThemeBackground);
+#endif
        if (!PyArg_ParseTuple(_args, "hhb",
                              &inBrush,
                              &inDepth,
@@ -219,6 +237,9 @@ static PyObject *App_SetThemeTextColor(PyObject *_self, PyObject *_args)
        ThemeTextColor inColor;
        SInt16 inDepth;
        Boolean inIsColorDevice;
+#ifndef SetThemeTextColor
+       PyMac_PRECHECK(SetThemeTextColor);
+#endif
        if (!PyArg_ParseTuple(_args, "hhb",
                              &inColor,
                              &inDepth,
@@ -240,6 +261,9 @@ static PyObject *App_SetThemeWindowBackground(PyObject *_self, PyObject *_args)
        WindowPtr inWindow;
        ThemeBrush inBrush;
        Boolean inUpdate;
+#ifndef SetThemeWindowBackground
+       PyMac_PRECHECK(SetThemeWindowBackground);
+#endif
        if (!PyArg_ParseTuple(_args, "O&hb",
                              WinObj_Convert, &inWindow,
                              &inBrush,
@@ -260,6 +284,9 @@ static PyObject *App_DrawThemeWindowHeader(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeWindowHeader
+       PyMac_PRECHECK(DrawThemeWindowHeader);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -278,6 +305,9 @@ static PyObject *App_DrawThemeWindowListViewHeader(PyObject *_self, PyObject *_a
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeWindowListViewHeader
+       PyMac_PRECHECK(DrawThemeWindowListViewHeader);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -296,6 +326,9 @@ static PyObject *App_DrawThemePlacard(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemePlacard
+       PyMac_PRECHECK(DrawThemePlacard);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -314,6 +347,9 @@ static PyObject *App_DrawThemeEditTextFrame(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeEditTextFrame
+       PyMac_PRECHECK(DrawThemeEditTextFrame);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -332,6 +368,9 @@ static PyObject *App_DrawThemeListBoxFrame(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeListBoxFrame
+       PyMac_PRECHECK(DrawThemeListBoxFrame);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -350,6 +389,9 @@ static PyObject *App_DrawThemeFocusRect(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        Boolean inHasFocus;
+#ifndef DrawThemeFocusRect
+       PyMac_PRECHECK(DrawThemeFocusRect);
+#endif
        if (!PyArg_ParseTuple(_args, "O&b",
                              PyMac_GetRect, &inRect,
                              &inHasFocus))
@@ -368,6 +410,9 @@ static PyObject *App_DrawThemePrimaryGroup(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemePrimaryGroup
+       PyMac_PRECHECK(DrawThemePrimaryGroup);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -386,6 +431,9 @@ static PyObject *App_DrawThemeSecondaryGroup(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeSecondaryGroup
+       PyMac_PRECHECK(DrawThemeSecondaryGroup);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -404,6 +452,9 @@ static PyObject *App_DrawThemeSeparator(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeSeparator
+       PyMac_PRECHECK(DrawThemeSeparator);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -422,6 +473,9 @@ static PyObject *App_DrawThemeModelessDialogFrame(PyObject *_self, PyObject *_ar
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeModelessDialogFrame
+       PyMac_PRECHECK(DrawThemeModelessDialogFrame);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -441,6 +495,9 @@ static PyObject *App_DrawThemeGenericWell(PyObject *_self, PyObject *_args)
        Rect inRect;
        ThemeDrawState inState;
        Boolean inFillCenter;
+#ifndef DrawThemeGenericWell
+       PyMac_PRECHECK(DrawThemeGenericWell);
+#endif
        if (!PyArg_ParseTuple(_args, "O&lb",
                              PyMac_GetRect, &inRect,
                              &inState,
@@ -460,6 +517,9 @@ static PyObject *App_DrawThemeFocusRegion(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        Boolean inHasFocus;
+#ifndef DrawThemeFocusRegion
+       PyMac_PRECHECK(DrawThemeFocusRegion);
+#endif
        if (!PyArg_ParseTuple(_args, "b",
                              &inHasFocus))
                return NULL;
@@ -477,6 +537,9 @@ static PyObject *App_IsThemeInColor(PyObject *_self, PyObject *_args)
        Boolean _rv;
        SInt16 inDepth;
        Boolean inIsColorDevice;
+#ifndef IsThemeInColor
+       PyMac_PRECHECK(IsThemeInColor);
+#endif
        if (!PyArg_ParseTuple(_args, "hb",
                              &inDepth,
                              &inIsColorDevice))
@@ -493,6 +556,9 @@ static PyObject *App_GetThemeAccentColors(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        CTabHandle outColors;
+#ifndef GetThemeAccentColors
+       PyMac_PRECHECK(GetThemeAccentColors);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeAccentColors(&outColors);
@@ -509,6 +575,9 @@ static PyObject *App_DrawThemeMenuBarBackground(PyObject *_self, PyObject *_args
        Rect inBounds;
        ThemeMenuBarState inState;
        UInt32 inAttributes;
+#ifndef DrawThemeMenuBarBackground
+       PyMac_PRECHECK(DrawThemeMenuBarBackground);
+#endif
        if (!PyArg_ParseTuple(_args, "O&Hl",
                              PyMac_GetRect, &inBounds,
                              &inState,
@@ -528,6 +597,9 @@ static PyObject *App_GetThemeMenuBarHeight(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        SInt16 outHeight;
+#ifndef GetThemeMenuBarHeight
+       PyMac_PRECHECK(GetThemeMenuBarHeight);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeMenuBarHeight(&outHeight);
@@ -543,6 +615,9 @@ static PyObject *App_DrawThemeMenuBackground(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inMenuRect;
        ThemeMenuType inMenuType;
+#ifndef DrawThemeMenuBackground
+       PyMac_PRECHECK(DrawThemeMenuBackground);
+#endif
        if (!PyArg_ParseTuple(_args, "O&H",
                              PyMac_GetRect, &inMenuRect,
                              &inMenuType))
@@ -561,6 +636,9 @@ static PyObject *App_GetThemeMenuBackgroundRegion(PyObject *_self, PyObject *_ar
        OSStatus _err;
        Rect inMenuRect;
        ThemeMenuType menuType;
+#ifndef GetThemeMenuBackgroundRegion
+       PyMac_PRECHECK(GetThemeMenuBackgroundRegion);
+#endif
        if (!PyArg_ParseTuple(_args, "O&H",
                              PyMac_GetRect, &inMenuRect,
                              &menuType))
@@ -579,6 +657,9 @@ static PyObject *App_DrawThemeMenuSeparator(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        Rect inItemRect;
+#ifndef DrawThemeMenuSeparator
+       PyMac_PRECHECK(DrawThemeMenuSeparator);
+#endif
        if (!PyArg_ParseTuple(_args, "O&",
                              PyMac_GetRect, &inItemRect))
                return NULL;
@@ -594,6 +675,9 @@ static PyObject *App_GetThemeMenuSeparatorHeight(PyObject *_self, PyObject *_arg
        PyObject *_res = NULL;
        OSStatus _err;
        SInt16 outHeight;
+#ifndef GetThemeMenuSeparatorHeight
+       PyMac_PRECHECK(GetThemeMenuSeparatorHeight);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeMenuSeparatorHeight(&outHeight);
@@ -610,6 +694,9 @@ static PyObject *App_GetThemeMenuItemExtra(PyObject *_self, PyObject *_args)
        ThemeMenuItemType inItemType;
        SInt16 outHeight;
        SInt16 outWidth;
+#ifndef GetThemeMenuItemExtra
+       PyMac_PRECHECK(GetThemeMenuItemExtra);
+#endif
        if (!PyArg_ParseTuple(_args, "H",
                              &inItemType))
                return NULL;
@@ -629,6 +716,9 @@ static PyObject *App_GetThemeMenuTitleExtra(PyObject *_self, PyObject *_args)
        OSStatus _err;
        SInt16 outWidth;
        Boolean inIsSquished;
+#ifndef GetThemeMenuTitleExtra
+       PyMac_PRECHECK(GetThemeMenuTitleExtra);
+#endif
        if (!PyArg_ParseTuple(_args, "b",
                              &inIsSquished))
                return NULL;
@@ -646,6 +736,9 @@ static PyObject *App_DrawThemeTabPane(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect inRect;
        ThemeDrawState inState;
+#ifndef DrawThemeTabPane
+       PyMac_PRECHECK(DrawThemeTabPane);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &inRect,
                              &inState))
@@ -665,6 +758,9 @@ static PyObject *App_GetThemeTabRegion(PyObject *_self, PyObject *_args)
        Rect inRect;
        ThemeTabStyle inStyle;
        ThemeTabDirection inDirection;
+#ifndef GetThemeTabRegion
+       PyMac_PRECHECK(GetThemeTabRegion);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HH",
                              PyMac_GetRect, &inRect,
                              &inStyle,
@@ -685,6 +781,9 @@ static PyObject *App_SetThemeCursor(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeCursor inCursor;
+#ifndef SetThemeCursor
+       PyMac_PRECHECK(SetThemeCursor);
+#endif
        if (!PyArg_ParseTuple(_args, "l",
                              &inCursor))
                return NULL;
@@ -701,6 +800,9 @@ static PyObject *App_SetAnimatedThemeCursor(PyObject *_self, PyObject *_args)
        OSStatus _err;
        ThemeCursor inCursor;
        UInt32 inAnimationStep;
+#ifndef SetAnimatedThemeCursor
+       PyMac_PRECHECK(SetAnimatedThemeCursor);
+#endif
        if (!PyArg_ParseTuple(_args, "ll",
                              &inCursor,
                              &inAnimationStep))
@@ -718,6 +820,9 @@ static PyObject *App_GetThemeScrollBarThumbStyle(PyObject *_self, PyObject *_arg
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeScrollBarThumbStyle outStyle;
+#ifndef GetThemeScrollBarThumbStyle
+       PyMac_PRECHECK(GetThemeScrollBarThumbStyle);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeScrollBarThumbStyle(&outStyle);
@@ -732,6 +837,9 @@ static PyObject *App_GetThemeScrollBarArrowStyle(PyObject *_self, PyObject *_arg
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeScrollBarArrowStyle outStyle;
+#ifndef GetThemeScrollBarArrowStyle
+       PyMac_PRECHECK(GetThemeScrollBarArrowStyle);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeScrollBarArrowStyle(&outStyle);
@@ -746,6 +854,9 @@ static PyObject *App_GetThemeCheckBoxStyle(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeCheckBoxStyle outStyle;
+#ifndef GetThemeCheckBoxStyle
+       PyMac_PRECHECK(GetThemeCheckBoxStyle);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeCheckBoxStyle(&outStyle);
@@ -761,6 +872,9 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
        OSStatus _err;
        ThemeFontID inFontID;
        ScriptCode inScript;
+#ifndef UseThemeFont
+       PyMac_PRECHECK(UseThemeFont);
+#endif
        if (!PyArg_ParseTuple(_args, "Hh",
                              &inFontID,
                              &inScript))
@@ -785,6 +899,9 @@ static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
        Boolean inWrapToWidth;
        Rect inBoundingBox;
        SInt16 inJust;
+#ifndef DrawThemeTextBox
+       PyMac_PRECHECK(DrawThemeTextBox);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HlbO&h",
                              CFStringRefObj_Convert, &inString,
                              &inFontID,
@@ -819,6 +936,9 @@ static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
        SInt16 inPixelWidthLimit;
        TruncCode inTruncWhere;
        Boolean outTruncated;
+#ifndef TruncateThemeText
+       PyMac_PRECHECK(TruncateThemeText);
+#endif
        if (!PyArg_ParseTuple(_args, "O&Hlhh",
                              CFMutableStringRefObj_Convert, &inString,
                              &inFontID,
@@ -851,6 +971,9 @@ static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
        Boolean inWrapToWidth;
        Point ioBounds;
        SInt16 outBaseline;
+#ifndef GetThemeTextDimensions
+       PyMac_PRECHECK(GetThemeTextDimensions);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HlbO&",
                              CFStringRefObj_Convert, &inString,
                              &inFontID,
@@ -881,6 +1004,9 @@ static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
        ThemeFontID inFontID;
        ThemeDrawState inState;
        Rect outOutset;
+#ifndef GetThemeTextShadowOutset
+       PyMac_PRECHECK(GetThemeTextShadowOutset);
+#endif
        if (!PyArg_ParseTuple(_args, "Hl",
                              &inFontID,
                              &inState))
@@ -904,6 +1030,9 @@ static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
        ThemeTrackPressState pressState;
        Boolean isHoriz;
        Rect trackBounds;
+#ifndef DrawThemeScrollBarArrows
+       PyMac_PRECHECK(DrawThemeScrollBarArrows);
+#endif
        if (!PyArg_ParseTuple(_args, "O&bbb",
                              PyMac_GetRect, &bounds,
                              &enableState,
@@ -930,6 +1059,9 @@ static PyObject *App_GetThemeScrollBarTrackRect(PyObject *_self, PyObject *_args
        ThemeTrackPressState pressState;
        Boolean isHoriz;
        Rect trackBounds;
+#ifndef GetThemeScrollBarTrackRect
+       PyMac_PRECHECK(GetThemeScrollBarTrackRect);
+#endif
        if (!PyArg_ParseTuple(_args, "O&bbb",
                              PyMac_GetRect, &bounds,
                              &enableState,
@@ -958,6 +1090,9 @@ static PyObject *App_HitTestThemeScrollBarArrows(PyObject *_self, PyObject *_arg
        Point ptHit;
        Rect trackBounds;
        ControlPartCode partcode;
+#ifndef HitTestThemeScrollBarArrows
+       PyMac_PRECHECK(HitTestThemeScrollBarArrows);
+#endif
        if (!PyArg_ParseTuple(_args, "O&bbbO&",
                              PyMac_GetRect, &scrollBarBounds,
                              &enableState,
@@ -987,6 +1122,9 @@ static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_ar
        Rect inContRect;
        ThemeDrawState state;
        ThemeWindowAttributes attributes;
+#ifndef DrawThemeScrollBarDelimiters
+       PyMac_PRECHECK(DrawThemeScrollBarDelimiters);
+#endif
        if (!PyArg_ParseTuple(_args, "HO&ll",
                              &flavor,
                              PyMac_GetRect, &inContRect,
@@ -1012,6 +1150,9 @@ static PyObject *App_DrawThemeButton(PyObject *_self, PyObject *_args)
        ThemeButtonDrawInfo inNewInfo;
        ThemeButtonDrawInfo inPrevInfo;
        UInt32 inUserData;
+#ifndef DrawThemeButton
+       PyMac_PRECHECK(DrawThemeButton);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HO&O&l",
                              PyMac_GetRect, &inBounds,
                              &inKind,
@@ -1039,6 +1180,9 @@ static PyObject *App_GetThemeButtonRegion(PyObject *_self, PyObject *_args)
        Rect inBounds;
        UInt16 inKind;
        ThemeButtonDrawInfo inNewInfo;
+#ifndef GetThemeButtonRegion
+       PyMac_PRECHECK(GetThemeButtonRegion);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HO&",
                              PyMac_GetRect, &inBounds,
                              &inKind,
@@ -1062,6 +1206,9 @@ static PyObject *App_GetThemeButtonContentBounds(PyObject *_self, PyObject *_arg
        UInt16 inKind;
        ThemeButtonDrawInfo inDrawInfo;
        Rect outBounds;
+#ifndef GetThemeButtonContentBounds
+       PyMac_PRECHECK(GetThemeButtonContentBounds);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HO&",
                              PyMac_GetRect, &inBounds,
                              &inKind,
@@ -1085,6 +1232,9 @@ static PyObject *App_GetThemeButtonBackgroundBounds(PyObject *_self, PyObject *_
        UInt16 inKind;
        ThemeButtonDrawInfo inDrawInfo;
        Rect outBounds;
+#ifndef GetThemeButtonBackgroundBounds
+       PyMac_PRECHECK(GetThemeButtonBackgroundBounds);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HO&",
                              PyMac_GetRect, &inBounds,
                              &inKind,
@@ -1105,6 +1255,9 @@ static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeSoundKind kind;
+#ifndef PlayThemeSound
+       PyMac_PRECHECK(PlayThemeSound);
+#endif
        if (!PyArg_ParseTuple(_args, "O&",
                              PyMac_GetOSType, &kind))
                return NULL;
@@ -1120,6 +1273,9 @@ static PyObject *App_BeginThemeDragSound(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeDragSoundKind kind;
+#ifndef BeginThemeDragSound
+       PyMac_PRECHECK(BeginThemeDragSound);
+#endif
        if (!PyArg_ParseTuple(_args, "O&",
                              PyMac_GetOSType, &kind))
                return NULL;
@@ -1134,6 +1290,9 @@ static PyObject *App_EndThemeDragSound(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        OSStatus _err;
+#ifndef EndThemeDragSound
+       PyMac_PRECHECK(EndThemeDragSound);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = EndThemeDragSound();
@@ -1149,6 +1308,9 @@ static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
        OSStatus _err;
        Rect bounds;
        ThemeDrawState state;
+#ifndef DrawThemeTickMark
+       PyMac_PRECHECK(DrawThemeTickMark);
+#endif
        if (!PyArg_ParseTuple(_args, "O&l",
                              PyMac_GetRect, &bounds,
                              &state))
@@ -1169,6 +1331,9 @@ static PyObject *App_DrawThemeChasingArrows(PyObject *_self, PyObject *_args)
        UInt32 index;
        ThemeDrawState state;
        UInt32 eraseData;
+#ifndef DrawThemeChasingArrows
+       PyMac_PRECHECK(DrawThemeChasingArrows);
+#endif
        if (!PyArg_ParseTuple(_args, "O&lll",
                              PyMac_GetRect, &bounds,
                              &index,
@@ -1195,6 +1360,9 @@ static PyObject *App_DrawThemePopupArrow(PyObject *_self, PyObject *_args)
        ThemePopupArrowSize size;
        ThemeDrawState state;
        UInt32 eraseData;
+#ifndef DrawThemePopupArrow
+       PyMac_PRECHECK(DrawThemePopupArrow);
+#endif
        if (!PyArg_ParseTuple(_args, "O&HHll",
                              PyMac_GetRect, &bounds,
                              &orientation,
@@ -1222,6 +1390,9 @@ static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args
        ThemeGrowDirection growDirection;
        Boolean isSmall;
        ThemeDrawState state;
+#ifndef DrawThemeStandaloneGrowBox
+       PyMac_PRECHECK(DrawThemeStandaloneGrowBox);
+#endif
        if (!PyArg_ParseTuple(_args, "O&Hbl",
                              PyMac_GetPoint, &origin,
                              &growDirection,
@@ -1246,6 +1417,9 @@ static PyObject *App_DrawThemeStandaloneNoGrowBox(PyObject *_self, PyObject *_ar
        ThemeGrowDirection growDirection;
        Boolean isSmall;
        ThemeDrawState state;
+#ifndef DrawThemeStandaloneNoGrowBox
+       PyMac_PRECHECK(DrawThemeStandaloneNoGrowBox);
+#endif
        if (!PyArg_ParseTuple(_args, "O&Hbl",
                              PyMac_GetPoint, &origin,
                              &growDirection,
@@ -1270,6 +1444,9 @@ static PyObject *App_GetThemeStandaloneGrowBoxBounds(PyObject *_self, PyObject *
        ThemeGrowDirection growDirection;
        Boolean isSmall;
        Rect bounds;
+#ifndef GetThemeStandaloneGrowBoxBounds
+       PyMac_PRECHECK(GetThemeStandaloneGrowBoxBounds);
+#endif
        if (!PyArg_ParseTuple(_args, "O&Hb",
                              PyMac_GetPoint, &origin,
                              &growDirection,
@@ -1289,6 +1466,9 @@ static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args
 {
        PyObject *_res = NULL;
        OSStatus _err;
+#ifndef NormalizeThemeDrawingState
+       PyMac_PRECHECK(NormalizeThemeDrawingState);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = NormalizeThemeDrawingState();
@@ -1303,6 +1483,9 @@ static PyObject *App_GetThemeDrawingState(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        OSStatus _err;
        ThemeDrawingState outState;
+#ifndef GetThemeDrawingState
+       PyMac_PRECHECK(GetThemeDrawingState);
+#endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetThemeDrawingState(&outState);
@@ -1321,6 +1504,9 @@ static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
        ThemeDrawState inState;
        SInt16 inDepth;
        Boolean inColorDev;
+#ifndef ApplyThemeBackground
+       PyMac_PRECHECK(ApplyThemeBackground);
+#endif
        if (!PyArg_ParseTuple(_args, "lO&lhb",
                              &inKind,
                              PyMac_GetRect, &bounds,
@@ -1347,6 +1533,9 @@ static PyObject *App_SetThemeTextColorForWindow(PyObject *_self, PyObject *_args
        Boolean isActive;
        SInt16 depth;
        Boolean isColorDev;
+#ifndef SetThemeTextColorForWindow
+       PyMac_PRECHECK(SetThemeTextColorForWindow);
+#endif
        if (!PyArg_ParseTuple(_args, "O&bhb",
                              WinObj_Convert, &window,
                              &isActive,
@@ -1368,6 +1557,9 @@ static PyObject *App_IsValidAppearanceFileType(PyObject *_self, PyObject *_args)
        PyObject *_res = NULL;
        Boolean _rv;
        OSType fileType;
+#ifndef IsValidAppearanceFileType
+       PyMac_PRECHECK(IsValidAppearanceFileType);
+#endif
        if (!PyArg_ParseTuple(_args, "O&",
                              PyMac_GetOSType, &fileType))
                return NULL;
@@ -1385,6 +1577,9 @@ static PyObject *App_GetThemeBrushAsColor(PyObject *_self, PyObject *_args)
        SInt16 inDepth;
        Boolean inColorDev;
        RGBColor outColor;
+#ifndef GetThemeBrushAsColor
+       PyMac_PRECHECK(GetThemeBrushAsColor);
+#endif
        if (!PyArg_ParseTuple(_args, "hhb",
                              &inBrush,
                              &inDepth,
@@ -1408,6 +1603,9 @@ static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
        SInt16 inDepth;
        Boolean inColorDev;
        RGBColor outColor;
+#ifndef GetThemeTextColor
+       PyMac_PRECHECK(GetThemeTextColor);
+#endif
        if (!PyArg_ParseTuple(_args, "hhb",
                              &inColor,
                              &inDepth,
@@ -1431,6 +1629,9 @@ static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
        OSStatus _err;
        ThemeMetric inMetric;
        SInt32 outMetric;
+#ifndef GetThemeMetric
+       PyMac_PRECHECK(GetThemeMetric);
+#endif
        if (!PyArg_ParseTuple(_args, "l",
                              &inMetric))
                return NULL;
index 4be504a71015e68acb1efe63cdb4fbacfa155afc..880a70db90bd04d83eac92b96175419239123f4c 100644 (file)
@@ -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 = []