[8/14] gdiplus: added GdipCreateMetafileFromEmf stub

Evan Stade estade at gmail.com
Tue Jul 24 19:19:05 CDT 2007


Hi,

The next few patches are a series of stub functions.  They allow
pptviewer to render some presentations (except for the images therein)
that would otherwise just crash pptviewer. These stubs actually allow
pptviewer to view some presentations that pptviewer cannot render with
native gdiplus (with native gdiplus the screen is black whereas with
builtin gdiplus the only thing missing is the image).

changelog:
*added GpMetafile type
*added GdipCreateMetafileFromEmf stub

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   14 ++++++++++++++
 include/gdiplusflat.h     |    1 +
 include/gdiplusgpstubs.h  |    4 ++++
 4 files changed, 20 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 49732db..5481670 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -99,7 +99,7 @@
 @ stub GdipCreateMatrix3
 @ stub GdipCreateMatrix3I
 @ stdcall GdipCreateMatrix(ptr)
-@ stub GdipCreateMetafileFromEmf
+@ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
 @ stub GdipCreateMetafileFromFile
 @ stub GdipCreateMetafileFromStream
 @ stub GdipCreateMetafileFromWmf
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 6c8f13e..f024d7c 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -804,6 +804,20 @@ GpStatus WINGDIPAPI GdipCreateFromHWND(H
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete,
+    GpMetafile **metafile)
+{
+    static int calls;
+
+    if(!hemf || !metafile)
+        return InvalidParameter;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
 {
     if(!graphics) return InvalidParameter;
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 1143195..e493df5 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -46,6 +46,7 @@ GpStatus WINGDIPAPI GdipSetPenStartCap(G
 
 GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**);
 GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**);
+GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**);
 GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *);
 GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,
diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h
index 70da065..9d57648 100644
--- a/include/gdiplusgpstubs.h
+++ b/include/gdiplusgpstubs.h
@@ -29,6 +29,8 @@ class GpPath {};
 class GpMatrix {};
 class GpPathIterator {};
 class GpCustomLineCap {};
+class GpImage {};
+class GpMetafile : public GpImage {};
 
 #else /* end of c++ declarations */
 
@@ -40,6 +42,8 @@ typedef struct GpPath GpPath;
 typedef struct GpMatrix GpMatrix;
 typedef struct GpPathIterator GpPathIterator;
 typedef struct GpCustomLineCap GpCustomLineCap;
+typedef struct GpImage GpImage;
+typedef struct GpMetafile GpMetafile;
 
 #endif /* end of c declarations */
 
-- 
1.4.1


More information about the wine-patches mailing list