Move meta code from painting to arc. Including the new Pie function with ifed out.

svn path=/trunk/; revision=28079
This commit is contained in:
James Tabor 2007-08-01 19:26:55 +00:00
parent e6e690ba9a
commit 29241f09f4
2 changed files with 193 additions and 249 deletions

View file

@ -1,79 +1,193 @@
#include "precomp.h" #include "precomp.h"
BOOL BOOL
WINAPI WINAPI
Arc( Arc(
HDC hDC, HDC hDC,
int nLeftRect, int nLeftRect,
int nTopRect, int nTopRect,
int nRightRect, int nRightRect,
int nBottomRect, int nBottomRect,
int nXStartArc, int nXStartArc,
int nYStartArc, int nYStartArc,
int nXEndArc, int nXEndArc,
int nYEndArc int nYEndArc
) )
{ {
return NtGdiArcInternal(GdiTypeArc, #if 0
hDC, // Handle something other than a normal dc object.
nLeftRect, if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
nTopRect, {
nRightRect, if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
nBottomRect, // Call Wine (rewrite of) MFDRV_MetaParam8
nXStartArc, return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8)
nYStartArc, else
nXEndArc, {
nYEndArc); PLDC pLDC = GdiGetLDC(hDC);
} if ( !pLDC )
{
BOOL SetLastError(ERROR_INVALID_HANDLE);
WINAPI return FALSE;
ArcTo( }
HDC hDC, if (pLDC->iType == LDC_EMFLDC)
int nLeftRect, {
int nTopRect, // Call Wine (rewrite of) EMFDRV_ArcChordPie
int nRightRect, BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC);
int nBottomRect, return Ret;
int nXRadial1, }
int nYRadial1, return FALSE;
int nXRadial2, }
int nYRadial2) }
{ #endif
return NtGdiArcInternal(GdiTypeArcTo, return NtGdiArcInternal(GdiTypeArc,
hDC, hDC,
nLeftRect, nLeftRect,
nTopRect, nTopRect,
nRightRect, nRightRect,
nBottomRect, nBottomRect,
nXRadial1, nXStartArc,
nYRadial1, nYStartArc,
nXRadial2, nXEndArc,
nYRadial2); nYEndArc);
} }
BOOL BOOL
WINAPI WINAPI
Chord( ArcTo(
HDC hDC, HDC hDC,
int nLeftRect, int nLeftRect,
int nTopRect, int nTopRect,
int nRightRect, int nRightRect,
int nBottomRect, int nBottomRect,
int nXRadial1, int nXRadial1,
int nYRadial1, int nYRadial1,
int nXRadial2, int nXRadial2,
int nYRadial2) int nYRadial2)
{ {
return NtGdiArcInternal(GdiTypeChord, #if 0
hDC, // Handle something other than a normal dc object.
nLeftRect, if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
nTopRect, {
nRightRect, if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
nBottomRect, return FALSE; //No meta support for ArcTo
nXRadial1, else
nYRadial1, {
nXRadial2, PLDC pLDC = GdiGetLDC(hDC);
nYRadial2); if ( !pLDC )
} {
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO);
return Ret;
}
return FALSE;
}
}
#endif
return NtGdiArcInternal(GdiTypeArcTo,
hDC,
nLeftRect,
nTopRect,
nRightRect,
nBottomRect,
nXRadial1,
nYRadial1,
nXRadial2,
nYRadial2);
}
BOOL
WINAPI
Chord(
HDC hDC,
int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect,
int nXRadial1,
int nYRadial1,
int nXRadial2,
int nYRadial2)
{
#if 0
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8)
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD);
return Ret;
}
return FALSE;
}
}
#endif
return NtGdiArcInternal(GdiTypeChord,
hDC,
nLeftRect,
nTopRect,
nRightRect,
nBottomRect,
nXRadial1,
nYRadial1,
nXRadial2,
nYRadial2);
}
#if 0
/*
* @unimplemented
*/
BOOL
STDCALL
Pie(
HDC hDC,
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8
)
{
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8)
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE);
return Ret;
}
return FALSE;
}
}
return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
}
#endif

View file

@ -234,176 +234,6 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
} }
/*
* @unimplemented
*/
BOOL
STDCALL
NewArc(
HDC hDC,
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8
)
{
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
// Call Wine (rewrite of) MFDRV_MetaParam8
return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8)
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
// Call Wine (rewrite of) EMFDRV_ArcChordPie
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC);
return Ret;
}
return FALSE;
}
}
return NtGdiArcInternal(GdiTypeArc, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
}
/*
* @unimplemented
*/
BOOL
STDCALL
NewArcTo(
HDC hDC,
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8
)
{
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
return FALSE; //No meta support for ArcTo
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO);
return Ret;
}
return FALSE;
}
}
return NtGdiArcInternal(GdiTypeArcTo, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
}
/*
* @unimplemented
*/
BOOL
STDCALL
Chord(
HDC hDC,
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8
)
{
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8)
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD);
return Ret;
}
return FALSE;
}
}
return NtGdiArcInternal(GdiTypeChord, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
}
/*
* @unimplemented
*/
BOOL
STDCALL
NewPie(
HDC hDC,
int a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8
)
{
// Handle something other than a normal dc object.
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8)
else
{
PLDC pLDC = GdiGetLDC(hDC);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (pLDC->iType == LDC_EMFLDC)
{
BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE);
return Ret;
}
return FALSE;
}
}
return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
}
BOOL BOOL
STDCALL STDCALL
Ellipse(HDC hDC, INT Left, INT Top, INT Right, INT Bottom) Ellipse(HDC hDC, INT Left, INT Top, INT Right, INT Bottom)