- rename NtGdiSelectPalette to NtUserSelectPalette, move it to ntuser/windc.c and implement stub function SelectPalette in gdi32.dll calling it (Don't ask me why it is named this way, but it is on windows)

- rename NtGdiSetDIBitsToDevice to NtGdiSetDIBitsToDeviceInternal and implement stub function in gdi32.dll
- update ntgdibad.h

svn path=/trunk/; revision=28428
This commit is contained in:
Timo Kreuzer 2007-08-19 23:49:47 +00:00
parent 263feb7b7d
commit 0e85f8a438
9 changed files with 133 additions and 112 deletions

View file

@ -527,7 +527,7 @@ SelectClipPath@8
SelectClipRgn@8
SelectFontLocal@8
SelectObject@8=NtGdiSelectObject@8
SelectPalette@12=NtGdiSelectPalette@12
SelectPalette@12
SetAbortProc@8
SetArcDirection@8
SetBitmapAttributes@8
@ -544,7 +544,7 @@ SetDCBrushColor@8
SetDCPenColor@8
SetDIBColorTable@16=NtGdiSetDIBColorTable@16
SetDIBits@28=NtGdiSetDIBits@28
SetDIBitsToDevice@48=NtGdiSetDIBitsToDevice@48
SetDIBitsToDevice@48
SetDeviceGammaRamp@8
SetEnhMetaFileBits@8
SetFontEnumeration@4

View file

@ -110,3 +110,37 @@ CreateDiscardableBitmap(
{
return NtGdiCreateCompatibleBitmap(hDC, Width, Height);
}
INT WINAPI
SetDIBitsToDevice(
HDC hDC,
int XDest,
int YDest,
DWORD Width,
DWORD Height,
int XSrc,
int YSrc,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *lpbmi,
UINT ColorUse)
{
return NtGdiSetDIBitsToDeviceInternal(hDC,
XDest,
YDest,
Width,
Height,
XSrc,
YSrc,
StartScan,
ScanLines,
(LPBYTE)Bits,
(LPBITMAPINFO)lpbmi,
ColorUse,
lpbmi->bmiHeader.biSizeImage,
lpbmi->bmiHeader.biSize,
FALSE,
NULL);
}

View file

@ -918,3 +918,17 @@ GetWindowOrgEx(
return NtGdiGetDCPoint( hdc, GdiGetWindowOrg, lpPoint );
}
/* FIXME: include correct header */
HPALETTE STDCALL NtUserSelectPalette(HDC hDC,
HPALETTE hpal,
BOOL ForceBackground);
HPALETTE
STDCALL
SelectPalette(
HDC hDC,
HPALETTE hPal,
BOOL bForceBackground)
{
return NtUserSelectPalette(hDC, hPal, bForceBackground);
}

View file

@ -78,11 +78,6 @@ NtGdiCreateScalableFontResource(
LPCWSTR CurrentPath
);
/* The gdi32 call Should Use NtGdiGetRandomRgn and nothing else */
HRGN
NTAPI
NtGdiGetClipRgn(HDC hDC);
/* The gdi32 call Should Use NtGdiGetTextExtent */
BOOL
NTAPI
@ -604,15 +599,6 @@ NtGdiRemoveFontResource(LPCWSTR FileName);
/* Should be done in user-mode. */
HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj);
/* Use NtUserSelectPalette. */
HPALETTE
STDCALL
NtGdiSelectPalette (
HDC hDC,
HPALETTE hpal,
BOOL ForceBackground
);
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
COLORREF STDCALL NtGdiSetBkColor (HDC hDC, COLORREF Color);
@ -642,24 +628,6 @@ NtGdiSetDIBits (
UINT ColorUse
);
/* Use NtGdiSetDIBitsToDeviceInternal. */
INT
STDCALL
NtGdiSetDIBitsToDevice (
HDC hDC,
INT XDest,
INT YDest,
DWORD Width,
DWORD Height,
INT XSrc,
INT YSrc,
UINT StartScan,
UINT ScanLines,
CONST VOID * Bits,
CONST BITMAPINFO * bmi,
UINT ColorUse
);
/* Metafiles are user-mode. */
HENHMETAFILE
STDCALL

View file

@ -1006,5 +1006,62 @@ NtUserChangeDisplaySettings(
return Ret;
}
/*!
* Select logical palette into device context.
* \param hDC handle to the device context
* \param hpal handle to the palette
* \param ForceBackground If this value is FALSE the logical palette will be copied to the device palette only when the applicatioon
* is in the foreground. If this value is TRUE then map the colors in the logical palette to the device
* palette colors in the best way.
* \return old palette
*
* \todo implement ForceBackground == TRUE
*/
HPALETTE STDCALL NtUserSelectPalette(HDC hDC,
HPALETTE hpal,
BOOL ForceBackground)
{
PDC dc;
HPALETTE oldPal = NULL;
PPALGDI PalGDI;
// FIXME: mark the palette as a [fore\back]ground pal
dc = DC_LockDc(hDC);
if (NULL != dc)
{
/* Check if this is a valid palette handle */
PalGDI = PALETTE_LockPalette(hpal);
if (NULL != PalGDI)
{
/* Is this a valid palette for this depth? */
if ((dc->w.bitsPerPixel <= 8 && PAL_INDEXED == PalGDI->Mode)
|| (8 < dc->w.bitsPerPixel && PAL_INDEXED != PalGDI->Mode))
{
PALETTE_UnlockPalette(PalGDI);
oldPal = dc->w.hPalette;
dc->w.hPalette = hpal;
}
else if (8 < dc->w.bitsPerPixel && PAL_INDEXED == PalGDI->Mode)
{
PALETTE_UnlockPalette(PalGDI);
oldPal = dc->PalIndexed;
dc->PalIndexed = hpal;
}
else
{
PALETTE_UnlockPalette(PalGDI);
oldPal = NULL;
}
}
else
{
oldPal = NULL;
}
DC_UnlockDc(dc);
}
return oldPal;
}
/* EOF */

View file

@ -617,63 +617,6 @@ BOOL STDCALL NtGdiResizePalette(HPALETTE hpal,
return FALSE;
}
/*!
* Select logical palette into device context.
* \param hDC handle to the device context
* \param hpal handle to the palette
* \param ForceBackground If this value is FALSE the logical palette will be copied to the device palette only when the applicatioon
* is in the foreground. If this value is TRUE then map the colors in the logical palette to the device
* palette colors in the best way.
* \return old palette
*
* \todo implement ForceBackground == TRUE
*/
HPALETTE STDCALL NtGdiSelectPalette(HDC hDC,
HPALETTE hpal,
BOOL ForceBackground)
{
PDC dc;
HPALETTE oldPal = NULL;
PPALGDI PalGDI;
// FIXME: mark the palette as a [fore\back]ground pal
dc = DC_LockDc(hDC);
if (NULL != dc)
{
/* Check if this is a valid palette handle */
PalGDI = PALETTE_LockPalette(hpal);
if (NULL != PalGDI)
{
/* Is this a valid palette for this depth? */
if ((dc->w.bitsPerPixel <= 8 && PAL_INDEXED == PalGDI->Mode)
|| (8 < dc->w.bitsPerPixel && PAL_INDEXED != PalGDI->Mode))
{
PALETTE_UnlockPalette(PalGDI);
oldPal = dc->w.hPalette;
dc->w.hPalette = hpal;
}
else if (8 < dc->w.bitsPerPixel && PAL_INDEXED == PalGDI->Mode)
{
PALETTE_UnlockPalette(PalGDI);
oldPal = dc->PalIndexed;
dc->PalIndexed = hpal;
}
else
{
PALETTE_UnlockPalette(PalGDI);
oldPal = NULL;
}
}
else
{
oldPal = NULL;
}
DC_UnlockDc(dc);
}
return oldPal;
}
BOOL STDCALL NtGdiSetColorAdjustment(HDC hDC,
CONST LPCOLORADJUSTMENT ca)
{

View file

@ -1461,7 +1461,7 @@ IntGdiSetDCState ( HDC hDC, HDC hDCSave )
NtGdiSetBkColor( hDC, dcs->Dc_Attr.crBackgroundClr);
NtGdiSetTextColor( hDC, dcs->Dc_Attr.crForegroundClr);
NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE );
NtUserSelectPalette( hDC, dcs->w.hPalette, FALSE );
#if 0
GDISelectPalette16( hDC, dcs->w.hPalette, FALSE );

View file

@ -324,20 +324,27 @@ NtGdiSetDIBits(
return Ret;
}
INT STDCALL
NtGdiSetDIBitsToDevice(
HDC hDC,
INT XDest,
INT YDest,
DWORD Width,
DWORD Height,
INT XSrc,
INT YSrc,
UINT StartScan,
UINT ScanLines,
CONST VOID *Bits,
CONST BITMAPINFO *bmi,
UINT ColorUse)
W32KAPI
INT
APIENTRY
NtGdiSetDIBitsToDeviceInternal(
IN HDC hDC,
IN INT XDest,
IN INT YDest,
IN DWORD Width,
IN DWORD Height,
IN INT XSrc,
IN INT YSrc,
IN DWORD StartScan,
IN DWORD ScanLines,
IN LPBYTE Bits,
IN LPBITMAPINFO bmi,
IN DWORD ColorUse,
IN UINT cjMaxBits,
IN UINT cjMaxInfo,
IN BOOL bTransformCoordinates,
IN OPTIONAL HANDLE hcmXform
)
{
UNIMPLEMENTED;
return 0;
@ -591,7 +598,7 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
if(Usage == DIB_PAL_COLORS)
{
hPal = NtGdiGetCurrentObject(hDC, OBJ_PAL);
hPal = NtGdiSelectPalette(hdcMem, hPal, FALSE);
hPal = NtUserSelectPalette(hdcMem, hPal, FALSE);
}
if (BitsInfo->bmiHeader.biCompression == BI_RLE4 ||
@ -622,7 +629,7 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
SrcWidth, SrcHeight, ROP, 0);
if(hPal)
NtGdiSelectPalette(hdcMem, hPal, FALSE);
NtUserSelectPalette(hdcMem, hPal, FALSE);
NtGdiSelectObject(hdcMem, hOldBitmap);
NtGdiDeleteObjectApp(hdcMem);

View file

@ -277,7 +277,7 @@ NtGdiSetBrushOrg 4
NtGdiSetColorAdjustment 2
NtGdiSetColorSpace 2
NtGdiSetDeviceGammaRamp 2
# NtGdiSetDIBitsToDeviceInternal 16
NtGdiSetDIBitsToDeviceInternal 16
# NtGdiSetFontEnumeration 1
# NtGdiSetFontXform 3
NtGdiSetIcmMode 3
@ -507,7 +507,7 @@ NtUserResolveDesktopForWOW 1
NtUserSBGetParms 4
NtUserScrollDC 7
NtUserScrollWindowEx 8
# NtUserSelectPalette 3
NtUserSelectPalette 3
NtUserSendInput 3
NtUserSetActiveWindow 1
# NtUserSetAppImeLevel 2
@ -692,12 +692,10 @@ NtUserValidateHandleSecure 1
#
#ReactOS specify syscall
NtGdiSelectObject 2
NtGdiSelectPalette 3
NtGdiSetBkColor 2
NtGdiSetBkMode 2
NtGdiSetDIBColorTable 4
NtGdiSetDIBits 7
NtGdiSetDIBitsToDevice 12
NtGdiSetEnhMetaFileBits 2
NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2