2021-07-17 14:56:39 +00:00
|
|
|
/*
|
|
|
|
* GDI Device Context functions
|
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
|
|
|
* Copyright 1997 Bertho A. Stultiens
|
|
|
|
* 1999 Huw D M Davies
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "gdi_private.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
|
|
|
|
|
2021-07-20 07:18:50 +00:00
|
|
|
static DC_ATTR *get_dc_attr( HDC hdc )
|
|
|
|
{
|
|
|
|
WORD type = gdi_handle_type( hdc );
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
if ((type & 0x1f) != NTGDI_OBJ_DC || !(dc_attr = get_gdi_client_ptr( hdc, 0 )))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_HANDLE );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return dc_attr;
|
|
|
|
}
|
|
|
|
|
2021-07-23 08:49:19 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* GetTextAlign (GDI32.@)
|
|
|
|
*/
|
|
|
|
UINT WINAPI GetTextAlign( HDC hdc )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr = get_dc_attr( hdc );
|
|
|
|
return dc_attr ? dc_attr->text_align : 0;
|
|
|
|
}
|
|
|
|
|
2021-07-26 21:29:36 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* SetTextAlign (GDI32.@)
|
|
|
|
*/
|
|
|
|
UINT WINAPI SetTextAlign( HDC hdc, UINT align )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
UINT ret;
|
|
|
|
|
|
|
|
TRACE("hdc=%p align=%d\n", hdc, align);
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_SetTextAlign( hdc, align );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return GDI_ERROR;
|
|
|
|
if (dc_attr->emf && !EMFDC_SetTextAlign( dc_attr, align )) return GDI_ERROR;
|
|
|
|
|
|
|
|
ret = dc_attr->text_align;
|
|
|
|
dc_attr->text_align = align;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-07-26 21:29:51 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* GetBkMode (GDI32.@)
|
|
|
|
*/
|
|
|
|
INT WINAPI GetBkMode( HDC hdc )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr = get_dc_attr( hdc );
|
|
|
|
return dc_attr ? dc_attr->background_mode : 0;
|
|
|
|
}
|
|
|
|
|
2021-07-20 07:18:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* GetCurrentPositionEx (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetCurrentPositionEx( HDC hdc, POINT *point )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
*point = dc_attr->cur_pos;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-07-23 08:51:16 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* SetPixel (GDI32.@)
|
|
|
|
*/
|
|
|
|
COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_SetPixel( hdc, x, y, color );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return CLR_INVALID;
|
|
|
|
if (dc_attr->emf && !EMFDC_SetPixel( dc_attr, x, y, color )) return CLR_INVALID;
|
|
|
|
return NtGdiSetPixel( hdc, x, y, color );
|
|
|
|
}
|
|
|
|
|
2021-07-23 08:51:51 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* SetPixelV (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
|
|
|
|
{
|
|
|
|
return SetPixel( hdc, x, y, color ) != CLR_INVALID;
|
|
|
|
}
|
|
|
|
|
2021-07-17 14:56:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* LineTo (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
|
|
|
|
{
|
2021-07-20 07:18:50 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:56:39 +00:00
|
|
|
TRACE( "%p, (%d, %d)\n", hdc, x, y );
|
2021-07-17 15:00:55 +00:00
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_LineTo( hdc, x, y );
|
2021-07-20 07:18:50 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_LineTo( dc_attr, x, y )) return FALSE;
|
2021-07-17 14:56:39 +00:00
|
|
|
return NtGdiLineTo( hdc, x, y );
|
|
|
|
}
|
2021-07-17 14:56:46 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MoveToEx (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, POINT *pt )
|
|
|
|
{
|
2021-07-20 07:19:05 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:56:46 +00:00
|
|
|
TRACE( "%p, (%d, %d), %p\n", hdc, x, y, pt );
|
2021-07-17 15:20:11 +00:00
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_MoveTo( hdc, x, y );
|
2021-07-20 07:19:05 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_MoveTo( dc_attr, x, y )) return FALSE;
|
2021-07-17 14:56:46 +00:00
|
|
|
return NtGdiMoveTo( hdc, x, y, pt );
|
|
|
|
}
|
2021-07-17 14:56:54 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Arc (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
|
|
|
{
|
2021-07-20 07:19:24 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:56:54 +00:00
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
|
|
|
|
right, bottom, xstart, ystart, xend, yend );
|
2021-07-18 10:57:34 +00:00
|
|
|
|
|
|
|
if (is_meta_dc( hdc ))
|
|
|
|
return METADC_Arc( hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-20 07:19:24 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ArcChordPie( dc_attr, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend, EMR_ARC ))
|
|
|
|
return FALSE;
|
|
|
|
|
2021-07-17 14:56:54 +00:00
|
|
|
return NtGdiArcInternal( NtGdiArc, hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
}
|
2021-07-17 14:57:06 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ArcTo (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI ArcTo( HDC hdc, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
|
|
|
{
|
2021-07-20 07:19:24 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:57:06 +00:00
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
|
|
|
|
right, bottom, xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-20 07:19:24 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ArcChordPie( dc_attr, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend, EMR_ARCTO ))
|
|
|
|
return FALSE;
|
|
|
|
|
2021-07-17 14:57:06 +00:00
|
|
|
return NtGdiArcInternal( NtGdiArcTo, hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
}
|
2021-07-17 14:57:16 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Chord (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Chord( HDC hdc, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
|
|
|
{
|
2021-07-20 07:19:24 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:57:16 +00:00
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
|
|
|
|
right, bottom, xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-17 15:01:18 +00:00
|
|
|
if (is_meta_dc( hdc ))
|
|
|
|
return METADC_Chord( hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-20 07:19:24 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ArcChordPie( dc_attr, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend, EMR_CHORD ))
|
|
|
|
return FALSE;
|
|
|
|
|
2021-07-17 14:57:16 +00:00
|
|
|
return NtGdiArcInternal( NtGdiChord, hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
}
|
2021-07-17 14:57:25 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Pie (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
|
|
|
{
|
2021-07-20 07:19:24 +00:00
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
2021-07-17 14:57:25 +00:00
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
|
|
|
|
right, bottom, xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-17 15:01:18 +00:00
|
|
|
if (is_meta_dc( hdc ))
|
|
|
|
return METADC_Pie( hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
|
2021-07-20 07:19:24 +00:00
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ArcChordPie( dc_attr, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend, EMR_PIE ))
|
|
|
|
return FALSE;
|
|
|
|
|
2021-07-17 14:57:25 +00:00
|
|
|
return NtGdiArcInternal( NtGdiPie, hdc, left, top, right, bottom,
|
|
|
|
xstart, ystart, xend, yend );
|
|
|
|
}
|
2021-07-20 07:19:33 +00:00
|
|
|
|
2021-07-20 07:20:02 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* AngleArc (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI AngleArc( HDC hdc, INT x, INT y, DWORD radius, FLOAT start_angle, FLOAT sweep_angle )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, (%d, %d), %u, %f, %f\n", hdc, x, y, radius, start_angle, sweep_angle );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_AngleArc( dc_attr, x, y, radius, start_angle, sweep_angle ))
|
|
|
|
return FALSE;
|
|
|
|
return NtGdiAngleArc( hdc, x, y, radius, start_angle, sweep_angle );
|
|
|
|
}
|
|
|
|
|
2021-07-20 07:19:33 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Ellipse (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d)\n", hdc, left, top, right, bottom );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_Ellipse( hdc, left, top, right, bottom );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_Ellipse( dc_attr, left, top, right, bottom )) return FALSE;
|
|
|
|
return NtGdiEllipse( hdc, left, top, right, bottom );
|
|
|
|
}
|
2021-07-20 07:19:41 +00:00
|
|
|
|
2021-07-20 07:19:51 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Rectangle (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Rectangle( HDC hdc, INT left, INT top, INT right, INT bottom )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d)\n", hdc, left, top, right, bottom );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_Rectangle( hdc, left, top, right, bottom );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_Rectangle( dc_attr, left, top, right, bottom )) return FALSE;
|
|
|
|
return NtGdiRectangle( hdc, left, top, right, bottom );
|
|
|
|
}
|
|
|
|
|
2021-07-20 07:19:41 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* RoundRect (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
|
|
|
|
INT bottom, INT ell_width, INT ell_height )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, (%d, %d)-(%d, %d), %dx%d\n", hdc, left, top, right, bottom,
|
|
|
|
ell_width, ell_height );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc ))
|
|
|
|
return METADC_RoundRect( hdc, left, top, right, bottom, ell_width, ell_height );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_RoundRect( dc_attr, left, top, right, bottom,
|
|
|
|
ell_width, ell_height ))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return NtGdiRoundRect( hdc, left, top, right, bottom, ell_width, ell_height );
|
|
|
|
}
|
2021-07-22 09:25:17 +00:00
|
|
|
|
2021-07-22 09:26:00 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* Polygon (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Polygon( HDC hdc, const POINT *points, INT count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %d\n", hdc, points, count );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_Polygon( hdc, points, count );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_Polygon( dc_attr, points, count )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, (const UINT *)&count, 1, NtGdiPolyPolygon );
|
|
|
|
}
|
|
|
|
|
2021-07-22 09:25:17 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* PolyPolygon (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolyPolygon( HDC hdc, const POINT *points, const INT *counts, UINT polygons )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %p, %u\n", hdc, points, counts, polygons );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_PolyPolygon( hdc, points, counts, polygons );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolyPolygon( dc_attr, points, counts, polygons )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, (const UINT *)counts, polygons, NtGdiPolyPolygon );
|
|
|
|
}
|
2021-07-22 09:26:15 +00:00
|
|
|
|
2021-07-22 09:26:36 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* Polyline (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI Polyline( HDC hdc, const POINT *points, INT count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %d\n", hdc, points, count );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_Polyline( hdc, points, count );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_Polyline( dc_attr, points, count )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, (const UINT *)&count, 1, NtGdiPolyPolyline );
|
|
|
|
}
|
|
|
|
|
2021-07-22 09:26:15 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* PolyPolyline (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolyPolyline( HDC hdc, const POINT *points, const DWORD *counts, DWORD polylines )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %p, %u\n", hdc, points, counts, polylines );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolyPolyline( dc_attr, points, counts, polylines )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, counts, polylines, NtGdiPolyPolyline );
|
|
|
|
}
|
2021-07-22 09:27:07 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* PolyBezier (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolyBezier( HDC hdc, const POINT *points, DWORD count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %u\n", hdc, points, count );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolyBezier( dc_attr, points, count )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, &count, 1, NtGdiPolyBezier );
|
|
|
|
}
|
2021-07-22 09:27:20 +00:00
|
|
|
|
2021-07-22 09:27:36 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* PolyBezierTo (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolyBezierTo( HDC hdc, const POINT *points, DWORD count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %u\n", hdc, points, count );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolyBezierTo( dc_attr, points, count )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, &count, 1, NtGdiPolyBezierTo );
|
|
|
|
}
|
|
|
|
|
2021-07-22 09:27:20 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* PolylineTo (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolylineTo( HDC hdc, const POINT *points, DWORD count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %u\n", hdc, points, count );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolylineTo( dc_attr, points, count )) return FALSE;
|
|
|
|
return NtGdiPolyPolyDraw( hdc, points, &count, 1, NtGdiPolylineTo );
|
|
|
|
}
|
2021-07-23 08:48:48 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PolyDraw (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PolyDraw( HDC hdc, const POINT *points, const BYTE *types, DWORD count )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %p, %u\n", hdc, points, types, count );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PolyDraw( dc_attr, points, types, count )) return FALSE;
|
|
|
|
return NtGdiPolyDraw( hdc, points, types, count );
|
|
|
|
}
|
2021-07-23 08:49:42 +00:00
|
|
|
|
2021-07-25 08:56:11 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* FillRgn (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %p\n", hdc, hrgn, hbrush );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_FillRgn( hdc, hrgn, hbrush );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_FillRgn( dc_attr, hrgn, hbrush )) return FALSE;
|
|
|
|
return NtGdiFillRgn( hdc, hrgn, hbrush );
|
|
|
|
}
|
|
|
|
|
2021-07-25 08:56:36 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* PaintRgn (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p\n", hdc, hrgn );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_PaintRgn( hdc, hrgn );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_PaintRgn( dc_attr, hrgn )) return FALSE;
|
|
|
|
return NtGdiFillRgn( hdc, hrgn, GetCurrentObject( hdc, OBJ_BRUSH ));
|
|
|
|
}
|
|
|
|
|
2021-07-25 08:56:56 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* FrameRgn (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p, %p, %dx%d\n", hdc, hrgn, hbrush, width, height );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_FrameRgn( hdc, hrgn, hbrush, width, height );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_FrameRgn( dc_attr, hrgn, hbrush, width, height ))
|
|
|
|
return FALSE;
|
|
|
|
return NtGdiFrameRgn( hdc, hrgn, hbrush, width, height );
|
|
|
|
}
|
|
|
|
|
2021-07-25 08:57:12 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* InvertRgn (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, %p\n", hdc, hrgn );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_InvertRgn( hdc, hrgn );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_InvertRgn( dc_attr, hrgn )) return FALSE;
|
|
|
|
return NtGdiInvertRgn( hdc, hrgn );
|
|
|
|
}
|
|
|
|
|
2021-07-25 08:57:58 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ExtFloodFill (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fill_type )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p, (%d, %d), %08x, %x\n", hdc, x, y, color, fill_type );
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_ExtFloodFill( hdc, x, y, color, fill_type );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ExtFloodFill( dc_attr, x, y, color, fill_type )) return FALSE;
|
|
|
|
return NtGdiExtFloodFill( hdc, x, y, color, fill_type );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* FloodFill (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
|
|
|
|
{
|
|
|
|
return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
|
|
|
|
}
|
|
|
|
|
2021-07-25 08:58:49 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* GdiGradientFill (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
|
|
|
|
void *grad_array, ULONG ngrad, ULONG mode )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
TRACE( "%p vert_array:%p nvert:%d grad_array:%p ngrad:%d\n", hdc, vert_array,
|
|
|
|
nvert, grad_array, ngrad );
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc )))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (dc_attr->emf &&
|
|
|
|
!EMFDC_GradientFill( dc_attr, vert_array, nvert, grad_array, ngrad, mode ))
|
|
|
|
return FALSE;
|
|
|
|
return NtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
|
|
|
|
}
|
|
|
|
|
2021-07-23 08:49:42 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ExtTextOutW (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
|
|
|
|
const WCHAR *str, UINT count, const INT *dx )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (is_meta_dc( hdc )) return METADC_ExtTextOut( hdc, x, y, flags, rect, str, count, dx );
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_ExtTextOut( dc_attr, x, y, flags, rect, str, count, dx ))
|
|
|
|
return FALSE;
|
|
|
|
return NtGdiExtTextOutW( hdc, x, y, flags, rect, str, count, dx, 0 );
|
|
|
|
}
|
2021-07-23 08:50:13 +00:00
|
|
|
|
2021-07-23 08:50:37 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* BeginPath (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI BeginPath(HDC hdc)
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_BeginPath( dc_attr )) return FALSE;
|
|
|
|
return NtGdiBeginPath( hdc );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* EndPath (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EndPath(HDC hdc)
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_EndPath( dc_attr )) return FALSE;
|
|
|
|
return NtGdiEndPath( hdc );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* AbortPath (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI AbortPath( HDC hdc )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_AbortPath( dc_attr )) return FALSE;
|
|
|
|
return NtGdiAbortPath( hdc );
|
|
|
|
}
|
|
|
|
|
2021-07-23 08:50:13 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* CloseFigure (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CloseFigure( HDC hdc )
|
|
|
|
{
|
|
|
|
DC_ATTR *dc_attr;
|
|
|
|
|
|
|
|
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
|
|
|
|
if (dc_attr->emf && !EMFDC_CloseFigure( dc_attr )) return FALSE;
|
|
|
|
return NtGdiCloseFigure( hdc );
|
|
|
|
}
|
2021-07-25 08:55:31 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GdiSetPixelFormat (GDI32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr )
|
|
|
|
{
|
|
|
|
TRACE( "(%p,%d,%p)\n", hdc, format, descr );
|
|
|
|
return NtGdiSetPixelFormat( hdc, format );
|
|
|
|
}
|