Author: jimtabor
Date: Sun Nov 4 03:28:49 2007
New Revision: 30097
URL:
http://svn.reactos.org/svn/reactos?rev=30097&view=rev
Log:
Gdi32:
- Implement GdiGetCodePage and SetROP2. Still testing.
- Implemented batch support for SetBrushOrgEx. Still testing.
- Moved PatBlt and PolyPatBlt out of stubs.
Modified:
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/dll/win32/gdi32/objects/brush.c
trunk/reactos/dll/win32/gdi32/objects/text.c
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 Sun Nov 4 03:28:49 2007
@@ -105,19 +105,6 @@
*/
int
STDCALL
-SetROP2(HDC hdc,
- int fnDrawMode)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-int
-STDCALL
SetStretchBltMode(HDC hdc, int iStretchMode)
{
/* FIXME share memory */
@@ -205,20 +192,6 @@
{
/* FIXME share memory */
return NtGdiSetViewportOrgEx(hdc,X,Y,lpPoint);
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-SetBrushOrgEx(HDC hdc,
- int nXOrg,
- int nYOrg,
- LPPOINT lppt)
-{
- /* FIXME share memory */
- return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
}
/*
@@ -1513,18 +1486,6 @@
BOOL
STDCALL
GdiDrawStream(HDC dc, ULONG l, VOID *v)
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-GdiGetCodePage(HDC hdc)
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -2681,36 +2642,10 @@
}
-BOOL
-STDCALL
-PatBlt(HDC hdc,
- int nXLeft,
- int nYLeft,
- int nWidth,
- int nHeight,
- DWORD dwRop)
-{
- /* FIXME some part need be done in user mode */
- return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
-}
-
-BOOL
-STDCALL
-PolyPatBlt(IN HDC hdc,
- IN DWORD rop4,
- IN PPOLYPATBLT pPoly,
- IN DWORD Count,
- IN DWORD Mode)
-{
- /* FIXME some part need be done in user mode */
- return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
-}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/br…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/brush.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/brush.c Sun Nov 4 03:28:49 2007
@@ -179,3 +179,146 @@
return hBrush;
}
+BOOL
+STDCALL
+PatBlt(HDC hdc,
+ int nXLeft,
+ int nYLeft,
+ int nWidth,
+ int nHeight,
+ DWORD dwRop)
+{
+ /* FIXME some part need be done in user mode */
+ return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
+}
+
+BOOL
+STDCALL
+PolyPatBlt(IN HDC hdc,
+ IN DWORD rop4,
+ IN PPOLYPATBLT pPoly,
+ IN DWORD Count,
+ IN DWORD Mode)
+{
+ /* FIXME some part need be done in user mode */
+ return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
+}
+
+
+/*
+ * @implemented
+ */
+int
+STDCALL
+SetROP2(HDC hdc,
+ int fnDrawMode)
+{
+ PDC_ATTR Dc_Attr;
+ INT Old_ROP2;
+
+#if 0
+// Handle something other than a normal dc object.
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_SetROP2( hdc, fnDrawMode);
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ return EMFDRV_SetROP2(( hdc, fnDrawMode);
+ }
+ return FALSE;
+ }
+ }
+#endif
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
+
+ if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG) hdc)
+ {
+ if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
+ {
+ NtGdiFlush();
+ Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
+ }
+ }
+
+ Old_ROP2 = Dc_Attr->jROP2;
+ Dc_Attr->jROP2 = fnDrawMode;
+
+ return Old_ROP2;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+SetBrushOrgEx(HDC hdc,
+ int nXOrg,
+ int nYOrg,
+ LPPOINT lppt)
+{
+#if 0
+// Handle something other than a normal dc object.
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( (pLDC == NULL) || (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC))
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ return EMFDRV_SetBrushOrg(hdc, nXOrg, nYOrg); // ReactOS only.
+ }
+ return FALSE;
+ }
+#endif
+#if 0
+ PDC_ATTR Dc_Attr;
+
+ if (GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr))
+ {
+ PTEB pTeb = NtCurrentTeb();
+ if (lppt)
+ {
+ lppt->x = Dc_Attr->ptlBrushOrigin.x;
+ lppt->y = Dc_Attr->ptlBrushOrigin.y;
+ }
+ if ((nXOrg == Dc_Attr->ptlBrushOrigin.x) && (nYOrg ==
Dc_Attr->ptlBrushOrigin.y))
+ return TRUE;
+
+ if(((pTeb->GdiTebBatch.HDC == 0) || (pTeb->GdiTebBatch.HDC == (ULONG)hdc))
&&
+ ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSSETBRHORG)) <= GDIBATCHBUFSIZE)
&&
+ (!(Dc_Attr->ulDirty_ & DC_DIBSECTION)) )
+ {
+ PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG)(&pTeb->GdiTebBatch.Buffer[0] +
+ pTeb->GdiTebBatch.Offset);
+
+ Dc_Attr->ptlBrushOrigin.x = nXOrg;
+ Dc_Attr->ptlBrushOrigin.y = nYOrg;
+
+ pgSBO->gbHdr.Cmd = GdiBCSetBrushOrg;
+ pgSBO->gbHdr.Size = sizeof(GDIBSSETBRHORG);
+ pgSBO->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
+
+ pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG);
+ pTeb->GdiTebBatch.HDC = (ULONG)hdc;
+ pTeb->GdiBatchCount++;
+ if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
+
+ return TRUE;
+ }
+ }
+#endif
+ return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
+}
+
Modified: trunk/reactos/dll/win32/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/text.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/text.c Sun Nov 4 03:28:49 2007
@@ -44,6 +44,20 @@
int cbString)
{
return NtGdiExtTextOut(hdc, nXStart, nYStart, 0, NULL, lpString, cbString, NULL);
+}
+
+
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+GdiGetCodePage(HDC hdc)
+{
+ PDC_ATTR Dc_Attr;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0;
+ if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc));
+ return LOWORD(Dc_Attr->iCS_CP);
}