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
e668aa9d
Commit
e668aa9d
authored
Mar 25, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add support for TXTBACK_TRANSPARENT.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
909b2ced
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
31 deletions
+49
-31
editor.c
dlls/riched20/editor.c
+3
-0
editstr.h
dlls/riched20/editstr.h
+1
-0
paint.c
dlls/riched20/paint.c
+45
-31
No files found.
dlls/riched20/editor.c
View file @
e668aa9d
...
...
@@ -3037,6 +3037,9 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed
->
wheel_remain
=
0
;
ed
->
back_style
=
TXTBACK_OPAQUE
;
ITextHost_TxGetBackStyle
(
texthost
,
&
ed
->
back_style
);
list_init
(
&
ed
->
reobj_list
);
OleInitialize
(
NULL
);
...
...
dlls/riched20/editstr.h
View file @
e668aa9d
...
...
@@ -436,6 +436,7 @@ typedef struct tagME_TextEditor
BOOL
caret_hidden
;
BOOL
bMouseCaptured
;
int
wheel_remain
;
TXTBACKSTYLE
back_style
;
struct
list
style_list
;
struct
list
reobj_list
;
struct
wine_rb_tree
marked_paras
;
...
...
dlls/riched20/paint.c
View file @
e668aa9d
...
...
@@ -25,6 +25,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
static
void
draw_paragraph
(
ME_Context
*
c
,
ME_Paragraph
*
para
);
static
inline
BOOL
editor_opaque
(
ME_TextEditor
*
editor
)
{
return
editor
->
back_style
!=
TXTBACK_TRANSPARENT
;
}
void
editor_draw
(
ME_TextEditor
*
editor
,
HDC
hDC
,
const
RECT
*
update
)
{
ME_Paragraph
*
para
;
...
...
@@ -78,23 +83,26 @@ void editor_draw( ME_TextEditor *editor, HDC hDC, const RECT *update )
draw_paragraph
(
&
c
,
para
);
para
=
para_next
(
para
);
}
if
(
c
.
pt
.
y
+
editor
->
nTotalLength
<
c
.
rcView
.
bottom
)
{
/* space after the end of the text */
rc
.
top
=
c
.
pt
.
y
+
editor
->
nTotalLength
;
rc
.
left
=
c
.
rcView
.
left
;
rc
.
bottom
=
c
.
rcView
.
bottom
;
rc
.
right
=
c
.
rcView
.
right
;
if
(
IntersectRect
(
&
rc
,
&
rc
,
update
))
PatBlt
(
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
if
(
editor
->
selofs
)
{
/* selection bar */
rc
.
left
=
c
.
rcView
.
left
-
editor
->
selofs
;
rc
.
top
=
c
.
rcView
.
top
;
rc
.
right
=
c
.
rcView
.
left
;
rc
.
bottom
=
c
.
rcView
.
bottom
;
if
(
IntersectRect
(
&
rc
,
&
rc
,
update
))
PatBlt
(
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
if
(
editor_opaque
(
editor
))
{
if
(
c
.
pt
.
y
+
editor
->
nTotalLength
<
c
.
rcView
.
bottom
)
{
/* space after the end of the text */
rc
.
top
=
c
.
pt
.
y
+
editor
->
nTotalLength
;
rc
.
left
=
c
.
rcView
.
left
;
rc
.
bottom
=
c
.
rcView
.
bottom
;
rc
.
right
=
c
.
rcView
.
right
;
if
(
IntersectRect
(
&
rc
,
&
rc
,
update
))
PatBlt
(
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
if
(
editor
->
selofs
)
{
/* selection bar */
rc
.
left
=
c
.
rcView
.
left
-
editor
->
selofs
;
rc
.
top
=
c
.
rcView
.
top
;
rc
.
right
=
c
.
rcView
.
left
;
rc
.
bottom
=
c
.
rcView
.
bottom
;
if
(
IntersectRect
(
&
rc
,
&
rc
,
update
))
PatBlt
(
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
}
if
(
editor
->
nTotalLength
!=
editor
->
nLastTotalLength
||
editor
->
nTotalWidth
!=
editor
->
nLastTotalWidth
)
ME_SendRequestResize
(
editor
,
FALSE
);
...
...
@@ -597,22 +605,28 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
if
(
para
->
fmt
.
dwMask
&
PFM_SPACEBEFORE
)
{
rc
.
left
=
c
->
rcView
.
left
;
rc
.
right
=
c
->
rcView
.
right
;
rc
.
top
=
y
;
bounds
->
top
=
ME_twips2pointsY
(
c
,
para
->
fmt
.
dySpaceBefore
);
rc
.
bottom
=
y
+
bounds
->
top
+
top_border
;
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
if
(
editor_opaque
(
c
->
editor
))
{
rc
.
left
=
c
->
rcView
.
left
;
rc
.
right
=
c
->
rcView
.
right
;
rc
.
top
=
y
;
rc
.
bottom
=
y
+
bounds
->
top
+
top_border
;
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
}
if
(
para
->
fmt
.
dwMask
&
PFM_SPACEAFTER
)
{
rc
.
left
=
c
->
rcView
.
left
;
rc
.
right
=
c
->
rcView
.
right
;
rc
.
bottom
=
y
+
para
->
nHeight
;
bounds
->
bottom
=
ME_twips2pointsY
(
c
,
para
->
fmt
.
dySpaceAfter
);
rc
.
top
=
rc
.
bottom
-
bounds
->
bottom
-
bottom_border
;
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
if
(
editor_opaque
(
c
->
editor
))
{
rc
.
left
=
c
->
rcView
.
left
;
rc
.
right
=
c
->
rcView
.
right
;
rc
.
bottom
=
y
+
para
->
nHeight
;
rc
.
top
=
rc
.
bottom
-
bounds
->
bottom
-
bottom_border
;
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
}
/* Native richedit doesn't support paragraph borders in v1.0 - 4.1,
...
...
@@ -730,7 +744,7 @@ static void draw_table_borders( ME_Context *c, ME_Paragraph *para )
rc
.
top
=
top
+
width
;
width
=
cell
->
yTextOffset
-
width
;
rc
.
bottom
=
rc
.
top
+
width
;
if
(
width
)
if
(
width
&&
editor_opaque
(
c
->
editor
)
)
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
/* Draw cell borders.
...
...
@@ -973,7 +987,7 @@ static void draw_paragraph( ME_Context *c, ME_Paragraph *para )
rc
.
bottom
=
y
+
p
->
member
.
row
.
nHeight
;
}
visible
=
RectVisible
(
c
->
hDC
,
&
rc
);
if
(
visible
)
if
(
editor_opaque
(
c
->
editor
)
&&
visible
)
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
if
(
bounds
.
right
)
{
...
...
@@ -982,7 +996,7 @@ static void draw_paragraph( ME_Context *c, ME_Paragraph *para )
RECT
after_bdr
=
rc
;
after_bdr
.
left
=
rc
.
right
+
bounds
.
right
;
after_bdr
.
right
=
c
->
rcView
.
right
;
if
(
RectVisible
(
c
->
hDC
,
&
after_bdr
))
if
(
editor_opaque
(
c
->
editor
)
&&
RectVisible
(
c
->
hDC
,
&
after_bdr
))
PatBlt
(
c
->
hDC
,
after_bdr
.
left
,
after_bdr
.
top
,
after_bdr
.
right
-
after_bdr
.
left
,
after_bdr
.
bottom
-
after_bdr
.
top
,
PATCOPY
);
}
...
...
@@ -1035,7 +1049,7 @@ static void draw_paragraph( ME_Context *c, ME_Paragraph *para )
no
++
;
}
if
(
para_cell
(
para
))
if
(
editor_opaque
(
c
->
editor
)
&&
para_cell
(
para
))
{
/* Clear any space at the bottom of the cell after the text. */
rc
.
top
=
c
->
pt
.
y
+
para
->
pt
.
y
+
para
->
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