mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 06:52:07 +00:00
Gdi32:
- Implement GdiGetCodePage and SetROP2. Still testing. - Implemented batch support for SetBrushOrgEx. Still testing. - Moved PatBlt and PolyPatBlt out of stubs. svn path=/trunk/; revision=30097
This commit is contained in:
parent
87d8ff0d8c
commit
0029160b44
3 changed files with 157 additions and 65 deletions
|
@ -100,19 +100,6 @@ SetPolyFillMode(HDC hdc,
|
|||
return NtGdiSetPolyFillMode(hdc, iPolyFillMode);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
int
|
||||
STDCALL
|
||||
SetROP2(HDC hdc,
|
||||
int fnDrawMode)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -207,20 +194,6 @@ SetViewportOrgEx(HDC hdc,
|
|||
return NtGdiSetViewportOrgEx(hdc,X,Y,lpPoint);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
SetBrushOrgEx(HDC hdc,
|
||||
int nXOrg,
|
||||
int nYOrg,
|
||||
LPPOINT lppt)
|
||||
{
|
||||
/* FIXME share memory */
|
||||
return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -1519,18 +1492,6 @@ GdiDrawStream(HDC dc, ULONG l, VOID *v)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
DWORD
|
||||
STDCALL
|
||||
GdiGetCodePage(HDC hdc)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -2681,32 +2642,6 @@ NamedEscape(HDC hdc,
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
PatBlt(HDC hdc,
|
||||
int nXLeft,
|
||||
int nYLeft,
|
||||
int nWidth,
|
||||
int nHeight,
|
||||
DWORD dwRop)
|
||||
{
|
||||
/* FIXME some part need be done in user mode */
|
||||
return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
|
||||
}
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
PolyPatBlt(IN HDC hdc,
|
||||
IN DWORD rop4,
|
||||
IN PPOLYPATBLT pPoly,
|
||||
IN DWORD Count,
|
||||
IN DWORD Mode)
|
||||
{
|
||||
/* FIXME some part need be done in user mode */
|
||||
return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -179,3 +179,146 @@ CreateBrushIndirect(
|
|||
return hBrush;
|
||||
}
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
PatBlt(HDC hdc,
|
||||
int nXLeft,
|
||||
int nYLeft,
|
||||
int nWidth,
|
||||
int nHeight,
|
||||
DWORD dwRop)
|
||||
{
|
||||
/* FIXME some part need be done in user mode */
|
||||
return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
|
||||
}
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
PolyPatBlt(IN HDC hdc,
|
||||
IN DWORD rop4,
|
||||
IN PPOLYPATBLT pPoly,
|
||||
IN DWORD Count,
|
||||
IN DWORD Mode)
|
||||
{
|
||||
/* FIXME some part need be done in user mode */
|
||||
return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int
|
||||
STDCALL
|
||||
SetROP2(HDC hdc,
|
||||
int fnDrawMode)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
INT Old_ROP2;
|
||||
|
||||
#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_SetROP2( hdc, fnDrawMode);
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetROP2(( hdc, fnDrawMode);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG) hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
|
||||
}
|
||||
}
|
||||
|
||||
Old_ROP2 = Dc_Attr->jROP2;
|
||||
Dc_Attr->jROP2 = fnDrawMode;
|
||||
|
||||
return Old_ROP2;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
SetBrushOrgEx(HDC hdc,
|
||||
int nXOrg,
|
||||
int nYOrg,
|
||||
LPPOINT lppt)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( (pLDC == NULL) || (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetBrushOrg(hdc, nXOrg, nYOrg); // ReactOS only.
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr))
|
||||
{
|
||||
PTEB pTeb = NtCurrentTeb();
|
||||
if (lppt)
|
||||
{
|
||||
lppt->x = Dc_Attr->ptlBrushOrigin.x;
|
||||
lppt->y = Dc_Attr->ptlBrushOrigin.y;
|
||||
}
|
||||
if ((nXOrg == Dc_Attr->ptlBrushOrigin.x) && (nYOrg == Dc_Attr->ptlBrushOrigin.y))
|
||||
return TRUE;
|
||||
|
||||
if(((pTeb->GdiTebBatch.HDC == 0) || (pTeb->GdiTebBatch.HDC == (ULONG)hdc)) &&
|
||||
((pTeb->GdiTebBatch.Offset + sizeof(GDIBSSETBRHORG)) <= GDIBATCHBUFSIZE) &&
|
||||
(!(Dc_Attr->ulDirty_ & DC_DIBSECTION)) )
|
||||
{
|
||||
PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG)(&pTeb->GdiTebBatch.Buffer[0] +
|
||||
pTeb->GdiTebBatch.Offset);
|
||||
|
||||
Dc_Attr->ptlBrushOrigin.x = nXOrg;
|
||||
Dc_Attr->ptlBrushOrigin.y = nYOrg;
|
||||
|
||||
pgSBO->gbHdr.Cmd = GdiBCSetBrushOrg;
|
||||
pgSBO->gbHdr.Size = sizeof(GDIBSSETBRHORG);
|
||||
pgSBO->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
|
||||
|
||||
pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG);
|
||||
pTeb->GdiTebBatch.HDC = (ULONG)hdc;
|
||||
pTeb->GdiBatchCount++;
|
||||
if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,20 @@ TextOutW(
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
DWORD
|
||||
STDCALL
|
||||
GdiGetCodePage(HDC hdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
|
||||
if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc));
|
||||
return LOWORD(Dc_Attr->iCS_CP);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue