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
0ba0d7a1
Commit
0ba0d7a1
authored
Aug 26, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetUpdateRgn should clip the returned region to the client area.
Changed GetUpdateRect and ExcludeUpdateRgn to call GetUpdateRgn. Moved these 3 functions to dlls/user/painting.c.
parent
b72994b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
117 deletions
+95
-117
painting.c
dlls/user/painting.c
+95
-0
painting.c
windows/painting.c
+0
-117
No files found.
dlls/user/painting.c
View file @
0ba0d7a1
...
...
@@ -71,6 +71,20 @@ static HRGN copy_rgn( HRGN hSrc )
/***********************************************************************
* get_update_region
*
* Return update region for a window.
*/
static
HRGN
get_update_region
(
WND
*
win
)
{
if
(
!
win
->
hrgnUpdate
)
return
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
win
->
hrgnUpdate
>
(
HRGN
)
1
)
return
copy_rgn
(
win
->
hrgnUpdate
);
return
CreateRectRgn
(
0
,
0
,
win
->
rectWindow
.
right
-
win
->
rectWindow
.
left
,
win
->
rectWindow
.
bottom
-
win
->
rectWindow
.
top
);
}
/***********************************************************************
* get_update_regions
*
* Return update regions for the whole window and for the client area.
...
...
@@ -258,3 +272,84 @@ BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
ShowCaret
(
hwnd
);
return
TRUE
;
}
/***********************************************************************
* GetUpdateRgn (USER32.@)
*/
INT
WINAPI
GetUpdateRgn
(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
erase
)
{
INT
retval
;
HRGN
update_rgn
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
return
ERROR
;
if
(
wndPtr
==
WND_OTHER_PROCESS
)
{
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
ERROR
;
}
if
((
update_rgn
=
get_update_region
(
wndPtr
)))
{
/* map coordinates and clip to client area */
OffsetRgn
(
update_rgn
,
wndPtr
->
rectWindow
.
left
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectWindow
.
top
-
wndPtr
->
rectClient
.
top
);
SetRectRgn
(
hrgn
,
0
,
0
,
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
);
retval
=
CombineRgn
(
hrgn
,
hrgn
,
update_rgn
,
RGN_AND
);
DeleteObject
(
update_rgn
);
}
else
retval
=
ERROR
;
WIN_ReleasePtr
(
wndPtr
);
if
(
erase
)
RedrawWindow
(
hwnd
,
NULL
,
0
,
RDW_ERASENOW
|
RDW_NOCHILDREN
);
return
retval
;
}
/***********************************************************************
* GetUpdateRect (USER32.@)
*/
BOOL
WINAPI
GetUpdateRect
(
HWND
hwnd
,
LPRECT
rect
,
BOOL
erase
)
{
HRGN
update_rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
INT
retval
=
GetUpdateRgn
(
hwnd
,
update_rgn
,
erase
);
if
(
rect
)
{
GetRgnBox
(
update_rgn
,
rect
);
if
(
GetClassLongA
(
hwnd
,
GCL_STYLE
)
&
CS_OWNDC
)
{
HDC
hdc
=
GetDCEx
(
hwnd
,
0
,
DCX_USESTYLE
);
if
(
hdc
)
{
if
(
GetMapMode
(
hdc
)
!=
MM_TEXT
)
DPtoLP
(
hdc
,
(
LPPOINT
)
rect
,
2
);
ReleaseDC
(
hwnd
,
hdc
);
}
}
}
DeleteObject
(
update_rgn
);
return
(
retval
!=
ERROR
&&
retval
!=
NULLREGION
);
}
/***********************************************************************
* ExcludeUpdateRgn (USER32.@)
*/
INT
WINAPI
ExcludeUpdateRgn
(
HDC
hdc
,
HWND
hwnd
)
{
HRGN
update_rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
INT
ret
=
GetUpdateRgn
(
hwnd
,
update_rgn
,
FALSE
);
if
(
ret
!=
ERROR
)
{
/* do ugly coordinate translations in dce.c */
ret
=
DCE_ExcludeRgn
(
hdc
,
hwnd
,
update_rgn
);
DeleteObject
(
update_rgn
);
}
return
ret
;
}
windows/painting.c
View file @
0ba0d7a1
...
...
@@ -944,123 +944,6 @@ BOOL WINAPI ValidateRect( HWND hwnd, const RECT *rect )
/***********************************************************************
* GetUpdateRect (USER32.@)
*/
BOOL
WINAPI
GetUpdateRect
(
HWND
hwnd
,
LPRECT
rect
,
BOOL
erase
)
{
BOOL
retvalue
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
if
(
!
wndPtr
)
return
FALSE
;
if
(
rect
)
{
if
(
wndPtr
->
hrgnUpdate
>
(
HRGN
)
1
)
{
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
GetUpdateRgn
(
hwnd
,
hrgn
,
erase
)
==
ERROR
)
{
retvalue
=
FALSE
;
goto
END
;
}
GetRgnBox
(
hrgn
,
rect
);
DeleteObject
(
hrgn
);
if
(
GetClassLongA
(
wndPtr
->
hwndSelf
,
GCL_STYLE
)
&
CS_OWNDC
)
{
if
(
GetMapMode
(
wndPtr
->
dce
->
hDC
)
!=
MM_TEXT
)
{
DPtoLP
(
wndPtr
->
dce
->
hDC
,
(
LPPOINT
)
rect
,
2
);
}
}
}
else
if
(
wndPtr
->
hrgnUpdate
==
(
HRGN
)
1
)
{
GetClientRect
(
hwnd
,
rect
);
if
(
erase
)
RedrawWindow
(
hwnd
,
NULL
,
0
,
RDW_FRAME
|
RDW_ERASENOW
|
RDW_NOCHILDREN
);
}
else
SetRectEmpty
(
rect
);
}
retvalue
=
(
wndPtr
->
hrgnUpdate
>=
(
HRGN
)
1
);
END:
WIN_ReleaseWndPtr
(
wndPtr
);
return
retvalue
;
}
/***********************************************************************
* GetUpdateRgn (USER32.@)
*/
INT
WINAPI
GetUpdateRgn
(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
erase
)
{
INT
retval
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
if
(
!
wndPtr
)
return
ERROR
;
if
(
wndPtr
->
hrgnUpdate
==
0
)
{
SetRectRgn
(
hrgn
,
0
,
0
,
0
,
0
);
retval
=
NULLREGION
;
goto
END
;
}
else
if
(
wndPtr
->
hrgnUpdate
==
(
HRGN
)
1
)
{
SetRectRgn
(
hrgn
,
0
,
0
,
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
);
retval
=
SIMPLEREGION
;
}
else
{
retval
=
CombineRgn
(
hrgn
,
wndPtr
->
hrgnUpdate
,
0
,
RGN_COPY
);
OffsetRgn
(
hrgn
,
wndPtr
->
rectWindow
.
left
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectWindow
.
top
-
wndPtr
->
rectClient
.
top
);
}
if
(
erase
)
RedrawWindow
(
hwnd
,
NULL
,
0
,
RDW_ERASENOW
|
RDW_NOCHILDREN
);
END:
WIN_ReleaseWndPtr
(
wndPtr
);
return
retval
;
}
/***********************************************************************
* ExcludeUpdateRgn (USER32.@)
*/
INT
WINAPI
ExcludeUpdateRgn
(
HDC
hdc
,
HWND
hwnd
)
{
RECT
rect
;
WND
*
wndPtr
;
if
(
!
(
wndPtr
=
WIN_FindWndPtr
(
hwnd
)))
return
ERROR
;
if
(
wndPtr
->
hrgnUpdate
)
{
INT
ret
;
HRGN
hrgn
=
CreateRectRgn
(
wndPtr
->
rectWindow
.
left
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectWindow
.
top
-
wndPtr
->
rectClient
.
top
,
wndPtr
->
rectWindow
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectWindow
.
bottom
-
wndPtr
->
rectClient
.
top
);
if
(
wndPtr
->
hrgnUpdate
>
(
HRGN
)
1
)
{
CombineRgn
(
hrgn
,
wndPtr
->
hrgnUpdate
,
0
,
RGN_COPY
);
OffsetRgn
(
hrgn
,
wndPtr
->
rectWindow
.
left
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectWindow
.
top
-
wndPtr
->
rectClient
.
top
);
}
/* do ugly coordinate translations in dce.c */
ret
=
DCE_ExcludeRgn
(
hdc
,
hwnd
,
hrgn
);
DeleteObject
(
hrgn
);
WIN_ReleaseWndPtr
(
wndPtr
);
return
ret
;
}
WIN_ReleaseWndPtr
(
wndPtr
);
return
GetClipBox
(
hdc
,
&
rect
);
}
/***********************************************************************
* FillRect (USER.81)
* NOTE
* The Win16 variant doesn't support special color brushes like
...
...
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