1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Mappings for the contents of d2d1_2.h
7 use shared::dxgi::IDXGIDevice;
8 use shared::minwindef::FLOAT;
9 use um::d2d1::{ID2D1Brush, ID2D1Geometry, ID2D1StrokeStyle};
10 use um::d2d1::{ID2D1Resource, ID2D1ResourceVtbl};
11 use um::d2d1_1::{D2D1_DEVICE_CONTEXT_OPTIONS, D2D1_PRIMITIVE_BLEND};
12 use um::d2d1_1::{ID2D1DeviceContext, ID2D1DeviceContextVtbl};
13 use um::d2d1_1::{ID2D1Device, ID2D1DeviceVtbl};
14 use um::d2d1_1::{ID2D1Factory1, ID2D1Factory1Vtbl};
15 use um::d2d1_1::{ID2D1CommandSink, ID2D1CommandSinkVtbl};
16 use um::winnt::HRESULT;
17 ENUM!{enum D2D1_RENDERING_PRIORITY {
18     D2D1_RENDERING_PRIORITY_NORMAL = 0,
19     D2D1_RENDERING_PRIORITY_LOW = 1,
20     D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff,
21 }}
22 RIDL!{#[uuid(0xa16907d7, 0xbc02, 0x4801, 0x99, 0xe8, 0x8c, 0xf7, 0xf4, 0x85, 0xf7, 0x74)]
23 interface ID2D1GeometryRealization(ID2D1GeometryRealizationVtbl):
24     ID2D1Resource(ID2D1ResourceVtbl) {}}
25 RIDL!{#[uuid(0xd37f57e4, 0x6908, 0x459f, 0xa1, 0x99, 0xe7, 0x2f, 0x24, 0xf7, 0x99, 0x87)]
26 interface ID2D1DeviceContext1(ID2D1DeviceContext1Vtbl):
27     ID2D1DeviceContext(ID2D1DeviceContextVtbl) {
28     fn CreateFilledGeometryRealization(
29         geometry: *mut ID2D1Geometry,
30         flatteningTolerance: FLOAT,
31         geometryRealization: *mut *mut ID2D1GeometryRealization,
32     ) -> HRESULT,
33     fn CreateStrokedGeometryRealization(
34         geometry: *mut ID2D1Geometry,
35         flatteningTolerance: FLOAT,
36         strokeWidth: FLOAT,
37         strokeStyle: *mut ID2D1StrokeStyle,
38         geometryRealization: *mut *mut ID2D1GeometryRealization,
39     ) -> HRESULT,
40     fn DrawGeometryRealization(
41         geometryRealization: *mut ID2D1GeometryRealization,
42         brush: *mut ID2D1Brush,
43     ) -> (),
44 }}
45 RIDL!{#[uuid(0xd21768e1, 0x23a4, 0x4823, 0xa1, 0x4b, 0x7c, 0x3e, 0xba, 0x85, 0xd6, 0x58)]
46 interface ID2D1Device1(ID2D1Device1Vtbl): ID2D1Device(ID2D1DeviceVtbl) {
47     fn GetRenderingPriority() -> D2D1_RENDERING_PRIORITY,
48     fn SetRenderingPriority(
49         renderingPriority: D2D1_RENDERING_PRIORITY,
50     ) -> (),
51     fn CreateDeviceContext(
52         options: D2D1_DEVICE_CONTEXT_OPTIONS,
53         deviceContext1: *mut *mut ID2D1DeviceContext1,
54     ) -> HRESULT,
55 }}
56 RIDL!{#[uuid(0x94f81a73, 0x9212, 0x4376, 0x9c, 0x58, 0xb1, 0x6a, 0x3a, 0x0d, 0x39, 0x92)]
57 interface ID2D1Factory2(ID2D1Factory2Vtbl): ID2D1Factory1(ID2D1Factory1Vtbl) {
58     fn CreateDevice(
59         dxgiDevice: *mut IDXGIDevice,
60         d2dDevice1: *mut *mut ID2D1Device1,
61     ) -> HRESULT,
62 }}
63 RIDL!{#[uuid(0x9eb767fd, 0x4269, 0x4467, 0xb8, 0xc2, 0xeb, 0x30, 0xcb, 0x30, 0x57, 0x43)]
64 interface ID2D1CommandSink1(ID2D1CommandSink1Vtbl): ID2D1CommandSink(ID2D1CommandSinkVtbl) {
65     fn SetPrimitiveBlend1(
66         primitiveBlend: D2D1_PRIMITIVE_BLEND,
67     ) -> HRESULT,
68 }}
69