Author: jimtabor
Date: Fri Sep 27 23:36:39 2013
New Revision: 60394
URL:
http://svn.reactos.org/svn/reactos?rev=60394&view=rev
Log:
[Win32ss]
- Add more GDI drawing support.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dc.h
trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
trunk/reactos/win32ss/gdi/ntgdi/font.c
trunk/reactos/win32ss/gdi/ntgdi/intgdi.h
trunk/reactos/win32ss/gdi/ntgdi/line.c
trunk/reactos/win32ss/gdi/ntgdi/paint.h
trunk/reactos/win32ss/gdi/ntgdi/text.c
trunk/reactos/win32ss/gdi/ntgdi/text.h
Modified: trunk/reactos/win32ss/gdi/ntgdi/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dc.h?rev…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -183,7 +183,11 @@
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);
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -2,6 +2,42 @@
#define NDEBUG
#include <debug.h>
+
+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)
@@ -94,6 +130,53 @@
DC_UnlockDc(pdc);
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
Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -159,6 +159,17 @@
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);
+}
/******************************************************************************/
Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -13,7 +13,33 @@
#define NDEBUG
#include <debug.h>
+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
Modified: trunk/reactos/win32ss/gdi/ntgdi/intgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/intgdi.h…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/intgdi.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/intgdi.h [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -44,6 +44,12 @@
IntGdiPolylineTo(DC *dc,
LPPOINT pt,
DWORD Count);
+
+BOOL FASTCALL
+GreMoveTo( HDC hdc,
+ INT x,
+ INT y,
+ LPPOINT pptOut);
/* Shape functions */
Modified: trunk/reactos/win32ss/gdi/ntgdi/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/line.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -52,6 +52,21 @@
return PATH_MoveTo ( 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
Modified: trunk/reactos/win32ss/gdi/ntgdi/paint.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/paint.h?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/paint.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/paint.h [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -4,3 +4,4 @@
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);
Modified: trunk/reactos/win32ss/gdi/ntgdi/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/text.c [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -14,6 +14,17 @@
#include <debug.h>
/** 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 :
Modified: trunk/reactos/win32ss/gdi/ntgdi/text.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.h?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] Fri Sep 27 23:36:39 2013
@@ -131,6 +131,8 @@
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)