This is Jonathan Wilson's patch, which implements DrawFrame and fixes PolyPatBlt.

svn path=/trunk/; revision=5637
This commit is contained in:
Andrew Greenwood 2003-08-18 09:59:29 +00:00
parent 1ec31c1ff5
commit e7eff667e5
7 changed files with 104 additions and 22 deletions

View file

@ -346,10 +346,10 @@ PolyPatBlt(HDC hDC,DWORD dwRop,PPATRECT pRects,int cRects,ULONG Reserved)
HBRUSH hBrOld;
for (i = 0;i<cRects;i++)
{
hBrOld = SelectObject(hDC,r.hBrush);
r = *pRects;
PatBlt(hDC,r.r.top,r.r.left,r.r.bottom-r.r.top,r.r.right-r.r.left,dwRop);
pRects+=sizeof(PATRECT);
hBrOld = (HBRUSH)SelectObject(hDC,r.hBrush);
PatBlt(hDC,r.r.left,r.r.top,r.r.right,r.r.bottom,dwRop);
pRects++;
SelectObject(hDC,hBrOld);
}
return TRUE;

View file

@ -14,3 +14,5 @@ typedef struct _USER32_THREAD_DATA
PUSER32_THREAD_DATA
User32GetThreadData();
extern HBRUSH FrameBrushes[13];
#define DF_HATCH (30000)

View file

@ -20,6 +20,8 @@ static ULONG User32TlsIndex;
VOID STDCALL KeBugCheck (ULONG BugCheckCode) {}
HWINSTA ProcessWindowStation;
HBRUSH FrameBrushes[13];
HBITMAP hHatch;
PUSER32_THREAD_DATA
User32GetThreadData()
@ -46,6 +48,42 @@ CleanupThread(VOID)
HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, ThreadData);
TlsSetValue(User32TlsIndex, 0);
}
VOID
CreateFrameBrushes(HINSTANCE hInstance)
{
FrameBrushes[0] = CreateSolidBrush(RGB(0,0,0));
FrameBrushes[1] = CreateSolidBrush(RGB(0,0,128));
FrameBrushes[2] = CreateSolidBrush(RGB(10,36,106));
FrameBrushes[3] = CreateSolidBrush(RGB(128,128,128));
FrameBrushes[4] = CreateSolidBrush(RGB(181,181,181));
FrameBrushes[5] = CreateSolidBrush(RGB(212,208,200));
FrameBrushes[6] = CreateSolidBrush(RGB(236,233,216));
FrameBrushes[7] = CreateSolidBrush(RGB(255,255,255));
FrameBrushes[8] = CreateSolidBrush(RGB(49,106,197));
FrameBrushes[9] = CreateSolidBrush(RGB(58,110,165));
FrameBrushes[10] = CreateSolidBrush(RGB(64,64,64));
FrameBrushes[11] = CreateSolidBrush(RGB(255,255,225));
hHatch = LoadBitmapW(hInstance,MAKEINTRESOURCEW(DF_HATCH));
FrameBrushes[12] = CreatePatternBrush(hHatch);
}
VOID
DeleteFrameBrushes(VOID)
{
DeleteObject(FrameBrushes[0]);
DeleteObject(FrameBrushes[1]);
DeleteObject(FrameBrushes[2]);
DeleteObject(FrameBrushes[3]);
DeleteObject(FrameBrushes[4]);
DeleteObject(FrameBrushes[5]);
DeleteObject(FrameBrushes[6]);
DeleteObject(FrameBrushes[7]);
DeleteObject(FrameBrushes[8]);
DeleteObject(FrameBrushes[9]);
DeleteObject(FrameBrushes[10]);
DeleteObject(FrameBrushes[11]);
DeleteObject(FrameBrushes[12]);
DeleteObject(hHatch);
}
DWORD
Init(VOID)
@ -116,6 +154,7 @@ DllMain(
hProcessHeap = RtlGetProcessHeap();
Init();
InitThread();
CreateFrameBrushes(hinstDll);
break;
case DLL_THREAD_ATTACH:
InitThread();
@ -124,6 +163,7 @@ DllMain(
CleanupThread();
break;
case DLL_PROCESS_DETACH:
DeleteFrameBrushes();
CleanupThread();
Cleanup();
break;

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.31 2003/08/17 20:29:56 silverblade Exp $
/* $Id: stubs.c,v 1.32 2003/08/18 09:59:29 silverblade Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -1251,22 +1251,6 @@ GetInputDesktop ( VOID )
return FALSE;
}
/*
* @unimplemented
*/
WINBOOL
STDCALL
DrawFrame(
HDC hDc,
RECT *r,
DWORD width,
DWORD type
)
{
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

View file

@ -38,6 +38,7 @@ BEGIN
END
OBM_CLOSE BITMAP "resources/obm_close.bmp"
DF_HATCH BITMAP "resources/df_hatch.bmp"
/////////////////////////////////////////////////////////////////////////////
//

View file

@ -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);
}