Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
82c8e567
Commit
82c8e567
authored
Feb 14, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Feb 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Pass the run to the text drawing routine.
parent
941775e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
paint.c
dlls/riched20/paint.c
+26
-27
No files found.
dlls/riched20/paint.c
View file @
82c8e567
...
...
@@ -215,9 +215,8 @@ static void ME_HighlightSpace(ME_Context *c, int x, int y, LPCWSTR szText,
}
}
static
void
ME_DrawTextWithStyle
(
ME_Context
*
c
,
int
x
,
int
y
,
LPCWSTR
szText
,
int
nChars
,
ME_Style
*
s
,
int
width
,
int
nSelFrom
,
int
nSelTo
,
int
ymin
,
int
cy
)
static
void
ME_DrawTextWithStyle
(
ME_Context
*
c
,
ME_Run
*
run
,
int
x
,
int
y
,
LPCWSTR
szText
,
int
nChars
,
int
nSelFrom
,
int
nSelTo
,
int
ymin
,
int
cy
)
{
HDC
hDC
=
c
->
hDC
;
HGDIOBJ
hOldFont
;
...
...
@@ -233,26 +232,26 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
* by the font extends to the end of the tab. Tabs are always stored as
* a single character run, so we can handle this case separately, since
* otherwise lpDx would need to specify the lengths of each character. */
if
(
w
idth
&&
nChars
==
1
)
lpDx
=
&
w
idth
;
/* Make sure underline for tab extends across tab space */
if
(
run
->
nW
idth
&&
nChars
==
1
)
lpDx
=
&
run
->
nW
idth
;
/* Make sure underline for tab extends across tab space */
hOldFont
=
ME_SelectStyleFont
(
c
,
s
);
if
((
s
->
fmt
.
dwMask
&
s
->
fmt
.
dwEffects
)
&
CFM_OFFSET
)
{
yTwipsOffset
=
s
->
fmt
.
yOffset
;
hOldFont
=
ME_SelectStyleFont
(
c
,
run
->
style
);
if
((
run
->
style
->
fmt
.
dwMask
&
run
->
style
->
fmt
.
dwEffects
)
&
CFM_OFFSET
)
{
yTwipsOffset
=
run
->
style
->
fmt
.
yOffset
;
}
if
((
s
->
fmt
.
dwMask
&
s
->
fmt
.
dwEffects
)
&
(
CFM_SUPERSCRIPT
|
CFM_SUBSCRIPT
))
{
if
(
s
->
fmt
.
dwEffects
&
CFE_SUPERSCRIPT
)
yTwipsOffset
=
s
->
fmt
.
yHeight
/
3
;
if
(
s
->
fmt
.
dwEffects
&
CFE_SUBSCRIPT
)
yTwipsOffset
=
-
s
->
fmt
.
yHeight
/
12
;
if
((
run
->
style
->
fmt
.
dwMask
&
run
->
style
->
fmt
.
dwEffects
)
&
(
CFM_SUPERSCRIPT
|
CFM_SUBSCRIPT
))
{
if
(
run
->
style
->
fmt
.
dwEffects
&
CFE_SUPERSCRIPT
)
yTwipsOffset
=
run
->
style
->
fmt
.
yHeight
/
3
;
if
(
run
->
style
->
fmt
.
dwEffects
&
CFE_SUBSCRIPT
)
yTwipsOffset
=
-
run
->
style
->
fmt
.
yHeight
/
12
;
}
if
(
yTwipsOffset
)
yOffset
=
ME_twips2pointsY
(
c
,
yTwipsOffset
);
if
((
s
->
fmt
.
dwMask
&
CFM_LINK
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_LINK
))
if
((
run
->
style
->
fmt
.
dwMask
&
CFM_LINK
)
&&
(
run
->
style
->
fmt
.
dwEffects
&
CFE_LINK
))
rgb
=
RGB
(
0
,
0
,
255
);
else
if
((
s
->
fmt
.
dwMask
&
CFM_COLOR
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_AUTOCOLOR
))
else
if
((
run
->
style
->
fmt
.
dwMask
&
CFM_COLOR
)
&&
(
run
->
style
->
fmt
.
dwEffects
&
CFE_AUTOCOLOR
))
rgb
=
ITextHost_TxGetSysColor
(
c
->
editor
->
texthost
,
COLOR_WINDOWTEXT
);
else
rgb
=
s
->
fmt
.
crTextColor
;
rgb
=
run
->
style
->
fmt
.
crTextColor
;
if
(
bHighlightedText
)
{
...
...
@@ -269,7 +268,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
if
(
nSelTo
>=
nChars
)
{
nSelTo
=
nChars
;
xSelEnd
=
x
+
w
idth
;
xSelEnd
=
x
+
run
->
nW
idth
;
}
else
{
...
...
@@ -279,9 +278,9 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
}
/* Choose the pen type for underlining the text. */
if
(
s
->
fmt
.
dwMask
&
CFM_UNDERLINETYPE
)
if
(
run
->
style
->
fmt
.
dwMask
&
CFM_UNDERLINETYPE
)
{
switch
(
s
->
fmt
.
bUnderlineType
)
switch
(
run
->
style
->
fmt
.
bUnderlineType
)
{
case
CFU_UNDERLINE
:
case
CFU_UNDERLINEWORD
:
/* native seems to map it to simple underline (MSDN) */
...
...
@@ -292,7 +291,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
hPen
=
CreatePen
(
PS_DOT
,
1
,
rgb
);
break
;
default:
FIXME
(
"Unknown underline type (%u)
\n
"
,
s
->
fmt
.
bUnderlineType
);
FIXME
(
"Unknown underline type (%u)
\n
"
,
run
->
style
->
fmt
.
bUnderlineType
);
/* fall through */
case
CFU_CF1UNDERLINE
:
/* this type is supported in the font, do nothing */
case
CFU_UNDERLINENONE
:
...
...
@@ -332,13 +331,13 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
if
(
hPen
)
LineTo
(
hDC
,
xSelEnd
,
y
-
yOffset
+
1
);
SetBkColor
(
hDC
,
rgbBackOld
);
if
(
xSelEnd
<
x
+
w
idth
)
if
(
xSelEnd
<
x
+
run
->
nW
idth
)
{
SetTextColor
(
hDC
,
rgb
);
ExtTextOutW
(
hDC
,
xSelEnd
,
y
-
yOffset
,
0
,
NULL
,
szText
+
nSelTo
,
nChars
-
nSelTo
,
NULL
);
if
(
hPen
)
LineTo
(
hDC
,
x
+
w
idth
,
y
-
yOffset
+
1
);
LineTo
(
hDC
,
x
+
run
->
nW
idth
,
y
-
yOffset
+
1
);
}
}
else
...
...
@@ -349,7 +348,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
if
(
hPen
)
{
MoveToEx
(
hDC
,
x
,
y
-
yOffset
+
1
,
NULL
);
LineTo
(
hDC
,
x
+
w
idth
,
y
-
yOffset
+
1
);
LineTo
(
hDC
,
x
+
run
->
nW
idth
,
y
-
yOffset
+
1
);
}
if
(
bHighlightedText
)
/* v1.0 inverts the selection */
...
...
@@ -364,7 +363,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
DeleteObject
(
hPen
);
}
SetTextColor
(
hDC
,
rgbOld
);
ME_UnselectStyleFont
(
c
,
s
,
hOldFont
);
ME_UnselectStyleFont
(
c
,
run
->
style
,
hOldFont
);
}
static
void
ME_DebugWrite
(
HDC
hDC
,
const
POINT
*
pt
,
LPCWSTR
szText
)
{
...
...
@@ -407,7 +406,7 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa
{
/* wszSpace is used instead of the tab character because otherwise
* an unwanted symbol can be inserted instead. */
ME_DrawTextWithStyle
(
c
,
x
,
y
,
wszSpace
,
1
,
run
->
style
,
run
->
nWidth
,
ME_DrawTextWithStyle
(
c
,
run
,
x
,
y
,
wszSpace
,
1
,
nSelFrom
-
runofs
,
nSelTo
-
runofs
,
c
->
pt
.
y
+
para
->
pt
.
y
+
start
->
member
.
row
.
pt
.
y
,
start
->
member
.
row
.
nHeight
);
...
...
@@ -421,16 +420,16 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa
if
(
c
->
editor
->
cPasswordMask
)
{
ME_String
*
szMasked
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
run
->
len
);
ME_DrawTextWithStyle
(
c
,
x
,
y
,
szMasked
->
szData
,
szMasked
->
nLen
,
run
->
style
,
run
->
nWidth
,
ME_DrawTextWithStyle
(
c
,
run
,
x
,
y
,
szMasked
->
szData
,
szMasked
->
nLen
,
nSelFrom
-
runofs
,
nSelTo
-
runofs
,
c
->
pt
.
y
+
para
->
pt
.
y
+
start
->
member
.
row
.
pt
.
y
,
start
->
member
.
row
.
nHeight
);
ME_DestroyString
(
szMasked
);
}
else
ME_DrawTextWithStyle
(
c
,
x
,
y
,
get_text
(
run
,
0
),
run
->
len
,
run
->
style
,
run
->
nWidth
,
ME_DrawTextWithStyle
(
c
,
run
,
x
,
y
,
get_text
(
run
,
0
),
run
->
len
,
nSelFrom
-
runofs
,
nSelTo
-
runofs
,
c
->
pt
.
y
+
para
->
pt
.
y
+
start
->
member
.
row
.
pt
.
y
,
start
->
member
.
row
.
nHeight
);
...
...
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