Skip to content

Commit

Permalink
bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Dec 9, 2024
1 parent b2ac221 commit c13a24b
Show file tree
Hide file tree
Showing 42 changed files with 186 additions and 330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ impl windows_core::RuntimeType for BackgroundTaskCanceledEventHandler {
impl BackgroundTaskCanceledEventHandler {
pub fn new<F: FnMut(Option<&IBackgroundTaskInstance>, BackgroundTaskCancellationReason) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = BackgroundTaskCanceledEventHandlerBox { vtable: &BackgroundTaskCanceledEventHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0>(&self, sender: P0, reason: BackgroundTaskCancellationReason) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -628,7 +628,7 @@ impl<F: FnMut(Option<&IBackgroundTaskInstance>, BackgroundTaskCancellationReason
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -696,7 +696,7 @@ impl windows_core::RuntimeType for BackgroundTaskCompletedEventHandler {
impl BackgroundTaskCompletedEventHandler {
pub fn new<F: FnMut(Option<&BackgroundTaskRegistration>, Option<&BackgroundTaskCompletedEventArgs>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = BackgroundTaskCompletedEventHandlerBox { vtable: &BackgroundTaskCompletedEventHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, args: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -741,7 +741,7 @@ impl<F: FnMut(Option<&BackgroundTaskRegistration>, Option<&BackgroundTaskComplet
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -811,7 +811,7 @@ impl windows_core::RuntimeType for BackgroundTaskProgressEventHandler {
impl BackgroundTaskProgressEventHandler {
pub fn new<F: FnMut(Option<&BackgroundTaskRegistration>, Option<&BackgroundTaskProgressEventArgs>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = BackgroundTaskProgressEventHandlerBox { vtable: &BackgroundTaskProgressEventHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, args: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -856,7 +856,7 @@ impl<F: FnMut(Option<&BackgroundTaskRegistration>, Option<&BackgroundTaskProgres
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ impl windows_core::RuntimeType for DataProviderHandler {
impl DataProviderHandler {
pub fn new<F: FnMut(Option<&DataProviderRequest>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = DataProviderHandlerBox { vtable: &DataProviderHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0>(&self, request: P0) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -1204,7 +1204,7 @@ impl<F: FnMut(Option<&DataProviderRequest>) -> windows_core::Result<()> + Send +
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -2274,7 +2274,7 @@ impl windows_core::RuntimeType for ShareProviderHandler {
impl ShareProviderHandler {
pub fn new<F: FnMut(Option<&ShareProviderOperation>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = ShareProviderHandlerBox { vtable: &ShareProviderHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0>(&self, operation: P0) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -2318,7 +2318,7 @@ impl<F: FnMut(Option<&ShareProviderOperation>) -> windows_core::Result<()> + Sen
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ impl windows_core::RuntimeType for PaymentRequestChangedHandler {
impl PaymentRequestChangedHandler {
pub fn new<F: FnMut(Option<&PaymentRequest>, Option<&PaymentRequestChangedArgs>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = PaymentRequestChangedHandlerBox { vtable: &PaymentRequestChangedHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, paymentrequest: P0, args: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -1476,7 +1476,7 @@ impl<F: FnMut(Option<&PaymentRequest>, Option<&PaymentRequestChangedArgs>) -> wi
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/windows/src/Windows/Data/Text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl windows_core::RuntimeType for SelectableWordSegmentsTokenizingHandler {
impl SelectableWordSegmentsTokenizingHandler {
pub fn new<F: FnMut(Option<&super::super::Foundation::Collections::IIterable<SelectableWordSegment>>, Option<&super::super::Foundation::Collections::IIterable<SelectableWordSegment>>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = SelectableWordSegmentsTokenizingHandlerBox { vtable: &SelectableWordSegmentsTokenizingHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, precedingwords: P0, words: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -403,7 +403,7 @@ impl<F: FnMut(Option<&super::super::Foundation::Collections::IIterable<Selectabl
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -1034,7 +1034,7 @@ impl windows_core::RuntimeType for WordSegmentsTokenizingHandler {
impl WordSegmentsTokenizingHandler {
pub fn new<F: FnMut(Option<&super::super::Foundation::Collections::IIterable<WordSegment>>, Option<&super::super::Foundation::Collections::IIterable<WordSegment>>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = WordSegmentsTokenizingHandlerBox { vtable: &WordSegmentsTokenizingHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, precedingwords: P0, words: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -1082,7 +1082,7 @@ impl<F: FnMut(Option<&super::super::Foundation::Collections::IIterable<WordSegme
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/windows/src/Windows/Devices/SmartCards/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ impl windows_core::RuntimeType for SmartCardPinResetHandler {
impl SmartCardPinResetHandler {
pub fn new<F: FnMut(Option<&SmartCardProvisioning>, Option<&SmartCardPinResetRequest>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = SmartCardPinResetHandlerBox { vtable: &SmartCardPinResetHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, request: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -2941,7 +2941,7 @@ impl<F: FnMut(Option<&SmartCardProvisioning>, Option<&SmartCardPinResetRequest>)
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/windows/src/Windows/Devices/Sms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@ impl windows_core::RuntimeType for SmsDeviceStatusChangedEventHandler {
impl SmsDeviceStatusChangedEventHandler {
pub fn new<F: FnMut(Option<&SmsDevice>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = SmsDeviceStatusChangedEventHandlerBox { vtable: &SmsDeviceStatusChangedEventHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0>(&self, sender: P0) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -2240,7 +2240,7 @@ impl<F: FnMut(Option<&SmsDevice>) -> windows_core::Result<()> + Send + 'static>
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -2574,7 +2574,7 @@ impl windows_core::RuntimeType for SmsMessageReceivedEventHandler {
impl SmsMessageReceivedEventHandler {
pub fn new<F: FnMut(Option<&SmsDevice>, Option<&SmsMessageReceivedEventArgs>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = SmsMessageReceivedEventHandlerBox { vtable: &SmsMessageReceivedEventHandlerBox::<F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, e: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -2622,7 +2622,7 @@ impl<F: FnMut(Option<&SmsDevice>, Option<&SmsMessageReceivedEventArgs>) -> windo
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/windows/src/Windows/Foundation/Collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ impl<K: windows_core::RuntimeType + 'static, V: windows_core::RuntimeType + 'sta
impl<K: windows_core::RuntimeType + 'static, V: windows_core::RuntimeType + 'static> MapChangedEventHandler<K, V> {
pub fn new<F: FnMut(Option<&IObservableMap<K, V>>, Option<&IMapChangedEventArgs<K>>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = MapChangedEventHandlerBox { vtable: &MapChangedEventHandlerBox::<K, V, F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, event: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -1758,7 +1758,7 @@ impl<K: windows_core::RuntimeType + 'static, V: windows_core::RuntimeType + 'sta
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down Expand Up @@ -2100,7 +2100,7 @@ impl<T: windows_core::RuntimeType + 'static> windows_core::RuntimeType for Vecto
impl<T: windows_core::RuntimeType + 'static> VectorChangedEventHandler<T> {
pub fn new<F: FnMut(Option<&IObservableVector<T>>, Option<&IVectorChangedEventArgs>) -> windows_core::Result<()> + Send + 'static>(invoke: F) -> Self {
let com = VectorChangedEventHandlerBox { vtable: &VectorChangedEventHandlerBox::<T, F>::VTABLE, count: windows_core::imp::RefCount::new(1), invoke };
unsafe { core::mem::transmute(Box::new(com)) }
unsafe { core::mem::transmute(windows_core::imp::Box::new(com)) }
}
pub fn Invoke<P0, P1>(&self, sender: P0, event: P1) -> windows_core::Result<()>
where
Expand Down Expand Up @@ -2156,7 +2156,7 @@ impl<T: windows_core::RuntimeType + 'static, F: FnMut(Option<&IObservableVector<
let this = this as *mut *mut core::ffi::c_void as *mut Self;
let remaining = (*this).count.release();
if remaining == 0 {
let _ = Box::from_raw(this);
let _ = windows_core::imp::Box::from_raw(this);
}
remaining
}
Expand Down
Loading

0 comments on commit c13a24b

Please sign in to comment.