[PATCH 1/1] d2d1: Add a stub D2D1CreateFactory() implementation.

Henri Verbeet hverbeet at codeweavers.com
Tue Feb 18 03:39:22 CST 2014


---
 dlls/d2d1/Makefile.in |    7 +++++++
 dlls/d2d1/d2d1.spec   |   11 +++++++++++
 dlls/d2d1/d2d1_main.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 dlls/d2d1/version.rc  |   26 ++++++++++++++++++++++++++
 include/d2d1.idl      |   24 ++++++++++++++++++++++++
 5 files changed, 116 insertions(+)
 create mode 100644 dlls/d2d1/Makefile.in
 create mode 100644 dlls/d2d1/d2d1.spec
 create mode 100644 dlls/d2d1/d2d1_main.c
 create mode 100644 dlls/d2d1/version.rc

diff --git a/dlls/d2d1/Makefile.in b/dlls/d2d1/Makefile.in
new file mode 100644
index 0000000..0db375a
--- /dev/null
+++ b/dlls/d2d1/Makefile.in
@@ -0,0 +1,7 @@
+MODULE    = d2d1.dll
+IMPORTLIB = d2d1
+
+C_SRCS = \
+	d2d1_main.c
+
+RC_SRCS = version.rc
diff --git a/dlls/d2d1/d2d1.spec b/dlls/d2d1/d2d1.spec
new file mode 100644
index 0000000..b1bfe9b
--- /dev/null
+++ b/dlls/d2d1/d2d1.spec
@@ -0,0 +1,11 @@
+@ stdcall D2D1CreateFactory(long ptr ptr ptr)
+@ stub D2D1MakeRotateMatrix
+@ stub D2D1MakeSkewMatrix
+@ stub D2D1IsMatrixInvertible
+@ stub D2D1InvertMatrix
+@ stub D2D1ConvertColorSpace
+@ stub D2D1CreateDevice
+@ stub D2D1CreateDeviceContext
+@ stub D2D1SinCos
+@ stub D2D1Tan
+@ stub D2D1Vec3Length
diff --git a/dlls/d2d1/d2d1_main.c b/dlls/d2d1/d2d1_main.c
new file mode 100644
index 0000000..9a389a2
--- /dev/null
+++ b/dlls/d2d1/d2d1_main.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2014 Henri Verbeet for CodeWeavers
+ *
+ * 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
+ *
+ */
+
+#include "config.h"
+#include "wine/port.h"
+#include "wine/debug.h"
+
+#define COBJMACROS
+#include "d2d1.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d2d);
+
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
+{
+    switch (reason)
+    {
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls(inst);
+            break;
+    }
+
+    return TRUE;
+}
+
+HRESULT WINAPI D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
+        const D2D1_FACTORY_OPTIONS *factory_options, void **factory)
+{
+    FIXME("factory_type %#x, iid %s, factory_options %p, factory %p stub!\n",
+            factory_type, debugstr_guid(iid), factory_options, factory);
+
+    return E_NOTIMPL;
+}
diff --git a/dlls/d2d1/version.rc b/dlls/d2d1/version.rc
new file mode 100644
index 0000000..ab7a911
--- /dev/null
+++ b/dlls/d2d1/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2014 Henri Verbeet for CodeWeavers
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Direct2D"
+#define WINE_FILENAME_STR "d2d1.dll"
+#define WINE_FILEVERSION 6,2,9200,16765
+#define WINE_FILEVERSION_STR "6.2.9200.16765"
+#define WINE_PRODUCTVERSION 6,2,9200,16765
+#define WINE_PRODUCTVERSION_STR "6.2.9200.16765"
+
+#include "wine/wine_common_ver.rc"
diff --git a/include/d2d1.idl b/include/d2d1.idl
index 8c9cdb3..c63ed24 100644
--- a/include/d2d1.idl
+++ b/include/d2d1.idl
@@ -21,6 +21,22 @@ import "d2dbasetypes.h";
 
 typedef D2D_POINT_2F D2D1_POINT_2F;
 
+typedef enum D2D1_DEBUG_LEVEL
+{
+    D2D1_DEBUG_LEVEL_NONE = 0,
+    D2D1_DEBUG_LEVEL_ERROR = 1,
+    D2D1_DEBUG_LEVEL_WARNING = 2,
+    D2D1_DEBUG_LEVEL_INFORMATION = 3,
+    D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff,
+} D2D1_DEBUG_LEVEL;
+
+typedef enum D2D1_FACTORY_TYPE
+{
+    D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
+    D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
+    D2D1_FACTORY_TYPE_FORCE_DWORD = 0xfffffff,
+} D2D1_FACTORY_TYPE;
+
 typedef enum D2D1_FILL_MODE
 {
     D2D1_FILL_MODE_ALTERNATE = 0,
@@ -57,6 +73,11 @@ typedef enum D2D1_FIGURE_END
     D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff
 } D2D1_FIGURE_END;
 
+typedef struct D2D1_FACTORY_OPTIONS
+{
+    D2D1_DEBUG_LEVEL debugLevel;
+} D2D1_FACTORY_OPTIONS;
+
 [
     local,
     object,
@@ -72,3 +93,6 @@ interface ID2D1SimplifiedGeometrySink : IUnknown
     void EndFigure(D2D1_FIGURE_END figureEnd);
     HRESULT Close();
 }
+
+[local] HRESULT __stdcall D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
+        const D2D1_FACTORY_OPTIONS *factory_options, void **factory);
-- 
1.7.10.4




More information about the wine-patches mailing list