[12/14] gdiplus: added GdipCreateMetafileFromWmf stub

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


Hi,

changelog:
*added GdipCreateMetafileFromWmf stub
*added gdiplusmetaheader.h (needed WmfPlaceableFileHeader)

 dlls/gdiplus/gdiplus.spec   |    2 +-
 dlls/gdiplus/graphics.c     |   14 ++++++++++++++
 include/Makefile.in         |    1 +
 include/gdiplus.h           |    2 ++
 include/gdiplusflat.h       |    2 ++
 include/gdiplusmetaheader.h |   40 ++++++++++++++++++++++++++++++++++++++++
 6 files changed, 60 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 52179ec..5d2c3bd 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -102,7 +102,7 @@
 @ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
 @ stub GdipCreateMetafileFromFile
 @ stub GdipCreateMetafileFromStream
-@ stub GdipCreateMetafileFromWmf
+@ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
 @ stub GdipCreateMetafileFromWmfFile
 @ stub GdipCreatePath2
 @ stub GdipCreatePath2I
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index a29d3a1..f53ea4c 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -818,6 +818,20 @@ GpStatus WINGDIPAPI GdipCreateMetafileFr
     return NotImplemented;
 }
 
+GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
+    GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile)
+{
+    static int calls;
+
+    if(!hwmf || !metafile || !placeable)
+        return InvalidParameter;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
 {
     if(!graphics) return InvalidParameter;
diff --git a/include/Makefile.in b/include/Makefile.in
index 782e671..44ef893 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -169,6 +169,7 @@ SRCDIR_INCLUDES = \
 	gdiplusgpstubs.h \
 	gdiplusinit.h \
 	gdiplusmem.h \
+	gdiplusmetaheader.h \
 	gdipluspixelformats.h \
 	gdiplustypes.h \
 	guiddef.h \
diff --git a/include/gdiplus.h b/include/gdiplus.h
index e5da625..6b42093 100644
--- a/include/gdiplus.h
+++ b/include/gdiplus.h
@@ -32,6 +32,7 @@ #include "gdiplustypes.h"
 #include "gdiplusenums.h"
 #include "gdiplusinit.h"
 #include "gdipluspixelformats.h"
+#include "gdiplusmetaheader.h"
 #include "gdiplusgpstubs.h"
 
     namespace DllExports
@@ -48,6 +49,7 @@ #include "gdiplustypes.h"
 #include "gdiplusenums.h"
 #include "gdiplusinit.h"
 #include "gdipluspixelformats.h"
+#include "gdiplusmetaheader.h"
 #include "gdiplusgpstubs.h"
 
 #include "gdiplusflat.h"
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2df7b7c..bfa2c41 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -47,6 +47,8 @@ GpStatus WINGDIPAPI GdipSetPenStartCap(G
 GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**);
 GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**);
 GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**);
+GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL,
+    GDIPCONST WmfPlaceableFileHeader*,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/gdiplusmetaheader.h b/include/gdiplusmetaheader.h
new file mode 100644
index 0000000..2dca026
--- /dev/null
+++ b/include/gdiplusmetaheader.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSMETAHEADER_H
+#define _GDIPLUSMETAHEADER_H
+
+typedef struct
+{
+    INT16  Left;
+    INT16  Top;
+    INT16  Right;
+    INT16  Bottom;
+} PWMFRect16;
+
+typedef struct
+{
+    UINT32     Key;
+    INT16      Hmf;
+    PWMFRect16 BoundingBox;
+    INT16      Inch;
+    UINT32     Reserved;
+    INT16      Checksum;
+} WmfPlaceableFileHeader;
+
+#endif /* _GDIPLUSMETAHEADER_H */
-- 
1.4.1


More information about the wine-patches mailing list