#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
dead_code,
clippy::all
)]
windows_core::imp::define_interface!(
IPointerPoint,
IPointerPoint_Vtbl,
0x0d430ee6_252c_59a4_b2a2_d44264dc6a40
);
impl windows_core::RuntimeType for IPointerPoint {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
impl windows_core::RuntimeName for IPointerPoint {
const NAME: &'static str = "Microsoft.UI.Input.IPointerPoint";
}
pub trait IPointerPoint_Impl: windows_core::IUnknownImpl {
fn FrameId(&self) -> windows_core::Result<u32>;
fn IsInContact(&self) -> windows_core::Result<bool>;
fn PointerDeviceType(&self) -> windows_core::Result<PointerDeviceType>;
fn PointerId(&self) -> windows_core::Result<u32>;
fn Position(&self) -> windows_core::Result<windows::Foundation::Point>;
fn Properties(&self) -> windows_core::Result<PointerPointProperties>;
fn Timestamp(&self) -> windows_core::Result<u64>;
}
impl IPointerPoint_Vtbl {
pub const fn new<Identity: IPointerPoint_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn FrameId<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::FrameId(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsInContact<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::IsInContact(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn PointerDeviceType<
Identity: IPointerPoint_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut PointerDeviceType,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::PointerDeviceType(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn PointerId<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::PointerId(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Position<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut windows::Foundation::Point,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::Position(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Properties<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::Properties(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Timestamp<Identity: IPointerPoint_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut u64,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPoint_Impl::Timestamp(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IPointerPoint, OFFSET>(),
FrameId: FrameId::<Identity, OFFSET>,
IsInContact: IsInContact::<Identity, OFFSET>,
PointerDeviceType: PointerDeviceType::<Identity, OFFSET>,
PointerId: PointerId::<Identity, OFFSET>,
Position: Position::<Identity, OFFSET>,
Properties: Properties::<Identity, OFFSET>,
Timestamp: Timestamp::<Identity, OFFSET>,
GetTransformedPoint: 0,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IPointerPoint as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IPointerPoint_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub FrameId:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT,
pub IsInContact:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub PointerDeviceType: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut PointerDeviceType,
) -> windows_core::HRESULT,
pub PointerId:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT,
pub Position: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Foundation::Point,
) -> windows_core::HRESULT,
pub Properties: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Timestamp:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT,
GetTransformedPoint: usize,
}
windows_core::imp::define_interface!(
IPointerPointProperties,
IPointerPointProperties_Vtbl,
0xd760ed77_4b10_57a5_b3cc_d9bf3413e996
);
impl windows_core::RuntimeType for IPointerPointProperties {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
impl windows_core::RuntimeName for IPointerPointProperties {
const NAME: &'static str = "Microsoft.UI.Input.IPointerPointProperties";
}
pub trait IPointerPointProperties_Impl: windows_core::IUnknownImpl {
fn ContactRect(&self) -> windows_core::Result<windows::Foundation::Rect>;
fn IsBarrelButtonPressed(&self) -> windows_core::Result<bool>;
fn IsCanceled(&self) -> windows_core::Result<bool>;
fn IsEraser(&self) -> windows_core::Result<bool>;
fn IsHorizontalMouseWheel(&self) -> windows_core::Result<bool>;
fn IsInRange(&self) -> windows_core::Result<bool>;
fn IsInverted(&self) -> windows_core::Result<bool>;
fn IsLeftButtonPressed(&self) -> windows_core::Result<bool>;
fn IsMiddleButtonPressed(&self) -> windows_core::Result<bool>;
fn IsPrimary(&self) -> windows_core::Result<bool>;
fn IsRightButtonPressed(&self) -> windows_core::Result<bool>;
fn IsXButton1Pressed(&self) -> windows_core::Result<bool>;
fn IsXButton2Pressed(&self) -> windows_core::Result<bool>;
fn MouseWheelDelta(&self) -> windows_core::Result<i32>;
fn Orientation(&self) -> windows_core::Result<f32>;
fn Pressure(&self) -> windows_core::Result<f32>;
fn TouchConfidence(&self) -> windows_core::Result<bool>;
fn Twist(&self) -> windows_core::Result<f32>;
fn XTilt(&self) -> windows_core::Result<f32>;
fn YTilt(&self) -> windows_core::Result<f32>;
}
impl IPointerPointProperties_Vtbl {
pub const fn new<Identity: IPointerPointProperties_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn ContactRect<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut windows::Foundation::Rect,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::ContactRect(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsBarrelButtonPressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsBarrelButtonPressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsCanceled<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsCanceled(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsEraser<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsEraser(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsHorizontalMouseWheel<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsHorizontalMouseWheel(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsInRange<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsInRange(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsInverted<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsInverted(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsLeftButtonPressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsLeftButtonPressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsMiddleButtonPressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsMiddleButtonPressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsPrimary<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsPrimary(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsRightButtonPressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsRightButtonPressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsXButton1Pressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsXButton1Pressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsXButton2Pressed<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::IsXButton2Pressed(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn MouseWheelDelta<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut i32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::MouseWheelDelta(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Orientation<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut f32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::Orientation(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Pressure<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut f32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::Pressure(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn TouchConfidence<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::TouchConfidence(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Twist<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut f32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::Twist(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn XTilt<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut f32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::XTilt(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn YTilt<
Identity: IPointerPointProperties_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut f32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointProperties_Impl::YTilt(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IPointerPointProperties, OFFSET>(
),
ContactRect: ContactRect::<Identity, OFFSET>,
IsBarrelButtonPressed: IsBarrelButtonPressed::<Identity, OFFSET>,
IsCanceled: IsCanceled::<Identity, OFFSET>,
IsEraser: IsEraser::<Identity, OFFSET>,
IsHorizontalMouseWheel: IsHorizontalMouseWheel::<Identity, OFFSET>,
IsInRange: IsInRange::<Identity, OFFSET>,
IsInverted: IsInverted::<Identity, OFFSET>,
IsLeftButtonPressed: IsLeftButtonPressed::<Identity, OFFSET>,
IsMiddleButtonPressed: IsMiddleButtonPressed::<Identity, OFFSET>,
IsPrimary: IsPrimary::<Identity, OFFSET>,
IsRightButtonPressed: IsRightButtonPressed::<Identity, OFFSET>,
IsXButton1Pressed: IsXButton1Pressed::<Identity, OFFSET>,
IsXButton2Pressed: IsXButton2Pressed::<Identity, OFFSET>,
MouseWheelDelta: MouseWheelDelta::<Identity, OFFSET>,
Orientation: Orientation::<Identity, OFFSET>,
PointerUpdateKind: 0,
Pressure: Pressure::<Identity, OFFSET>,
TouchConfidence: TouchConfidence::<Identity, OFFSET>,
Twist: Twist::<Identity, OFFSET>,
XTilt: XTilt::<Identity, OFFSET>,
YTilt: YTilt::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IPointerPointProperties as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IPointerPointProperties_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ContactRect: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Foundation::Rect,
) -> windows_core::HRESULT,
pub IsBarrelButtonPressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsCanceled:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsEraser:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsHorizontalMouseWheel:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsInRange:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsInverted:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsLeftButtonPressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsMiddleButtonPressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsPrimary:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsRightButtonPressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsXButton1Pressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub IsXButton2Pressed:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub MouseWheelDelta:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT,
pub Orientation:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut f32) -> windows_core::HRESULT,
PointerUpdateKind: usize,
pub Pressure:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut f32) -> windows_core::HRESULT,
pub TouchConfidence:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub Twist: unsafe extern "system" fn(*mut core::ffi::c_void, *mut f32) -> windows_core::HRESULT,
pub XTilt: unsafe extern "system" fn(*mut core::ffi::c_void, *mut f32) -> windows_core::HRESULT,
pub YTilt: unsafe extern "system" fn(*mut core::ffi::c_void, *mut f32) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
IPointerPointStatics,
IPointerPointStatics_Vtbl,
0x880d34c2_acfd_51d9_b60a_b408ce17590c
);
impl windows_core::RuntimeType for IPointerPointStatics {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
impl windows_core::RuntimeName for IPointerPointStatics {
const NAME: &'static str = "Microsoft.UI.Input.IPointerPointStatics";
}
pub trait IPointerPointStatics_Impl: windows_core::IUnknownImpl {
fn GetCurrentPoint(&self, pointerId: u32) -> windows_core::Result<PointerPoint>;
}
impl IPointerPointStatics_Vtbl {
pub const fn new<Identity: IPointerPointStatics_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetCurrentPoint<
Identity: IPointerPointStatics_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
pointerid: u32,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPointerPointStatics_Impl::GetCurrentPoint(this, pointerid) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IPointerPointStatics, OFFSET>(
),
GetCurrentPoint: GetCurrentPoint::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IPointerPointStatics as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IPointerPointStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetCurrentPoint: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct PointerDeviceType(pub i32);
impl PointerDeviceType {
pub const Touch: Self = Self(0i32);
pub const Pen: Self = Self(1i32);
pub const Mouse: Self = Self(2i32);
pub const Touchpad: Self = Self(3i32);
}
impl windows_core::TypeKind for PointerDeviceType {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for PointerDeviceType {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.UI.Input.PointerDeviceType;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PointerPoint(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
PointerPoint,
windows_core::IUnknown,
windows_core::IInspectable
);
impl PointerPoint {
pub fn FrameId(&self) -> windows_core::Result<u32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).FrameId)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsInContact(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsInContact)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn PointerDeviceType(&self) -> windows_core::Result<PointerDeviceType> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PointerDeviceType)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn PointerId(&self) -> windows_core::Result<u32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PointerId)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Position(&self) -> windows_core::Result<windows::Foundation::Point> {
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 Properties(&self) -> windows_core::Result<PointerPointProperties> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Properties)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
pub fn Timestamp(&self) -> windows_core::Result<u64> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Timestamp)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn GetCurrentPoint(pointerid: u32) -> windows_core::Result<PointerPoint> {
Self::IPointerPointStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetCurrentPoint)(
windows_core::Interface::as_raw(this),
pointerid,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
})
}
fn IPointerPointStatics<R, F: FnOnce(&IPointerPointStatics) -> windows_core::Result<R>>(
callback: F,
) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<PointerPoint, IPointerPointStatics> =
windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for PointerPoint {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IPointerPoint>();
}
unsafe impl windows_core::Interface for PointerPoint {
type Vtable = <IPointerPoint as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IPointerPoint as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for PointerPoint {
const NAME: &'static str = "Microsoft.UI.Input.PointerPoint";
}
unsafe impl Send for PointerPoint {}
unsafe impl Sync for PointerPoint {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PointerPointProperties(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(
PointerPointProperties,
windows_core::IUnknown,
windows_core::IInspectable
);
impl PointerPointProperties {
pub fn ContactRect(&self) -> windows_core::Result<windows::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ContactRect)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsBarrelButtonPressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsBarrelButtonPressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsCanceled(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsCanceled)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsEraser(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsEraser)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsHorizontalMouseWheel(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsHorizontalMouseWheel)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsInRange(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsInRange)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsInverted(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsInverted)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsLeftButtonPressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsLeftButtonPressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsMiddleButtonPressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsMiddleButtonPressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsPrimary(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsPrimary)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsRightButtonPressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsRightButtonPressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsXButton1Pressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsXButton1Pressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn IsXButton2Pressed(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsXButton2Pressed)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn MouseWheelDelta(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).MouseWheelDelta)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Orientation(&self) -> windows_core::Result<f32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Orientation)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Pressure(&self) -> windows_core::Result<f32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Pressure)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn TouchConfidence(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TouchConfidence)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn Twist(&self) -> windows_core::Result<f32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Twist)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn XTilt(&self) -> windows_core::Result<f32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).XTilt)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
pub fn YTilt(&self) -> windows_core::Result<f32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).YTilt)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeType for PointerPointProperties {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_class::<Self, IPointerPointProperties>();
}
unsafe impl windows_core::Interface for PointerPointProperties {
type Vtable = <IPointerPointProperties as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IPointerPointProperties as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for PointerPointProperties {
const NAME: &'static str = "Microsoft.UI.Input.PointerPointProperties";
}
unsafe impl Send for PointerPointProperties {}
unsafe impl Sync for PointerPointProperties {}