Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
188b32b7
Commit
188b32b7
authored
Jul 26, 2001
by
Travis Michielsen
Committed by
Alexandre Julliard
Jul 26, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fully implement DrawTextEx* functions.
parent
40734af7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
26 deletions
+37
-26
text.c
dlls/user/text.c
+33
-24
winuser.h
include/winuser.h
+4
-2
No files found.
dlls/user/text.c
View file @
188b32b7
...
...
@@ -225,7 +225,7 @@ INT16 WINAPI DrawText16( HDC16 hdc, LPCSTR str, INT16 count, LPRECT16 rect, UINT
* DrawTextExW (USER32.@)
*/
#define MAX_STATIC_BUFFER 1024
INT
WINAPI
DrawTextExW
(
HDC
hdc
,
LP
CWSTR
str
,
INT
i_count
,
INT
WINAPI
DrawTextExW
(
HDC
hdc
,
LP
WSTR
str
,
INT
i_count
,
LPRECT
rect
,
UINT
flags
,
LPDRAWTEXTPARAMS
dtp
)
{
SIZE
size
;
...
...
@@ -235,6 +235,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
int
prefix_x
=
0
;
int
prefix_end
=
0
;
TEXTMETRICW
tm
;
int
lmargin
=
0
,
rmargin
=
0
;
int
x
=
rect
->
left
,
y
=
rect
->
top
;
int
width
=
rect
->
right
-
rect
->
left
;
int
max_width
=
0
;
...
...
@@ -242,10 +243,8 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
TRACE
(
"%s, %d , [(%d,%d),(%d,%d)]
\n
"
,
debugstr_wn
(
str
,
count
),
count
,
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
if
(
dtp
)
{
FIXME
(
"Ignores params:%d,%d,%d,%d
\n
"
,
dtp
->
cbSize
,
if
(
dtp
)
TRACE
(
"Params: iTabLength=%d, iLeftMargin=%d, iRightMargin=%d
\n
"
,
dtp
->
iTabLength
,
dtp
->
iLeftMargin
,
dtp
->
iRightMargin
);
}
if
(
!
str
)
return
0
;
if
(
count
==
-
1
)
count
=
strlenW
(
str
);
...
...
@@ -258,8 +257,17 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
else
lh
=
tm
.
tmHeight
;
if
(
dtp
)
{
lmargin
=
dtp
->
iLeftMargin
*
tm
.
tmAveCharWidth
;
rmargin
=
dtp
->
iRightMargin
*
tm
.
tmAveCharWidth
;
if
(
!
(
flags
&
(
DT_CENTER
|
DT_RIGHT
)))
x
+=
lmargin
;
dtp
->
uiLengthDrawn
=
0
;
/* This param RECEIVES number of chars processed */
}
if
(
flags
&
DT_TABSTOP
)
tabstop
=
flags
>>
8
;
tabstop
=
dtp
?
dtp
->
iTabLength
:
flags
>>
8
;
if
(
flags
&
DT_EXPANDTABS
)
{
...
...
@@ -320,10 +328,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
line
[
totalLen
]
=
'\0'
;
lastBkSlash
=
strrchrW
(
line
,
BACK_SLASHW
[
0
]);
lastFwdSlash
=
strrchrW
(
line
,
FORWARD_SLASHW
[
0
]);
fnameDelim
=
lastFwdSlash
?
lastFwdSlash
:
lastBkSlash
;
if
(
lastBkSlash
&&
lastFwdSlash
)
/* which is last? */
if
(
lastBkSlash
>
lastFwdSlash
)
fnameDelim
=
lastBkSlash
;
fnameDelim
=
lastBkSlash
>
lastFwdSlash
?
lastBkSlash
:
lastFwdSlash
;
if
(
fnameDelim
)
fnameLen
=
&
line
[
totalLen
]
-
fnameDelim
;
...
...
@@ -382,11 +387,14 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
line
[
len
]
=
'\0'
;
strPtr
=
NULL
;
}
if
(
flags
&
DT_MODIFYSTRING
)
strcpyW
(
str
,
swapStr
);
}
}
if
(
!
(
flags
&
DT_CALCRECT
))
{
if
(
!
ExtTextOutW
(
hdc
,
x
,
y
,
(
flags
&
DT_NOCLIP
)
?
0
:
ETO_CLIPPED
,
if
(
!
ExtTextOutW
(
hdc
,
x
,
y
,
(
(
flags
&
DT_NOCLIP
)
?
0
:
ETO_CLIPPED
)
|
(
(
flags
&
DT_RTLREADING
)
?
0
:
ETO_RTLREADING
),
rect
,
line
,
len
,
NULL
))
return
0
;
if
(
prefix_offset
!=
-
1
)
{
...
...
@@ -410,20 +418,26 @@ INT WINAPI DrawTextExW( HDC hdc, LPCWSTR str, INT i_count,
break
;
}
}
if
(
dtp
)
dtp
->
uiLengthDrawn
+=
len
;
}
while
(
strPtr
);
if
(
flags
&
DT_CALCRECT
)
{
rect
->
right
=
rect
->
left
+
max_width
;
rect
->
bottom
=
y
;
if
(
dtp
)
rect
->
right
+=
lmargin
+
rmargin
;
}
return
y
-
rect
->
top
;
}
/***********************************************************************
* DrawTextA (USER32.@)
* DrawText
Ex
A (USER32.@)
*/
INT
WINAPI
DrawTextA
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
)
INT
WINAPI
DrawTextExA
(
HDC
hdc
,
LPSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
,
LPDRAWTEXTPARAMS
dtp
)
{
WCHAR
*
wstr
;
INT
ret
=
0
;
...
...
@@ -437,6 +451,8 @@ INT WINAPI DrawTextA( HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags )
{
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
count
,
wstr
,
wcount
);
ret
=
DrawTextExW
(
hdc
,
wstr
,
wcount
,
rect
,
flags
,
NULL
);
if
(
flags
&
DT_MODIFYSTRING
)
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
str
,
count
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
wstr
);
}
return
ret
;
...
...
@@ -445,24 +461,17 @@ INT WINAPI DrawTextA( HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags )
/***********************************************************************
* DrawTextW (USER32.@)
*/
INT
WINAPI
DrawTextW
(
HDC
hdc
,
LPCWSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
)
INT
WINAPI
DrawTextW
(
HDC
hdc
,
LPCWSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
)
{
return
DrawTextExW
(
hdc
,
str
,
count
,
rect
,
flags
,
NULL
);
return
DrawTextExW
(
hdc
,
(
LPWSTR
)
str
,
count
,
rect
,
flags
,
NULL
);
}
/***********************************************************************
* DrawText
Ex
A (USER32.@)
* DrawTextA (USER32.@)
*/
INT
WINAPI
DrawTextExA
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
,
LPDRAWTEXTPARAMS
dtp
)
INT
WINAPI
DrawTextA
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
LPRECT
rect
,
UINT
flags
)
{
TRACE
(
"(%d,%s,%d,%p,0x%08x,%p)
\n
"
,
hdc
,
debugstr_an
(
str
,
count
),
count
,
rect
,
flags
,
dtp
);
if
(
dtp
)
{
FIXME
(
"Ignores params:%d,%d,%d,%d
\n
"
,
dtp
->
cbSize
,
dtp
->
iTabLength
,
dtp
->
iLeftMargin
,
dtp
->
iRightMargin
);
}
return
DrawTextA
(
hdc
,
str
,
count
,
rect
,
flags
);
return
DrawTextExA
(
hdc
,
(
LPSTR
)
str
,
count
,
rect
,
flags
,
NULL
);
}
/***********************************************************************
...
...
include/winuser.h
View file @
188b32b7
...
...
@@ -3503,8 +3503,7 @@ BOOL WINAPI DrawEdge(HDC,LPRECT,UINT,UINT);
BOOL
WINAPI
DrawFocusRect
(
HDC
,
const
RECT
*
);
BOOL
WINAPI
DrawFrameControl
(
HDC
,
LPRECT
,
UINT
,
UINT
);
BOOL
WINAPI
DrawIcon
(
HDC
,
INT
,
INT
,
HICON
);
BOOL
WINAPI
DrawIconEx
(
HDC
,
INT
,
INT
,
HICON
,
INT
,
INT
,
UINT
,
HBRUSH
,
UINT
);
BOOL
WINAPI
DrawIconEx
(
HDC
,
INT
,
INT
,
HICON
,
INT
,
INT
,
UINT
,
HBRUSH
,
UINT
);
BOOL
WINAPI
DrawMenuBar
(
HWND
);
BOOL
WINAPI
DrawStateA
(
HDC
,
HBRUSH
,
DRAWSTATEPROC
,
LPARAM
,
WPARAM
,
INT
,
INT
,
INT
,
INT
,
UINT
);
BOOL
WINAPI
DrawStateW
(
HDC
,
HBRUSH
,
DRAWSTATEPROC
,
LPARAM
,
WPARAM
,
INT
,
INT
,
INT
,
INT
,
UINT
);
...
...
@@ -3512,6 +3511,9 @@ BOOL WINAPI DrawStateW(HDC,HBRUSH,DRAWSTATEPROC,LPARAM,WPARAM,INT,INT,INT,I
INT
WINAPI
DrawTextA
(
HDC
,
LPCSTR
,
INT
,
LPRECT
,
UINT
);
INT
WINAPI
DrawTextW
(
HDC
,
LPCWSTR
,
INT
,
LPRECT
,
UINT
);
#define DrawText WINELIB_NAME_AW(DrawText)
INT
WINAPI
DrawTextExA
(
HDC
,
LPSTR
,
INT
,
LPRECT
,
UINT
,
LPDRAWTEXTPARAMS
);
INT
WINAPI
DrawTextExW
(
HDC
,
LPWSTR
,
INT
,
LPRECT
,
UINT
,
LPDRAWTEXTPARAMS
);
#define DrawTextEx WINELIB_NAME_AW(DrawTextEx)
BOOL
WINAPI
EmptyClipboard
(
void
);
UINT
WINAPI
EnableMenuItem
(
HMENU
,
UINT
,
UINT
);
BOOL
WINAPI
EnableScrollBar
(
HWND
,
INT
,
UINT
);
...
...
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