Author: jimtabor
Date: Wed Nov 28 10:52:51 2007
New Revision: 30831
URL:
http://svn.reactos.org/svn/reactos?rev=30831&view=rev
Log:
- Removed NtGdiGet/SetStretchBltMode, updated all related files.
- Implement GetHFONT & Get/SetLayout/Width.
- Add layout types to PSDK.
- Updates and small cleanups.
Modified:
trunk/reactos/dll/win32/gdi32/misc/hacks.c
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/include/psdk/wingdi.h
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/include/reactos/win32k/ntgdihdl.h
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/objects/coord.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/stubs/stubs.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/misc/hacks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/hacks…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/hacks.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/hacks.c Wed Nov 28 10:52:51 2007
@@ -64,17 +64,6 @@
* @implemented
*
*/
-int
-STDCALL
-GetStretchBltMode(HDC hdc)
-{
- return NtGdiGetStretchBltMode(hdc);
-}
-
-/*
- * @implemented
- *
- */
BOOL
STDCALL
OffsetViewportOrgEx(HDC hdc,
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Wed Nov 28 10:52:51 2007
@@ -61,17 +61,6 @@
{
/* FIXME share memory */
return NtGdiSetDIBits(hdc, hbmp, uStartScan, cScanLines, lpvBits, lpbmi,
fuColorUse);
-}
-
-/*
- * @unimplemented
- */
-int
-STDCALL
-SetStretchBltMode(HDC hdc, int iStretchMode)
-{
- /* FIXME share memory */
- return NtGdiSetStretchBltMode(hdc, iStretchMode);
}
/*
@@ -1439,31 +1428,6 @@
}
/*
- * @unimplemented
- */
-HFONT
-STDCALL
-GetHFONT(HDC dc)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-GetLayout(HDC hdc
-)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
* @implemented
*/
BOOL
@@ -1583,33 +1547,6 @@
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-SetLayout(HDC hdc,
- DWORD dwLayout)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-
/*
* @implemented
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Wed Nov 28 10:52:51 2007
@@ -1515,7 +1515,7 @@
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
+ return NULL;
}
if (pLDC->iType == LDC_EMFLDC)
{
@@ -1560,11 +1560,134 @@
else
{
SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
+ return 0;
}
#endif
if ((Mode == Dc_Attr->iMapMode) && (Mode != MM_ISOTROPIC)) return Mode;
return GetAndSetDCDWord( hdc, GdiGetSetMapMode, Mode, 0, 0, 0 );
}
-
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+GetStretchBltMode(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->lStretchBltMode;
+}
+
+/*
+ * @implemented
+ */
+int
+STDCALL
+SetStretchBltMode(HDC hdc, int iStretchMode)
+{
+ INT oSMode;
+ PDC_ATTR Dc_Attr;
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetStretchBltMode( hdc, iStretchMode);
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return 0;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ return EMFDRV_SetStretchBltMode( hdc, iStretchMode);
+ }
+ }
+ }
+#endif
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+
+ oSMode = Dc_Attr->lStretchBltMode;
+ Dc_Attr->lStretchBltMode = iStretchMode;
+
+ // Wine returns an error here. We set the default.
+ if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode =
WHITEONBLACK;
+
+ Dc_Attr->jStretchBltMode = iStretchMode;
+
+ return oSMode;
+}
+
+/*
+ * @implemented
+ */
+HFONT
+STDCALL
+GetHFONT(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return NULL;
+ return Dc_Attr->hlfntNew;
+}
+
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+GetLayout(HDC hdc
+)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return GDI_ERROR;
+ return Dc_Attr->dwLayout;
+}
+
+
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+SetLayout(HDC hdc,
+ DWORD dwLayout)
+{
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetLayout( hdc, dwLayout);
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return 0;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ return EMFDRV_SetLayout( hdc, dwLayout);
+ }
+ }
+ }
+#endif
+ if (!GdiIsHandleValid((HGDIOBJ) hdc)) return GDI_ERROR;
+ return NtGdiSetLayout( hdc, -1, dwLayout);
+}
+
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout)
+{
+ if (!GdiIsHandleValid((HGDIOBJ) hdc)) return GDI_ERROR;
+ return NtGdiSetLayout( hdc, wox, dwLayout);
+}
+
Modified: trunk/reactos/include/psdk/wingdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/wingdi.h (original)
+++ trunk/reactos/include/psdk/wingdi.h Wed Nov 28 10:52:51 2007
@@ -1193,7 +1193,10 @@
#define WGL_SWAP_UNDERLAY14 0x20000000
#define WGL_SWAP_UNDERLAY15 0x40000000
#define AC_SRC_OVER 0
-#define LAYOUT_RTL 1
+#define LAYOUT_RTL 1 // Right to left
+#define LAYOUT_BTT 2 // Bottom to top
+#define LAYOUT_VBH 4 // Vertical before horizontal
+#define LAYOUT_ORIENTATIONMASK (LAYOUT_RTL | LAYOUT_BTT | LAYOUT_VBH)
#define LAYOUT_BITMAPORIENTATIONPRESERVED 8
#if (WINVER > 0x400)
#define CS_ENABLE 0x00000001
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Wed Nov 28 10:52:51 2007
@@ -276,9 +276,6 @@
NtGdiGetPixelFormat(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
NtGdiGetTextCharset(HDC hDC);
@@ -388,9 +385,6 @@
STDCALL
NtGdiSetMapperFlags(HDC hDC,
DWORD Flag);
-
-/* 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. */
BOOL
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Wed Nov 28 10:52:51 2007
@@ -378,6 +378,9 @@
HDC hNext;
HDC hPrev;
+ RECTL erclWindow;
+ RECTL erclBounds;
+
CLIPOBJ *CombinedClip;
XLATEOBJ *XlateBrush;
XLATEOBJ *XlatePen;
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h Wed Nov 28 10:52:51 2007
@@ -42,6 +42,7 @@
PERESOURCE hsemDevLock;
+ PVOID pvGammaRamp;
PVOID pfnSync;
DHPDEV PDev;
@@ -112,6 +113,7 @@
UINT FASTCALL NtGdiSetTextAlign(HDC hDC, UINT Mode);
UINT STDCALL NtGdiGetTextAlign(HDC hDC);
COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
+INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
/* For Metafile and MetaEnhFile not in windows this struct taken from wine cvs
15/9-2006*/
typedef struct
Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/coord.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/coord.c Wed Nov 28 10:52:51 2007
@@ -959,5 +959,43 @@
return TRUE;
}
+ /*
+ * @unimplemented
+ */
+DWORD
+APIENTRY
+NtGdiSetLayout(
+ IN HDC hdc,
+ IN LONG wox,
+ IN DWORD dwLayout)
+{
+ PDC dc;
+ PDC_ATTR Dc_Attr;
+ DWORD oLayout;
+
+ 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;
+
+ Dc_Attr->dwLayout = dwLayout;
+ oLayout = Dc_Attr->dwLayout;
+
+ if (!(dwLayout & LAYOUT_ORIENTATIONMASK))
+ {
+ DC_UnlockDc(dc);
+ return oLayout;
+ }
+
+// DC_UpdateXforms(dc);
+ DC_UnlockDc(dc);
+
+ UNIMPLEMENTED;
+ return GDI_ERROR;
+}
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Wed Nov 28 10:52:51 2007
@@ -827,11 +827,15 @@
((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cPlanes;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
- if (! CreateAsIC)
+ if (!CreateAsIC)
{
NewDC->PalIndexed = NtGdiGetStockObject(DEFAULT_PALETTE);
NewDC->w.hPalette = PrimarySurface.DevInfo.hpalDefault;
nDc_Attr->jROP2 = R2_COPYPEN;
+
+ NewDC->erclWindow.top = NewDC->erclWindow.left = 0;
+ NewDC->erclWindow.right = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes;
+ NewDC->erclWindow.bottom = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes;
DC_UnlockDc( NewDC );
@@ -1189,6 +1193,7 @@
if(!nDc_Attr) nDc_Attr = &newdc->Dc_Attr;
newdc->w.flags = dc->w.flags | DC_SAVED;
+ nDc_Attr->dwLayout = Dc_Attr->dwLayout;
nDc_Attr->hpen = Dc_Attr->hpen;
nDc_Attr->hbrush = Dc_Attr->hbrush;
nDc_Attr->hlfntNew = Dc_Attr->hlfntNew;
@@ -1272,6 +1277,7 @@
dc->w.hDevice = dcs->w.hDevice;
#endif
+ Dc_Attr->dwLayout = sDc_Attr->dwLayout;
dc->w.totalExtent = dcs->w.totalExtent;
Dc_Attr->jROP2 = sDc_Attr->jROP2;
Dc_Attr->jFillMode = sDc_Attr->jFillMode;
Modified: trunk/reactos/subsystems/win32/win32k/stubs/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/st…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/stubs/stubs.c (original)
+++ trunk/reactos/subsystems/win32/win32k/stubs/stubs.c Wed Nov 28 10:52:51 2007
@@ -3172,20 +3172,6 @@
/*
* @unimplemented
*/
-DWORD
-APIENTRY
-NtGdiSetLayout(
- IN HDC hdc,
- IN LONG wox,
- IN DWORD dwLayout)
-{
- UNIMPLEMENTED;
- return 0;
-}
-
- /*
- * @unimplemented
- */
INT
APIENTRY
NtGdiStretchDIBitsInternal(
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Wed Nov 28 10:52:51 2007
@@ -683,7 +683,6 @@
NtGdiSetEnhMetaFileBits 2
NtGdiSetICMProfile 2
NtGdiSetMapperFlags 2
-NtGdiSetStretchBltMode 2
NtGdiSetViewportExtEx 4
NtGdiSetViewportOrgEx 4
NtGdiSetWindowExtEx 4
@@ -749,7 +748,6 @@
NtGdiGetICMProfile 3
NtGdiGetLogColorSpace 3
NtGdiGetPixelFormat 1
-NtGdiGetStretchBltMode 1
NtGdiGetTextExtentPoint32 4
NtGdiOffsetViewportOrgEx 4
NtGdiOffsetWindowOrgEx 4