From e7eff667e5f46e9ea29f39f1c675acba2f77a9c2 Mon Sep 17 00:00:00 2001 From: Andrew Greenwood Date: Mon, 18 Aug 2003 09:59:29 +0000 Subject: [PATCH] This is Jonathan Wilson's patch, which implements DrawFrame and fixes PolyPatBlt. svn path=/trunk/; revision=5637 --- reactos/lib/gdi32/objects/bitblt.c | 6 +-- reactos/lib/user32/include/user32.h | 2 + reactos/lib/user32/misc/dllmain.c | 42 +++++++++++++++- reactos/lib/user32/misc/stubs.c | 18 +------ reactos/lib/user32/resources/df_hatch.bmp | Bin 0 -> 94 bytes reactos/lib/user32/user32.rc | 1 + reactos/lib/user32/windows/paint.c | 57 +++++++++++++++++++++- 7 files changed, 104 insertions(+), 22 deletions(-) create mode 100644 reactos/lib/user32/resources/df_hatch.bmp diff --git a/reactos/lib/gdi32/objects/bitblt.c b/reactos/lib/gdi32/objects/bitblt.c index 1e4ceb67b6c..6557eb70dfc 100644 --- a/reactos/lib/gdi32/objects/bitblt.c +++ b/reactos/lib/gdi32/objects/bitblt.c @@ -346,10 +346,10 @@ PolyPatBlt(HDC hDC,DWORD dwRop,PPATRECT pRects,int cRects,ULONG Reserved) HBRUSH hBrOld; for (i = 0;imW{0D+nKpcvP1_0xiA*KKT literal 0 HcmV?d00001 diff --git a/reactos/lib/user32/user32.rc b/reactos/lib/user32/user32.rc index 5359da5f20e..b56af33cc64 100644 --- a/reactos/lib/user32/user32.rc +++ b/reactos/lib/user32/user32.rc @@ -38,6 +38,7 @@ BEGIN END OBM_CLOSE BITMAP "resources/obm_close.bmp" +DF_HATCH BITMAP "resources/df_hatch.bmp" ///////////////////////////////////////////////////////////////////////////// // diff --git a/reactos/lib/user32/windows/paint.c b/reactos/lib/user32/windows/paint.c index b67d43d55c7..b81d7717850 100644 --- a/reactos/lib/user32/windows/paint.c +++ b/reactos/lib/user32/windows/paint.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: paint.c,v 1.16 2003/07/10 21:04:32 chorns Exp $ +/* $Id: paint.c,v 1.17 2003/08/18 09:59:29 silverblade Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -234,3 +234,58 @@ GetWindowRgn( UNIMPLEMENTED; return 0; } + +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}; +/* + * @implemented + */ +WINBOOL +STDCALL +DrawFrame( + HDC hDc, + RECT *r, + DWORD width, + DWORD type + ) +{ + DWORD rop; + DWORD brush; + HBRUSH hbrFrame; + PATRECT p[4]; + if (type & 4) + { + rop = PATINVERT; + } + else + { + rop = PATCOPY; + } + brush = type / 8; + if (brush >= 33) + { + brush = 32; + } + brush = MappingTable[brush]; + hbrFrame = FrameBrushes[brush]; + p[0].hBrush = hbrFrame; + p[1].hBrush = hbrFrame; + p[2].hBrush = hbrFrame; + p[3].hBrush = hbrFrame; + p[0].r.left = r->left; + p[0].r.top = r->top; + p[0].r.right = r->right - r->left; + p[0].r.bottom = width; + p[1].r.left = r->left; + p[1].r.top = r->bottom - width; + p[1].r.right = r->right - r->left; + p[1].r.bottom = width; + p[2].r.left = r->left; + p[2].r.top = r->top + width; + p[2].r.right = width; + p[2].r.bottom = r->bottom - r->top - (width * 2); + p[3].r.left = r->right - width; + p[3].r.top = r->top + width; + p[3].r.right = width; + p[3].r.bottom = r->bottom - r->top - (width * 2); + return PolyPatBlt(hDc,rop,p,4,0); +}