Module: wine
Branch: master
Commit: 0ccdda1262c84c3bab7fb1136ac97c92faf30830
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0ccdda1262c84c3bab7fb1136…
Author: Nikolay Sivov <nsivov(a)codeweavers.com>
Date: Tue Jul 31 08:12:35 2012 +0400
dwrite: Added IDWriteGdiInterop stub.
---
dlls/dwrite/Makefile.in | 1 +
dlls/dwrite/dwrite_private.h | 19 +++++++
dlls/dwrite/gdiinterop.c | 108 ++++++++++++++++++++++++++++++++++++++++++
dlls/dwrite/main.c | 5 +-
4 files changed, 131 insertions(+), 2 deletions(-)
diff --git a/dlls/dwrite/Makefile.in b/dlls/dwrite/Makefile.in
index 7438d92..7d88e77 100644
--- a/dlls/dwrite/Makefile.in
+++ b/dlls/dwrite/Makefile.in
@@ -1,6 +1,7 @@
MODULE = dwrite.dll
C_SRCS = \
+ gdiinterop.c \
main.c
@MAKE_DLL_RULES@
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
new file mode 100644
index 0000000..59ca09e
--- /dev/null
+++ b/dlls/dwrite/dwrite_private.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2012 Nikolay Sivov 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
+ */
+
+extern HRESULT create_gdiinterop(IDWriteGdiInterop**) DECLSPEC_HIDDEN;
diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c
new file mode 100644
index 0000000..7b3c589
--- /dev/null
+++ b/dlls/dwrite/gdiinterop.c
@@ -0,0 +1,108 @@
+/*
+ * GDI Interop
+ *
+ * Copyright 2012 Nikolay Sivov 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "dwrite.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
+
+static HRESULT WINAPI gdiinterop_QueryInterface(IDWriteGdiInterop *iface, REFIID riid, void **obj)
+{
+ TRACE("(%s %p)\n", debugstr_guid(riid), obj);
+
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteGdiInterop))
+ {
+ *obj = iface;
+ return S_OK;
+ }
+
+ *obj = NULL;
+
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop *iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop *iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop *iface,
+ LOGFONTW const *logfont, IDWriteFont **font)
+{
+ FIXME("(%p %p): stub\n", logfont, font);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop *iface,
+ IDWriteFont *font, LOGFONTW *logfont, BOOL *is_systemfont)
+{
+ FIXME("(%p %p %p): stub\n", font, logfont, is_systemfont);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI gdiinterop_ConvertFontFaceToLOGFONT(IDWriteGdiInterop *iface,
+ IDWriteFontFace *font, LOGFONTW *logfont)
+{
+ FIXME("(%p %p): stub\n", font, logfont);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface,
+ HDC hdc, IDWriteFontFace **fontface)
+{
+ FIXME("(%p %p): stub\n", hdc, fontface);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI gdiinterop_CreateBitmapRenderTarget(IDWriteGdiInterop *iface,
+ HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **target)
+{
+ FIXME("(%p %u %u %p): stub\n", hdc, width, height, target);
+ return E_NOTIMPL;
+}
+
+static const struct IDWriteGdiInteropVtbl gdiinteropvtbl = {
+ gdiinterop_QueryInterface,
+ gdiinterop_AddRef,
+ gdiinterop_Release,
+ gdiinterop_CreateFontFromLOGFONT,
+ gdiinterop_ConvertFontToLOGFONT,
+ gdiinterop_ConvertFontFaceToLOGFONT,
+ gdiinterop_CreateFontFaceFromHdc,
+ gdiinterop_CreateBitmapRenderTarget
+};
+
+static IDWriteGdiInterop gdiinterop = { &gdiinteropvtbl };
+
+HRESULT create_gdiinterop(IDWriteGdiInterop **ret)
+{
+ *ret = &gdiinterop;
+ return S_OK;
+}
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c
index d3f8135..ca7de8e 100644
--- a/dlls/dwrite/main.c
+++ b/dlls/dwrite/main.c
@@ -26,6 +26,7 @@
#include "initguid.h"
#include "dwrite.h"
+#include "dwrite_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
@@ -168,8 +169,8 @@ static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory *iface, IDWr
static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory *iface, IDWriteGdiInterop **gdi_interop)
{
- FIXME("(%p): stub\n", gdi_interop);
- return E_NOTIMPL;
+ TRACE("(%p)\n", gdi_interop);
+ return create_gdiinterop(gdi_interop);
}
static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory *iface, WCHAR const* string,