Author: jimtabor
Date: Fri Aug 7 05:56:01 2015
New Revision: 68608
URL:
http://svn.reactos.org/svn/reactos?rev=68608&view=rev
Log:
[NtGdi]
- Add more function for NtUser.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/coord.c
trunk/reactos/win32ss/gdi/ntgdi/coord.h
trunk/reactos/win32ss/gdi/ntgdi/dc.h
trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
trunk/reactos/win32ss/gdi/ntgdi/text.c
trunk/reactos/win32ss/gdi/ntgdi/text.h
Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] Fri Aug 7 05:56:01 2015
@@ -894,6 +894,38 @@
return iPrevMapMode;
}
+BOOL
+FASTCALL
+GreSetViewportOrgEx(
+ HDC hDC,
+ int X,
+ int Y,
+ LPPOINT Point)
+{
+ PDC dc;
+ PDC_ATTR pdcattr;
+
+ dc = DC_LockDc(hDC);
+ if (!dc)
+ {
+ EngSetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ pdcattr = dc->pdcattr;
+
+ if (Point)
+ {
+ Point->x = pdcattr->ptlViewportOrg.x;
+ Point->y = pdcattr->ptlViewportOrg.y;
+ }
+
+ pdcattr->ptlViewportOrg.x = X;
+ pdcattr->ptlViewportOrg.y = Y;
+ pdcattr->flXform |= PAGE_XLATE_CHANGED;
+
+ DC_UnlockDc(dc);
+ return TRUE;
+}
BOOL
APIENTRY
@@ -1239,6 +1271,89 @@
}
BOOL APIENTRY
+GreGetDCPoint(
+ HDC hDC,
+ UINT iPoint,
+ PPOINTL Point)
+{
+ BOOL Ret = TRUE;
+ DC *pdc;
+ SIZE Size;
+ PSIZEL pszlViewportExt;
+
+ if (!Point)
+ {
+ EngSetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ pdc = DC_LockDc(hDC);
+ if (!pdc)
+ {
+ EngSetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ switch (iPoint)
+ {
+ case GdiGetViewPortExt:
+ pszlViewportExt = DC_pszlViewportExt(pdc);
+ Point->x = pszlViewportExt->cx;
+ Point->y = pszlViewportExt->cy;
+ break;
+
+ case GdiGetWindowExt:
+ Point->x = pdc->pdcattr->szlWindowExt.cx;
+ Point->y = pdc->pdcattr->szlWindowExt.cy;
+ break;
+
+ case GdiGetViewPortOrg:
+ *Point = pdc->pdcattr->ptlViewportOrg;
+ break;
+
+ case GdiGetWindowOrg:
+ *Point = pdc->pdcattr->ptlWindowOrg;
+ break;
+
+ case GdiGetDCOrg:
+ *Point = pdc->ptlDCOrig;
+ break;
+
+ case GdiGetAspectRatioFilter:
+ DC_vGetAspectRatioFilter(pdc, &Size);
+ Point->x = Size.cx;
+ Point->y = Size.cy;
+ break;
+
+ default:
+ EngSetLastError(ERROR_INVALID_PARAMETER);
+ Ret = FALSE;
+ break;
+ }
+
+ DC_UnlockDc(pdc);
+ return Ret;
+}
+
+BOOL
+WINAPI
+GreGetWindowExtEx(
+ _In_ HDC hdc,
+ _Out_ LPSIZE lpSize)
+{
+ return GreGetDCPoint(hdc, GdiGetWindowExt, (PPOINTL)lpSize);
+}
+
+BOOL
+WINAPI
+GreGetViewportExtEx(
+ _In_ HDC hdc,
+ _Out_ LPSIZE lpSize)
+{
+ return GreGetDCPoint(hdc, GdiGetViewPortExt, (PPOINTL)lpSize);
+}
+
+BOOL APIENTRY
NtGdiGetDCPoint(
HDC hDC,
UINT iPoint,
Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.h?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.h [iso-8859-1] Fri Aug 7 05:56:01 2015
@@ -156,3 +156,7 @@
int APIENTRY IntGdiSetMapMode(PDC, int);
BOOL FASTCALL GreLPtoDP(HDC, LPPOINT, INT);
BOOL FASTCALL GreDPtoLP(HDC, LPPOINT, INT);
+BOOL APIENTRY GreGetDCPoint(HDC,UINT,PPOINTL);
+BOOL WINAPI GreGetWindowExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
+BOOL WINAPI GreGetViewportExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
+BOOL FASTCALL GreSetViewportOrgEx(HDC,int,int,LPPOINT);
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 Aug 7 05:56:01 2015
@@ -181,7 +181,7 @@
COLORREF FASTCALL GreGetTextColor(HDC);
COLORREF FASTCALL IntSetDCBrushColor(HDC,COLORREF);
COLORREF FASTCALL IntSetDCPenColor(HDC,COLORREF);
-
+int FASTCALL GreGetGraphicsMode(HDC);
INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID);
PPDEVOBJ FASTCALL IntEnumHDev(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 Aug 7 05:56:01 2015
@@ -239,6 +239,21 @@
DC_UnlockDc(pdc);
}
return oSMode;
+}
+
+int FASTCALL
+GreGetGraphicsMode(HDC hdc)
+{
+ PDC dc;
+ int GraphicsMode;
+ if (!(dc = DC_LockDc(hdc)))
+ {
+ EngSetLastError(ERROR_INVALID_HANDLE);
+ return CLR_INVALID;
+ }
+ GraphicsMode = dc->pdcattr->iGraphicsMode;;
+ DC_UnlockDc(dc);
+ return GraphicsMode;
}
VOID
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 Aug 7 05:56:01 2015
@@ -146,6 +146,18 @@
return Result;
}
+BOOL
+WINAPI
+GreGetTextMetricsW(
+ _In_ HDC hdc,
+ _Out_ LPTEXTMETRICW lptm)
+{
+ TMW_INTERNAL tmwi;
+ if (!ftGdiGetTextMetricsW(hdc, &tmwi)) return FALSE;
+ *lptm = tmwi.TextMetric;
+ return TRUE;
+}
+
DWORD
APIENTRY
NtGdiGetCharSet(HDC hDC)
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 Aug 7 05:56:01 2015
@@ -132,6 +132,7 @@
BOOL FASTCALL GreGetTextExtentExW(HDC,LPWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG);
BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int);
HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * );
+BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm);
#define IntLockProcessPrivateFonts(W32Process) \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)