diff --git a/reactos/dll/win32/gdi32/misc/hacks.c b/reactos/dll/win32/gdi32/misc/hacks.c index 86779d7437f..4a731efca0e 100644 --- a/reactos/dll/win32/gdi32/misc/hacks.c +++ b/reactos/dll/win32/gdi32/misc/hacks.c @@ -39,21 +39,6 @@ GetGraphicsMode(HDC hdc) return NtGdiGetGraphicsMode(hdc); } -/* - * @implemented - * - */ -int -STDCALL -GetROP2(HDC hdc) -{ - /* FIXME do not use reactos own syscall for this, - * this hack need be remove - */ - return NtGdiGetROP2(hdc); -} - - /* * @implemented * @@ -92,18 +77,6 @@ SetDIBitsToDevice( NULL); } -/* - * @implemented - * - */ -int -STDCALL -SetBkMode(HDC hdc, - int iBkMode) -{ - return NtGdiSetBkMode(hdc,iBkMode); -} - /* * @implemented * @@ -139,29 +112,6 @@ GetStretchBltMode(HDC hdc) return NtGdiGetStretchBltMode(hdc); } -/* - * @implemented - * - */ -UINT -STDCALL -GetTextAlign(HDC hdc) -{ - return NtGdiGetTextAlign(hdc); -} - - -/* - * @implemented - * - */ -COLORREF -STDCALL -GetTextColor(HDC hdc) -{ - return NtGdiGetTextColor(hdc); -} - /* * @implemented * diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 5cd6d4020a4..bd3062186f8 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -113,18 +113,6 @@ SetRectRgn(HRGN hrgn, return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); } -/* - * @unimplemented - */ -UINT -STDCALL -SetTextAlign(HDC hdc, - UINT fMode) -{ - /* FIXME share memory */ - return NtGdiSetTextAlign(hdc, fMode); -} - /* * @unimplemented */ @@ -2338,30 +2326,6 @@ GdiConvertBitmapV5( } -/* - * @implemented - * - */ -COLORREF -STDCALL -GetBkColor(HDC hdc) -{ - /* FIXME some part are done in user mode */ - return NtGdiGetBkColor(hdc); -} - -/* - * @implemented - * - */ -int -STDCALL -GetBkMode(HDC hdc) -{ - /* FIXME some part are done in user mode */ - return NtGdiGetBkMode(hdc); -} - /* * @implemented * diff --git a/reactos/dll/win32/gdi32/objects/brush.c b/reactos/dll/win32/gdi32/objects/brush.c index 4d59ea76ba3..f21402b03e7 100644 --- a/reactos/dll/win32/gdi32/objects/brush.c +++ b/reactos/dll/win32/gdi32/objects/brush.c @@ -204,6 +204,18 @@ PolyPatBlt(IN HDC hdc, return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode); } +/* + * @implemented + * + */ +int +STDCALL +GetROP2(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->jROP2; +} /* * @implemented diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c index ec1edc4f100..055b3298e71 100644 --- a/reactos/dll/win32/gdi32/objects/dc.c +++ b/reactos/dll/win32/gdi32/objects/dc.c @@ -823,53 +823,19 @@ SetDCPenColor( } } return OldColor; -// return NtUserSetDCPenColor(hdc, crColor); } /* * @implemented + * */ COLORREF STDCALL -SetTextColor( - HDC hdc, - COLORREF crColor -) +GetBkColor(HDC hdc) { PDC_ATTR Dc_Attr; - COLORREF OldColor = CLR_INVALID; - - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; -#if 0 - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetTextColor( hDC, crColor ); - else - { - PLDC pLDC = Dc_Attr->pvLDC; - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - if return EMFDRV_SetTextColor( hDC, crColor ); - } - } - } -#endif - OldColor = (COLORREF) Dc_Attr->ulForegroundClr; - Dc_Attr->ulForegroundClr = (ULONG) crColor; - - if ( Dc_Attr->crForegroundClr != crColor ) - { - Dc_Attr->ulDirty_ |= DIRTY_TEXT; - Dc_Attr->crForegroundClr = crColor; - } - return OldColor; -// return NtGdiSetTextColor(hdc, crColor); + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->ulBackgroundClr; } /* @@ -915,7 +881,58 @@ SetBkColor( Dc_Attr->crBackgroundClr = crColor; } return OldColor; -// return NtGdiSetBkColor(hdc, crColor); +} + +/* + * @implemented + * + */ +int +STDCALL +GetBkMode(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->lBkMode; +} + +/* + * @implemented + * + */ +int +STDCALL +SetBkMode(HDC hdc, + int iBkMode) +{ + PDC_ATTR Dc_Attr; + INT OldMode = 0; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetBkMode( hdc, iBkMode ) + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetBkMode( hdc, iBkMode ) + } + } + } +#endif + OldMode = Dc_Attr->lBkMode; + Dc_Attr->jBkMode = iBkMode; // Processed + Dc_Attr->lBkMode = iBkMode; // Raw + return OldMode; } /* diff --git a/reactos/dll/win32/gdi32/objects/text.c b/reactos/dll/win32/gdi32/objects/text.c index b2037c0edad..5cd93c40eb3 100644 --- a/reactos/dll/win32/gdi32/objects/text.c +++ b/reactos/dll/win32/gdi32/objects/text.c @@ -458,4 +458,117 @@ SetTextCharacterExtra( // return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 ); } +/* + * @implemented + * + */ +UINT +STDCALL +GetTextAlign(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->lTextAlign; +} + + +/* + * @implemented + * + */ +COLORREF +STDCALL +GetTextColor(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->ulForegroundClr; +} + + + +/* + * @unimplemented + */ +UINT +STDCALL +SetTextAlign(HDC hdc, + UINT fMode) +{ + PDC_ATTR Dc_Attr; + INT OldMode = 0; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetTextAlign( hdc, fMode ) + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetTextAlign( hdc, fMode ) + } + } + } +#endif + OldMode = Dc_Attr->lTextAlign; + Dc_Attr->lTextAlign = fMode; // Raw + Dc_Attr->flTextAlign = fMode & 0x1f; + return OldMode; + +} + + +/* + * @implemented + */ +COLORREF +STDCALL +SetTextColor( + HDC hdc, + COLORREF crColor +) +{ + PDC_ATTR Dc_Attr; + COLORREF OldColor = CLR_INVALID; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetTextColor( hDC, crColor ); + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetTextColor( hDC, crColor ); + } + } + } +#endif + OldColor = (COLORREF) Dc_Attr->ulForegroundClr; + Dc_Attr->ulForegroundClr = (ULONG) crColor; + + if ( Dc_Attr->crForegroundClr != crColor ) + { + Dc_Attr->ulDirty_ |= DIRTY_TEXT; + Dc_Attr->crForegroundClr = crColor; + } + return OldColor; +} diff --git a/reactos/include/reactos/win32k/ntgdibad.h b/reactos/include/reactos/win32k/ntgdibad.h index f2f893de950..2d96422e530 100644 --- a/reactos/include/reactos/win32k/ntgdibad.h +++ b/reactos/include/reactos/win32k/ntgdibad.h @@ -196,20 +196,6 @@ STDCALL NtGdiGetAspectRatioFilterEx(HDC hDC, LPSIZE AspectRatio); -/* Should be done in user-mode using shared GDI Objects. */ -COLORREF STDCALL NtGdiGetBkColor(HDC hDC); - -/* Should be done in user-mode using shared GDI Objects. */ -INT STDCALL NtGdiGetBkMode(HDC hDC); - -/* Use NtGdiGetCharABCWidthsW */ -BOOL -STDCALL -NtGdiGetCharABCWidths(HDC hDC, - UINT FirstChar, - UINT LastChar, - LPABC abc); - /* Use NtGdiGetColorSpaceforBitmap. */ HCOLORSPACE STDCALL @@ -306,23 +292,14 @@ NtGdiGetPixelFormat(HDC hDC); /* Should be done in user-mode using shared GDI Objects. */ INT STDCALL NtGdiGetPolyFillMode(HDC hDC); -/* Should be done in user-mode using shared GDI Objects. */ -INT STDCALL NtGdiGetROP2(HDC hDC); - /* Should be done in user-mode using shared GDI Objects. */ INT STDCALL NtGdiGetStretchBltMode(HDC hDC); -/* Should be done in user-mode using shared GDI Objects. */ -UINT STDCALL NtGdiGetTextAlign(HDC hDC); - /* Should be done in user-mode using shared GDI Objects. */ UINT STDCALL NtGdiGetTextCharset(HDC hDC); -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiGetTextColor(HDC hDC); - /* Use NtGdiGetDCPoint with GdiGetViewPortExt */ BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt); @@ -404,12 +381,6 @@ NtGdiRemoveFontResource(LPCWSTR FileName); /* Should be done in user-mode. */ HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj); -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiSetBkColor (HDC hDC, COLORREF Color); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -INT STDCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode); - /* Use SetDIBitsToDevice in gdi32. */ INT STDCALL @@ -454,21 +425,9 @@ NtGdiSetMapperFlags(HDC hDC, /* Needs to be done in user-mode, using shared GDI Object Attributes. */ INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode); -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -INT STDCALL NtGdiSetROP2(HDC hDC, INT ROPmode); - /* Needs to be done in user-mode, using shared GDI Object Attributes. */ INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode); -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -UINT -STDCALL -NtGdiSetTextAlign(HDC hDC, - UINT Mode); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiSetTextColor(HDC hDC, COLORREF color); - /* Needs to be done in user-mode. */ BOOL STDCALL @@ -536,29 +495,6 @@ NtGdiUpdateICMRegKey(DWORD Reserved, LPWSTR Filename, UINT Command); -/* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */ -DWORD -NTAPI -NtUserCallTwoParam( - DWORD Param1, - DWORD Param2, - DWORD Routine); - -#define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45 -#define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46 -#define TWOPARAM_ROUTINE_GETDCCOLOR 0x47 - -#define NtUserGetDCBrushColor(hbr) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR) - -#define NtUserGetDCPenColor(hbr) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR) - -#define NtUserSetDCBrushColor(hbr, crColor) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCBRUSHCOLOR) - -#define NtUserSetDCPenColor(hbr, crColor) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCPENCOLOR) #endif /* WIN32K_NTGDI_BAD_INCLUDED */ diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index 96e1b9ad5ba..728792e4a14 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -104,6 +104,15 @@ VOID FASTCALL IntGetWindowOrgEx(PDC dc, LPPOINT pt); NTSTATUS STDCALL NtGdiFlushUserBatch(VOID); +COLORREF FASTCALL NtGdiSetBkColor (HDC hDC, COLORREF Color); +INT FASTCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode); +COLORREF STDCALL NtGdiGetBkColor(HDC hDC); +INT STDCALL NtGdiGetBkMode(HDC hDC); +COLORREF FASTCALL NtGdiSetTextColor(HDC hDC, COLORREF color); +UINT FASTCALL NtGdiSetTextAlign(HDC hDC, UINT Mode); +UINT STDCALL NtGdiGetTextAlign(HDC hDC); +COLORREF STDCALL NtGdiGetTextColor(HDC hDC); + /* For Metafile and MetaEnhFile not in windows this struct taken from wine cvs 15/9-2006*/ typedef struct { diff --git a/reactos/subsystems/win32/win32k/include/intgdi.h b/reactos/subsystems/win32/win32k/include/intgdi.h index 152a7942e90..c7c94e1b1b5 100644 --- a/reactos/subsystems/win32/win32k/include/intgdi.h +++ b/reactos/subsystems/win32/win32k/include/intgdi.h @@ -164,12 +164,6 @@ IntGdiCreateDC(PUNICODE_STRING Driver, CONST PDEVMODEW InitData, BOOL CreateAsIC); -COLORREF FASTCALL -IntGetDCColor(HDC hDC, ULONG Object); - -COLORREF FASTCALL -IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color); - /* Coord functions */ BOOL FASTCALL diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index af4309e6155..5424ba6f24e 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -485,18 +485,6 @@ NtUserCallTwoParam( switch(Routine) { - case TWOPARAM_ROUTINE_SETDCPENCOLOR: - { - RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_PEN, (COLORREF)Param2)); - } - case TWOPARAM_ROUTINE_SETDCBRUSHCOLOR: - { - RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_BRUSH, (COLORREF)Param2)); - } - case TWOPARAM_ROUTINE_GETDCCOLOR: - { - RETURN( (DWORD)IntGetDCColor((HDC)Param1, (ULONG)Param2)); - } case TWOPARAM_ROUTINE_GETWINDOWRGNBOX: { DWORD Ret; diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 394be3828bf..f927141ed69 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -150,8 +150,11 @@ NtGdiCreateCompatibleDC(HDC hDC) NewDC->PalIndexed = OrigDC->PalIndexed; NewDC->w.hPalette = OrigDC->w.hPalette; - nDc_Attr->crForegroundClr = oDc_Attr->crForegroundClr; nDc_Attr->lTextAlign = oDc_Attr->lTextAlign; + nDc_Attr->ulForegroundClr = oDc_Attr->ulForegroundClr; + nDc_Attr->ulBackgroundClr = oDc_Attr->ulBackgroundClr; + nDc_Attr->lBkMode = oDc_Attr->lBkMode; + nDc_Attr->crForegroundClr = oDc_Attr->crForegroundClr; nDc_Attr->crBackgroundClr = oDc_Attr->crBackgroundClr; nDc_Attr->jBkMode = oDc_Attr->jBkMode; nDc_Attr->jROP2 = oDc_Attr->jROP2; @@ -1203,8 +1206,11 @@ IntGdiCopyToSaveState(PDC dc, PDC newdc) nDc_Attr->jStretchBltMode = Dc_Attr->jStretchBltMode; nDc_Attr->lRelAbs = Dc_Attr->lRelAbs; nDc_Attr->jBkMode = Dc_Attr->jBkMode; + nDc_Attr->lBkMode = Dc_Attr->lBkMode; nDc_Attr->crBackgroundClr = Dc_Attr->crBackgroundClr; nDc_Attr->crForegroundClr = Dc_Attr->crForegroundClr; + nDc_Attr->ulBackgroundClr = Dc_Attr->ulBackgroundClr; + nDc_Attr->ulForegroundClr = Dc_Attr->ulForegroundClr; nDc_Attr->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin; nDc_Attr->lTextAlign = Dc_Attr->lTextAlign; nDc_Attr->lTextExtra = Dc_Attr->lTextExtra; @@ -1273,6 +1279,9 @@ IntGdiCopyFromSaveState(PDC dc, PDC dcs, HDC hDC) Dc_Attr->jBkMode = sDc_Attr->jBkMode; Dc_Attr->crBackgroundClr = sDc_Attr->crBackgroundClr; Dc_Attr->crForegroundClr = sDc_Attr->crForegroundClr; + Dc_Attr->lBkMode = sDc_Attr->lBkMode; + Dc_Attr->ulBackgroundClr = sDc_Attr->ulBackgroundClr; + Dc_Attr->ulForegroundClr = sDc_Attr->ulForegroundClr; Dc_Attr->ptlBrushOrigin = sDc_Attr->ptlBrushOrigin; Dc_Attr->lTextAlign = sDc_Attr->lTextAlign; @@ -2579,42 +2588,6 @@ IntIsPrimarySurface(SURFOBJ *SurfObj) return SurfObj->hsurf == PrimarySurface.Handle; } -/* - * Returns the color of the brush or pen that is currently selected into the DC. - * This function is called from GetDCBrushColor() and GetDCPenColor() - */ -COLORREF FASTCALL -IntGetDCColor(HDC hDC, ULONG Object) -{ - /* - * The previous implementation was completly incorrect. It modified the - * brush that was currently selected into the device context, but in fact - * the DC pen/brush color should be stored directly in the device context - * (at address 0x2C of the user mode DC object memory on Windows 2K/XP). - * The actual color is then used when DC_BRUSH/DC_PEN object is selected - * into the device context and BRUSHOBJ for drawing is composed (belongs - * to IntGdiInitBrushInstance in the current ReactOS implementation). Also - * the implementation should be moved to user mode GDI32.dll when UM - * mapped GDI objects will be implemented. - */ - - DPRINT("WIN32K:IntGetDCColor is unimplemented\n"); - return 0xFFFFFF; /* The default DC color. */ -} - -/* - * Changes the color of the brush or pen that is currently selected into the DC. - * This function is called from SetDCBrushColor() and SetDCPenColor() - */ -COLORREF FASTCALL -IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color) -{ - /* See the comment in IntGetDCColor. */ - - DPRINT("WIN32K:IntSetDCColor is unimplemented\n"); - return CLR_INVALID; -} - #define SIZEOF_DEVMODEW_300 188 #define SIZEOF_DEVMODEW_400 212 #define SIZEOF_DEVMODEW_500 220 diff --git a/reactos/subsystems/win32/win32k/objects/dcutil.c b/reactos/subsystems/win32/win32k/objects/dcutil.c index a45f2ab8751..247fe1957e5 100644 --- a/reactos/subsystems/win32/win32k/objects/dcutil.c +++ b/reactos/subsystems/win32/win32k/objects/dcutil.c @@ -157,14 +157,13 @@ DC_GET_VAL_EX( GetWindowExtEx, szlWindowExt.cx, szlWindowExt.cy, SIZE, cx, cy ) DC_GET_VAL_EX( GetWindowOrgEx, ptlWindowOrg.x, ptlWindowOrg.y, POINT, x, y ) DC_GET_VAL_EX ( GetCurrentPositionEx, ptlCurrent.x, ptlCurrent.y, POINT, x, y ) -DC_SET_MODE( NtGdiSetBkMode, jBkMode, TRANSPARENT, OPAQUE ) DC_SET_MODE( NtGdiSetPolyFillMode, jFillMode, ALTERNATE, WINDING ) DC_SET_MODE( NtGdiSetROP2, jROP2, R2_BLACK, R2_WHITE ) DC_SET_MODE( NtGdiSetStretchBltMode, jStretchBltMode, BLACKONWHITE, HALFTONE ) -COLORREF STDCALL +COLORREF FASTCALL NtGdiSetBkColor(HDC hDC, COLORREF color) { COLORREF oldColor; @@ -181,9 +180,80 @@ NtGdiSetBkColor(HDC hDC, COLORREF color) if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; oldColor = Dc_Attr->crBackgroundClr; Dc_Attr->crBackgroundClr = color; + Dc_Attr->ulBackgroundClr = (ULONG)color; + Dc_Attr->ulDirty_ &= ~DIRTY_LINE; // Clear Flag if set. hBrush = Dc_Attr->hbrush; DC_UnlockDc(dc); NtGdiSelectObject(hDC, hBrush); return oldColor; } +INT FASTCALL +NtGdiSetBkMode(HDC hDC, INT Mode) +{ + COLORREF oldMode; + PDC dc; + PDC_ATTR Dc_Attr; + + if (!(dc = DC_LockDc(hDC))) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + oldMode = Dc_Attr->lBkMode; + Dc_Attr->jBkMode = Mode; + Dc_Attr->lBkMode = Mode; + DC_UnlockDc(dc); + return oldMode; +} + +UINT +FASTCALL +NtGdiSetTextAlign(HDC hDC, + UINT Mode) +{ + UINT prevAlign; + DC *dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return GDI_ERROR; + } + Dc_Attr = dc->pDc_Attr; + if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + prevAlign = Dc_Attr->lTextAlign; + Dc_Attr->lTextAlign = Mode; + DC_UnlockDc( dc ); + return prevAlign; +} + +COLORREF +FASTCALL +NtGdiSetTextColor(HDC hDC, + COLORREF color) +{ + COLORREF oldColor; + PDC dc = DC_LockDc(hDC); + PDC_ATTR Dc_Attr; + HBRUSH hBrush; + + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + Dc_Attr = dc->pDc_Attr; + if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + oldColor = Dc_Attr->crForegroundClr; + Dc_Attr->crForegroundClr = color; + hBrush = Dc_Attr->hbrush; + DC_UnlockDc( dc ); + NtGdiSelectObject(hDC, hBrush); + return oldColor; +} diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index 3be070afc18..f45da718a6c 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -4029,54 +4029,6 @@ NtGdiSetMapperFlags(HDC hDC, return 0; } -UINT -STDCALL -NtGdiSetTextAlign(HDC hDC, - UINT Mode) -{ - UINT prevAlign; - DC *dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return GDI_ERROR; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - prevAlign = Dc_Attr->lTextAlign; - Dc_Attr->lTextAlign = Mode; - DC_UnlockDc( dc ); - return prevAlign; -} - -COLORREF -STDCALL -NtGdiSetTextColor(HDC hDC, - COLORREF color) -{ - COLORREF oldColor; - PDC dc = DC_LockDc(hDC); - PDC_ATTR Dc_Attr; - HBRUSH hBrush; - - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return CLR_INVALID; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - oldColor = Dc_Attr->crForegroundClr; - Dc_Attr->crForegroundClr = color; - hBrush = Dc_Attr->hbrush; - DC_UnlockDc( dc ); - NtGdiSelectObject(hDC, hBrush); - return oldColor; -} BOOL STDCALL diff --git a/reactos/subsystems/win32/win32k/w32ksvc.db b/reactos/subsystems/win32/win32k/w32ksvc.db index 4d53e50fea2..db1e3b3354b 100644 --- a/reactos/subsystems/win32/win32k/w32ksvc.db +++ b/reactos/subsystems/win32/win32k/w32ksvc.db @@ -679,18 +679,13 @@ NtGdiDrawStream 3 # #ReactOS specify syscall NtGdiSelectObject 2 -NtGdiSetBkColor 2 -NtGdiSetBkMode 2 NtGdiSetDIBits 7 NtGdiSetEnhMetaFileBits 2 NtGdiSetGraphicsMode 2 NtGdiSetICMProfile 2 NtGdiSetMapperFlags 2 NtGdiSetPolyFillMode 2 -NtGdiSetROP2 2 NtGdiSetStretchBltMode 2 -NtGdiSetTextAlign 2 -NtGdiSetTextColor 2 NtGdiSetViewportExtEx 4 NtGdiSetViewportOrgEx 4 NtGdiSetWindowExtEx 4 @@ -744,8 +739,6 @@ NtGdiEnumICMProfiles 3 NtGdiExtTextOut 8 NtGdiGdiComment 3 NtGdiGetAspectRatioFilterEx 2 -NtGdiGetBkColor 1 -NtGdiGetBkMode 1 NtGdiGetColorSpace 1 NtGdiGetCurrentPositionEx 2 NtGdiGetEnhMetaFile 1 @@ -762,10 +755,7 @@ NtGdiGetLogColorSpace 3 NtGdiGetMapMode 1 NtGdiGetPixelFormat 1 NtGdiGetPolyFillMode 1 -NtGdiGetROP2 1 NtGdiGetStretchBltMode 1 -NtGdiGetTextAlign 1 -NtGdiGetTextColor 1 NtGdiGetTextExtentPoint32 4 NtGdiMoveToEx 4 NtGdiOffsetViewportOrgEx 4