2 * Scroll windows and DCs
4 * Copyright David W. Metcalfe, 1993
5 * Alex Korobka 1995,1996
14 #include "wine/winuser16.h"
17 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(scroll);
21 /*************************************************************************
22 * ScrollWindow (USER.61)
24 void WINAPI ScrollWindow16(HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect,
25 const RECT16 *clipRect )
27 RECT rect32, clipRect32;
29 if (rect) CONV_RECT16TO32( rect, &rect32 );
30 if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
31 ScrollWindow( hwnd, dx, dy, rect ? &rect32 : NULL,
32 clipRect ? &clipRect32 : NULL );
35 /*************************************************************************
36 * ScrollWindow (USER32.@)
39 BOOL WINAPI ScrollWindow( HWND hwnd, INT dx, INT dy,
40 const RECT *rect, const RECT *clipRect )
43 (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL,
44 (rect ? 0 : SW_SCROLLCHILDREN) |
48 /*************************************************************************
51 BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
52 const RECT16 *cliprc, HRGN16 hrgnUpdate,
55 RECT rect32, clipRect32, rcUpdate32;
58 if (rect) CONV_RECT16TO32( rect, &rect32 );
59 if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 );
60 ret = ScrollDC( hdc, dx, dy, rect ? &rect32 : NULL,
61 cliprc ? &clipRect32 : NULL, hrgnUpdate, &rcUpdate32 );
62 if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
67 /*************************************************************************
70 * Only the hrgnUpdate is return in device coordinate.
71 * rcUpdate must be returned in logical coordinate to comply with win API.
74 BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
75 const RECT *prLClip, HRGN hrgnUpdate,
78 if (USER_Driver.pScrollDC)
79 return USER_Driver.pScrollDC( hdc, dx, dy, rc, prLClip, hrgnUpdate, rcUpdate );
84 /*************************************************************************
85 * ScrollWindowEx (USER.319)
87 INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy,
88 const RECT16 *rect, const RECT16 *clipRect,
89 HRGN16 hrgnUpdate, LPRECT16 rcUpdate,
92 RECT rect32, clipRect32, rcUpdate32;
95 if (rect) CONV_RECT16TO32( rect, &rect32 );
96 if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
97 ret = ScrollWindowEx( hwnd, dx, dy, rect ? &rect32 : NULL,
98 clipRect ? &clipRect32 : NULL, hrgnUpdate,
99 (rcUpdate) ? &rcUpdate32 : NULL, flags );
100 if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
105 /*************************************************************************
106 * ScrollWindowEx (USER32.@)
108 * NOTE: Use this function instead of ScrollWindow32
110 INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
111 const RECT *rect, const RECT *clipRect,
112 HRGN hrgnUpdate, LPRECT rcUpdate,
115 if (USER_Driver.pScrollWindowEx)
116 return USER_Driver.pScrollWindowEx( hwnd, dx, dy, rect, clipRect,
117 hrgnUpdate, rcUpdate, flags );