ReactOS 0.4.15-dev-8222-g9164419
scroll.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagSBTRACK
 

Macros

#define IntGetScrollbarInfoFromWindow(Window, i)    ((PSCROLLBARINFO)(&((Window)->pSBInfoex + i)->ScrollBarInfo))
 
#define IntGetScrollInfoFromWindow(Window, i)    ((LPSCROLLINFO)(&((Window)->pSBInfoex + i)->ScrollInfo))
 
#define SBOBJ_TO_SBID(Obj)   ((Obj) - OBJID_HSCROLL)
 
#define SBID_IS_VALID(id)   (id == SB_HORZ || id == SB_VERT || id == SB_CTL)
 

Typedefs

typedef struct tagSBTRACK SBTRACK
 
typedef struct tagSBTRACKPSBTRACK
 

Functions

typedef VOID (NEAR NTAPI *PFN_SCROLLBAR)(PWND
 
BOOL FASTCALL co_IntCreateScrollBars (PWND)
 
BOOL FASTCALL IntDestroyScrollBars (PWND)
 
DWORD FASTCALL co_UserShowScrollBar (PWND, int, BOOL, BOOL)
 
BOOL FASTCALL co_IntGetScrollBarInfo (PWND, LONG, PSCROLLBARINFO)
 
BOOL FASTCALL co_IntSetScrollBarInfo (PWND, LONG, PSETSCROLLBARINFO)
 
void IntDrawScrollBar (PWND, HDC, INT)
 
BOOL FASTCALL IntScrollWindow (PWND, int, int, CONST RECT *, CONST RECT *)
 
DWORD FASTCALL IntScrollWindowEx (PWND, INT, INT, const RECT *, const RECT *, HRGN, LPRECT, UINT)
 

Variables

typedef UINT
 
typedef WPARAM
 
typedef LPARAM
 
typedef PSBCALC
 

Macro Definition Documentation

◆ IntGetScrollbarInfoFromWindow

#define IntGetScrollbarInfoFromWindow (   Window,
  i 
)     ((PSCROLLBARINFO)(&((Window)->pSBInfoex + i)->ScrollBarInfo))

Definition at line 33 of file scroll.h.

◆ IntGetScrollInfoFromWindow

#define IntGetScrollInfoFromWindow (   Window,
  i 
)     ((LPSCROLLINFO)(&((Window)->pSBInfoex + i)->ScrollInfo))

Definition at line 36 of file scroll.h.

◆ SBID_IS_VALID

#define SBID_IS_VALID (   id)    (id == SB_HORZ || id == SB_VERT || id == SB_CTL)

Definition at line 40 of file scroll.h.

◆ SBOBJ_TO_SBID

#define SBOBJ_TO_SBID (   Obj)    ((Obj) - OBJID_HSCROLL)

Definition at line 39 of file scroll.h.

Typedef Documentation

◆ PSBTRACK

◆ SBTRACK

Function Documentation

◆ co_IntCreateScrollBars()

BOOL FASTCALL co_IntCreateScrollBars ( PWND  Window)

Definition at line 748 of file scrollbar.c.

749{
750 PSCROLLBARINFO psbi;
751 PSBDATA pSBData;
752 ULONG Size, s;
753 INT i;
754
756
757 if (Window->pSBInfo && Window->pSBInfoex)
758 return TRUE; // No need to create it anymore
759
760 // Allocate memory for all scrollbars (HORZ, VERT, CONTROL)
761 Size = 3 * (sizeof(SBINFOEX));
763 {
764 ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window));
765 return FALSE;
766 }
767
768 RtlZeroMemory(Window->pSBInfoex, Size);
769
770 if(!(Window->pSBInfo = DesktopHeapAlloc(Window->head.rpdesk, sizeof(SBINFO))))
771 {
772 ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window));
773 return FALSE;
774 }
775
776 RtlZeroMemory(Window->pSBInfo, sizeof(SBINFO));
777 Window->pSBInfo->Vert.posMax = 100;
778 Window->pSBInfo->Horz.posMax = 100;
779
780 co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient);
781
782 for(s = SB_HORZ; s <= SB_VERT; s++)
783 {
785 psbi->cbSize = sizeof(SCROLLBARINFO);
786 for (i = 0; i < CCHILDREN_SCROLLBAR + 1; i++)
787 psbi->rgstate[i] = 0;
788
789 pSBData = IntGetSBData(Window, s);
790
792 IntCalculateThumb(Window, s, psbi, pSBData);
793 }
794
795 return TRUE;
796}
#define ERR(fmt,...)
Definition: debug.h:113
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
GLdouble s
Definition: gl.h:2039
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
struct _SBINFOEX SBINFOEX
PSBDATA FASTCALL IntGetSBData(PWND pwnd, INT Bar)
Definition: scrollbar.c:77
BOOL FASTCALL IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, PSBDATA pSBData)
Definition: scrollbar.c:166
BOOL FASTCALL IntGetScrollBarRect(PWND Wnd, INT nBar, RECTL *lprect)
Definition: scrollbar.c:104
LRESULT FASTCALL co_WinPosGetNonClientSize(PWND Window, RECT *WindowRect, RECT *ClientRect)
Definition: winpos.c:2366
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3754
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
static __inline PVOID DesktopHeapAlloc(IN PDESKTOP Desktop, IN SIZE_T Bytes)
Definition: desktop.h:204
#define TAG_SBARINFO
Definition: tags.h:9
#define SB_VERT
Definition: winuser.h:553
#define CCHILDREN_SCROLLBAR
Definition: winuser.h:3745
struct tagSCROLLBARINFO SCROLLBARINFO
#define SB_HORZ
Definition: winuser.h:552

Referenced by co_IntGetScrollBarInfo(), co_IntSetScrollBarInfo(), co_IntSetScrollInfo(), NtUserEnableScrollBar(), and NtUserSetScrollBarInfo().

◆ co_IntGetScrollBarInfo()

BOOL FASTCALL co_IntGetScrollBarInfo ( PWND  Window,
LONG  idObject,
PSCROLLBARINFO  psbi 
)

Definition at line 666 of file scrollbar.c.

667{
668 INT Bar;
669 PSCROLLBARINFO sbi;
670 PSBDATA pSBData;
672
673 Bar = SBOBJ_TO_SBID(idObject);
674
675 if(!SBID_IS_VALID(Bar))
676 {
678 ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar);
679 return FALSE;
680 }
681
683 {
684 ERR("Failed to create scrollbars for window\n");
685 return FALSE;
686 }
687
689 pSBData = IntGetSBData(Window, Bar);
690
692 IntCalculateThumb(Window, Bar, sbi, pSBData);
693
694 // Scrollbar state
695 psbi->rgstate[0] = 0;
696 if ((Bar == SB_HORZ && !(Window->style & WS_HSCROLL))
697 || (Bar == SB_VERT && !(Window->style & WS_VSCROLL)))
699 if (pSBData->posMin >= pSBData->posMax - max(pSBData->page - 1, 0))
700 {
701 if (!(psbi->rgstate[0] & STATE_SYSTEM_INVISIBLE))
703 else
705 }
706 if (Bar == SB_CTL && !(Window->style & WS_DISABLED))
708
709 RtlCopyMemory(psbi, sbi, sizeof(SCROLLBARINFO));
710
711 return TRUE;
712}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
void Bar(void)
Definition: terminate.cpp:70
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:748
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_DISABLED
Definition: pedump.c:621
#define WS_HSCROLL
Definition: pedump.c:628
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define SBOBJ_TO_SBID(Obj)
Definition: scroll.h:39
INT posMax
Definition: ntuser.h:506
INT posMin
Definition: ntuser.h:505
INT page
Definition: ntuser.h:507
#define max(a, b)
Definition: svc.c:63
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2877
#define STATE_SYSTEM_OFFSCREEN
Definition: winuser.h:2878
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2862
#define SB_CTL
Definition: winuser.h:554

Referenced by IntDrawScrollBar(), IntIsScrollBarVisible(), IntRefeshScrollInterior(), and NtUserGetScrollBarInfo().

◆ co_IntSetScrollBarInfo()

BOOL FASTCALL co_IntSetScrollBarInfo ( PWND  Window,
LONG  idObject,
PSETSCROLLBARINFO  psbi 
)

Definition at line 715 of file scrollbar.c.

716{
717 INT Bar;
718 PSCROLLBARINFO sbi;
719 LPSCROLLINFO psi;
721
722 Bar = SBOBJ_TO_SBID(idObject);
723
724 if(!SBID_IS_VALID(Bar))
725 {
727 ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar);
728 return FALSE;
729 }
730
732 {
733 ERR("Failed to create scrollbars for window\n");
734 return FALSE;
735 }
736
739
740 psi->nTrackPos = psbi->nTrackPos;
741 sbi->reserved = psbi->reserved;
742 RtlCopyMemory(&sbi->rgstate, &psbi->rgstate, sizeof(psbi->rgstate));
743
744 return TRUE;
745}
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: ntuser.h:3621

◆ co_UserShowScrollBar()

DWORD FASTCALL co_UserShowScrollBar ( PWND  Wnd,
int  nBar,
BOOL  fShowH,
BOOL  fShowV 
)

Definition at line 852 of file scrollbar.c.

853{
854 ULONG old_style, set_bits = 0, clear_bits = 0;
855
856 ASSERT_REFS_CO(Wnd);
857
858 switch(nBar)
859 {
860 case SB_CTL:
861 {
862 //IntUpdateSBInfo(Wnd, SB_CTL); // Is this needed? Was tested w/o!
863 co_WinPosShowWindow(Wnd, fShowH ? SW_SHOW : SW_HIDE);
864 return TRUE;
865 }
866 case SB_BOTH:
867 case SB_HORZ:
868 if (fShowH) set_bits |= WS_HSCROLL;
869 else clear_bits |= WS_HSCROLL;
870 if( nBar == SB_HORZ ) break;
871 // Fall through
872 case SB_VERT:
873 if (fShowV) set_bits |= WS_VSCROLL;
874 else clear_bits |= WS_VSCROLL;
875 break;
876 default:
878 return FALSE; // Nothing to do
879 }
880
881 old_style = IntSetStyle(Wnd, set_bits, clear_bits);
882 if ((old_style & clear_bits) != 0 || (old_style & set_bits) != set_bits)
883 {
885 //if (Wnd->style & WS_HSCROLL) IntUpdateSBInfo(Wnd, SB_HORZ);
886 //if (Wnd->style & WS_VSCROLL) IntUpdateSBInfo(Wnd, SB_VERT);
887
888 // Frame has been changed, let the window redraw itself
889 co_WinPosSetWindowPos(Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
891 return TRUE;
892 }
893 return FALSE; // no frame changes
894}
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1786
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2566
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
Definition: window.c:143
#define SW_HIDE
Definition: winuser.h:768
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define SWP_FRAMECHANGED
Definition: winuser.h:1240
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1245
#define SB_BOTH
Definition: winuser.h:555
#define SW_SHOW
Definition: winuser.h:775
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by co_IntSetScrollInfo(), co_UserCreateWindowEx(), and NtUserShowScrollBar().

◆ IntDestroyScrollBars()

BOOL FASTCALL IntDestroyScrollBars ( PWND  Window)

Definition at line 799 of file scrollbar.c.

800{
801 if (Window->pSBInfo && Window->pSBInfoex)
802 {
803 DesktopHeapFree(Window->head.rpdesk, Window->pSBInfo);
804 Window->pSBInfo = NULL;
806 Window->pSBInfoex = NULL;
807 return TRUE;
808 }
809 return FALSE;
810}
#define NULL
Definition: types.h:112
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static __inline BOOL DesktopHeapFree(IN PDESKTOP Desktop, IN PVOID lpMem)
Definition: desktop.h:215

Referenced by co_UserFreeWindow().

◆ IntDrawScrollBar()

void IntDrawScrollBar ( PWND  Wnd,
HDC  DC,
INT  Bar 
)

Definition at line 1072 of file scrollbar.c.

1073{
1074 PTHREADINFO pti;
1076 BOOL Vertical;
1077
1079
1080 // Get scrollbar info
1081 switch (Bar)
1082 {
1083 case SB_HORZ:
1084 Vertical = FALSE;
1085 break;
1086
1087 case SB_VERT:
1088 Vertical = TRUE;
1089 break;
1090
1091 case SB_CTL:
1092 Vertical = (Wnd->style & SBS_VERT) != 0;
1093 break;
1094
1095 default:
1096 return;
1097 }
1098
1100 return;
1101
1102 if (RECTL_bIsEmptyRect(&Info.rcScrollBar))
1103 return;
1104
1105 // Draw arrows
1106 if (Info.dxyLineButton)
1107 IntDrawScrollArrows(DC, &Info, Vertical);
1108
1109 // Draw interior
1110 IntDrawScrollInterior(Wnd, DC, Bar, Vertical, &Info);
1111
1112 // If scrollbar has focus, reposition the caret
1113 if (Wnd == pti->MessageQueue->spwndFocus && Bar == SB_CTL)
1114 {
1115 if (Vertical)
1116 co_IntSetCaretPos(Info.rcScrollBar.top + 1, Info.dxyLineButton + 1);
1117 else
1118 co_IntSetCaretPos(Info.dxyLineButton + 1, Info.rcScrollBar.top + 1);
1119 }
1120}
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
static VOID FASTCALL IntDrawScrollArrows(HDC hDC, PSCROLLBARINFO ScrollBarInfo, BOOL Vertical)
Definition: scrollbar.c:1009
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:666
static void IntDrawScrollInterior(PWND pWnd, HDC hDC, INT nBar, BOOL Vertical, PSCROLLBARINFO ScrollBarInfo)
Definition: scrollbar.c:897
static LONG FASTCALL IntScrollGetObjectId(INT SBType)
Definition: scrollbar.c:1047
Definition: polytest.cpp:41
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:89
DWORD style
Definition: ntuser.h:706
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
BOOL FASTCALL co_IntSetCaretPos(int X, int Y)
Definition: caret.c:193
#define SBS_VERT
Definition: winuser.h:334

Referenced by NC_DoNCPaint(), SCROLL_RefreshScrollBar(), and ScrollBarWndProc_common().

◆ IntScrollWindow()

BOOL FASTCALL IntScrollWindow ( PWND  pWnd,
int  dx,
int  dy,
CONST RECT lpRect,
CONST RECT prcClip 
)

Definition at line 458 of file scrollex.c.

463{
464 return IntScrollWindowEx( pWnd, dx, dy, lpRect, prcClip, 0, NULL,
466}
#define ERROR(name)
Definition: error_private.h:53
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
DWORD FASTCALL IntScrollWindowEx(PWND Window, INT dx, INT dy, const RECT *prcScroll, const RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, UINT flags)
Definition: scrollex.c:228
#define SW_SCROLLWNDDCE
Definition: undocuser.h:92
#define SW_SCROLLCHILDREN
Definition: winuser.h:2578
#define SW_INVALIDATE
Definition: winuser.h:2579
#define SW_ERASE
Definition: winuser.h:2580

Referenced by MENU_EnsureMenuItemVisible().

◆ IntScrollWindowEx()

DWORD FASTCALL IntScrollWindowEx ( PWND  Window,
INT  dx,
INT  dy,
const RECT prcScroll,
const RECT prcClip,
HRGN  hrgnUpdate,
LPRECT  prcUpdate,
UINT  flags 
)

Definition at line 228 of file scrollex.c.

237{
238 INT Result;
239 RECTL rcScroll, rcClip, rcCaret;
240 PWND CaretWnd;
241 HDC hDC;
242 PREGION RgnUpdate = NULL, RgnTemp, RgnWinupd = NULL;
243 HWND hwndCaret;
244 DWORD dcxflags = 0;
245 int rdw_flags;
246 USER_REFERENCE_ENTRY CaretRef;
247
249 {
250 return ERROR;
251 }
252
253 IntGetClientRect(Window, &rcClip);
254
255 if (prcScroll)
256 RECTL_bIntersectRect(&rcScroll, &rcClip, prcScroll);
257 else
258 rcScroll = rcClip;
259
260 if (prcClip)
261 RECTL_bIntersectRect(&rcClip, &rcClip, prcClip);
262
263 if (rcClip.right <= rcClip.left || rcClip.bottom <= rcClip.top ||
264 (dx == 0 && dy == 0))
265 {
266 return NULLREGION;
267 }
268
269 /* We must use a copy of the region, as we can't hold an exclusive lock
270 * on it while doing callouts to user-mode */
271 RgnUpdate = IntSysCreateRectpRgn(0, 0, 0, 0);
272 if(!RgnUpdate)
273 {
275 return ERROR;
276 }
277
278 if (hrgnUpdate)
279 {
280 RgnTemp = REGION_LockRgn(hrgnUpdate);
281 if (!RgnTemp)
282 {
284 Result = ERROR;
285 goto Cleanup;
286 }
287 IntGdiCombineRgn(RgnUpdate, RgnTemp, NULL, RGN_COPY);
288 REGION_UnlockRgn(RgnTemp);
289 }
290
291 /* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
293 {
294 dcxflags = DCX_USESTYLE;
295
296 if (!(Window->pcls->style & (CS_OWNDC|CS_CLASSDC)))
297 dcxflags |= DCX_CACHE; // AH??? wine~ If not Powned or with Class go Cheap!
298
300 dcxflags |= DCX_CACHE|DCX_NOCLIPCHILDREN;
301 }
302 else
303 {
304 /* So in this case ScrollWindowEx uses Cache DC. */
305 dcxflags = DCX_CACHE|DCX_USESTYLE;
306 if (flags & SW_SCROLLCHILDREN) dcxflags |= DCX_NOCLIPCHILDREN;
307 }
308
309 hDC = UserGetDCEx(Window, 0, dcxflags);
310 if (!hDC)
311 {
312 /* FIXME: SetLastError? */
313 Result = ERROR;
314 goto Cleanup;
315 }
316
318
319 rcCaret = rcScroll;
320 hwndCaret = co_IntFixCaret(Window, &rcCaret, flags);
321
323 dx,
324 dy,
325 &rcScroll,
326 &rcClip,
327 NULL,
328 RgnUpdate,
329 prcUpdate);
330
332
333 /*
334 * Take into account the fact that some damage may have occurred during
335 * the scroll. Keep a copy in hrgnWinupd to be added to hrngUpdate at the end.
336 */
337
338 RgnTemp = IntSysCreateRectpRgn(0, 0, 0, 0);
339 if (!RgnTemp)
340 {
342 Result = ERROR;
343 goto Cleanup;
344 }
345
346 if (co_IntGetUpdateRgn(Window, RgnTemp, FALSE) != NULLREGION)
347 {
348 PREGION RgnClip = IntSysCreateRectpRgnIndirect(&rcClip);
349 if (RgnClip)
350 {
351 if (hrgnUpdate)
352 {
353 RgnWinupd = IntSysCreateRectpRgn(0, 0, 0, 0);
354 // FIXME: What to do if RgnWinupd == NULL??
355 IntGdiCombineRgn( RgnWinupd, RgnTemp, 0, RGN_COPY);
356 }
357
358 REGION_bOffsetRgn(RgnTemp, dx, dy);
359
360 IntGdiCombineRgn(RgnTemp, RgnTemp, RgnClip, RGN_AND);
361
362 if (hrgnUpdate)
363 IntGdiCombineRgn( RgnWinupd, RgnWinupd, RgnTemp, RGN_OR );
364
365 co_UserRedrawWindow(Window, NULL, RgnTemp, rdw_flags );
366
367 REGION_Delete(RgnClip);
368 }
369 }
370 REGION_Delete(RgnTemp);
371
373 {
374 PWND Child;
375 RECTL rcChild;
376 POINT ClientOrigin;
378 RECTL rcDummy;
380
381 IntGetClientOrigin(Window, &ClientOrigin);
382
383 for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
384 {
385 rcChild = Child->rcWindow;
386 RECTL_vOffsetRect(&rcChild, -ClientOrigin.x, -ClientOrigin.y);
387
388 /* Adjust window positions */
389 RECTL_vOffsetRect(&Child->rcWindow, dx, dy);
390 RECTL_vOffsetRect(&Child->rcClient, dx, dy);
391
392 if (!prcScroll || RECTL_bIntersectRect(&rcDummy, &rcChild, &rcScroll))
393 {
394 UserRefObjectCo(Child, &WndRef);
395
396 if (UserIsDesktopWindow(Window->spwndParent))
397 lParam = MAKELONG(Child->rcClient.left, Child->rcClient.top);
398 else
399 lParam = MAKELONG(rcChild.left + dx, rcChild.top + dy);
400
401 /* wine sends WM_POSCHANGING, WM_POSCHANGED messages */
402 /* windows sometimes a WM_MOVE */
404
406 }
407 }
408 }
409
410 if (flags & (SW_INVALIDATE | SW_ERASE))
411 {
413 NULL,
414 RgnUpdate,
415 rdw_flags | /* HACK */
417 }
418
419 if (hwndCaret && (CaretWnd = UserGetWindowObject(hwndCaret)))
420 {
421 UserRefObjectCo(CaretWnd, &CaretRef);
422
423 co_IntSetCaretPos(rcCaret.left + dx, rcCaret.top + dy);
424 co_UserShowCaret(CaretWnd);
425
426 UserDerefObjectCo(CaretWnd);
427 }
428
429 if (hrgnUpdate && (Result != ERROR))
430 {
431 /* Give everything back to the caller */
432 RgnTemp = REGION_LockRgn(hrgnUpdate);
433 /* The handle should still be valid */
434 ASSERT(RgnTemp);
435 if (RgnWinupd)
436 IntGdiCombineRgn(RgnTemp, RgnUpdate, RgnWinupd, RGN_OR);
437 else
438 IntGdiCombineRgn(RgnTemp, RgnUpdate, NULL, RGN_COPY);
439 REGION_UnlockRgn(RgnTemp);
440 }
441
442Cleanup:
443 if (RgnWinupd)
444 {
445 REGION_Delete(RgnWinupd);
446 }
447
448 if (RgnUpdate)
449 {
450 REGION_Delete(RgnUpdate);
451 }
452
453 return Result;
454}
static HDC hDC
Definition: 3dtext.c:33
#define DCX_USESTYLE
Definition: GetDCEx.c:10
LPARAM lParam
Definition: combotst.c:139
#define DCX_NOCLIPCHILDREN
Definition: dce.h:40
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static const WCHAR Cleanup[]
Definition: register.c:80
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define ASSERT(a)
Definition: mode.c:44
static HDC
Definition: imagelist.c:92
BOOL FASTCALL IntGetClientOrigin(PWND Window OPTIONAL, LPPOINT Point)
Definition: winpos.c:71
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
static HWND FASTCALL co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags)
Definition: scrollex.c:15
static INT FASTCALL UserScrollDC(HDC hDC, INT dx, INT dy, const RECTL *prcScroll, const RECTL *prcClip, HRGN hrgnUpdate, PREGION RgnUpdate, RECTL *prcUpdate)
Definition: scrollex.c:100
INT FASTCALL co_IntGetUpdateRgn(PWND Window, PREGION Rgn, BOOL bErase)
Definition: scrollex.c:63
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
Definition: region.h:8
Definition: object.h:4
Definition: ntuser.h:694
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define MAKELONG(a, b)
Definition: typedefs.h:249
BOOL FASTCALL IntIsWindowDrawable(PWND Wnd)
Definition: painting.c:867
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:894
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
Definition: rect.h:31
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2449
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2407
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2707
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2487
BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
Definition: caret.c:262
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1445
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:92
LONG_PTR LPARAM
Definition: windef.h:208
#define NULLREGION
Definition: wingdi.h:361
#define RGN_COPY
Definition: wingdi.h:357
#define RGN_AND
Definition: wingdi.h:356
#define RGN_OR
Definition: wingdi.h:359
#define DCX_CACHE
Definition: winuser.h:2114
#define RDW_ERASE
Definition: winuser.h:1211
#define RDW_NOCHILDREN
Definition: winuser.h:1222
#define RDW_ALLCHILDREN
Definition: winuser.h:1221
#define WM_MOVE
Definition: winuser.h:1610
#define CS_OWNDC
Definition: winuser.h:655
#define CS_CLASSDC
Definition: winuser.h:650
#define RDW_INVALIDATE
Definition: winuser.h:1214
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by IntScrollWindow(), and NtUserScrollWindowEx().

◆ VOID()

typedef VOID ( NEAR NTAPI PFN_SCROLLBAR)

Variable Documentation

◆ LPARAM

typedef LPARAM

Definition at line 3 of file scroll.h.

◆ PSBCALC

typedef PSBCALC

Definition at line 3 of file scroll.h.

◆ UINT

typedef UINT

Definition at line 3 of file scroll.h.

◆ WPARAM

typedef WPARAM

Definition at line 3 of file scroll.h.