Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
715e0916
Commit
715e0916
authored
Jan 02, 2002
by
Just van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added DrawThemeTextBox()
- fixed GetThemeTextDimensions(): it has an in/out Point arg, not just out.
parent
b5a7ff16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
4 deletions
+50
-4
Mac/Modules/app/_Appmodule.c
Mac/Modules/app/_Appmodule.c
+43
-3
Mac/Modules/app/appscan.py
Mac/Modules/app/appscan.py
+5
-1
Mac/Modules/app/appsupport.py
Mac/Modules/app/appsupport.py
+2
-0
No files found.
Mac/Modules/app/_Appmodule.c
View file @
715e0916
...
...
@@ -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&Hlb
O&
"
,
CFStringRefObj_Convert
,
&
inString
,
&
inFontID
,
&
inState
,
&
inWrapToWidth
))
&
inWrapToWidth
,
PyMac_GetPoint
,
&
ioBounds
))
return
NULL
;
_err
=
GetThemeTextDimensions
(
inString
,
inFontID
,
...
...
@@ -1203,6 +1238,11 @@ static PyMethodDef App_methods[] = {
{
"UseThemeFont"
,
(
PyCFunction
)
App_UseThemeFont
,
1
,
"(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)"
},
...
...
@@ -1210,7 +1250,7 @@ static PyMethodDef App_methods[] = {
#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
...
...
Mac/Modules/app/appscan.py
View file @
715e0916
...
...
@@ -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__"
:
...
...
Mac/Modules/app/appsupport.py
View file @
715e0916
...
...
@@ -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")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment