mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
Beginning of an implementation of SelectObject, using NtGdiSelectBitmap, NtGdiSelectBrush, NtGdiselectFont, NtGdiSelectPen and ExtSelectClipRgn instead of NtGdiSelectObject.
Todo: Do most stuff in user mode svn path=/trunk/; revision=30906
This commit is contained in:
parent
39f5d78fed
commit
c8dc03129f
2 changed files with 55 additions and 11 deletions
|
@ -48,17 +48,6 @@ SetDIBitsToDevice(
|
|||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
HGDIOBJ
|
||||
STDCALL
|
||||
SelectObject(HDC hdc,
|
||||
HGDIOBJ hgdiobj)
|
||||
{
|
||||
return NtGdiSelectObject(hdc,hgdiobj);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
|
|
@ -1333,3 +1333,58 @@ GetHFONT(HDC hdc)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
HGDIOBJ
|
||||
STDCALL
|
||||
SelectObject(HDC hDC,
|
||||
HGDIOBJ hGdiObj)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
// HGDIOBJ hOldObj = NULL;
|
||||
|
||||
if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hGdiObj = GdiFixUpHandle(hGdiObj);
|
||||
if (!GdiIsHandleValid(hGdiObj))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UINT uType = GDI_HANDLE_GET_TYPE(hGdiObj);
|
||||
|
||||
switch (uType)
|
||||
{
|
||||
case GDI_OBJECT_TYPE_PALETTE:
|
||||
SetLastError(ERROR_INVALID_FUNCTION);
|
||||
return NULL;
|
||||
|
||||
case GDI_OBJECT_TYPE_REGION:
|
||||
return (HGDIOBJ)ExtSelectClipRgn(hDC, hGdiObj, RGN_COPY);
|
||||
|
||||
case GDI_OBJECT_TYPE_BITMAP:
|
||||
return NtGdiSelectBitmap(hDC, hGdiObj);
|
||||
|
||||
case GDI_OBJECT_TYPE_BRUSH:
|
||||
return NtGdiSelectBrush(hDC, hGdiObj);
|
||||
|
||||
case GDI_OBJECT_TYPE_PEN:
|
||||
case GDI_OBJECT_TYPE_EXTPEN:
|
||||
return NtGdiSelectPen(hDC, hGdiObj);
|
||||
|
||||
case GDI_OBJECT_TYPE_FONT:
|
||||
return NtGdiSelectFont(hDC, hGdiObj);
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue