diff options
author | Just van Rossum <just@letterror.com> | 2002-01-02 15:11:44 (GMT) |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2002-01-02 15:11:44 (GMT) |
commit | 4f6fe5242464e7930e0bd410bb68ba8b97b8514f (patch) | |
tree | 97efcc0c31c30daa23eabc0608f036edb2ab4772 /Mac/Modules/app | |
parent | 1ca65c07388f29be49a61791f2f252587fa6581c (diff) | |
download | cpython-4f6fe5242464e7930e0bd410bb68ba8b97b8514f.zip cpython-4f6fe5242464e7930e0bd410bb68ba8b97b8514f.tar.gz cpython-4f6fe5242464e7930e0bd410bb68ba8b97b8514f.tar.bz2 |
- Added DrawThemeTextBox()
- fixed GetThemeTextDimensions(): it has an in/out Point arg, not just out.
Diffstat (limited to 'Mac/Modules/app')
-rw-r--r-- | Mac/Modules/app/_Appmodule.c | 46 | ||||
-rw-r--r-- | Mac/Modules/app/appscan.py | 6 | ||||
-rw-r--r-- | Mac/Modules/app/appsupport.py | 2 |
3 files changed, 50 insertions, 4 deletions
diff --git a/Mac/Modules/app/_Appmodule.c b/Mac/Modules/app/_Appmodule.c index ab330a5..062197a 100644 --- a/Mac/Modules/app/_Appmodule.c +++ b/Mac/Modules/app/_Appmodule.c @@ -660,6 +660,40 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args) #if TARGET_API_MAC_CARBON +static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args) +{ + PyObject *_res = NULL; + OSStatus _err; + CFStringRef inString; + ThemeFontID inFontID; + ThemeDrawState inState; + Boolean inWrapToWidth; + Rect inBoundingBox; + SInt16 inJust; + if (!PyArg_ParseTuple(_args, "O&HlbO&h", + CFStringRefObj_Convert, &inString, + &inFontID, + &inState, + &inWrapToWidth, + PyMac_GetRect, &inBoundingBox, + &inJust)) + return NULL; + _err = DrawThemeTextBox(inString, + inFontID, + inState, + inWrapToWidth, + &inBoundingBox, + inJust, + NULL); + if (_err != noErr) return PyMac_Error(_err); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} +#endif + +#if TARGET_API_MAC_CARBON + static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; @@ -702,11 +736,12 @@ static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args) Boolean inWrapToWidth; Point ioBounds; SInt16 outBaseline; - if (!PyArg_ParseTuple(_args, "O&Hlb", + if (!PyArg_ParseTuple(_args, "O&HlbO&", CFStringRefObj_Convert, &inString, &inFontID, &inState, - &inWrapToWidth)) + &inWrapToWidth, + PyMac_GetPoint, &ioBounds)) return NULL; _err = GetThemeTextDimensions(inString, inFontID, @@ -1204,13 +1239,18 @@ static PyMethodDef App_methods[] = { "(ThemeFontID inFontID, ScriptCode inScript) -> None"}, #if TARGET_API_MAC_CARBON + {"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1, + "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None"}, +#endif + +#if TARGET_API_MAC_CARBON {"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1, "(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)"}, #endif #if TARGET_API_MAC_CARBON {"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1, - "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth) -> (Point ioBounds, SInt16 outBaseline)"}, + "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)"}, #endif #if TARGET_API_MAC_CARBON diff --git a/Mac/Modules/app/appscan.py b/Mac/Modules/app/appscan.py index 62409c7..5a7750a 100644 --- a/Mac/Modules/app/appscan.py +++ b/Mac/Modules/app/appscan.py @@ -48,7 +48,6 @@ class MyScanner(Scanner): "appearanceBadTextColorIndexErr", "appearanceThemeHasNoAccents", "appearanceBadCursorIndexErr", - "DrawThemeTextBox", # Funny void* out param ] def makegreylist(self): @@ -58,6 +57,7 @@ class MyScanner(Scanner): 'GetThemeTextShadowOutset', 'GetThemeTextDimensions', 'TruncateThemeText', + 'DrawThemeTextBox', ])] def makeblacklisttypes(self): @@ -80,6 +80,10 @@ class MyScanner(Scanner): def makerepairinstructions(self): return [ + ([("void", 'inContext', "OutMode")], + [("NULL", 'inContext', "InMode")]), + ([("Point", 'ioBounds', "OutMode")], + [("Point", 'ioBounds', "InOutMode")]), ] if __name__ == "__main__": diff --git a/Mac/Modules/app/appsupport.py b/Mac/Modules/app/appsupport.py index a0eff8e..94361a9 100644 --- a/Mac/Modules/app/appsupport.py +++ b/Mac/Modules/app/appsupport.py @@ -27,6 +27,8 @@ from macsupport import * #WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX) RgnHandle = FakeType("(RgnHandle)0") +NULL = FakeType("NULL") + # XXXX Should be next, but this will break a lot of code... # RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj") |