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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#![allow(non_camel_case_types, non_snake_case)]
use crate::co;
use crate::decl::*;
use crate::dxgi::vts::*;
use crate::macros::*;
use crate::ole::privs::*;
use crate::prelude::*;
com_interface! { IDXGIFactory2: "50c83a1c-e072-4c48-87b0-3630fa36a6d0";
/// [`IDXGIFactory2`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nn-dxgi1_2-idxgifactory2)
/// COM interface.
///
/// Automatically calls
/// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
/// when the object goes out of scope.
///
/// Usually created with [`CreateDXGIFactory2`](crate::CreateDXGIFactory2)
/// function.
///
/// # Examples
///
/// ```no_run
/// use winsafe::{self as w, co, prelude::*};
///
/// let factory2 = w::CreateDXGIFactory2(co::DXGI_CREATE_FACTORY::NoValue)?;
/// # w::HrResult::Ok(())
/// ```
}
impl dxgi_IDXGIObject for IDXGIFactory2 {}
impl dxgi_IDXGIFactory for IDXGIFactory2 {}
impl dxgi_IDXGIFactory1 for IDXGIFactory2 {}
impl dxgi_IDXGIFactory2 for IDXGIFactory2 {}
/// This trait is enabled with the `dxgi` feature, and provides methods for
/// [`IDXGIFactory2`](crate::IDXGIFactory2).
///
/// Prefer importing this trait through the prelude:
///
/// ```no_run
/// use winsafe::prelude::*;
/// ```
pub trait dxgi_IDXGIFactory2: dxgi_IDXGIFactory1 {
/// [`IsWindowedStereoEnabled`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-iswindowedstereoenabled)
/// method.
fn IsWindowedStereoEnabled(&self) -> bool {
unsafe { (vt::<IDXGIFactory2VT>(self).IsWindowedStereoEnabled)(self.ptr()) != 0 }
}
/// [`RegisterOcclusionStatusEvent`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-registerocclusionstatusevent)
/// method.
fn RegisterOcclusionStatusEvent(&self, hevent: &HEVENT) -> HrResult<u32> {
let mut cookie = 0u32;
HrRet(unsafe {
(vt::<IDXGIFactory2VT>(self).RegisterOcclusionStatusEvent)(
self.ptr(),
hevent.ptr(),
&mut cookie,
)
})
.to_hrresult()
.map(|_| cookie)
}
/// [`RegisterOcclusionStatusWindow`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-registerocclusionstatuswindow)
/// method.
fn RegisterOcclusionStatusWindow(&self, hwnd: &HWND, msg: co::WM) -> HrResult<u32> {
let mut cookie = 0u32;
HrRet(unsafe {
(vt::<IDXGIFactory2VT>(self).RegisterOcclusionStatusWindow)(
self.ptr(),
hwnd.ptr(),
msg.raw(),
&mut cookie,
)
})
.to_hrresult()
.map(|_| cookie)
}
/// [`RegisterStereoStatusEvent`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-registerstereostatusevent)
/// method.
fn RegisterStereoStatusEvent(&self, hevent: &HEVENT) -> HrResult<u32> {
let mut cookie = 0u32;
HrRet(unsafe {
(vt::<IDXGIFactory2VT>(self).RegisterStereoStatusEvent)(
self.ptr(),
hevent.ptr(),
&mut cookie,
)
})
.to_hrresult()
.map(|_| cookie)
}
/// [`RegisterStereoStatusWindow`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-registerstereostatuswindow)
/// method.
fn RegisterStereoStatusWindow(&self, hwnd: &HWND, msg: co::WM) -> HrResult<u32> {
let mut cookie = 0u32;
HrRet(unsafe {
(vt::<IDXGIFactory2VT>(self).RegisterStereoStatusWindow)(
self.ptr(),
hwnd.ptr(),
msg.raw(),
&mut cookie,
)
})
.to_hrresult()
.map(|_| cookie)
}
/// [`UnregisterOcclusionStatus`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-unregisterocclusionstatus)
/// method.
fn UnregisterOcclusionStatus(&self, cookie: u32) -> HrResult<()> {
HrRet(unsafe {
(vt::<IDXGIFactory2VT>(self).UnregisterOcclusionStatus)(self.ptr(), cookie)
})
.to_hrresult()
}
/// [`UnregisterStereoStatus`](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-unregisterstereostatus)
/// method.
fn UnregisterStereoStatus(&self, cookie: u32) -> HrResult<()> {
HrRet(unsafe { (vt::<IDXGIFactory2VT>(self).UnregisterStereoStatus)(self.ptr(), cookie) })
.to_hrresult()
}
}