Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Scroll windows and DCs |
| 3 | * |
| 4 | * Copyright David W. Metcalfe, 1993 |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 5 | * Alex Korobka 1995,1996 |
Alexandre Julliard | d471965 | 1995-12-12 18:49:11 +0000 | [diff] [blame] | 6 | * |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 11 | * |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 22 | #include <stdlib.h> |
Patrik Stridvall | b87fe2e | 1999-04-01 08:16:08 +0000 | [diff] [blame] | 23 | |
Jeremy White | d3e22d9 | 2000-02-10 19:03:02 +0000 | [diff] [blame] | 24 | #include "windef.h" |
| 25 | #include "wingdi.h" |
Patrik Stridvall | 1ed4ecf | 1999-06-26 14:58:24 +0000 | [diff] [blame] | 26 | #include "wine/winuser16.h" |
Marcus Meissner | 61afa33 | 1999-02-22 10:16:00 +0000 | [diff] [blame] | 27 | #include "winuser.h" |
Alexandre Julliard | e3fe9f2 | 2001-05-10 03:23:59 +0000 | [diff] [blame] | 28 | #include "user.h" |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 29 | #include "wine/debug.h" |
Alexandre Julliard | d471965 | 1995-12-12 18:49:11 +0000 | [diff] [blame] | 30 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 31 | WINE_DEFAULT_DEBUG_CHANNEL(scroll); |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 32 | |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 33 | /************************************************************************* |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 34 | * ScrollWindow (USER32.@) |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 35 | * |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 36 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 37 | BOOL WINAPI ScrollWindow( HWND hwnd, INT dx, INT dy, |
| 38 | const RECT *rect, const RECT *clipRect ) |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 39 | { |
Jerome Vouillon | 1da6dba | 1999-02-14 13:32:13 +0000 | [diff] [blame] | 40 | return |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 41 | (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL, |
Jerome Vouillon | 1da6dba | 1999-02-14 13:32:13 +0000 | [diff] [blame] | 42 | (rect ? 0 : SW_SCROLLCHILDREN) | |
| 43 | SW_INVALIDATE )); |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 44 | } |
| 45 | |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 46 | /************************************************************************* |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 47 | * ScrollDC (USER.221) |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 48 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 49 | BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect, |
| 50 | const RECT16 *cliprc, HRGN16 hrgnUpdate, |
| 51 | LPRECT16 rcUpdate ) |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 52 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 53 | RECT rect32, clipRect32, rcUpdate32; |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 54 | BOOL16 ret; |
| 55 | |
| 56 | if (rect) CONV_RECT16TO32( rect, &rect32 ); |
| 57 | if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 58 | ret = ScrollDC( hdc, dx, dy, rect ? &rect32 : NULL, |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 59 | cliprc ? &clipRect32 : NULL, hrgnUpdate, &rcUpdate32 ); |
| 60 | if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate ); |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | /************************************************************************* |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 66 | * ScrollDC (USER32.@) |
Vincent BĂ©ron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 67 | * |
Pascal Lessard | 83f39cf | 1999-02-25 16:35:22 +0000 | [diff] [blame] | 68 | * Only the hrgnUpdate is return in device coordinate. |
| 69 | * rcUpdate must be returned in logical coordinate to comply with win API. |
| 70 | * |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 71 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 72 | BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc, |
| 73 | const RECT *prLClip, HRGN hrgnUpdate, |
| 74 | LPRECT rcUpdate ) |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 75 | { |
Alexandre Julliard | dc4fe77 | 2001-06-04 21:55:17 +0000 | [diff] [blame] | 76 | if (USER_Driver.pScrollDC) |
| 77 | return USER_Driver.pScrollDC( hdc, dx, dy, rc, prLClip, hrgnUpdate, rcUpdate ); |
| 78 | return FALSE; |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | |
| 82 | /************************************************************************* |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 83 | * ScrollWindowEx (USER32.@) |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 84 | * |
| 85 | * NOTE: Use this function instead of ScrollWindow32 |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 86 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 87 | INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy, |
| 88 | const RECT *rect, const RECT *clipRect, |
| 89 | HRGN hrgnUpdate, LPRECT rcUpdate, |
| 90 | UINT flags ) |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 91 | { |
Alexandre Julliard | e3fe9f2 | 2001-05-10 03:23:59 +0000 | [diff] [blame] | 92 | if (USER_Driver.pScrollWindowEx) |
| 93 | return USER_Driver.pScrollWindowEx( hwnd, dx, dy, rect, clipRect, |
| 94 | hrgnUpdate, rcUpdate, flags ); |
| 95 | return ERROR; |
Alexandre Julliard | e399fc3 | 1993-11-24 17:08:56 +0000 | [diff] [blame] | 96 | } |