+/*
+ * ReactOS W32 Subsystem
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
/* $Id$
*/
//#include <win32k/debug.h>
#include <include/object.h>
#include <include/inteng.h>
+#include <include/error.h>
#define NDEBUG
#include <win32k/debug1.h>
-HBRUSH STDCALL W32kCreateBrushIndirect(CONST LOGBRUSH *lb)
+HBRUSH STDCALL NtGdiCreateBrushIndirect(CONST LOGBRUSH *lb)
{
PBRUSHOBJ brushPtr;
HBRUSH hBrush;
}
brushPtr = BRUSHOBJ_LockBrush (hBrush);
- ASSERT( brushPtr ); //I want to know if this ever occurs
+/* FIXME: Occurs! FiN */
+/* ASSERT( brushPtr ); *///I want to know if this ever occurs
if( brushPtr ){
brushPtr->iSolidColor = lb->lbColor;
return NULL;
}
-HBRUSH STDCALL W32kCreateDIBPatternBrush(HGLOBAL hDIBPacked,
+HBRUSH STDCALL NtGdiCreateDIBPatternBrush(HGLOBAL hDIBPacked,
UINT ColorSpec)
{
UNIMPLEMENTED;
memcpy(newInfo, info, size);
GlobalUnlock16((HGLOBAL16)logbrush.lbHatch);
GlobalUnlock(hbitmap);
- return W32kCreateBrushIndirect(&logbrush);
+ return NtGdiCreateBrushIndirect(&logbrush);
#endif
}
-HBRUSH STDCALL W32kCreateDIBPatternBrushPt(CONST VOID *PackedDIB,
+HBRUSH STDCALL NtGdiCreateDIBPatternBrushPt(CONST VOID *PackedDIB,
UINT Usage)
{
INT size;
}
size += DIB_BitmapInfoSize (info, Usage);
- logbrush.lbHatch = (LONG) GDIOBJ_AllocObj(size, GO_MAGIC_DONTCARE);
+ logbrush.lbHatch = (LONG) GDIOBJ_AllocObj(size, GDI_OBJECT_TYPE_DONTCARE, NULL);
if (logbrush.lbHatch == 0)
{
return 0;
}
- newInfo = (PBITMAPINFO) GDIOBJ_LockObj ((HGDIOBJ) logbrush.lbHatch, GO_MAGIC_DONTCARE);
+ newInfo = (PBITMAPINFO) GDIOBJ_LockObj ((HGDIOBJ) logbrush.lbHatch, GDI_OBJECT_TYPE_DONTCARE);
ASSERT(newInfo);
memcpy(newInfo, info, size);
- GDIOBJ_UnlockObj( (HGDIOBJ) logbrush.lbHatch, GO_MAGIC_DONTCARE );
+ GDIOBJ_UnlockObj((HGDIOBJ) logbrush.lbHatch, GDI_OBJECT_TYPE_DONTCARE);
- return W32kCreateBrushIndirect (&logbrush);
+ return NtGdiCreateBrushIndirect (&logbrush);
}
-HBRUSH STDCALL W32kCreateHatchBrush(INT Style,
+HBRUSH STDCALL NtGdiCreateHatchBrush(INT Style,
COLORREF Color)
{
LOGBRUSH logbrush;
logbrush.lbColor = Color;
logbrush.lbHatch = Style;
- return W32kCreateBrushIndirect (&logbrush);
+ return NtGdiCreateBrushIndirect (&logbrush);
}
-HBRUSH STDCALL W32kCreatePatternBrush(HBITMAP hBitmap)
+HBRUSH STDCALL NtGdiCreatePatternBrush(HBITMAP hBitmap)
{
LOGBRUSH logbrush = { BS_PATTERN, 0, 0 };
}
else
{
- return W32kCreateBrushIndirect( &logbrush );
+ return NtGdiCreateBrushIndirect( &logbrush );
}
}
-HBRUSH STDCALL W32kCreateSolidBrush(COLORREF Color)
+HBRUSH STDCALL NtGdiCreateSolidBrush(COLORREF Color)
{
LOGBRUSH logbrush;
logbrush.lbColor = Color;
logbrush.lbHatch = 0;
- return W32kCreateBrushIndirect(&logbrush);
+ return NtGdiCreateBrushIndirect(&logbrush);
}
-BOOL STDCALL W32kFixBrushOrgEx(VOID)
+BOOL STDCALL NtGdiFixBrushOrgEx(VOID)
{
return FALSE;
}
-BOOL STDCALL W32kPatBlt(HDC hDC,
+BOOL STDCALL IntPatBlt(DC *dc,
INT XLeft,
INT YLeft,
INT Width,
INT Height,
- DWORD ROP)
+ DWORD ROP,
+ PBRUSHOBJ BrushObj)
{
RECT DestRect;
- PBRUSHOBJ BrushObj;
PSURFOBJ SurfObj;
- DC *dc = DC_HandleToPtr(hDC);
BOOL ret;
- if (dc == NULL)
- {
- return(FALSE);
- }
-
SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
- BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
assert(BrushObj);
if (BrushObj->logbrush.lbStyle != BS_NULL)
{
}
else
{
- DestRect.left = XLeft + Width + dc->w.DCOrgX;
- DestRect.right = XLeft + dc->w.DCOrgX;
+ DestRect.left = XLeft + Width + 1 + dc->w.DCOrgX;
+ DestRect.right = XLeft + dc->w.DCOrgX + 1;
}
if (Height > 0)
{
}
else
{
- DestRect.top = YLeft + Height + dc->w.DCOrgY;
- DestRect.bottom = YLeft + dc->w.DCOrgY;
+ DestRect.top = YLeft + Height + dc->w.DCOrgY + 1;
+ DestRect.bottom = YLeft + dc->w.DCOrgY + 1;
}
ret = IntEngBitBlt(SurfObj,
NULL,
NULL,
- NULL,
+ dc->CombinedClip,
NULL,
&DestRect,
NULL,
NULL,
BrushObj,
NULL,
- PATCOPY);
+ ROP);
+ }
+ return(ret);
+}
+
+BOOL STDCALL NtGdiPolyPatBlt(HDC hDC,
+ DWORD dwRop,
+ PPATRECT pRects,
+ int cRects,
+ ULONG Reserved)
+{
+ int i;
+ PATRECT r;
+ PBRUSHOBJ BrushObj;
+ DC *dc = DC_LockDc(hDC);
+ if (dc == NULL)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+ for (i = 0;i<cRects;i++)
+ {
+ r = *pRects;
+ BrushObj = BRUSHOBJ_LockBrush(r.hBrush);
+ IntPatBlt(dc,r.r.left,r.r.top,r.r.right,r.r.bottom,dwRop,BrushObj);
+ BRUSHOBJ_UnlockBrush(r.hBrush);
+ pRects++;
+ }
+ DC_UnlockDc( hDC );
+ return TRUE;
+}
+
+BOOL STDCALL NtGdiPatBlt(HDC hDC,
+ INT XLeft,
+ INT YLeft,
+ INT Width,
+ INT Height,
+ DWORD ROP)
+{
+ PBRUSHOBJ BrushObj;
+ DC *dc = DC_LockDc(hDC);
+ BOOL ret;
+
+ if (dc == NULL)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return(FALSE);
}
- GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC );
- DC_ReleasePtr( hDC );
+
+ BrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush);
+ ret = IntPatBlt(dc,XLeft,YLeft,Width,Height,ROP,BrushObj);
+
+ BRUSHOBJ_UnlockBrush(dc->w.hBrush);
+ DC_UnlockDc( hDC );
return(ret);
}
-BOOL STDCALL W32kSetBrushOrgEx(HDC hDC,
+BOOL STDCALL NtGdiSetBrushOrgEx(HDC hDC,
INT XOrg,
INT YOrg,
LPPOINT Point)
{
UNIMPLEMENTED;
}
+/* EOF */