Added mappings for a few messages.
[wine] / windows / scroll.c
1 /*
2  * Scroll windows and DCs
3  *
4  * Copyright  David W. Metcalfe, 1993
5  *            Alex Korobka       1995,1996
6  *
7  *
8  */
9
10 #include <stdlib.h>
11
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"
18
19 DEFAULT_DEBUG_CHANNEL(scroll);
20
21 /*************************************************************************
22  *              ScrollWindow (USER.61)
23  */
24 void WINAPI ScrollWindow16(HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect,
25                            const RECT16 *clipRect )
26 {
27     RECT rect32, clipRect32;
28
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 );
33 }
34
35 /*************************************************************************
36  *              ScrollWindow (USER32.@)
37  *
38  */
39 BOOL WINAPI ScrollWindow( HWND hwnd, INT dx, INT dy,
40                               const RECT *rect, const RECT *clipRect )
41 {
42     return
43         (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL,
44                                     (rect ? 0 : SW_SCROLLCHILDREN) |
45                                     SW_INVALIDATE ));
46 }
47
48 /*************************************************************************
49  *              ScrollDC (USER.221)
50  */
51 BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
52                           const RECT16 *cliprc, HRGN16 hrgnUpdate,
53                           LPRECT16 rcUpdate )
54 {
55     RECT rect32, clipRect32, rcUpdate32;
56     BOOL16 ret;
57
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;
64 }
65
66
67 /*************************************************************************
68  *              ScrollDC (USER32.@)
69  * 
70  *   Only the hrgnUpdate is return in device coordinate.
71  *   rcUpdate must be returned in logical coordinate to comply with win API.
72  *
73  */
74 BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
75                           const RECT *prLClip, HRGN hrgnUpdate,
76                           LPRECT rcUpdate )
77 {
78     if (USER_Driver.pScrollDC)
79         return USER_Driver.pScrollDC( hdc, dx, dy, rc, prLClip, hrgnUpdate, rcUpdate );
80     return FALSE;
81 }
82
83
84 /*************************************************************************
85  *              ScrollWindowEx (USER.319)
86  */
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 )
91 {
92     RECT rect32, clipRect32, rcUpdate32;
93     BOOL16 ret;
94
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;
102 }
103
104
105 /*************************************************************************
106  *              ScrollWindowEx (USER32.@)
107  *
108  * NOTE: Use this function instead of ScrollWindow32
109  */
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 )
114 {
115     if (USER_Driver.pScrollWindowEx)
116         return USER_Driver.pScrollWindowEx( hwnd, dx, dy, rect, clipRect,
117                                             hrgnUpdate, rcUpdate, flags );
118     return ERROR;
119 }