- Full use of painting.c, imp GetCurrentObject and update gdi32.def.
svn path=/trunk/; revision=28731
HT_Get8BPPFormatPalette@16
HT_Get8BPPMaskPalette@24
IntersectClipRect@20=NtGdiIntersectClipRect@20
-InvertRgn@8=NtGdiInvertRgn@8
+InvertRgn@8
LPtoDP@12
LineDDA@24
-LineTo@12=NtGdiLineTo@12
+LineTo@12
MaskBlt@48
MirrorRgn@8
ModifyWorldTransform@12
OffsetRgn@12=NtGdiOffsetRgn@12
OffsetViewportOrgEx@16=NtGdiOffsetViewportOrgEx@16
OffsetWindowOrgEx@16=NtGdiOffsetWindowOrgEx@16
-PaintRgn@8=NtGdiPaintRgn@8
+PaintRgn@8
PatBlt@24=NtGdiPatBlt@24
PATHOBJ_bEnum@8
PATHOBJ_bEnumClipLines@12
RealizePalette@4=NtGdiRealizePalette@4
RectInRegion@8=NtGdiRectInRegion@8
RectVisible@8=NtGdiRectVisible@8
-Rectangle@20=NtGdiRectangle@20
+Rectangle@20
RemoveFontMemResourceEx@4
RemoveFontResourceA@4
RemoveFontResourceExA@12
ResetDCW@8
ResizePalette@8
RestoreDC@8=NtGdiRestoreDC@8
-RoundRect@28=NtGdiRoundRect@28
+RoundRect@28
SaveDC@4=NtGdiSaveDC@4
ScaleViewportExtEx@24
ScaleWindowExtEx@24
SetMetaRgn@4
SetMiterLimit@12
SetPaletteEntries@16
-SetPixel@16=NtGdiSetPixel@16
+SetPixel@16
SetPixelFormat@12
-SetPixelV@16=NtGdiSetPixelV@16
+SetPixelV@16
SetPolyFillMode@8=NtGdiSetPolyFillMode@8
SetROP2@8=NtGdiSetROP2@8
SetRectRgn@20=NtGdiSetRectRgn@20
STDCALL
GetDCDWord( HDC, INT, DWORD);
+HGDIOBJ
+STDCALL
+GetDCObject( HDC, INT);
+
VOID
NTAPI
LogFontA2W(
}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-Ellipse(
- HDC hdc,
- int nLeftRect,
- int nTopRect,
- int nRightRect,
- int nBottomRect)
-{
- /* FIXME some parts need be done in user mode */
- return NtGdiEllipse(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect);
-}
-
-
/*
* @unimplemented
*/
return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
}
-/*
- * @implemented
- */
-BOOL
-STDCALL
-FillRgn( IN HDC hdc, IN HRGN hrgn, IN HBRUSH hbrush)
-{
- /* FIXME some part need be done on user mode size */
- return NtGdiFillRgn( hdc, hrgn, hbrush);
-}
-
/*
* @implemented
*/
}
-/*
- * @implemented
- */
-BOOL
-STDCALL
-FrameRgn(
- IN HDC hdc,
- IN HRGN hrgn,
- IN HBRUSH hbrush,
- IN INT xWidth,
- IN INT yHeight)
-{
- /* FIXME some part need be done in user mode */
- return NtGdiFrameRgn(hdc, hrgn, hbrush, xWidth, yHeight);
-}
-
/*
* @implemented
*/
return NtGdiGetCurrentPositionEx(hdc, lpPoint);
}
-/*
- * @implemented
- *
- */
-HGDIOBJ
-STDCALL
-GetCurrentObject(HDC hdc,
- UINT uObjectType)
-{
- /* FIXME some part need be done in user mode */
- return NtGdiGetCurrentObject(hdc, uObjectType);
-}
-
/*
* @implemented
*
}
-/*
- * @implemented
- *
- */
-DWORD
-STDCALL
-GetPixel(HDC hdc,
- INT x,
- INT y)
-{
- /* FIXME some part need todo in user mode */
- return NtGdiGetPixel(hdc, x, y);
-}
-
-
}
+/*
+ * @implemented
+ *
+ */
+HGDIOBJ
+STDCALL
+GetCurrentObject(HDC hdc,
+ UINT uObjectType)
+{
+ /* FIXME some part need be done in user mode */
+ switch(uObjectType)
+ {
+ case OBJ_EXTPEN:
+ case OBJ_PEN:
+ uObjectType = GDI_OBJECT_TYPE_PEN;
+ break;
+ case OBJ_BRUSH:
+ uObjectType = GDI_OBJECT_TYPE_BRUSH;
+ break;
+ case OBJ_PAL:
+ uObjectType = GDI_OBJECT_TYPE_PALETTE;
+ break;
+ case OBJ_FONT:
+ uObjectType = GDI_OBJECT_TYPE_FONT;
+ break;
+ case OBJ_BITMAP:
+ uObjectType = GDI_OBJECT_TYPE_BITMAP;
+ break;
+ case OBJ_COLORSPACE:
+ uObjectType = GDI_OBJECT_TYPE_COLORSPACE;
+ break;
+ /* tests show that OBJ_REGION is explicitly ignored */
+ case OBJ_REGION:
+ return NULL;
+ /* the SDK only mentions those above */
+ default:
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+ return GetDCObject(hdc, uObjectType);
+}
+
+
/*
* @implemented
*/
#include "precomp.h"
-#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
-
+/*
+ * @implemented
+ */
BOOL
STDCALL
LineTo( HDC hDC, INT x, INT y )
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiLineTo( hDC, x, y);
}
+#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
BOOL
STDCALL
Dc_Attr->ulDirty_ |= ( DIRTY_PTLCURRENT|DIRTY_STYLESTATE); // Set dirty
return TRUE;
}
+#endif
-
+/*
+ * @implemented
+ */
BOOL
STDCALL
Ellipse(HDC hDC, INT Left, INT Top, INT Right, INT Bottom)
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiEllipse( hDC, Left, Top, Right, Bottom);
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
-Rectangle(HDC, INT Left, INT Top, INT Right, INT Bottom)
+Rectangle(HDC hDC, INT Left, INT Top, INT Right, INT Bottom)
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiRectangle( hDC, Left, Top, Right, Bottom);
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
-RoundRect(HDC, INT Left, INT Top, INT Right, INT Bottom,
+RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom,
INT ell_Width, INT ell_Height)
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
- return NtGdiRoundRect( hDc, Left, Top, Right, Bottom, ell_Width, ell_Height);
+#endif
+ return NtGdiRoundRect( hDC, Left, Top, Right, Bottom, ell_Width, ell_Height);
}
+/*
+ * @implemented
+ */
COLORREF
STDCALL
GetPixel( HDC hDC, INT x, INT y )
}
+/*
+ * @implemented
+ */
COLORREF
STDCALL
SetPixel( HDC hDC, INT x, INT y, COLORREF Color )
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return 0;
}
}
+#endif
return NtGdiSetPixel( hDC, x, y, Color);
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
SetPixelV( HDC hDC, INT x, INT y, COLORREF Color )
{
COLORREF Cr = SetPixel( hDC, x, y, Color );
- if (Cr) return TRUE;
+ if (Cr != CLR_INVALID) return TRUE;
return FALSE;
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
FillRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush )
{
if ( (!hRgn) || (!hBrush) ) return FALSE;
-
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiFillRgn( hDC, hRgn, hBrush);
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
FrameRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush, INT nWidth, INT nHeight )
{
if ( (!hRgn) || (!hBrush) ) return FALSE;
-
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiFrameRgn( hDC, hRgn, hBrush, nWidth, nHeight);
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
InvertRgn( HDC hDC, HRGN hRgn )
{
if ( !hRgn ) return FALSE;
-
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
+#endif
return NtGdiInvertRgn( hDC, hRgn);
}
+
+/*
+ * @implemented
+ */
BOOL
STDCALL
PaintRgn( HDC hDC, HRGN hRgn )
{
+#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
return FALSE;
}
}
- // Could just use Dc_Attr->hbrush
- HBRUSH hbrush = (HBRUSH) GetDCObject( hDC, GDI_OBJECT_TYPE_BRUSH);
-
+#endif
+ // Could just use Dc_Attr->hbrush? No.
+ HBRUSH hBrush = (HBRUSH) GetDCObject( hDC, GDI_OBJECT_TYPE_BRUSH);
+
return NtGdiFillRgn( hDC, hRgn, hBrush);
}
-#endif
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolyBezier(HDC hDC ,const POINT* Point, DWORD cPoints)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolyBezierTo(HDC hDC, const POINT* Point ,DWORD cPoints)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolyDraw(HDC hDC, const POINT* Point, const BYTE *lpbTypes, int cCount )
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
Polygon(HDC hDC, const POINT *Point, int Count)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
Polyline(HDC hDC, const POINT *Point, int Count)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolylineTo(HDC hDC, const POINT* Point, DWORD Count)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolyPolygon(HDC hDC, const POINT* Point, const INT* Count, int Polys)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
PolyPolyline(HDC hDC, const POINT* Point, const DWORD* Counts, DWORD Polys)
}
+/*
+ * @implemented
+ */
BOOL
STDCALL
ExtFloodFill(
}
+/*
+ * @implemented
+ */
BOOL
WINAPI
FloodFill(
return ExtFloodFill(hDC, nXStart, nYStart, crFill, FLOODFILLBORDER);
}
+
+/*
+ * @implemented
+ */
BOOL WINAPI
MaskBlt(
HDC hdcDest,
}
+/*
+ * @implemented
+ */
BOOL
WINAPI
PlgBlt(
STDCALL
NtGdiGetColorSpace(HDC hDC);
-/* Should be done in user-mode and/or NtGdiGetDCObject. */
-HGDIOBJ STDCALL NtGdiGetCurrentObject(HDC hDC, UINT ObjectType);
-
/* Should be done in user mode. */
BOOL STDCALL NtGdiGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
LPPOINT Point
);
-/* Use NtGdiFillRgn. Add 0 at the end. */
-BOOL
-STDCALL
-NtGdiPaintRgn(HDC hDC,
- HRGN hRgn);
-
/* Metafiles are user-mode. */
BOOL
STDCALL
NtGdiSetMapperFlags(HDC hDC,
DWORD Flag);
-/* Use NtGdiSetPixel(hdc, x, y, color) != CLR_INVALID; */
-BOOL
-STDCALL
-NtGdiSetPixelV (
- HDC hDC,
- INT X,
- INT Y,
- COLORREF Color
- );
-
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode);
return TRUE;
}
-COLORREF STDCALL
-NtGdiSetPixel(
- HDC hDC,
- INT X,
- INT Y,
- COLORREF Color)
-{
-
- DPRINT("0 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
-
-
- DPRINT("0 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
-
- if (NtGdiSetPixelV(hDC,X,Y,Color))
- {
- Color = NtGdiGetPixel(hDC,X,Y);
- DPRINT("1 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
- return Color;
- }
-
- Color = ((COLORREF) -1);
- DPRINT("2 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
- return Color;
-}
-
BOOL STDCALL
-NtGdiSetPixelV(
+GdiSetPixelV(
HDC hDC,
INT X,
INT Y,
return TRUE;
}
+COLORREF STDCALL
+NtGdiSetPixel(
+ HDC hDC,
+ INT X,
+ INT Y,
+ COLORREF Color)
+{
+ DPRINT("0 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+
+ if (GdiSetPixelV(hDC,X,Y,Color))
+ {
+ Color = NtGdiGetPixel(hDC,X,Y);
+ DPRINT("1 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+ return Color;
+ }
+
+ Color = ((COLORREF) CLR_INVALID);
+ DPRINT("2 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+ return Color;
+}
+
+
/* Internal Functions */
INT FASTCALL
DC_GET_VAL( INT, NtGdiGetBkMode, Dc_Attr.jBkMode )
DC_GET_VAL_EX( GetBrushOrgEx, Dc_Attr.ptlBrushOrigin.x, Dc_Attr.ptlBrushOrigin.y, POINT, x, y )
-HGDIOBJ STDCALL
-NtGdiGetCurrentObject(HDC hDC, UINT ObjectType)
+HANDLE
+STDCALL
+NtGdiGetDCObject(HDC hDC, INT ObjectType)
{
HGDIOBJ SelObject;
DC *dc;
switch(ObjectType)
{
- case OBJ_PEN:
- case OBJ_EXTPEN:
+ case GDI_OBJECT_TYPE_EXTPEN:
+ case GDI_OBJECT_TYPE_PEN:
SelObject = dc->Dc_Attr.hpen;
break;
- case OBJ_BRUSH:
+ case GDI_OBJECT_TYPE_BRUSH:
SelObject = dc->Dc_Attr.hbrush;
break;
- case OBJ_PAL:
+ case GDI_OBJECT_TYPE_PALETTE:
SelObject = dc->w.hPalette;
break;
- case OBJ_FONT:
+ case GDI_OBJECT_TYPE_FONT:
SelObject = dc->Dc_Attr.hlfntNew;
break;
- case OBJ_BITMAP:
+ case GDI_OBJECT_TYPE_BITMAP:
SelObject = dc->w.hBitmap;
break;
- case OBJ_COLORSPACE:
+ case GDI_OBJECT_TYPE_COLORSPACE:
DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not supported yet!\n");
SelObject = NULL;
break;
return objOrg;
}
+
WORD STDCALL
IntGdiSetHookFlags(HDC hDC, WORD Flags)
{
if(Usage == DIB_PAL_COLORS)
{
- hPal = NtGdiGetCurrentObject(hDC, OBJ_PAL);
+ hPal = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE);
hPal = NtUserSelectPalette(hdcMem, hPal, FALSE);
}
return TRUE;
}
-BOOL
-STDCALL
-NtGdiPaintRgn(HDC hDC,
- HRGN hRgn)
-{
- DC *dc = DC_LockDc(hDC);
-
- BOOL Ret = IntGdiPaintRgn(dc, hRgn);
-
- DC_UnlockDc( dc );
- return Ret;
-}
-
-
BOOL
STDCALL
NtGdiPtInRegion(HRGN hRgn,
}
- /*
- * @unimplemented
- */
-HANDLE
-STDCALL
-NtGdiGetDCObject(
- IN HDC hdc,
- IN INT itype)
-{
- UNIMPLEMENTED;
- return NULL;
-}
-
/*
* @unimplemented
*/
NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2
NtGdiSetMapperFlags 2
-NtGdiSetPixelV 4
NtGdiSetPolyFillMode 2
NtGdiSetROP2 2
NtGdiSetStretchBltMode 2
NtGdiGetCharWidthFloat 4
NtGdiGetClipBox 2
NtGdiGetColorSpace 1
-NtGdiGetCurrentObject 2
NtGdiGetCurrentPositionEx 2
NtGdiGetEnhMetaFile 1
NtGdiGetEnhMetaFileBits 3
NtGdiMoveToEx 4
NtGdiOffsetViewportOrgEx 4
NtGdiOffsetWindowOrgEx 4
-NtGdiPaintRgn 2
NtGdiPlayEnhMetaFile 3
NtGdiPlayEnhMetaFileRecord 4
NtGdiPolyBezier 3