Author: jimtabor
Date: Tue Aug 21 13:28:51 2007
New Revision: 28446
URL:
http://svn.reactos.org/svn/reactos?rev=28446&view=rev
Log:
- Removed NtGdiSetMapMode from w32ksvc.db and updated ntgdibad.h.
- Moved NtGdiSetMapMode to an internal function.
- Changed NtGdiPaintRgn and added IntdiPaintRgn.
- Cleaned up win32k path.c.
- Connected the gdi32 parts.
Modified:
trunk/reactos/dll/win32/gdi32/gdi32.def
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/include/coord.h
trunk/reactos/subsystems/win32/win32k/include/region.h
trunk/reactos/subsystems/win32/win32k/objects/coord.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/path.c
trunk/reactos/subsystems/win32/win32k/objects/region.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.def?…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.def (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.def Tue Aug 21 13:28:51 2007
@@ -555,7 +555,7 @@
SetLayout@8
SetLayoutWidth@12
SetMagicColors@12
-SetMapMode@8=NtGdiSetMapMode@8
+SetMapMode@8
SetMapperFlags@8
SetMetaFileBitsEx@8
SetMetaRgn@4
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 Aug 21 13:28:51 2007
@@ -932,3 +932,18 @@
{
return NtUserSelectPalette(hDC, hPal, bForceBackground);
}
+
+/*
+ * @implemented
+ */
+INT
+STDCALL
+SetMapMode(
+ HDC hdc,
+ INT Mode
+ )
+{
+ return GetAndSetDCDWord( hdc, GdiGetSetMapMode, Mode, 0, 0, 0 );
+}
+
+
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 Aug 21 13:28:51 2007
@@ -643,14 +643,6 @@
LPWSTR Filename);
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
-int
-STDCALL
-NtGdiSetMapMode (
- HDC hDC,
- int MapMode
- );
-
-/* Needs to be done in user-mode, using shared GDI Object Attributes. */
DWORD
STDCALL
NtGdiSetMapperFlags(HDC hDC,
Modified: trunk/reactos/subsystems/win32/win32k/include/coord.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/coord.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/coord.h Tue Aug 21 13:28:51 2007
@@ -21,6 +21,8 @@
FASTCALL
IntLPtoDP ( PDC dc, LPPOINT Points, INT Count );
+int STDCALL IntGdiSetMapMode(PDC, int);
+
BOOL
FASTCALL
IntGdiModifyWorldTransform(PDC pDc,
Modified: trunk/reactos/subsystems/win32/win32k/include/region.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/region.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/region.h Tue Aug 21 13:28:51 2007
@@ -17,5 +17,7 @@
HRGN FASTCALL RGNDATA_AllocRgn(INT n);
BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody);
+BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
+
#endif
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 Tue Aug 21 13:28:51 2007
@@ -454,6 +454,7 @@
}
_SEH_END;
+ DCU_UpdateUserXForms(dc,
WORLD_TO_PAGE_IDENTITY|DEVICE_TO_WORLD_INVALID|WORLD_XFORM_CHANGED );
DC_UnlockDc(dc);
return Ret;
}
@@ -621,18 +622,10 @@
int
STDCALL
-NtGdiSetMapMode(HDC hDC,
+IntGdiSetMapMode(PDC dc,
int MapMode)
{
int PrevMapMode;
- PDC dc;
-
- dc = DC_LockDc(hDC);
- if (!dc)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return 0;
- }
PrevMapMode = dc->Dc_Attr.iMapMode;
@@ -692,8 +685,6 @@
DC_UpdateXforms(dc);
DCU_UpdateUserXForms(dc,
WORLD_TO_PAGE_IDENTITY|DEVICE_TO_WORLD_INVALID|WORLD_XFORM_CHANGED );
}
-
- DC_UnlockDc(dc);
return PrevMapMode;
}
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 Tue Aug 21 13:28:51 2007
@@ -2269,8 +2269,7 @@
case GdiGetSetMapperFlagsInternal:
break;
case GdiGetSetMapMode:
- SafeResult = dc->Dc_Attr.iMapMode;
- dc->Dc_Attr.iMapMode = dwIn;
+ SafeResult = IntGdiSetMapMode( dc, dwIn);
break;
case GdiGetSetArcDirection:
if (dwIn != AD_COUNTERCLOCKWISE && dwIn != AD_CLOCKWISE)
Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/path.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/path.c Tue Aug 21 13:28:51 2007
@@ -412,11 +412,11 @@
*/
/* Save the information about the old mapping mode */
- mapMode = NtGdiGetMapMode( dc->hSelf );
- NtGdiGetViewportExtEx( dc->hSelf, &ptViewportExt );
- NtGdiGetViewportOrgEx( dc->hSelf, &ptViewportOrg );
- NtGdiGetWindowExtEx( dc->hSelf, &ptWindowExt );
- NtGdiGetWindowOrgEx( dc->hSelf, &ptWindowOrg );
+ mapMode = dc->Dc_Attr.iMapMode;
+ ptViewportExt = dc->Dc_Attr.szlViewportExt;
+ ptViewportOrg = dc->Dc_Attr.ptlViewportOrg;
+ ptWindowExt = dc->Dc_Attr.szlWindowExt;
+ ptWindowOrg = dc->Dc_Attr.ptlWindowOrg;
/* Save world transform
* NB: The Windows documentation on world transforms would lead one to
@@ -424,32 +424,36 @@
* tests show that resetting the graphics mode to GM_COMPATIBLE does
* not reset the world transform.
*/
- NtGdiGetTransform( dc->hSelf, GdiWorldSpaceToPageSpace, &xform );
-
+ xform = dc->w.xformWorld2Wnd;
+
/* Set MM_TEXT */
- NtGdiSetMapMode( dc->hSelf, MM_TEXT );
- NtGdiSetViewportOrgEx( dc->hSelf, 0, 0, NULL );
- NtGdiSetWindowOrgEx( dc->hSelf, 0, 0, NULL );
- graphicsMode = NtGdiGetGraphicsMode( dc->hSelf );
- NtGdiSetGraphicsMode( dc->hSelf, GM_ADVANCED );
- NtGdiModifyWorldTransform( dc->hSelf, &xform, MWT_IDENTITY );
- NtGdiSetGraphicsMode( dc->hSelf, graphicsMode );
+ IntGdiSetMapMode( dc, MM_TEXT );
+ dc->Dc_Attr.ptlViewportOrg.x = 0;
+ dc->Dc_Attr.ptlViewportOrg.y = 0;
+ dc->Dc_Attr.ptlWindowOrg.x = 0;
+ dc->Dc_Attr.ptlWindowOrg.y = 0;
+
+ graphicsMode = dc->Dc_Attr.iGraphicsMode;
+ dc->Dc_Attr.iGraphicsMode = GM_ADVANCED;
+ IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
+ dc->Dc_Attr.iGraphicsMode = graphicsMode;
/* Paint the region */
- NtGdiPaintRgn( dc->hSelf, hrgn );
+ IntGdiPaintRgn( dc, hrgn );
NtGdiDeleteObject( hrgn );
/* Restore the old mapping mode */
- NtGdiSetMapMode( dc->hSelf, mapMode );
- NtGdiSetViewportExtEx( dc->hSelf, ptViewportExt.cx, ptViewportExt.cy, NULL );
- NtGdiSetViewportOrgEx( dc->hSelf, ptViewportOrg.x, ptViewportOrg.y, NULL );
- NtGdiSetWindowExtEx( dc->hSelf, ptWindowExt.cx, ptWindowExt.cy, NULL );
- NtGdiSetWindowOrgEx( dc->hSelf, ptWindowOrg.x, ptWindowOrg.y, NULL );
+ IntGdiSetMapMode( dc, mapMode );
+ dc->Dc_Attr.szlViewportExt = ptViewportExt;
+ dc->Dc_Attr.ptlViewportOrg = ptViewportOrg;
+ dc->Dc_Attr.szlWindowExt = ptWindowExt;
+ dc->Dc_Attr.ptlWindowOrg = ptWindowOrg;
/* Go to GM_ADVANCED temporarily to restore the world transform */
- graphicsMode = NtGdiGetGraphicsMode( dc->hSelf );
- NtGdiSetGraphicsMode( dc->hSelf, GM_ADVANCED );
- NtGdiModifyWorldTransform( dc->hSelf, &xform, MWT_MAX+1 );
- NtGdiSetGraphicsMode( dc->hSelf, graphicsMode );
+ graphicsMode = dc->Dc_Attr.iGraphicsMode;
+ dc->Dc_Attr.iGraphicsMode = GM_ADVANCED;
+ IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
+ dc->Dc_Attr.iGraphicsMode = graphicsMode;
+// DCU_UpdateUserXForms(dc,
WORLD_TO_PAGE_IDENTITY|DEVICE_TO_WORLD_INVALID|WORLD_XFORM_CHANGED );
return TRUE;
}
return FALSE;
@@ -1623,7 +1627,7 @@
IntDPtoLP(dc, &pt, 1);
IntGdiMoveToEx(dc, pt.x, pt.y, NULL);
}
-
+ DCU_UpdateUserXForms(dc,
WORLD_TO_PAGE_IDENTITY|DEVICE_TO_WORLD_INVALID|WORLD_XFORM_CHANGED );
DPRINT("Leave %s, ret=%d\n", __FUNCTION__, ret);
return ret;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c Tue Aug 21 13:28:51 2007
@@ -2524,13 +2524,11 @@
}
BOOL
-STDCALL
-NtGdiPaintRgn(HDC hDC,
- HRGN hRgn)
+FASTCALL
+IntGdiPaintRgn(PDC dc, HRGN hRgn)
{
//RECT box;
- HRGN tmpVisRgn; //, prevVisRgn;
- DC *dc = DC_LockDc(hDC);
+ HRGN tmpVisRgn; //, prevVisRgn;
PROSRGNDATA visrgn;
CLIPOBJ* ClipRegion;
BOOL bRet = FALSE;
@@ -2595,9 +2593,22 @@
NtGdiDeleteObject( tmpVisRgn );
// Fill the region
+ return TRUE;
+}
+
+BOOL
+STDCALL
+NtGdiPaintRgn(HDC hDC,
+ HRGN hRgn)
+{
+ DC *dc = DC_LockDc(hDC);
+
+ BOOL Ret = IntGdiPaintRgn(dc, hRgn);
+
DC_UnlockDc( dc );
- return TRUE;
-}
+ return Ret;
+}
+
BOOL
STDCALL
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 Aug 21 13:28:51 2007
@@ -698,7 +698,6 @@
NtGdiSetEnhMetaFileBits 2
NtGdiSetGraphicsMode 2
NtGdiSetICMProfile 2
-NtGdiSetMapMode 2
NtGdiSetMapperFlags 2
NtGdiSetPaletteEntries 4
NtGdiSetPixelV 4