@@ -660,6 +660,40 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
660660
661661#if TARGET_API_MAC_CARBON
662662
663+ static PyObject * App_DrawThemeTextBox (PyObject * _self , PyObject * _args )
664+ {
665+ PyObject * _res = NULL ;
666+ OSStatus _err ;
667+ CFStringRef inString ;
668+ ThemeFontID inFontID ;
669+ ThemeDrawState inState ;
670+ Boolean inWrapToWidth ;
671+ Rect inBoundingBox ;
672+ SInt16 inJust ;
673+ if (!PyArg_ParseTuple (_args , "O&HlbO&h" ,
674+ CFStringRefObj_Convert , & inString ,
675+ & inFontID ,
676+ & inState ,
677+ & inWrapToWidth ,
678+ PyMac_GetRect , & inBoundingBox ,
679+ & inJust ))
680+ return NULL ;
681+ _err = DrawThemeTextBox (inString ,
682+ inFontID ,
683+ inState ,
684+ inWrapToWidth ,
685+ & inBoundingBox ,
686+ inJust ,
687+ NULL );
688+ if (_err != noErr ) return PyMac_Error (_err );
689+ Py_INCREF (Py_None );
690+ _res = Py_None ;
691+ return _res ;
692+ }
693+ #endif
694+
695+ #if TARGET_API_MAC_CARBON
696+
663697static PyObject * App_TruncateThemeText (PyObject * _self , PyObject * _args )
664698{
665699 PyObject * _res = NULL ;
@@ -702,11 +736,12 @@ static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
702736 Boolean inWrapToWidth ;
703737 Point ioBounds ;
704738 SInt16 outBaseline ;
705- if (!PyArg_ParseTuple (_args , "O&Hlb " ,
739+ if (!PyArg_ParseTuple (_args , "O&HlbO& " ,
706740 CFStringRefObj_Convert , & inString ,
707741 & inFontID ,
708742 & inState ,
709- & inWrapToWidth ))
743+ & inWrapToWidth ,
744+ PyMac_GetPoint , & ioBounds ))
710745 return NULL ;
711746 _err = GetThemeTextDimensions (inString ,
712747 inFontID ,
@@ -1203,14 +1238,19 @@ static PyMethodDef App_methods[] = {
12031238 {"UseThemeFont" , (PyCFunction )App_UseThemeFont , 1 ,
12041239 "(ThemeFontID inFontID, ScriptCode inScript) -> None" },
12051240
1241+ #if TARGET_API_MAC_CARBON
1242+ {"DrawThemeTextBox" , (PyCFunction )App_DrawThemeTextBox , 1 ,
1243+ "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None" },
1244+ #endif
1245+
12061246#if TARGET_API_MAC_CARBON
12071247 {"TruncateThemeText" , (PyCFunction )App_TruncateThemeText , 1 ,
12081248 "(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)" },
12091249#endif
12101250
12111251#if TARGET_API_MAC_CARBON
12121252 {"GetThemeTextDimensions" , (PyCFunction )App_GetThemeTextDimensions , 1 ,
1213- "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth) -> (Point ioBounds, SInt16 outBaseline)" },
1253+ "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds ) -> (Point ioBounds, SInt16 outBaseline)" },
12141254#endif
12151255
12161256#if TARGET_API_MAC_CARBON
0 commit comments