diff --git a/reactos/win32ss/gdi/ntgdi/dc.h b/reactos/win32ss/gdi/ntgdi/dc.h index 53eeaaf2c04..7d646f75679 100644 --- a/reactos/win32ss/gdi/ntgdi/dc.h +++ b/reactos/win32ss/gdi/ntgdi/dc.h @@ -183,7 +183,11 @@ VOID FASTCALL DCU_SetDcUndeletable(HDC); BOOL FASTCALL IntSetDefaultRegion(PDC); ULONG TranslateCOLORREF(PDC pdc, COLORREF crColor); int FASTCALL GreSetStretchBltMode(HDC hdc, int iStretchMode); - +int FASTCALL GreGetBkMode(HDC); +int FASTCALL GreGetMapMode(HDC); +COLORREF FASTCALL GreGetTextColor(HDC); +COLORREF FASTCALL IntSetDCBrushColor(HDC,COLORREF); +COLORREF FASTCALL IntSetDCPenColor(HDC,COLORREF); INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID); diff --git a/reactos/win32ss/gdi/ntgdi/dcutil.c b/reactos/win32ss/gdi/ntgdi/dcutil.c index 7b89718d1ba..2fb9cb3e0c8 100644 --- a/reactos/win32ss/gdi/ntgdi/dcutil.c +++ b/reactos/win32ss/gdi/ntgdi/dcutil.c @@ -3,6 +3,42 @@ #define NDEBUG #include +int FASTCALL +GreGetBkMode(HDC hdc) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + return dc->pdcattr->lBkMode; +} + +int FASTCALL +GreGetMapMode(HDC hdc) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + return dc->pdcattr->iMapMode; +} + +COLORREF FASTCALL +GreGetTextColor(HDC hdc) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + return dc->pdcattr->ulForegroundClr; +} + COLORREF FASTCALL IntGdiSetBkColor(HDC hDC, COLORREF color) { @@ -96,6 +132,53 @@ IntGdiSetTextColor(HDC hDC, return crOldColor; } +COLORREF FASTCALL +IntSetDCBrushColor(HDC hdc, COLORREF crColor) +{ + COLORREF OldColor = CLR_INVALID; + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + else + { + OldColor = (COLORREF) dc->pdcattr->ulBrushClr; + dc->pdcattr->ulBrushClr = (ULONG) crColor; + + if ( dc->pdcattr->crBrushClr != crColor ) + { + dc->pdcattr->ulDirty_ |= DIRTY_FILL; + dc->pdcattr->crBrushClr = crColor; + } + } + return OldColor; +} + +COLORREF FASTCALL +IntSetDCPenColor(HDC hdc, COLORREF crColor) +{ + COLORREF OldColor; + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return CLR_INVALID; + } + + OldColor = (COLORREF)dc->pdcattr->ulPenClr; + dc->pdcattr->ulPenClr = (ULONG)crColor; + + if (dc->pdcattr->crPenClr != crColor) + { + dc->pdcattr->ulDirty_ |= DIRTY_LINE; + dc->pdcattr->crPenClr = crColor; + } + + return OldColor; +} + int FASTCALL GreSetStretchBltMode(HDC hDC, int iStretchMode) diff --git a/reactos/win32ss/gdi/ntgdi/fillshap.c b/reactos/win32ss/gdi/ntgdi/fillshap.c index a185073db3a..b3356a2e825 100644 --- a/reactos/win32ss/gdi/ntgdi/fillshap.c +++ b/reactos/win32ss/gdi/ntgdi/fillshap.c @@ -159,6 +159,17 @@ IntGdiPolyPolygon(DC *dc, return TRUE; } +BOOL FASTCALL +IntPolygon(HDC hdc, POINT *Point, int Count) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + return IntGdiPolygon(dc, Point, Count); +} /******************************************************************************/ diff --git a/reactos/win32ss/gdi/ntgdi/font.c b/reactos/win32ss/gdi/ntgdi/font.c index 74dd207eb4b..825a2802d32 100644 --- a/reactos/win32ss/gdi/ntgdi/font.c +++ b/reactos/win32ss/gdi/ntgdi/font.c @@ -13,8 +13,34 @@ #define NDEBUG #include +HFONT APIENTRY HfontCreate( IN PENUMLOGFONTEXDVW pelfw,IN ULONG cjElfw,IN LFTYPE lft,IN FLONG fl,IN PVOID pvCliData ); + /** Internal ******************************************************************/ +HFONT FASTCALL +GreCreateFontIndirectW( LOGFONTW *lplf ) +{ + if (lplf) + { + ENUMLOGFONTEXDVW Logfont; + + RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW)); + RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfFullName, + sizeof(Logfont.elfEnumLogfontEx.elfFullName)); + RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfStyle, + sizeof(Logfont.elfEnumLogfontEx.elfStyle)); + RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfScript, + sizeof(Logfont.elfEnumLogfontEx.elfScript)); + + Logfont.elfDesignVector.dvNumAxes = 0; + + RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR)); + + return HfontCreate((PENUMLOGFONTEXDVW)&Logfont, 0, 0, 0, NULL ); + } + else return NULL; +} + DWORD FASTCALL GreGetKerningPairs( diff --git a/reactos/win32ss/gdi/ntgdi/intgdi.h b/reactos/win32ss/gdi/ntgdi/intgdi.h index d7aa777b094..913470a8a02 100644 --- a/reactos/win32ss/gdi/ntgdi/intgdi.h +++ b/reactos/win32ss/gdi/ntgdi/intgdi.h @@ -45,6 +45,12 @@ IntGdiPolylineTo(DC *dc, LPPOINT pt, DWORD Count); +BOOL FASTCALL +GreMoveTo( HDC hdc, + INT x, + INT y, + LPPOINT pptOut); + /* Shape functions */ BOOL diff --git a/reactos/win32ss/gdi/ntgdi/line.c b/reactos/win32ss/gdi/ntgdi/line.c index edf98716661..d4d5505fce4 100644 --- a/reactos/win32ss/gdi/ntgdi/line.c +++ b/reactos/win32ss/gdi/ntgdi/line.c @@ -54,6 +54,21 @@ IntGdiMoveToEx(DC *dc, return TRUE; } +BOOL FASTCALL +GreMoveTo( HDC hdc, + INT x, + INT y, + LPPOINT pptOut) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + return IntGdiMoveToEx(dc, x, y, pptOut, TRUE); +} + // Should use Fx in pt // VOID FASTCALL diff --git a/reactos/win32ss/gdi/ntgdi/paint.h b/reactos/win32ss/gdi/ntgdi/paint.h index 698321c2b75..caea80af1f1 100644 --- a/reactos/win32ss/gdi/ntgdi/paint.h +++ b/reactos/win32ss/gdi/ntgdi/paint.h @@ -4,3 +4,4 @@ BOOL APIENTRY FillSolid (SURFOBJ* Surface, RECTL* Dimensions, ULONG iColor); BOOL APIENTRY FillPolygon ( DC* dc, SURFACE* pSurface, BRUSHOBJ* BrushObj, MIX RopMode, CONST PPOINT Points, INT Count, RECTL BoundRect ); BOOL FASTCALL IntFillPolygon(PDC dc, SURFACE *psurf, BRUSHOBJ *BrushObj, CONST PPOINT Points, int Count, RECTL DestRect, POINTL *BrushOrigin); +BOOL FASTCALL IntPolygon(HDC,POINT *,int); diff --git a/reactos/win32ss/gdi/ntgdi/text.c b/reactos/win32ss/gdi/ntgdi/text.c index 82ceb015ae2..bbab094006a 100644 --- a/reactos/win32ss/gdi/ntgdi/text.c +++ b/reactos/win32ss/gdi/ntgdi/text.c @@ -15,6 +15,17 @@ /** Functions *****************************************************************/ +BOOL FASTCALL +GreTextOutW( + HDC hdc, + int nXStart, + int nYStart, + LPCWSTR lpString, + int cchString) +{ + return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0); +} + /* flOpts : GetTextExtentPoint32W = 0 diff --git a/reactos/win32ss/gdi/ntgdi/text.h b/reactos/win32ss/gdi/ntgdi/text.h index 2fd1bbe4f24..7abb55390ce 100644 --- a/reactos/win32ss/gdi/ntgdi/text.h +++ b/reactos/win32ss/gdi/ntgdi/text.h @@ -131,6 +131,8 @@ DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD); BOOL FASTCALL GreGetTextExtentW(HDC,LPWSTR,INT,LPSIZE,UINT); BOOL FASTCALL GreGetTextExtentExW(HDC,LPWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG); DWORD FASTCALL GreGetGlyphIndicesW(HDC,LPWSTR,INT,LPWORD,DWORD,DWORD); +BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int); +HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * ); #define IntLockProcessPrivateFonts(W32Process) \ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)