Author: tkreuzer
Date: Mon Aug 20 03:49:47 2007
New Revision: 28428
URL:
http://svn.reactos.org/svn/reactos?rev=28428&view=rev
Log:
- 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
Modified:
trunk/reactos/dll/win32/gdi32/gdi32.def
trunk/reactos/dll/win32/gdi32/objects/bitmap.c
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
trunk/reactos/subsystems/win32/win32k/objects/color.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.def?…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.def (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.def Mon Aug 20 03:49:47 2007
@@ -527,7 +527,7 @@
SelectClipRgn@8
SelectFontLocal@8
SelectObject@8=NtGdiSelectObject@8
-SelectPalette@12=NtGdiSelectPalette@12
+SelectPalette@12
SetAbortProc@8
SetArcDirection@8
SetBitmapAttributes@8
@@ -544,7 +544,7 @@
SetDCPenColor@8
SetDIBColorTable@16=NtGdiSetDIBColorTable@16
SetDIBits@28=NtGdiSetDIBits@28
-SetDIBitsToDevice@48=NtGdiSetDIBitsToDevice@48
+SetDIBitsToDevice@48
SetDeviceGammaRamp@8
SetEnhMetaFileBits@8
SetFontEnumeration@4
Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bi…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/bitmap.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c Mon Aug 20 03:49:47 2007
@@ -110,3 +110,37 @@
{
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);
+}
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Mon Aug 20 03:49:47 2007
@@ -918,3 +918,17 @@
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);
+}
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Mon Aug 20 03:49:47 2007
@@ -78,11 +78,6 @@
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 @@
/* 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);
@@ -635,24 +621,6 @@
NtGdiSetDIBits (
HDC hDC,
HBITMAP hBitmap,
- UINT StartScan,
- UINT ScanLines,
- CONST VOID * Bits,
- CONST BITMAPINFO * bmi,
- 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,
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Mon Aug 20 03:49:47 2007
@@ -1006,5 +1006,62 @@
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 */
Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/color.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/color.c Mon Aug 20 03:49:47 2007
@@ -617,63 +617,6 @@
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)
{
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Mon Aug 20 03:49:47 2007
@@ -1461,7 +1461,7 @@
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 );
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Mon Aug 20 03:49:47 2007
@@ -324,20 +324,27 @@
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 @@
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 @@
SrcWidth, SrcHeight, ROP, 0);
if(hPal)
- NtGdiSelectPalette(hdcMem, hPal, FALSE);
+ NtUserSelectPalette(hdcMem, hPal, FALSE);
NtGdiSelectObject(hdcMem, hOldBitmap);
NtGdiDeleteObjectApp(hdcMem);
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Mon Aug 20 03:49:47 2007
@@ -277,7 +277,7 @@
NtGdiSetColorAdjustment 2
NtGdiSetColorSpace 2
NtGdiSetDeviceGammaRamp 2
-# NtGdiSetDIBitsToDeviceInternal 16
+NtGdiSetDIBitsToDeviceInternal 16
# NtGdiSetFontEnumeration 1
# NtGdiSetFontXform 3
NtGdiSetIcmMode 3
@@ -507,7 +507,7 @@
NtUserSBGetParms 4
NtUserScrollDC 7
NtUserScrollWindowEx 8
-# NtUserSelectPalette 3
+NtUserSelectPalette 3
NtUserSendInput 3
NtUserSetActiveWindow 1
# NtUserSetAppImeLevel 2
@@ -692,12 +692,10 @@
#
#ReactOS specify syscall
NtGdiSelectObject 2
-NtGdiSelectPalette 3
NtGdiSetBkColor 2
NtGdiSetBkMode 2
NtGdiSetDIBColorTable 4
NtGdiSetDIBits 7
-NtGdiSetDIBitsToDevice 12
NtGdiSetEnhMetaFileBits 2
NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2