For drawing a caret, internally replaced the brush by a bitmap (this
[wine/wine-kai.git] / windows / scroll.c
blob84e2391bed04db87ece84985eb5c5fc4fad591e0
1 /*
2 * Scroll windows and DCs
4 * Copyright David W. Metcalfe, 1993
5 * Alex Korobka 1995,1996
8 */
10 #include <stdlib.h>
12 #include "windef.h"
13 #include "wingdi.h"
14 #include "wine/winuser16.h"
15 #include "winuser.h"
16 #include "user.h"
17 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(scroll);
21 /*************************************************************************
22 * ScrollWindow (USER32.@)
25 BOOL WINAPI ScrollWindow( HWND hwnd, INT dx, INT dy,
26 const RECT *rect, const RECT *clipRect )
28 return
29 (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL,
30 (rect ? 0 : SW_SCROLLCHILDREN) |
31 SW_INVALIDATE ));
34 /*************************************************************************
35 * ScrollDC (USER.221)
37 BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
38 const RECT16 *cliprc, HRGN16 hrgnUpdate,
39 LPRECT16 rcUpdate )
41 RECT rect32, clipRect32, rcUpdate32;
42 BOOL16 ret;
44 if (rect) CONV_RECT16TO32( rect, &rect32 );
45 if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 );
46 ret = ScrollDC( hdc, dx, dy, rect ? &rect32 : NULL,
47 cliprc ? &clipRect32 : NULL, hrgnUpdate, &rcUpdate32 );
48 if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
49 return ret;
53 /*************************************************************************
54 * ScrollDC (USER32.@)
56 * Only the hrgnUpdate is return in device coordinate.
57 * rcUpdate must be returned in logical coordinate to comply with win API.
60 BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
61 const RECT *prLClip, HRGN hrgnUpdate,
62 LPRECT rcUpdate )
64 if (USER_Driver.pScrollDC)
65 return USER_Driver.pScrollDC( hdc, dx, dy, rc, prLClip, hrgnUpdate, rcUpdate );
66 return FALSE;
70 /*************************************************************************
71 * ScrollWindowEx (USER32.@)
73 * NOTE: Use this function instead of ScrollWindow32
75 INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
76 const RECT *rect, const RECT *clipRect,
77 HRGN hrgnUpdate, LPRECT rcUpdate,
78 UINT flags )
80 if (USER_Driver.pScrollWindowEx)
81 return USER_Driver.pScrollWindowEx( hwnd, dx, dy, rect, clipRect,
82 hrgnUpdate, rcUpdate, flags );
83 return ERROR;