dwrite: Store font style provided in LOGFONT data.
[wine.git] / dlls / dwrite / gdiinterop.c
blobd98eb5b4c618b5f938a21b208747d42582f4726e
1 /*
2 * GDI Interop
4 * Copyright 2012 Nikolay Sivov for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "dwrite.h"
26 #include "dwrite_private.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
32 static HRESULT WINAPI gdiinterop_QueryInterface(IDWriteGdiInterop *iface, REFIID riid, void **obj)
34 TRACE("(%s %p)\n", debugstr_guid(riid), obj);
36 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteGdiInterop))
38 *obj = iface;
39 return S_OK;
42 *obj = NULL;
44 return E_NOINTERFACE;
47 static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop *iface)
49 return 2;
52 static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop *iface)
54 return 1;
57 static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop *iface,
58 LOGFONTW const *logfont, IDWriteFont **font)
60 TRACE("(%p %p)\n", logfont, font);
62 if (!logfont) return E_INVALIDARG;
64 return create_font_from_logfont(logfont, font);
67 static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop *iface,
68 IDWriteFont *font, LOGFONTW *logfont, BOOL *is_systemfont)
70 FIXME("(%p %p %p): stub\n", font, logfont, is_systemfont);
71 return E_NOTIMPL;
74 static HRESULT WINAPI gdiinterop_ConvertFontFaceToLOGFONT(IDWriteGdiInterop *iface,
75 IDWriteFontFace *font, LOGFONTW *logfont)
77 FIXME("(%p %p): stub\n", font, logfont);
78 return E_NOTIMPL;
81 static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface,
82 HDC hdc, IDWriteFontFace **fontface)
84 FIXME("(%p %p): stub\n", hdc, fontface);
85 return E_NOTIMPL;
88 static HRESULT WINAPI gdiinterop_CreateBitmapRenderTarget(IDWriteGdiInterop *iface,
89 HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **target)
91 FIXME("(%p %u %u %p): stub\n", hdc, width, height, target);
92 return E_NOTIMPL;
95 static const struct IDWriteGdiInteropVtbl gdiinteropvtbl = {
96 gdiinterop_QueryInterface,
97 gdiinterop_AddRef,
98 gdiinterop_Release,
99 gdiinterop_CreateFontFromLOGFONT,
100 gdiinterop_ConvertFontToLOGFONT,
101 gdiinterop_ConvertFontFaceToLOGFONT,
102 gdiinterop_CreateFontFaceFromHdc,
103 gdiinterop_CreateBitmapRenderTarget
106 static IDWriteGdiInterop gdiinterop = { &gdiinteropvtbl };
108 HRESULT create_gdiinterop(IDWriteGdiInterop **ret)
110 *ret = &gdiinterop;
111 return S_OK;