From: Lucian Poston lucian.poston@gmail.com
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/d2d1/d2d1_private.h | 2 +- dlls/d2d1/factory.c | 182 ++++++++++++++++++++++++++++++++++++----------- dlls/uuid/d2d.c | 2 +- include/d2d1_1.idl | 136 +++++++++++++++++++++++++++++++++++ 4 files changed, 278 insertions(+), 44 deletions(-) create mode 100644 include/d2d1_1.idl
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 98298f8..3b21bc1 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -24,7 +24,7 @@ #include <assert.h> #include <limits.h> #define COBJMACROS -#include "d2d1.h" +#include "d2d1_1.h" #ifdef D2D1_INIT_GUID #include "initguid.h" #endif diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 4b9315f..da2b892 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
struct d2d_factory { - ID2D1Factory ID2D1Factory_iface; + ID2D1Factory1 ID2D1Factory1_iface; LONG refcount;
ID3D10Device1 *device; @@ -35,9 +35,9 @@ struct d2d_factory float dpi_y; };
-static inline struct d2d_factory *impl_from_ID2D1Factory(ID2D1Factory *iface) +static inline struct d2d_factory *impl_from_ID2D1Factory1(ID2D1Factory1 *iface) { - return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory_iface); + return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory1_iface); }
static HRESULT d2d_factory_reload_sysmetrics(struct d2d_factory *factory) @@ -58,14 +58,15 @@ static HRESULT d2d_factory_reload_sysmetrics(struct d2d_factory *factory) return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_QueryInterface(ID2D1Factory *iface, REFIID iid, void **out) +static HRESULT STDMETHODCALLTYPE d2d_factory_QueryInterface(ID2D1Factory1 *iface, REFIID iid, void **out) { TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
- if (IsEqualGUID(iid, &IID_ID2D1Factory) + if (IsEqualGUID(iid, &IID_ID2D1Factory1) + || IsEqualGUID(iid, &IID_ID2D1Factory) || IsEqualGUID(iid, &IID_IUnknown)) { - ID2D1Factory_AddRef(iface); + ID2D1Factory1_AddRef(iface); *out = iface; return S_OK; } @@ -76,9 +77,9 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_QueryInterface(ID2D1Factory *iface, return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d2d_factory_AddRef(ID2D1Factory *iface) +static ULONG STDMETHODCALLTYPE d2d_factory_AddRef(ID2D1Factory1 *iface) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface); ULONG refcount = InterlockedIncrement(&factory->refcount);
TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -86,9 +87,9 @@ static ULONG STDMETHODCALLTYPE d2d_factory_AddRef(ID2D1Factory *iface) return refcount; }
-static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory *iface) +static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory1 *iface) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface); ULONG refcount = InterlockedDecrement(&factory->refcount);
TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -103,18 +104,18 @@ static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory *iface) return refcount; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_ReloadSystemMetrics(ID2D1Factory *iface) +static HRESULT STDMETHODCALLTYPE d2d_factory_ReloadSystemMetrics(ID2D1Factory1 *iface) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface);
TRACE("iface %p.\n", iface);
return d2d_factory_reload_sysmetrics(factory); }
-static void STDMETHODCALLTYPE d2d_factory_GetDesktopDpi(ID2D1Factory *iface, float *dpi_x, float *dpi_y) +static void STDMETHODCALLTYPE d2d_factory_GetDesktopDpi(ID2D1Factory1 *iface, float *dpi_x, float *dpi_y) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface);
TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
@@ -122,7 +123,7 @@ static void STDMETHODCALLTYPE d2d_factory_GetDesktopDpi(ID2D1Factory *iface, flo *dpi_y = factory->dpi_y; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factory1 *iface, const D2D1_RECT_F *rect, ID2D1RectangleGeometry **geometry) { struct d2d_geometry *object; @@ -133,7 +134,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factor if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_rectangle_geometry_init(object, iface, rect))) + if (FAILED(hr = d2d_rectangle_geometry_init(object, (ID2D1Factory *)iface, rect))) { WARN("Failed to initialize rectangle geometry, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -146,7 +147,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factor return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D1Factory1 *iface, const D2D1_ROUNDED_RECT *rect, ID2D1RoundedRectangleGeometry **geometry) { FIXME("iface %p, rect %p, geometry %p stub!\n", iface, rect, geometry); @@ -154,7 +155,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateEllipseGeometry(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateEllipseGeometry(ID2D1Factory1 *iface, const D2D1_ELLIPSE *ellipse, ID2D1EllipseGeometry **geometry) { FIXME("iface %p, ellipse %p, geometry %p stub!\n", iface, ellipse, geometry); @@ -162,7 +163,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateEllipseGeometry(ID2D1Factory return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGeometryGroup(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGeometryGroup(ID2D1Factory1 *iface, D2D1_FILL_MODE fill_mode, ID2D1Geometry **geometries, UINT32 geometry_count, ID2D1GeometryGroup **group) { FIXME("iface %p, fill_mode %#x, geometries %p, geometry_count %u, group %p stub!\n", @@ -171,7 +172,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGeometryGroup(ID2D1Factory *i return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Factory1 *iface, ID2D1Geometry *src_geometry, const D2D1_MATRIX_3X2_F *transform, ID2D1TransformedGeometry **transformed_geometry) { @@ -183,7 +184,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Fact if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- d2d_transformed_geometry_init(object, iface, src_geometry, transform); + d2d_transformed_geometry_init(object, (ID2D1Factory *)iface, src_geometry, transform);
TRACE("Created transformed geometry %p.\n", object); *transformed_geometry = (ID2D1TransformedGeometry *)&object->ID2D1Geometry_iface; @@ -191,7 +192,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Fact return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory *iface, ID2D1PathGeometry **geometry) +static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory1 *iface, ID2D1PathGeometry **geometry) { struct d2d_geometry *object;
@@ -200,7 +201,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory *if if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- d2d_path_geometry_init(object, iface); + d2d_path_geometry_init(object, (ID2D1Factory *)iface);
TRACE("Created path geometry %p.\n", object); *geometry = (ID2D1PathGeometry *)&object->ID2D1Geometry_iface; @@ -208,7 +209,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory *if return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory1 *iface, const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count, ID2D1StrokeStyle **stroke_style) { @@ -221,7 +222,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory *ifa if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_stroke_style_init(object, iface, desc, dashes, dash_count))) + if (FAILED(hr = d2d_stroke_style_init(object, (ID2D1Factory *)iface, desc, dashes, dash_count))) { WARN("Failed to initialize stroke style, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -234,7 +235,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory *ifa return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factory1 *iface, const D2D1_DRAWING_STATE_DESCRIPTION *desc, IDWriteRenderingParams *text_rendering_params, ID2D1DrawingStateBlock **state_block) { @@ -246,7 +247,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factor if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- d2d_state_block_init(object, iface, desc, text_rendering_params); + d2d_state_block_init(object, (ID2D1Factory *)iface, desc, text_rendering_params);
TRACE("Created state block %p.\n", object); *state_block = &object->ID2D1DrawingStateBlock_iface; @@ -266,10 +267,10 @@ static HRESULT d2d_factory_get_device(struct d2d_factory *factory, ID3D10Device1 return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Factory1 *iface, IWICBitmap *target, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface); struct d2d_wic_render_target *object; ID3D10Device1 *device; HRESULT hr; @@ -285,7 +286,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Fa return hr; }
- if (FAILED(hr = d2d_wic_render_target_init(object, iface, device, target, desc))) + if (FAILED(hr = d2d_wic_render_target_init(object, (ID2D1Factory *)iface, device, target, desc))) { WARN("Failed to initialize render target, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -298,11 +299,11 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Fa return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory1 *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc, const D2D1_HWND_RENDER_TARGET_PROPERTIES *hwnd_rt_desc, ID2D1HwndRenderTarget **render_target) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface); struct d2d_hwnd_render_target *object; ID3D10Device1 *device; HRESULT hr; @@ -315,7 +316,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_hwnd_render_target_init(object, iface, device, desc, hwnd_rt_desc))) + if (FAILED(hr = d2d_hwnd_render_target_init(object, (ID2D1Factory *)iface, device, desc, hwnd_rt_desc))) { WARN("Failed to initialize render target, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -328,18 +329,18 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1Factory1 *iface, IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target) { TRACE("iface %p, surface %p, desc %p, render_target %p.\n", iface, surface, desc, render_target);
- return d2d_d3d_create_render_target(iface, surface, NULL, desc, render_target); + return d2d_d3d_create_render_target((ID2D1Factory *)iface, surface, NULL, desc, render_target); }
-static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory *iface, +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory1 *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1DCRenderTarget **render_target) { - struct d2d_factory *factory = impl_from_ID2D1Factory(iface); + struct d2d_factory *factory = impl_from_ID2D1Factory1(iface); struct d2d_dc_render_target *object; ID3D10Device1 *device; HRESULT hr; @@ -352,7 +353,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory * if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_dc_render_target_init(object, iface, device, desc))) + if (FAILED(hr = d2d_dc_render_target_init(object, (ID2D1Factory *)iface, device, desc))) { WARN("Failed to initialize render target, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -365,7 +366,94 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory * return S_OK; }
-static const struct ID2D1FactoryVtbl d2d_factory_vtbl = +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory1 *iface, + IDXGIDevice *dxgi_device, ID2D1Device **device) +{ + FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory1 *iface, + const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count, + ID2D1StrokeStyle1 **stroke_style) +{ + FIXME("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p stub!\n", + iface, desc, dashes, dash_count, stroke_style); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry1(ID2D1Factory1 *iface, ID2D1PathGeometry1 **geometry) +{ + FIXME("iface %p, geometry %p stub!\n", iface, geometry); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock1(ID2D1Factory1 *iface, + const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, IDWriteRenderingParams *text_rendering_params, + ID2D1DrawingStateBlock1 **state_block) +{ + FIXME("iface %p, desc %p, text_rendering_params %p, state_block %p stub!\n", + iface, desc, text_rendering_params, state_block); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGdiMetafile(ID2D1Factory1 *iface, + IStream *stream, ID2D1GdiMetafile **metafile) +{ + FIXME("iface %p, stream %p, metafile %p stub!\n", iface, stream, metafile); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Factory1 *iface, + REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings, + UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory) +{ + FIXME("iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p stub!\n", + iface, debugstr_guid(effect_id), property_xml, bindings, binding_count, effect_factory); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Factory1 *iface, + REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, + UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory) +{ + FIXME("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p stub!\n", + iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory1 *iface, REFCLSID effect_id) +{ + FIXME("iface %p, effect_id %s stub!\n", iface, debugstr_guid(effect_id)); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_GetRegisteredEffects(ID2D1Factory1 *iface, + CLSID *effects, UINT32 effect_count, UINT32 *returned, UINT32 *registered) +{ + FIXME("iface %p, effects %p, effect_count %u, returned %p, registered %p stub!\n", + iface, effects, effect_count, returned, registered); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_factory_GetEffectProperties(ID2D1Factory1 *iface, + REFCLSID effect_id, ID2D1Properties **props) +{ + FIXME("iface %p, effect_id %s, props %p stub!\n", iface, debugstr_guid(effect_id), props); + + return E_NOTIMPL; +} + +static const struct ID2D1Factory1Vtbl d2d_factory_vtbl = { d2d_factory_QueryInterface, d2d_factory_AddRef, @@ -384,6 +472,16 @@ static const struct ID2D1FactoryVtbl d2d_factory_vtbl = d2d_factory_CreateHwndRenderTarget, d2d_factory_CreateDxgiSurfaceRenderTarget, d2d_factory_CreateDCRenderTarget, + d2d_factory_CreateDevice, + d2d_factory_CreateStrokeStyle1, + d2d_factory_CreatePathGeometry1, + d2d_factory_CreateDrawingStateBlock1, + d2d_factory_CreateGdiMetafile, + d2d_factory_RegisterEffectFromStream, + d2d_factory_RegisterEffectFromString, + d2d_factory_UnregisterEffect, + d2d_factory_GetRegisteredEffects, + d2d_factory_GetEffectProperties, };
static void d2d_factory_init(struct d2d_factory *factory, D2D1_FACTORY_TYPE factory_type, @@ -394,7 +492,7 @@ static void d2d_factory_init(struct d2d_factory *factory, D2D1_FACTORY_TYPE fact if (factory_options && factory_options->debugLevel != D2D1_DEBUG_LEVEL_NONE) WARN("Ignoring debug level %#x.\n", factory_options->debugLevel);
- factory->ID2D1Factory_iface.lpVtbl = &d2d_factory_vtbl; + factory->ID2D1Factory1_iface.lpVtbl = &d2d_factory_vtbl; factory->refcount = 1; d2d_factory_reload_sysmetrics(factory); } @@ -415,8 +513,8 @@ HRESULT WINAPI D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
TRACE("Created factory %p.\n", object);
- hr = ID2D1Factory_QueryInterface(&object->ID2D1Factory_iface, iid, factory); - ID2D1Factory_Release(&object->ID2D1Factory_iface); + hr = ID2D1Factory1_QueryInterface(&object->ID2D1Factory1_iface, iid, factory); + ID2D1Factory1_Release(&object->ID2D1Factory1_iface);
return hr; } diff --git a/dlls/uuid/d2d.c b/dlls/uuid/d2d.c index dbe143e..d2cf6db 100644 --- a/dlls/uuid/d2d.c +++ b/dlls/uuid/d2d.c @@ -18,4 +18,4 @@
#include "d3d10_1.h" #include "initguid.h" -#include "d2d1.h" +#include "d2d1_1.h" diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl new file mode 100644 index 0000000..1fbbb30 --- /dev/null +++ b/include/d2d1_1.idl @@ -0,0 +1,136 @@ +/* + * Copyright 2017 Lucian Poston + * + * 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 + */ + +import "d2d1.idl"; + +interface ID2D1Device; +interface ID2D1StrokeStyle1; +interface ID2D1PathGeometry1; +interface ID2D1DrawingStateBlock1; +interface ID2D1GdiMetafile; +interface ID2D1Properties; + +typedef enum D2D1_STROKE_TRANSFORM_TYPE +{ + D2D1_STROKE_TRANSFORM_TYPE_NORMAL = 0x0, + D2D1_STROKE_TRANSFORM_TYPE_FIXED = 0x1, + D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE = 0x2, + D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD = 0xffffffff, +} D2D1_STROKE_TRANSFORM_TYPE; + +typedef enum D2D1_PRIMITIVE_BLEND +{ + D2D1_PRIMITIVE_BLEND_SOURCE_OVER = 0x0, + D2D1_PRIMITIVE_BLEND_COPY = 0x1, + D2D1_PRIMITIVE_BLEND_MIN = 0x2, + D2D1_PRIMITIVE_BLEND_ADD = 0x3, + D2D1_PRIMITIVE_BLEND_MAX = 0x4, + D2D1_PRIMITIVE_BLEND_FORCE_DWORD = 0xffffffff, +} D2D1_PRIMITIVE_BLEND; + +typedef enum D2D1_UNIT_MODE +{ + D2D1_UNIT_MODE_DIPS = 0x0, + D2D1_UNIT_MODE_PIXELS = 0x1, + D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff, +} D2D1_UNIT_MODE; + +typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING; + +typedef struct D2D1_STROKE_STYLE_PROPERTIES1 +{ + D2D1_CAP_STYLE startCap; + D2D1_CAP_STYLE endCap; + D2D1_CAP_STYLE dashCap; + D2D1_LINE_JOIN lineJoin; + float miterLimit; + D2D1_DASH_STYLE dashStyle; + float dashOffset; + D2D1_STROKE_TRANSFORM_TYPE transformType; +} D2D1_STROKE_STYLE_PROPERTIES1; + +typedef struct D2D1_DRAWING_STATE_DESCRIPTION1 +{ + D2D1_ANTIALIAS_MODE antialiasMode; + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode; + D2D1_TAG tag1; + D2D1_TAG tag2; + D2D1_MATRIX_3X2_F transform; + D2D1_PRIMITIVE_BLEND primitiveBlend; + D2D1_UNIT_MODE unitMode; +} D2D1_DRAWING_STATE_DESCRIPTION1; + +typedef HRESULT (__stdcall *PD2D1_EFFECT_FACTORY)(IUnknown **effect); + +[ + object, + uuid(bb12d362-daee-4b9a-aa1d-14ba401cfa1f), + local, +] +interface ID2D1Factory1 : ID2D1Factory +{ + HRESULT CreateDevice( + [in] IDXGIDevice *dxgi_device, + [out] ID2D1Device **device + ); + HRESULT CreateStrokeStyle( + [in] const D2D1_STROKE_STYLE_PROPERTIES1 *desc, + [in, size_is(dash_count)] const float *dashes, + [in] UINT32 dash_count, + [out] ID2D1StrokeStyle1 **stroke_style + ); + HRESULT CreatePathGeometry( + [out] ID2D1PathGeometry1 **geometry + ); + HRESULT CreateDrawingStateBlock( + [in] const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, + [in] IDWriteRenderingParams *text_rendering_params, + [out] ID2D1DrawingStateBlock1 **state_block + ); + HRESULT CreateGdiMetafile( + [in] IStream *stream, + [out] ID2D1GdiMetafile **metafile + ); + HRESULT RegisterEffectFromStream( + [in] REFCLSID effect_id, + [in] IStream *property_xml, + [in, size_is(binding_count)] const D2D1_PROPERTY_BINDING *bindings, + [in] UINT32 binding_count, + [in] PD2D1_EFFECT_FACTORY effect_factory + ); + HRESULT RegisterEffectFromString( + [in] REFCLSID effect_id, + [in] const WCHAR *property_xml, + [in, size_is(binding_count)] const D2D1_PROPERTY_BINDING *bindings, + [in] UINT32 binding_count, + [in] PD2D1_EFFECT_FACTORY effect_factory + ); + HRESULT UnregisterEffect( + [in] REFCLSID effect_id + ); + HRESULT GetRegisteredEffects( + [out, size_is(effect_count)] CLSID *effects, + [in] UINT32 effect_count, + [out] UINT32 *returned, + [out] UINT32 *registered + ); + HRESULT GetEffectProperties( + [in] REFCLSID effect_id, + [out] ID2D1Properties **props + ); +}