ReactOS 0.4.15-dev-5884-gab5aff5
vis.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PREGION FASTCALL VIS_ComputeVisibleRegion (PWND Window, BOOLEAN ClientArea, BOOLEAN ClipChildren, BOOLEAN ClipSiblings)
 
VOID FASTCALL co_VIS_WindowLayoutChanged (PWND Window, PREGION UncoveredRgn)
 

Function Documentation

◆ co_VIS_WindowLayoutChanged()

VOID FASTCALL co_VIS_WindowLayoutChanged ( PWND  Window,
PREGION  UncoveredRgn 
)

Definition at line 145 of file vis.c.

148{
149 PWND Parent;
151
152 ASSERT_REFS_CO(Wnd);
153
154 Parent = Wnd->spwndParent;
155 if(Parent)
156 {
157 PREGION TempRgn = IntSysCreateRectpRgn(0, 0, 0, 0);
158
159 if (!TempRgn)
160 return;
161
162 IntGdiCombineRgn(TempRgn, NewlyExposed, NULL, RGN_COPY);
163 REGION_bOffsetRgn(TempRgn,
164 Wnd->rcWindow.left - Parent->rcClient.left,
165 Wnd->rcWindow.top - Parent->rcClient.top);
166
167 UserRefObjectCo(Parent, &Ref);
172
173 REGION_Delete(TempRgn);
174 }
175}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
#define NULL
Definition: types.h:112
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
Definition: region.h:8
Definition: object.h:4
Definition: ntuser.h:689
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2465
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2423
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2724
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2503
#define RGN_COPY
Definition: wingdi.h:357
#define RDW_ERASE
Definition: winuser.h:1201
#define RDW_ALLCHILDREN
Definition: winuser.h:1211
#define RDW_FRAME
Definition: winuser.h:1202
#define RDW_INVALIDATE
Definition: winuser.h:1204

Referenced by co_WinPosSetWindowPos().

◆ VIS_ComputeVisibleRegion()

PREGION FASTCALL VIS_ComputeVisibleRegion ( PWND  Window,
BOOLEAN  ClientArea,
BOOLEAN  ClipChildren,
BOOLEAN  ClipSiblings 
)

Definition at line 13 of file vis.c.

18{
19 PREGION VisRgn, ClipRgn;
20 PWND PreviousWindow, CurrentWindow, CurrentSibling;
21
22 if (!Wnd || !(Wnd->style & WS_VISIBLE))
23 {
24 return NULL;
25 }
26
27 VisRgn = NULL;
28
29 if (ClientArea)
30 {
31 VisRgn = IntSysCreateRectpRgnIndirect(&Wnd->rcClient);
32 }
33 else
34 {
35 VisRgn = IntSysCreateRectpRgnIndirect(&Wnd->rcWindow);
36 }
37
38 /*
39 * Walk through all parent windows and for each clip the visble region
40 * to the parent's client area and exclude all siblings that are over
41 * our window.
42 */
43
44 PreviousWindow = Wnd;
45 CurrentWindow = Wnd->spwndParent;
46 while (CurrentWindow)
47 {
48 if (!VerifyWnd(CurrentWindow))
49 {
50 ERR("ATM the Current Window or Parent is dead! %p\n",CurrentWindow);
51 if (VisRgn)
52 REGION_Delete(VisRgn);
53 return NULL;
54 }
55
56 if (!(CurrentWindow->style & WS_VISIBLE))
57 {
58 if (VisRgn)
59 REGION_Delete(VisRgn);
60 return NULL;
61 }
62
63 ClipRgn = IntSysCreateRectpRgnIndirect(&CurrentWindow->rcClient);
64 IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
65 REGION_Delete(ClipRgn);
66
67 if ((PreviousWindow->style & WS_CLIPSIBLINGS) ||
68 (PreviousWindow == Wnd && ClipSiblings))
69 {
70 CurrentSibling = CurrentWindow->spwndChild;
71 while ( CurrentSibling != NULL &&
72 CurrentSibling != PreviousWindow )
73 {
74 if ((CurrentSibling->style & WS_VISIBLE) &&
75 !(CurrentSibling->ExStyle & WS_EX_TRANSPARENT))
76 {
77 ClipRgn = IntSysCreateRectpRgnIndirect(&CurrentSibling->rcWindow);
78 /* Combine it with the window region if available */
79 if (CurrentSibling->hrgnClip && !(CurrentSibling->style & WS_MINIMIZE))
80 {
81 PREGION SiblingClipRgn = REGION_LockRgn(CurrentSibling->hrgnClip);
82 if (SiblingClipRgn)
83 {
84 REGION_bOffsetRgn(ClipRgn, -CurrentSibling->rcWindow.left, -CurrentSibling->rcWindow.top);
85 IntGdiCombineRgn(ClipRgn, ClipRgn, SiblingClipRgn, RGN_AND);
86 REGION_bOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left, CurrentSibling->rcWindow.top);
87 REGION_UnlockRgn(SiblingClipRgn);
88 }
89 }
90 IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
91 REGION_Delete(ClipRgn);
92 }
93 CurrentSibling = CurrentSibling->spwndNext;
94 }
95 }
96
97 PreviousWindow = CurrentWindow;
98 CurrentWindow = CurrentWindow->spwndParent;
99 }
100
101 if (ClipChildren)
102 {
103 CurrentWindow = Wnd->spwndChild;
104 while (CurrentWindow)
105 {
106 if ((CurrentWindow->style & WS_VISIBLE) &&
107 !(CurrentWindow->ExStyle & WS_EX_TRANSPARENT))
108 {
109 ClipRgn = IntSysCreateRectpRgnIndirect(&CurrentWindow->rcWindow);
110 /* Combine it with the window region if available */
111 if (CurrentWindow->hrgnClip && !(CurrentWindow->style & WS_MINIMIZE))
112 {
113 PREGION CurrentRgnClip = REGION_LockRgn(CurrentWindow->hrgnClip);
114 if (CurrentRgnClip)
115 {
116 REGION_bOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left, -CurrentWindow->rcWindow.top);
117 IntGdiCombineRgn(ClipRgn, ClipRgn, CurrentRgnClip, RGN_AND);
118 REGION_bOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top);
119 REGION_UnlockRgn(CurrentRgnClip);
120 }
121 }
122 IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
123 REGION_Delete(ClipRgn);
124 }
125 CurrentWindow = CurrentWindow->spwndNext;
126 }
127 }
128
129 if (Wnd->hrgnClip && !(Wnd->style & WS_MINIMIZE))
130 {
131 PREGION WndRgnClip = REGION_LockRgn(Wnd->hrgnClip);
132 if (WndRgnClip)
133 {
134 REGION_bOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
135 IntGdiCombineRgn(VisRgn, VisRgn, WndRgnClip, RGN_AND);
136 REGION_bOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
137 REGION_UnlockRgn(WndRgnClip);
138 }
139 }
140
141 return VisRgn;
142}
#define ERR(fmt,...)
Definition: debug.h:110
#define WS_MINIMIZE
Definition: pedump.c:622
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
DWORD ExStyle
Definition: ntuser.h:699
HRGN hrgnClip
Definition: ntuser.h:728
DWORD style
Definition: ntuser.h:701
struct _WND * spwndChild
Definition: ntuser.h:709
RECT rcClient
Definition: ntuser.h:712
struct _WND * spwndNext
Definition: ntuser.h:706
RECT rcWindow
Definition: ntuser.h:711
struct _WND * spwndParent
Definition: ntuser.h:708
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2374
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2389
PWND FASTCALL VerifyWnd(PWND pWnd)
Definition: window.c:86
#define RGN_DIFF
Definition: wingdi.h:358
#define RGN_AND
Definition: wingdi.h:356

Referenced by co_WinPosSetWindowPos(), DceGetVisRgn(), and IntEngWndUpdateClipObj().