mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 10:33:48 +00:00
[Win32ss]
- Add more GDI drawing support. svn path=/trunk/; revision=60394
This commit is contained in:
parent
77ebd8b527
commit
d7afb702a8
9 changed files with 160 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -3,6 +3,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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -13,8 +13,34 @@
|
|||
#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
|
||||
GreGetKerningPairs(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue