Author: jimtabor
Date: Tue Nov 27 04:01:39 2007
New Revision: 30806
URL:
http://svn.reactos.org/svn/reactos?rev=30806&view=rev
Log:
Removed NtGdiGet/Set/GraphicsMode/PolyFillMode/MapMode, update all related files. Tested
with Qemu and AbiWord. The underline problem is pre rev 30783.
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/dll/win32/gdi32/objects/region.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/objects/line.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 Tue Nov 27 04:01:39 2007
@@ -9,35 +9,6 @@
* Api that are hacked but we can not do correct implemtions yetm but using own syscall
*
*/
-
-/*
- * @implemented
- *
- */
-int
-STDCALL
-GetPolyFillMode(HDC hdc)
-{
- /* FIXME do not use reactos own syscall for this,
- * this hack need be remove
- */
- return NtGdiGetPolyFillMode(hdc);
-}
-
-
-/*
- * @implemented
- *
- */
-int
-STDCALL
-GetGraphicsMode(HDC hdc)
-{
- /* FIXME do not use reactos own syscall for this,
- * this hack need be remove
- */
- return NtGdiGetGraphicsMode(hdc);
-}
/*
* @implemented
@@ -89,18 +60,6 @@
return NtGdiSelectObject(hdc,hgdiobj);
}
-
-/*
- * @implemented
- *
- */
-int
-STDCALL
-GetMapMode(HDC hdc)
-{
- return NtGdiGetMapMode(hdc);
-}
-
/*
* @implemented
*
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 Tue Nov 27 04:01:39 2007
@@ -68,30 +68,6 @@
*/
int
STDCALL
-SetGraphicsMode(HDC hdc,
- int iMode)
-{
- /* FIXME share memory */
- return NtGdiSetGraphicsMode(hdc, iMode);
-}
-
-/*
- * @unimplemented
- */
-int
-STDCALL
-SetPolyFillMode(HDC hdc,
- int iPolyFillMode)
-{
- /* FIXME share memory */
- return NtGdiSetPolyFillMode(hdc, iPolyFillMode);
-}
-
-/*
- * @unimplemented
- */
-int
-STDCALL
SetStretchBltMode(HDC hdc, int iStretchMode)
{
/* FIXME share memory */
@@ -274,23 +250,6 @@
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
-
-/*
- * @unimplemented
- */
-HRGN
-STDCALL
-ExtCreateRegion(
- CONST XFORM * a0,
- DWORD a1,
- CONST RGNDATA * a2
- )
-{
- 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 Tue Nov 27 04:01:39 2007
@@ -910,9 +910,9 @@
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode;
#if 0
- if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
- {
- if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
return MFDRV_SetBkMode( hdc, iBkMode )
else
{
@@ -937,6 +937,112 @@
/*
* @implemented
+ *
+ */
+int
+STDCALL
+GetPolyFillMode(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->lFillMode;
+}
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetPolyFillMode(HDC hdc,
+ int iPolyFillMode)
+{
+ INT fmode;
+ 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_SetPolyFillMode( hdc, iPolyFillMode )
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if return EMFDRV_SetPolyFillMode( hdc, iPolyFillMode )
+ }
+ }
+ }
+#endif
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+
+ if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
+ {
+ if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
+ {
+ NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
+ Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+ }
+ }
+
+ fmode = Dc_Attr->lFillMode;
+ Dc_Attr->lFillMode = iPolyFillMode;
+
+ return fmode;
+}
+
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+GetGraphicsMode(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->iGraphicsMode;
+}
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetGraphicsMode(HDC hdc,
+ int iMode)
+{
+ INT oMode;
+ PDC_ATTR Dc_Attr;
+ if ((iMode < GM_COMPATIBLE) || (iMode > GM_ADVANCED))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+
+ if (iMode == Dc_Attr->iGraphicsMode) return iMode;
+
+ if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
+ {
+ if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
+ {
+ NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
+ Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+ }
+ }
+ oMode = Dc_Attr->iGraphicsMode;
+ Dc_Attr->iGraphicsMode = iMode;
+
+ return oMode;
+}
+
+/*
+ * @implemented
*/
HDC
STDCALL
@@ -1164,7 +1270,40 @@
HPALETTE hPal,
BOOL bForceBackground)
{
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SelectPalette( hDC, hPal, bForceBackground);
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hDC);
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if return EMFDRV_SelectPalette( hDC, hPal, bForceBackground);
+ }
+ }
+ }
+#endif
return NtUserSelectPalette(hDC, hPal, bForceBackground);
+}
+
+/*
+ * @implemented
+ *
+ */
+int
+STDCALL
+GetMapMode(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ return Dc_Attr->iMapMode;
}
/*
@@ -1177,6 +1316,20 @@
INT Mode
)
{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+#if 0
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetMapMode(hdc, Mode);
+ else
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+#endif
+ if ((Mode == Dc_Attr->iMapMode) && (Mode != MM_ISOTROPIC)) return Mode;
return GetAndSetDCDWord( hdc, GdiGetSetMapMode, Mode, 0, 0, 0 );
}
Modified: trunk/reactos/dll/win32/gdi32/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/region.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/region.c Tue Nov 27 04:01:39 2007
@@ -112,3 +112,27 @@
return NtGdiDeleteObjectApp((HGDIOBJ) hRgn);
}
+/*
+ * @implemented
+ */
+HRGN
+STDCALL
+ExtCreateRegion(
+ CONST XFORM * lpXform,
+ DWORD nCount,
+ CONST RGNDATA * lpRgnData
+ )
+{
+ if (lpRgnData)
+ {
+ if ((!lpXform) && (lpRgnData->rdh.nCount == 1))
+ {
+ PRECT pRect = (PRECT)&lpRgnData->Buffer[0];
+ return CreateRectRgn(pRect->left, pRect->top, pRect->right,
pRect->bottom);
+ }
+ return NtGdiExtCreateRegion((LPXFORM) lpXform, nCount,(LPRGNDATA) lpRgnData);
+ }
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+}
+
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 Tue Nov 27 04:01:39 2007
@@ -257,11 +257,6 @@
NtGdiGetFontLanguageInfo(HDC hDC);
/* Should be done in user-mode. */
-int
-STDCALL
-NtGdiGetGraphicsMode ( HDC hDC );
-
-/* Should be done in user-mode. */
BOOL
STDCALL
NtGdiGetICMProfile(HDC hDC,
@@ -274,17 +269,11 @@
NtGdiGetLogColorSpace(HCOLORSPACE hColorSpace,
LPLOGCOLORSPACEW Buffer,
DWORD Size);
-
-/* Should be done in user-mode using shared GDI Objects. */
-INT STDCALL NtGdiGetMapMode(HDC hDC);
-
+
/* Should be done in user-mode using shared GDI Objects. */
INT
STDCALL
NtGdiGetPixelFormat(HDC hDC);
-
-/* Should be done in user-mode using shared GDI Objects. */
-INT STDCALL NtGdiGetPolyFillMode(HDC hDC);
/* Should be done in user-mode using shared GDI Objects. */
INT STDCALL NtGdiGetStretchBltMode(HDC hDC);
@@ -388,14 +377,6 @@
CONST PBYTE Data
);
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-int
-STDCALL
-NtGdiSetGraphicsMode (
- HDC hDC,
- int Mode
- );
-
/* Should be done in user-mode. */
BOOL
STDCALL
@@ -407,9 +388,6 @@
STDCALL
NtGdiSetMapperFlags(HDC hDC,
DWORD Flag);
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode);
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c Tue Nov 27 04:01:39 2007
@@ -52,7 +52,7 @@
Dc_Attr->ptlCurrent.x = X;
Dc_Attr->ptlCurrent.y = Y;
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
PathIsOpen = PATH_IsPathOpen(dc->w.path);
@@ -76,7 +76,7 @@
if (Dc_Attr->ulDirty_ & DIRTY_PTFXCURRENT)
{
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
pt->x = Dc_Attr->ptlCurrent.x;
@@ -108,7 +108,7 @@
Dc_Attr->ptlCurrent.x = XEnd;
Dc_Attr->ptlCurrent.y = YEnd;
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &=
~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
return Ret;
@@ -166,7 +166,7 @@
Dc_Attr->ptlCurrent.x = XEnd;
Dc_Attr->ptlCurrent.y = YEnd;
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &=
~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
@@ -230,7 +230,7 @@
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
@@ -327,7 +327,7 @@
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
- IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
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 Tue Nov 27 04:01:39 2007
@@ -681,10 +681,8 @@
NtGdiSelectObject 2
NtGdiSetDIBits 7
NtGdiSetEnhMetaFileBits 2
-NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2
NtGdiSetMapperFlags 2
-NtGdiSetPolyFillMode 2
NtGdiSetStretchBltMode 2
NtGdiSetViewportExtEx 4
NtGdiSetViewportOrgEx 4
@@ -748,12 +746,9 @@
NtGdiGetEnhMetaFilePixelFormat 3
NtGdiGetFontFamilyInfo 4
NtGdiGetFontLanguageInfo 1
-NtGdiGetGraphicsMode 1
NtGdiGetICMProfile 3
NtGdiGetLogColorSpace 3
-NtGdiGetMapMode 1
NtGdiGetPixelFormat 1
-NtGdiGetPolyFillMode 1
NtGdiGetStretchBltMode 1
NtGdiGetTextExtentPoint32 4
NtGdiOffsetViewportOrgEx 4