The [windows] section is in win.ini not in ~/.wine/config.
[wine.git] / windows / scroll.c
blobbf094eb9a6dbce095f826555e3278d47ce70aa3c
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 (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 )
42 return
43 (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL,
44 (rect ? 0 : SW_SCROLLCHILDREN) |
45 SW_INVALIDATE ));
48 /*************************************************************************
49 * ScrollDC (USER.221)
51 BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
52 const RECT16 *cliprc, HRGN16 hrgnUpdate,
53 LPRECT16 rcUpdate )
55 RECT rect32, clipRect32, rcUpdate32;
56 BOOL16 ret;
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 );
63 return ret;
67 /*************************************************************************
68 * ScrollDC (USER32.@)
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,
76 LPRECT rcUpdate )
78 if (USER_Driver.pScrollDC)
79 return USER_Driver.pScrollDC( hdc, dx, dy, rc, prLClip, hrgnUpdate, rcUpdate );
80 return FALSE;
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,
90 UINT16 flags )
92 RECT rect32, clipRect32, rcUpdate32;
93 BOOL16 ret;
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 );
101 return ret;
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,
113 UINT flags )
115 if (USER_Driver.pScrollWindowEx)
116 return USER_Driver.pScrollWindowEx( hwnd, dx, dy, rect, clipRect,
117 hrgnUpdate, rcUpdate, flags );
118 return ERROR;