3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/windows/input.c
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
26 * 09-05-2001 CSH Created
29 /* INCLUDES ******************************************************************/
37 static HBRUSH FrameBrushes[13];
38 static HBITMAP hHatch;
40 /* FUNCTIONS *****************************************************************/
45 FrameBrushes[0] = CreateSolidBrush(RGB(0,0,0));
46 FrameBrushes[1] = CreateSolidBrush(RGB(0,0,128));
47 FrameBrushes[2] = CreateSolidBrush(RGB(10,36,106));
48 FrameBrushes[3] = CreateSolidBrush(RGB(128,128,128));
49 FrameBrushes[4] = CreateSolidBrush(RGB(181,181,181));
50 FrameBrushes[5] = CreateSolidBrush(RGB(212,208,200));
51 FrameBrushes[6] = CreateSolidBrush(RGB(236,233,216));
52 FrameBrushes[7] = CreateSolidBrush(RGB(255,255,255));
53 FrameBrushes[8] = CreateSolidBrush(RGB(49,106,197));
54 FrameBrushes[9] = CreateSolidBrush(RGB(58,110,165));
55 FrameBrushes[10] = CreateSolidBrush(RGB(64,64,64));
56 FrameBrushes[11] = CreateSolidBrush(RGB(255,255,225));
57 hHatch = LoadBitmapW(NULL,MAKEINTRESOURCEW(DF_HATCH));
58 FrameBrushes[12] = CreatePatternBrush(hHatch);
62 DeleteFrameBrushes(VOID)
66 for (Brush = 0; Brush < sizeof(FrameBrushes) / sizeof(HBRUSH); Brush++)
68 if (NULL != FrameBrushes[Brush])
70 DeleteObject(FrameBrushes[Brush]);
71 FrameBrushes[Brush] = NULL;
88 LPPAINTSTRUCT lpPaint)
90 return NtUserBeginPaint(hwnd, lpPaint);
101 CONST PAINTSTRUCT *lpPaint)
103 return NtUserEndPaint(hWnd, lpPaint);
146 return NtUserGetUpdateRgn(hWnd, hRgn, bErase);
160 return NtUserInvalidateRect( hWnd, lpRect, bErase );
174 return NtUserInvalidateRgn( hWnd, hRgn, bErase );
185 CONST RECT *lprcUpdate,
189 return NtUserRedrawWindow(hWnd, lprcUpdate, hrgnUpdate, flags);
202 CONST RECT *lprcScroll,
203 CONST RECT *lprcClip,
235 return NtUserUpdateWindow( hWnd );
262 return (WINBOOL) NtUserCallTwoParam((DWORD) hWnd,
264 TWOPARAM_ROUTINE_VALIDATERGN);
281 const BYTE MappingTable[33] = {5,9,2,3,5,7,0,0,0,7,5,5,3,2,7,5,3,3,0,5,7,10,5,0,11,4,1,1,3,8,6,12,7};
298 if (NULL == FrameBrushes[0])
300 CreateFrameBrushes();
315 brush = MappingTable[brush];
316 hbrFrame = FrameBrushes[brush];
317 p[0].hBrush = hbrFrame;
318 p[1].hBrush = hbrFrame;
319 p[2].hBrush = hbrFrame;
320 p[3].hBrush = hbrFrame;
321 p[0].r.left = r->left;
323 p[0].r.right = r->right - r->left;
324 p[0].r.bottom = width;
325 p[1].r.left = r->left;
326 p[1].r.top = r->bottom - width;
327 p[1].r.right = r->right - r->left;
328 p[1].r.bottom = width;
329 p[2].r.left = r->left;
330 p[2].r.top = r->top + width;
331 p[2].r.right = width;
332 p[2].r.bottom = r->bottom - r->top - (width * 2);
333 p[3].r.left = r->right - width;
334 p[3].r.top = r->top + width;
335 p[3].r.right = width;
336 p[3].r.bottom = r->bottom - r->top - (width * 2);
337 return PolyPatBlt(hDc,rop,p,4,0);