#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
dead_code,
clippy::all
)]
pub mod Microsoft {
pub mod UI {
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct WindowId {
pub Value: u64,
}
impl windows_core::TypeKind for WindowId {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for WindowId {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(b"struct(Microsoft.UI.WindowId;u8)");
}
pub mod Dispatching {
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DispatcherExitDeferral(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
DispatcherExitDeferral,
windows_core::IUnknown,
windows_core::IInspectable
);
impl DispatcherExitDeferral {
pub fn new() -> windows_core::Result<Self> {
Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
}
fn IActivationFactory<
R,
F: FnOnce(&windows_core::imp::IGenericFactory) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<
DispatcherExitDeferral,
windows_core::imp::IGenericFactory,
> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
pub fn Complete(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Complete)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
}
impl windows_core::RuntimeType for DispatcherExitDeferral {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IDispatcherExitDeferral>();
}
unsafe impl windows_core::Interface for DispatcherExitDeferral {
type Vtable = <IDispatcherExitDeferral as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IDispatcherExitDeferral as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DispatcherExitDeferral {
const NAME: &'static str = "Microsoft.UI.Dispatching.DispatcherExitDeferral";
}
unsafe impl Send for DispatcherExitDeferral {}
unsafe impl Sync for DispatcherExitDeferral {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DispatcherQueue(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
DispatcherQueue,
windows_core::IUnknown,
windows_core::IInspectable
);
impl DispatcherQueue {
pub fn CreateTimer(&self) -> windows_core::Result<DispatcherQueueTimer> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateTimer)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn TryEnqueue<P0>(&self, callback: P0) -> windows_core::Result<bool>
where
P0: windows_core::Param<DispatcherQueueHandler>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TryEnqueue)(
windows_core::Interface::as_raw(this),
callback.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn TryEnqueueWithPriority<P1>(
&self,
priority: DispatcherQueuePriority,
callback: P1,
) -> windows_core::Result<bool>
where
P1: windows_core::Param<DispatcherQueueHandler>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TryEnqueueWithPriority)(
windows_core::Interface::as_raw(this),
priority,
callback.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn ShutdownStarting<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
DispatcherQueue,
DispatcherQueueShutdownStartingEventArgs,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShutdownStarting)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveShutdownStarting(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveShutdownStarting)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn ShutdownCompleted<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
DispatcherQueue,
windows_core::IInspectable,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShutdownCompleted)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveShutdownCompleted(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveShutdownCompleted)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn HasThreadAccess(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IDispatcherQueue2>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).HasThreadAccess)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn EnqueueEventLoopExit(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).EnqueueEventLoopExit)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn EnsureSystemDispatcherQueue(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).EnsureSystemDispatcherQueue)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn RunEventLoop(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RunEventLoop)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn RunEventLoopWithOptions<P1>(
&self,
options: DispatcherRunOptions,
deferral: P1,
) -> windows_core::Result<()>
where
P1: windows_core::Param<DispatcherExitDeferral>,
{
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RunEventLoopWithOptions)(
windows_core::Interface::as_raw(this),
options,
deferral.param().abi(),
)
.ok()
}
}
pub fn FrameworkShutdownStarting<P0>(
&self,
handler: P0,
) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
DispatcherQueue,
DispatcherQueueShutdownStartingEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).FrameworkShutdownStarting)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveFrameworkShutdownStarting(
&self,
token: i64,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveFrameworkShutdownStarting)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn FrameworkShutdownCompleted<P0>(
&self,
handler: P0,
) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
DispatcherQueue,
windows_core::IInspectable,
>,
>,
{
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).FrameworkShutdownCompleted)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveFrameworkShutdownCompleted(
&self,
token: i64,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueue3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveFrameworkShutdownCompleted)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn GetForCurrentThread() -> windows_core::Result<DispatcherQueue> {
Self::IDispatcherQueueStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetForCurrentThread)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
fn IDispatcherQueueStatics<
R,
F: FnOnce(&IDispatcherQueueStatics) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<
DispatcherQueue,
IDispatcherQueueStatics,
> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for DispatcherQueue {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IDispatcherQueue>();
}
unsafe impl windows_core::Interface for DispatcherQueue {
type Vtable = <IDispatcherQueue as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IDispatcherQueue as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DispatcherQueue {
const NAME: &'static str = "Microsoft.UI.Dispatching.DispatcherQueue";
}
unsafe impl Send for DispatcherQueue {}
unsafe impl Sync for DispatcherQueue {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DispatcherQueueController(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
DispatcherQueueController,
windows_core::IUnknown,
windows_core::IInspectable
);
impl DispatcherQueueController {
pub fn DispatcherQueue(&self) -> windows_core::Result<DispatcherQueue> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DispatcherQueue)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn ShutdownQueueAsync(
&self,
) -> windows_core::Result<windows_future::IAsyncAction> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShutdownQueueAsync)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn ShutdownQueue(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IDispatcherQueueController2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).ShutdownQueue)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn CreateOnDedicatedThread() -> windows_core::Result<DispatcherQueueController>
{
Self::IDispatcherQueueControllerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateOnDedicatedThread)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
pub fn CreateOnCurrentThread() -> windows_core::Result<DispatcherQueueController> {
Self::IDispatcherQueueControllerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateOnCurrentThread)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
fn IDispatcherQueueControllerStatics<
R,
F: FnOnce(&IDispatcherQueueControllerStatics) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<
DispatcherQueueController,
IDispatcherQueueControllerStatics,
> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for DispatcherQueueController {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IDispatcherQueueController>();
}
unsafe impl windows_core::Interface for DispatcherQueueController {
type Vtable = <IDispatcherQueueController as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IDispatcherQueueController as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DispatcherQueueController {
const NAME: &'static str = "Microsoft.UI.Dispatching.DispatcherQueueController";
}
unsafe impl Send for DispatcherQueueController {}
unsafe impl Sync for DispatcherQueueController {}
windows_core::imp::define_interface!(
DispatcherQueueHandler,
DispatcherQueueHandler_Vtbl,
0x2e0872a9_4e29_5f14_b688_fb96d5f9d5f8
);
impl windows_core::RuntimeType for DispatcherQueueHandler {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
impl DispatcherQueueHandler {
pub fn new<F: Fn() -> windows_core::Result<()> + Send + 'static>(
invoke: F,
) -> Self {
let com = DispatcherQueueHandlerBox {
vtable: &DispatcherQueueHandlerBox::<F>::VTABLE,
count: windows_core::imp::RefCount::new(1),
invoke,
};
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Invoke)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
}
#[repr(C)]
#[doc(hidden)]
pub struct DispatcherQueueHandler_Vtbl {
base__: windows_core::IUnknown_Vtbl,
Invoke: unsafe extern "system" fn(
this: *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
#[repr(C)]
struct DispatcherQueueHandlerBox<F: Fn() -> windows_core::Result<()> + Send + 'static> {
vtable: *const DispatcherQueueHandler_Vtbl,
invoke: F,
count: windows_core::imp::RefCount,
}
impl<F: Fn() -> windows_core::Result<()> + Send + 'static> DispatcherQueueHandlerBox<F> {
const VTABLE: DispatcherQueueHandler_Vtbl = DispatcherQueueHandler_Vtbl {
base__: windows_core::IUnknown_Vtbl {
QueryInterface: Self::QueryInterface,
AddRef: Self::AddRef,
Release: Self::Release,
},
Invoke: Self::Invoke,
};
unsafe extern "system" fn QueryInterface(
this: *mut core::ffi::c_void,
iid: *const windows_core::GUID,
interface: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this = this as *mut *mut core::ffi::c_void as *mut Self;
if iid.is_null() || interface.is_null() {
return windows_core::HRESULT(-2147467261);
}
*interface = if *iid
== <DispatcherQueueHandler as windows_core::Interface>::IID
|| *iid == <windows_core::IUnknown as windows_core::Interface>::IID
|| *iid
== <windows_core::imp::IAgileObject as windows_core::Interface>::IID
{
&mut (*this).vtable as *mut _ as _
} else if *iid
== <windows_core::imp::IMarshal as windows_core::Interface>::IID
{
(*this).count.add_ref();
return windows_core::imp::marshaler(
core::mem::transmute(
&mut (*this).vtable as *mut _ as *mut core::ffi::c_void,
),
interface,
);
} else {
core::ptr::null_mut()
};
if (*interface).is_null() {
windows_core::HRESULT(-2147467262)
} else {
(*this).count.add_ref();
windows_core::HRESULT(0)
}
}
}
unsafe extern "system" fn AddRef(this: *mut core::ffi::c_void) -> u32 {
unsafe {
let this = this as *mut *mut core::ffi::c_void as *mut Self;
(*this).count.add_ref()
}
}
unsafe extern "system" fn Release(this: *mut core::ffi::c_void) -> u32 {
unsafe {
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
}
unsafe extern "system" fn Invoke(
this: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this = &mut *(this as *mut *mut core::ffi::c_void as *mut Self);
(this.invoke)().into()
}
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DispatcherQueuePriority(pub i32);
impl DispatcherQueuePriority {
pub const Low: Self = Self(-10i32);
pub const Normal: Self = Self(0i32);
pub const High: Self = Self(10i32);
}
impl windows_core::TypeKind for DispatcherQueuePriority {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for DispatcherQueuePriority {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Dispatching.DispatcherQueuePriority;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DispatcherQueueShutdownStartingEventArgs(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
DispatcherQueueShutdownStartingEventArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
impl DispatcherQueueShutdownStartingEventArgs {
pub fn GetDeferral(&self) -> windows_core::Result<windows::Foundation::Deferral> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetDeferral)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeType for DispatcherQueueShutdownStartingEventArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<
Self,
IDispatcherQueueShutdownStartingEventArgs,
>();
}
unsafe impl windows_core::Interface for DispatcherQueueShutdownStartingEventArgs {
type Vtable =
<IDispatcherQueueShutdownStartingEventArgs as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IDispatcherQueueShutdownStartingEventArgs as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DispatcherQueueShutdownStartingEventArgs {
const NAME: &'static str =
"Microsoft.UI.Dispatching.DispatcherQueueShutdownStartingEventArgs";
}
unsafe impl Send for DispatcherQueueShutdownStartingEventArgs {}
unsafe impl Sync for DispatcherQueueShutdownStartingEventArgs {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DispatcherQueueTimer(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
DispatcherQueueTimer,
windows_core::IUnknown,
windows_core::IInspectable
);
impl DispatcherQueueTimer {
pub fn Interval(&self) -> windows_core::Result<windows::Foundation::TimeSpan> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Interval)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetInterval(
&self,
value: windows::Foundation::TimeSpan,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetInterval)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn IsRunning(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsRunning)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsRepeating(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsRepeating)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetIsRepeating(&self, value: bool) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetIsRepeating)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn Start(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Start)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn Stop(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Stop)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn Tick<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
DispatcherQueueTimer,
windows_core::IInspectable,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Tick)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveTick(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveTick)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeType for DispatcherQueueTimer {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IDispatcherQueueTimer>();
}
unsafe impl windows_core::Interface for DispatcherQueueTimer {
type Vtable = <IDispatcherQueueTimer as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IDispatcherQueueTimer as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DispatcherQueueTimer {
const NAME: &'static str = "Microsoft.UI.Dispatching.DispatcherQueueTimer";
}
unsafe impl Send for DispatcherQueueTimer {}
unsafe impl Sync for DispatcherQueueTimer {}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct DispatcherRunOptions(pub u32);
impl DispatcherRunOptions {
pub const None: Self = Self(0u32);
pub const ContinueOnQuit: Self = Self(1u32);
pub const QuitOnlyLocalLoop: Self = Self(2u32);
}
impl windows_core::TypeKind for DispatcherRunOptions {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for DispatcherRunOptions {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Dispatching.DispatcherRunOptions;u4)",
);
}
impl DispatcherRunOptions {
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
}
impl core::ops::BitOr for DispatcherRunOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl core::ops::BitAnd for DispatcherRunOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
impl core::ops::BitOrAssign for DispatcherRunOptions {
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl core::ops::BitAndAssign for DispatcherRunOptions {
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0)
}
}
impl core::ops::Not for DispatcherRunOptions {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
windows_core::imp::define_interface!(
IDispatcherExitDeferral,
IDispatcherExitDeferral_Vtbl,
0x910b5aac_3310_563e_8418_f3005579729e
);
impl windows_core::RuntimeType for IDispatcherExitDeferral {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherExitDeferral_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Complete:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueue,
IDispatcherQueue_Vtbl,
0xf6ebf8fa_be1c_5bf6_a467_73da28738ae8
);
impl windows_core::RuntimeType for IDispatcherQueue {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueue_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateTimer: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub TryEnqueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut bool,
) -> windows_core::HRESULT,
pub TryEnqueueWithPriority: unsafe extern "system" fn(
*mut core::ffi::c_void,
DispatcherQueuePriority,
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
pub ShutdownStarting: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
)
-> windows_core::HRESULT,
pub RemoveShutdownStarting:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
pub ShutdownCompleted: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
)
-> windows_core::HRESULT,
pub RemoveShutdownCompleted:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueue2,
IDispatcherQueue2_Vtbl,
0x0cf48751_f1ac_59b8_ba52_6ce7a1444d6f
);
impl windows_core::RuntimeType for IDispatcherQueue2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueue2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub HasThreadAccess: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueue3,
IDispatcherQueue3_Vtbl,
0x14a7a175_5c27_5a35_b079_21960cf764a8
);
impl windows_core::RuntimeType for IDispatcherQueue3 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueue3_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub EnqueueEventLoopExit:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub EnsureSystemDispatcherQueue:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub RunEventLoop:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub RunEventLoopWithOptions: unsafe extern "system" fn(
*mut core::ffi::c_void,
DispatcherRunOptions,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub FrameworkShutdownStarting: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
)
-> windows_core::HRESULT,
pub RemoveFrameworkShutdownStarting:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
pub FrameworkShutdownCompleted: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
)
-> windows_core::HRESULT,
pub RemoveFrameworkShutdownCompleted:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueController,
IDispatcherQueueController_Vtbl,
0xbce8178d_2183_584c_9e5b_f9366f6ae484
);
impl windows_core::RuntimeType for IDispatcherQueueController {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueController_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub DispatcherQueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub ShutdownQueueAsync: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueController2,
IDispatcherQueueController2_Vtbl,
0x4c68ee2a_1cb1_5591_a3a2_9b590b8f8b9a
);
impl windows_core::RuntimeType for IDispatcherQueueController2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueController2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ShutdownQueue:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueControllerStatics,
IDispatcherQueueControllerStatics_Vtbl,
0xf18d6145_722b_593d_bcf2_a61e713f0037
);
impl windows_core::RuntimeType for IDispatcherQueueControllerStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueControllerStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateOnDedicatedThread: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub CreateOnCurrentThread: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueShutdownStartingEventArgs,
IDispatcherQueueShutdownStartingEventArgs_Vtbl,
0x32519be5_072b_5660_a70e_8835c9b8157d
);
impl windows_core::RuntimeType for IDispatcherQueueShutdownStartingEventArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueShutdownStartingEventArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetDeferral: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueStatics,
IDispatcherQueueStatics_Vtbl,
0xcd3382ea_a455_5124_b63a_ca40d34ca23c
);
impl windows_core::RuntimeType for IDispatcherQueueStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetForCurrentThread: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IDispatcherQueueTimer,
IDispatcherQueueTimer_Vtbl,
0xad4d63fd_88fe_541f_ac11_bf2dc1ed2ce5
);
impl windows_core::RuntimeType for IDispatcherQueueTimer {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDispatcherQueueTimer_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Interval: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Foundation::TimeSpan,
) -> windows_core::HRESULT,
pub SetInterval: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Foundation::TimeSpan,
)
-> windows_core::HRESULT,
pub IsRunning: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
) -> windows_core::HRESULT,
pub IsRepeating: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
pub SetIsRepeating: unsafe extern "system" fn(
*mut core::ffi::c_void,
bool,
)
-> windows_core::HRESULT,
pub Start:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub Stop:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub Tick: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
) -> windows_core::HRESULT,
pub RemoveTick:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
}
pub mod Input {
windows_core::imp::define_interface!(
IInputNonClientPointerSource,
IInputNonClientPointerSource_Vtbl,
0x471732b4_3d07_5104_b192_ebacf71e86df
);
impl windows_core::RuntimeType for IInputNonClientPointerSource {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IInputNonClientPointerSource_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub DispatcherQueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub ClearAllRegionRects:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub ClearRegionRects: unsafe extern "system" fn(
*mut core::ffi::c_void,
NonClientRegionKind,
)
-> windows_core::HRESULT,
pub GetRegionRects: unsafe extern "system" fn(
*mut core::ffi::c_void,
NonClientRegionKind,
*mut u32,
*mut *mut windows::Graphics::RectInt32,
)
-> windows_core::HRESULT,
pub SetRegionRects: unsafe extern "system" fn(
*mut core::ffi::c_void,
NonClientRegionKind,
u32,
*const windows::Graphics::RectInt32,
)
-> windows_core::HRESULT,
CaptionTapped: usize,
pub RemoveCaptionTapped:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
PointerEntered: usize,
pub RemovePointerEntered:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
PointerExited: usize,
pub RemovePointerExited:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
PointerMoved: usize,
pub RemovePointerMoved:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
PointerPressed: usize,
pub RemovePointerPressed:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
PointerReleased: usize,
pub RemovePointerReleased:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
RegionsChanged: usize,
pub RemoveRegionsChanged:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IInputNonClientPointerSource2,
IInputNonClientPointerSource2_Vtbl,
0xdd2b10c4_7de6_5c1d_b438_06ddc994058f
);
impl windows_core::RuntimeType for IInputNonClientPointerSource2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IInputNonClientPointerSource2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
EnteringMoveSize: usize,
pub RemoveEnteringMoveSize:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
EnteredMoveSize: usize,
pub RemoveEnteredMoveSize:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
WindowRectChanging: usize,
pub RemoveWindowRectChanging:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
WindowRectChanged: usize,
pub RemoveWindowRectChanged:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
ExitedMoveSize: usize,
pub RemoveExitedMoveSize:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IInputNonClientPointerSourceStatics,
IInputNonClientPointerSourceStatics_Vtbl,
0x7d0b775c_1903_5dc7_bd2f_7a4b31f0cff2
);
impl windows_core::RuntimeType for IInputNonClientPointerSourceStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IInputNonClientPointerSourceStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetForWindowId: unsafe extern "system" fn(
*mut core::ffi::c_void,
super::WindowId,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct InputNonClientPointerSource(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
InputNonClientPointerSource,
windows_core::IUnknown,
windows_core::IInspectable
);
impl InputNonClientPointerSource {
pub fn DispatcherQueue(
&self,
) -> windows_core::Result<super::Dispatching::DispatcherQueue> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DispatcherQueue)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn ClearAllRegionRects(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).ClearAllRegionRects)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn ClearRegionRects(
&self,
region: NonClientRegionKind,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).ClearRegionRects)(
windows_core::Interface::as_raw(this),
region,
)
.ok()
}
}
pub fn GetRegionRects(
&self,
region: NonClientRegionKind,
) -> windows_core::Result<windows_core::Array<windows::Graphics::RectInt32>>
{
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetRegionRects)(
windows_core::Interface::as_raw(this),
region,
windows_core::Array::<windows::Graphics::RectInt32>::set_abi_len(
core::mem::transmute(&mut result__),
),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
pub fn SetRegionRects(
&self,
region: NonClientRegionKind,
rects: &[windows::Graphics::RectInt32],
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetRegionRects)(
windows_core::Interface::as_raw(this),
region,
rects.len().try_into().unwrap(),
rects.as_ptr(),
)
.ok()
}
}
pub fn RemoveCaptionTapped(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveCaptionTapped)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemovePointerEntered(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePointerEntered)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemovePointerExited(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePointerExited)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemovePointerMoved(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePointerMoved)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemovePointerPressed(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePointerPressed)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemovePointerReleased(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePointerReleased)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveRegionsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveRegionsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveEnteringMoveSize(&self, token: i64) -> windows_core::Result<()> {
let this =
&windows_core::Interface::cast::<IInputNonClientPointerSource2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveEnteringMoveSize)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveEnteredMoveSize(&self, token: i64) -> windows_core::Result<()> {
let this =
&windows_core::Interface::cast::<IInputNonClientPointerSource2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveEnteredMoveSize)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveWindowRectChanging(&self, token: i64) -> windows_core::Result<()> {
let this =
&windows_core::Interface::cast::<IInputNonClientPointerSource2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveWindowRectChanging)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveWindowRectChanged(&self, token: i64) -> windows_core::Result<()> {
let this =
&windows_core::Interface::cast::<IInputNonClientPointerSource2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveWindowRectChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveExitedMoveSize(&self, token: i64) -> windows_core::Result<()> {
let this =
&windows_core::Interface::cast::<IInputNonClientPointerSource2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveExitedMoveSize)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn GetForWindowId(
windowid: super::WindowId,
) -> windows_core::Result<InputNonClientPointerSource> {
Self::IInputNonClientPointerSourceStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetForWindowId)(
windows_core::Interface::as_raw(this),
windowid,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
fn IInputNonClientPointerSourceStatics<
R,
F: FnOnce(&IInputNonClientPointerSourceStatics) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<
InputNonClientPointerSource,
IInputNonClientPointerSourceStatics,
> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for InputNonClientPointerSource {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IInputNonClientPointerSource>(
);
}
unsafe impl windows_core::Interface for InputNonClientPointerSource {
type Vtable = <IInputNonClientPointerSource as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IInputNonClientPointerSource as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for InputNonClientPointerSource {
const NAME: &'static str = "Microsoft.UI.Input.InputNonClientPointerSource";
}
unsafe impl Send for InputNonClientPointerSource {}
unsafe impl Sync for InputNonClientPointerSource {}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct NonClientRegionKind(pub i32);
impl NonClientRegionKind {
pub const Close: Self = Self(0i32);
pub const Maximize: Self = Self(1i32);
pub const Minimize: Self = Self(2i32);
pub const Icon: Self = Self(3i32);
pub const Caption: Self = Self(4i32);
pub const TopBorder: Self = Self(5i32);
pub const LeftBorder: Self = Self(6i32);
pub const BottomBorder: Self = Self(7i32);
pub const RightBorder: Self = Self(8i32);
pub const Passthrough: Self = Self(9i32);
}
impl windows_core::TypeKind for NonClientRegionKind {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for NonClientRegionKind {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Input.NonClientRegionKind;i4)",
);
}
}
pub mod Windowing {
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AppWindow(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
AppWindow,
windows_core::IUnknown,
windows_core::IInspectable
);
impl AppWindow {
pub fn Id(&self) -> windows_core::Result<super::WindowId> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsShownInSwitchers(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsShownInSwitchers)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetIsShownInSwitchers(&self, value: bool) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetIsShownInSwitchers)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn IsVisible(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsVisible)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn OwnerWindowId(&self) -> windows_core::Result<super::WindowId> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).OwnerWindowId)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Position(&self) -> windows_core::Result<windows::Graphics::PointInt32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Position)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Presenter(&self) -> windows_core::Result<AppWindowPresenter> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Presenter)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn Size(&self) -> windows_core::Result<windows::Graphics::SizeInt32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Size)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
pub fn SetTitle(&self, value: &windows_core::HSTRING) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetTitle)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(value),
)
.ok()
}
}
pub fn TitleBar(&self) -> windows_core::Result<AppWindowTitleBar> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TitleBar)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn Destroy(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Destroy)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn Hide(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Hide)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn Move(
&self,
position: windows::Graphics::PointInt32,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Move)(
windows_core::Interface::as_raw(this),
position,
)
.ok()
}
}
pub fn MoveAndResize(
&self,
rect: windows::Graphics::RectInt32,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).MoveAndResize)(
windows_core::Interface::as_raw(this),
rect,
)
.ok()
}
}
pub fn Resize(
&self,
size: windows::Graphics::SizeInt32,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Resize)(
windows_core::Interface::as_raw(this),
size,
)
.ok()
}
}
pub fn SetIcon(
&self,
iconpath: &windows_core::HSTRING,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetIcon)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(iconpath),
)
.ok()
}
}
pub fn SetPresenter<P0>(&self, appwindowpresenter: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<AppWindowPresenter>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetPresenter)(
windows_core::Interface::as_raw(this),
appwindowpresenter.param().abi(),
)
.ok()
}
}
pub fn SetPresenterByKind(
&self,
appwindowpresenterkind: AppWindowPresenterKind,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetPresenterByKind)(
windows_core::Interface::as_raw(this),
appwindowpresenterkind,
)
.ok()
}
}
pub fn Show(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Show)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn ShowWithActivation(&self, activatewindow: bool) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).ShowWithActivation)(
windows_core::Interface::as_raw(this),
activatewindow,
)
.ok()
}
}
pub fn RemoveChanged(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn RemoveClosing(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveClosing)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn Destroying<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
AppWindow,
windows_core::IInspectable,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Destroying)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
pub fn RemoveDestroying(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveDestroying)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
pub fn ClientSize(&self) -> windows_core::Result<windows::Graphics::SizeInt32> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ClientSize)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn MoveInZOrderAtBottom(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).MoveInZOrderAtBottom)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn MoveInZOrderAtTop(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).MoveInZOrderAtTop)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn MoveInZOrderBelow(
&self,
windowid: super::WindowId,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).MoveInZOrderBelow)(
windows_core::Interface::as_raw(this),
windowid,
)
.ok()
}
}
pub fn ResizeClient(
&self,
size: windows::Graphics::SizeInt32,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).ResizeClient)(
windows_core::Interface::as_raw(this),
size,
)
.ok()
}
}
pub fn ShowOnceWithRequestedStartupState(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).ShowOnceWithRequestedStartupState)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn AssociateWithDispatcherQueue<P0>(
&self,
dispatcherqueue: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<super::Dispatching::DispatcherQueue>,
{
let this = &windows_core::Interface::cast::<IAppWindow3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).AssociateWithDispatcherQueue)(
windows_core::Interface::as_raw(this),
dispatcherqueue.param().abi(),
)
.ok()
}
}
pub fn DispatcherQueue(
&self,
) -> windows_core::Result<super::Dispatching::DispatcherQueue> {
let this = &windows_core::Interface::cast::<IAppWindow3>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DispatcherQueue)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetTaskbarIcon(
&self,
iconpath: &windows_core::HSTRING,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow4>(self)?;
unsafe {
(windows_core::Interface::vtable(this).SetTaskbarIcon)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(iconpath),
)
.ok()
}
}
pub fn SetTitleBarIcon(
&self,
iconpath: &windows_core::HSTRING,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindow4>(self)?;
unsafe {
(windows_core::Interface::vtable(this).SetTitleBarIcon)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(iconpath),
)
.ok()
}
}
pub fn Create() -> windows_core::Result<AppWindow> {
Self::IAppWindowStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Create)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
pub fn CreateWithPresenter<P0>(
appwindowpresenter: P0,
) -> windows_core::Result<AppWindow>
where
P0: windows_core::Param<AppWindowPresenter>,
{
Self::IAppWindowStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateWithPresenter)(
windows_core::Interface::as_raw(this),
appwindowpresenter.param().abi(),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
pub fn CreateWithPresenterAndOwner<P0>(
appwindowpresenter: P0,
ownerwindowid: super::WindowId,
) -> windows_core::Result<AppWindow>
where
P0: windows_core::Param<AppWindowPresenter>,
{
Self::IAppWindowStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateWithPresenterAndOwner)(
windows_core::Interface::as_raw(this),
appwindowpresenter.param().abi(),
ownerwindowid,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
pub fn GetFromWindowId(
windowid: super::WindowId,
) -> windows_core::Result<AppWindow> {
Self::IAppWindowStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetFromWindowId)(
windows_core::Interface::as_raw(this),
windowid,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
pub fn CreateWithDispatcherQueue<P0, P2>(
appwindowpresenter: P0,
ownerwindowid: super::WindowId,
dispatcherqueue: P2,
) -> windows_core::Result<AppWindow>
where
P0: windows_core::Param<AppWindowPresenter>,
P2: windows_core::Param<super::Dispatching::DispatcherQueue>,
{
Self::IAppWindowStatics2(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateWithDispatcherQueue)(
windows_core::Interface::as_raw(this),
appwindowpresenter.param().abi(),
ownerwindowid,
dispatcherqueue.param().abi(),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
fn IAppWindowStatics<
R,
F: FnOnce(&IAppWindowStatics) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<AppWindow, IAppWindowStatics> =
windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
fn IAppWindowStatics2<
R,
F: FnOnce(&IAppWindowStatics2) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<AppWindow, IAppWindowStatics2> =
windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for AppWindow {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IAppWindow>();
}
unsafe impl windows_core::Interface for AppWindow {
type Vtable = <IAppWindow as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IAppWindow as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for AppWindow {
const NAME: &'static str = "Microsoft.UI.Windowing.AppWindow";
}
unsafe impl Send for AppWindow {}
unsafe impl Sync for AppWindow {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AppWindowPresenter(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
AppWindowPresenter,
windows_core::IUnknown,
windows_core::IInspectable
);
impl AppWindowPresenter {
pub fn Kind(&self) -> windows_core::Result<AppWindowPresenterKind> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Kind)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeType for AppWindowPresenter {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IAppWindowPresenter>();
}
unsafe impl windows_core::Interface for AppWindowPresenter {
type Vtable = <IAppWindowPresenter as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IAppWindowPresenter as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for AppWindowPresenter {
const NAME: &'static str = "Microsoft.UI.Windowing.AppWindowPresenter";
}
unsafe impl Send for AppWindowPresenter {}
unsafe impl Sync for AppWindowPresenter {}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct AppWindowPresenterKind(pub i32);
impl AppWindowPresenterKind {
pub const Default: Self = Self(0i32);
pub const CompactOverlay: Self = Self(1i32);
pub const FullScreen: Self = Self(2i32);
pub const Overlapped: Self = Self(3i32);
}
impl windows_core::TypeKind for AppWindowPresenterKind {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for AppWindowPresenterKind {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Windowing.AppWindowPresenterKind;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AppWindowTitleBar(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
AppWindowTitleBar,
windows_core::IUnknown,
windows_core::IInspectable
);
impl AppWindowTitleBar {
pub fn BackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).BackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetBackgroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonBackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonBackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonBackgroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonForegroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonHoverBackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonHoverBackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonHoverBackgroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonHoverBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonHoverForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonHoverForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonHoverForegroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonHoverForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonInactiveBackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonInactiveBackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonInactiveBackgroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonInactiveBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonInactiveForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonInactiveForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonInactiveForegroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonInactiveForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonPressedBackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonPressedBackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonPressedBackgroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonPressedBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ButtonPressedForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ButtonPressedForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetButtonPressedForegroundColor<P0>(
&self,
value: P0,
) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetButtonPressedForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn ExtendsContentIntoTitleBar(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ExtendsContentIntoTitleBar)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetExtendsContentIntoTitleBar(
&self,
value: bool,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetExtendsContentIntoTitleBar)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn ForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetForegroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn Height(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Height)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IconShowOptions(&self) -> windows_core::Result<IconShowOptions> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IconShowOptions)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetIconShowOptions(
&self,
value: IconShowOptions,
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetIconShowOptions)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn InactiveBackgroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).InactiveBackgroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetInactiveBackgroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetInactiveBackgroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn InactiveForegroundColor(
&self,
) -> windows_core::Result<windows::Foundation::IReference<windows::UI::Color>>
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).InactiveForegroundColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn SetInactiveForegroundColor<P0>(&self, value: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<windows::Foundation::IReference<windows::UI::Color>>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetInactiveForegroundColor)(
windows_core::Interface::as_raw(this),
value.param().abi(),
)
.ok()
}
}
pub fn LeftInset(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).LeftInset)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn RightInset(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).RightInset)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn ResetToDefault(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).ResetToDefault)(
windows_core::Interface::as_raw(this),
)
.ok()
}
}
pub fn SetDragRectangles(
&self,
value: &[windows::Graphics::RectInt32],
) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetDragRectangles)(
windows_core::Interface::as_raw(this),
value.len().try_into().unwrap(),
value.as_ptr(),
)
.ok()
}
}
pub fn PreferredHeightOption(&self) -> windows_core::Result<TitleBarHeightOption> {
let this = &windows_core::Interface::cast::<IAppWindowTitleBar2>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PreferredHeightOption)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetPreferredHeightOption(
&self,
value: TitleBarHeightOption,
) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindowTitleBar2>(self)?;
unsafe {
(windows_core::Interface::vtable(this).SetPreferredHeightOption)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn PreferredTheme(&self) -> windows_core::Result<TitleBarTheme> {
let this = &windows_core::Interface::cast::<IAppWindowTitleBar3>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PreferredTheme)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn SetPreferredTheme(&self, value: TitleBarTheme) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IAppWindowTitleBar3>(self)?;
unsafe {
(windows_core::Interface::vtable(this).SetPreferredTheme)(
windows_core::Interface::as_raw(this),
value,
)
.ok()
}
}
pub fn IsCustomizationSupported() -> windows_core::Result<bool> {
Self::IAppWindowTitleBarStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsCustomizationSupported)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
})
}
fn IAppWindowTitleBarStatics<
R,
F: FnOnce(&IAppWindowTitleBarStatics) -> windows_core::Result<R>,
>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<
AppWindowTitleBar,
IAppWindowTitleBarStatics,
> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for AppWindowTitleBar {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IAppWindowTitleBar>();
}
unsafe impl windows_core::Interface for AppWindowTitleBar {
type Vtable = <IAppWindowTitleBar as windows_core::Interface>::Vtable;
const IID: windows_core::GUID =
<IAppWindowTitleBar as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for AppWindowTitleBar {
const NAME: &'static str = "Microsoft.UI.Windowing.AppWindowTitleBar";
}
unsafe impl Send for AppWindowTitleBar {}
unsafe impl Sync for AppWindowTitleBar {}
windows_core::imp::define_interface!(
IAppWindow,
IAppWindow_Vtbl,
0xcfa788b3_643b_5c5e_ad4e_321d48a82acd
);
impl windows_core::RuntimeType for IAppWindow {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindow_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Id: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut super::WindowId,
) -> windows_core::HRESULT,
pub IsShownInSwitchers: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
pub SetIsShownInSwitchers: unsafe extern "system" fn(
*mut core::ffi::c_void,
bool,
)
-> windows_core::HRESULT,
pub IsVisible: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
) -> windows_core::HRESULT,
pub OwnerWindowId: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut super::WindowId,
)
-> windows_core::HRESULT,
pub Position: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Graphics::PointInt32,
) -> windows_core::HRESULT,
pub Presenter: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Size: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Graphics::SizeInt32,
) -> windows_core::HRESULT,
pub Title: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetTitle: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub TitleBar: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Destroy:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub Hide:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub Move: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Graphics::PointInt32,
) -> windows_core::HRESULT,
pub MoveAndResize: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Graphics::RectInt32,
)
-> windows_core::HRESULT,
MoveAndResizeRelativeToDisplayArea: usize,
pub Resize: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Graphics::SizeInt32,
) -> windows_core::HRESULT,
pub SetIcon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
SetIconWithIconId: usize,
pub SetPresenter: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetPresenterByKind: unsafe extern "system" fn(
*mut core::ffi::c_void,
AppWindowPresenterKind,
)
-> windows_core::HRESULT,
pub Show:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub ShowWithActivation: unsafe extern "system" fn(
*mut core::ffi::c_void,
bool,
)
-> windows_core::HRESULT,
Changed: usize,
pub RemoveChanged:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
Closing: usize,
pub RemoveClosing:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
pub Destroying: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
) -> windows_core::HRESULT,
pub RemoveDestroying:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindow2,
IAppWindow2_Vtbl,
0x6cd41292_794c_5cac_8961_210d012c6ebc
);
impl windows_core::RuntimeType for IAppWindow2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindow2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ClientSize: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Graphics::SizeInt32,
) -> windows_core::HRESULT,
pub MoveInZOrderAtBottom:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub MoveInZOrderAtTop:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub MoveInZOrderBelow: unsafe extern "system" fn(
*mut core::ffi::c_void,
super::WindowId,
)
-> windows_core::HRESULT,
pub ResizeClient: unsafe extern "system" fn(
*mut core::ffi::c_void,
windows::Graphics::SizeInt32,
)
-> windows_core::HRESULT,
pub ShowOnceWithRequestedStartupState:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindow3,
IAppWindow3_Vtbl,
0x2f260cea_193d_5dd6_a904_d7649a608d2f
);
impl windows_core::RuntimeType for IAppWindow3 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindow3_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub AssociateWithDispatcherQueue:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub DispatcherQueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindow4,
IAppWindow4_Vtbl,
0x383bfb91_ea29_5414_80cd_6c76d981eb31
);
impl windows_core::RuntimeType for IAppWindow4 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindow4_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub SetTaskbarIcon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
SetTaskbarIconWithIconId: usize,
pub SetTitleBarIcon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
SetTitleBarIconWithIconId: usize,
}
windows_core::imp::define_interface!(
IAppWindowPresenter,
IAppWindowPresenter_Vtbl,
0xbc3042c2_c6c6_5632_8989_ff0ec6d3b40d
);
impl windows_core::RuntimeType for IAppWindowPresenter {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowPresenter_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Kind: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut AppWindowPresenterKind,
) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowPresenterFactory,
IAppWindowPresenterFactory_Vtbl,
0x62082e3c_1368_5238_90d1_e932dc718a82
);
impl windows_core::RuntimeType for IAppWindowPresenterFactory {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowPresenterFactory_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
windows_core::imp::define_interface!(
IAppWindowStatics,
IAppWindowStatics_Vtbl,
0x3c315c24_d540_5d72_b518_b226b83627cb
);
impl windows_core::RuntimeType for IAppWindowStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Create: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub CreateWithPresenter: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub CreateWithPresenterAndOwner: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
super::WindowId,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub GetFromWindowId: unsafe extern "system" fn(
*mut core::ffi::c_void,
super::WindowId,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowStatics2,
IAppWindowStatics2_Vtbl,
0xcabc23db_4606_5d6e_89a5_06de1d8bd3e2
);
impl windows_core::RuntimeType for IAppWindowStatics2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowStatics2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateWithDispatcherQueue: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
super::WindowId,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowTitleBar,
IAppWindowTitleBar_Vtbl,
0x5574efa2_c91c_5700_a363_539c71a7aaf4
);
impl windows_core::RuntimeType for IAppWindowTitleBar {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowTitleBar_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub BackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub ButtonBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetButtonBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub ButtonForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetButtonForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub ButtonHoverBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetButtonHoverBackgroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ButtonHoverForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetButtonHoverForegroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ButtonInactiveBackgroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetButtonInactiveBackgroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ButtonInactiveForegroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetButtonInactiveForegroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ButtonPressedBackgroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetButtonPressedBackgroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ButtonPressedForegroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetButtonPressedForegroundColor:
unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ExtendsContentIntoTitleBar: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
pub SetExtendsContentIntoTitleBar:
unsafe extern "system" fn(
*mut core::ffi::c_void,
bool,
) -> windows_core::HRESULT,
pub ForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub Height: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut i32,
) -> windows_core::HRESULT,
pub IconShowOptions: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut IconShowOptions,
)
-> windows_core::HRESULT,
pub SetIconShowOptions: unsafe extern "system" fn(
*mut core::ffi::c_void,
IconShowOptions,
)
-> windows_core::HRESULT,
pub InactiveBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetInactiveBackgroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub InactiveForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub SetInactiveForegroundColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
)
-> windows_core::HRESULT,
pub LeftInset: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut i32,
) -> windows_core::HRESULT,
pub RightInset: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut i32,
) -> windows_core::HRESULT,
pub ResetToDefault:
unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
pub SetDragRectangles: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*const windows::Graphics::RectInt32,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowTitleBar2,
IAppWindowTitleBar2_Vtbl,
0x86faed38_748a_5b4b_9ccf_3ba0496c9041
);
impl windows_core::RuntimeType for IAppWindowTitleBar2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowTitleBar2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub PreferredHeightOption: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut TitleBarHeightOption,
)
-> windows_core::HRESULT,
pub SetPreferredHeightOption: unsafe extern "system" fn(
*mut core::ffi::c_void,
TitleBarHeightOption,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowTitleBar3,
IAppWindowTitleBar3_Vtbl,
0x07146e74_0410_5597_aba7_1af276d2ae07
);
impl windows_core::RuntimeType for IAppWindowTitleBar3 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowTitleBar3_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub PreferredTheme: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut TitleBarTheme,
)
-> windows_core::HRESULT,
pub SetPreferredTheme: unsafe extern "system" fn(
*mut core::ffi::c_void,
TitleBarTheme,
)
-> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IAppWindowTitleBarStatics,
IAppWindowTitleBarStatics_Vtbl,
0x9e1da52e_8b15_54d6_a886_f7b9f9d930b2
);
impl windows_core::RuntimeType for IAppWindowTitleBarStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IAppWindowTitleBarStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub IsCustomizationSupported: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut bool,
)
-> windows_core::HRESULT,
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct IconShowOptions(pub i32);
impl IconShowOptions {
pub const ShowIconAndSystemMenu: Self = Self(0i32);
pub const HideIconAndSystemMenu: Self = Self(1i32);
}
impl windows_core::TypeKind for IconShowOptions {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for IconShowOptions {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Windowing.IconShowOptions;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct TitleBarHeightOption(pub i32);
impl TitleBarHeightOption {
pub const Standard: Self = Self(0i32);
pub const Tall: Self = Self(1i32);
pub const Collapsed: Self = Self(2i32);
}
impl windows_core::TypeKind for TitleBarHeightOption {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for TitleBarHeightOption {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Windowing.TitleBarHeightOption;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct TitleBarTheme(pub i32);
impl TitleBarTheme {
pub const Legacy: Self = Self(0i32);
pub const UseDefaultAppMode: Self = Self(1i32);
pub const Light: Self = Self(2i32);
pub const Dark: Self = Self(3i32);
}
impl windows_core::TypeKind for TitleBarTheme {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for TitleBarTheme {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Windowing.TitleBarTheme;i4)",
);
}
}
}
}