1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
mod brush;
mod context;
pub mod d2d;
pub mod d3d11;
pub mod d3d12;
pub mod error;
mod image;
mod path;
mod shape;
mod stroke_style;
mod text;
mod utility;
pub use brush::*;
pub use context::*;
pub use d2d::Direct2D;
pub use d3d11::Direct3D11;
pub use d3d12::Direct3D12;
pub use error::{Error, ErrorKind};
pub use gecl;
pub use gecl::{circle, point, rect, rgba, size, vector};
pub use image::*;
pub use path::*;
pub use shape::*;
pub use stroke_style::*;
pub use text::*;
pub use utility::*;
use windows::Win32::Graphics::{Direct2D::Common::*, Direct2D::*, Direct3D::*};
pub type Result<T> = core::result::Result<T, Error>;
pub trait Target {
fn bitmap(&self) -> &ID2D1Bitmap1;
fn size(&self) -> Size;
fn physical_size(&self) -> gecl::Size<u32>;
}
pub trait Fill {
fn fill(&self, dc: &ID2D1DeviceContext, brush: &ID2D1Brush);
}
pub trait Stroke {
fn stroke(
&self,
dc: &ID2D1DeviceContext,
brush: &ID2D1Brush,
width: f32,
style: Option<ID2D1StrokeStyle>,
);
}
pub mod api {
pub use windows::Win32::System::Com::{
CoInitializeEx, CoUninitialize, COINIT_APARTMENTTHREADED, COINIT_DISABLE_OLE1DDE,
COINIT_MULTITHREADED, COINIT_SPEED_OVER_MEMORY,
};
}