mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
1207 lines
52 KiB
C++
1207 lines
52 KiB
C++
// WARNING: Please don't edit this file. It was generated by C++/WinRT
|
|
// v2.0.250303.1
|
|
|
|
#pragma once
|
|
#ifndef WINRT_Microsoft_UI_Xaml_Interop_H
|
|
#define WINRT_Microsoft_UI_Xaml_Interop_H
|
|
#include "winrt/base.h"
|
|
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"),
|
|
"Mismatched C++/WinRT headers.");
|
|
#define CPPWINRT_VERSION "2.0.250303.1"
|
|
#include "winrt/Microsoft.UI.Xaml.h"
|
|
#include "winrt/impl/Microsoft.UI.Xaml.Interop.2.h"
|
|
#include "winrt/impl/Windows.Foundation.2.h"
|
|
namespace winrt::impl {
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableIterable<D>::First() const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterable>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterable, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableIterable>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->First(&result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableIterable>**)this;
|
|
check_hresult(_winrt_abi_type->First(&result));
|
|
}
|
|
return winrt::Microsoft::UI::Xaml::Interop::IBindableIterator{
|
|
result, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableIterator<D>::Current() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableIterator>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Current(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>**)this;
|
|
check_hresult(_winrt_abi_type->get_Current(&value));
|
|
}
|
|
return winrt::Windows::Foundation::IInspectable{value,
|
|
take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableIterator<D>::HasCurrent()
|
|
const {
|
|
bool value{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableIterator>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_HasCurrent(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>**)this;
|
|
check_hresult(_winrt_abi_type->get_HasCurrent(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableIterator<D>::MoveNext() const {
|
|
bool result{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableIterator, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableIterator>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->MoveNext(&result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>**)this;
|
|
check_hresult(_winrt_abi_type->MoveNext(&result));
|
|
}
|
|
return result;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableObservableVector<D>::
|
|
VectorChanged(winrt::Microsoft::UI::Xaml::Interop::
|
|
BindableVectorChangedEventHandler const& handler) const {
|
|
winrt::event_token token{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->add_VectorChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
} else {
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>**)this;
|
|
check_hresult(_winrt_abi_type->add_VectorChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
}
|
|
return token;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableObservableVector<D>::
|
|
VectorChanged(auto_revoke_t,
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
BindableVectorChangedEventHandler const& handler) const {
|
|
return impl::make_event_revoker<D, VectorChanged_revoker>(
|
|
this, VectorChanged(handler));
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableObservableVector<
|
|
D>::VectorChanged(winrt::event_token const& token) const noexcept {
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>**)&_winrt_casted_result;
|
|
_winrt_abi_type->remove_VectorChanged(impl::bind_in(token));
|
|
} else {
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector>**)this;
|
|
_winrt_abi_type->remove_VectorChanged(impl::bind_in(token));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::GetAt(
|
|
uint32_t index) const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetAt(index, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->GetAt(index, &result));
|
|
}
|
|
return winrt::Windows::Foundation::IInspectable{result,
|
|
take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::Size() const {
|
|
uint32_t value{};
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Size(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->get_Size(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::GetView() const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetView(&result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->GetView(&result));
|
|
}
|
|
return winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView{
|
|
result, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::IndexOf(
|
|
winrt::Windows::Foundation::IInspectable const& value,
|
|
uint32_t& index) const {
|
|
bool returnValue{};
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->IndexOf(*(void**)(&value), &index, &returnValue));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->IndexOf(*(void**)(&value), &index, &returnValue));
|
|
}
|
|
return returnValue;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::SetAt(
|
|
uint32_t index,
|
|
winrt::Windows::Foundation::IInspectable const& value) const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->SetAt(index, *(void**)(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->SetAt(index, *(void**)(&value)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::InsertAt(
|
|
uint32_t index,
|
|
winrt::Windows::Foundation::IInspectable const& value) const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->InsertAt(index, *(void**)(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->InsertAt(index, *(void**)(&value)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::RemoveAt(
|
|
uint32_t index) const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->RemoveAt(index));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->RemoveAt(index));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::Append(
|
|
winrt::Windows::Foundation::IInspectable const& value) const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Append(*(void**)(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->Append(*(void**)(&value)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::RemoveAtEnd() const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->RemoveAtEnd());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->RemoveAtEnd());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVector<D>::Clear() const {
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Clear());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>**)this;
|
|
check_hresult(_winrt_abi_type->Clear());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVectorView<D>::GetAt(
|
|
uint32_t index) const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVectorView>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetAt(index, &result));
|
|
} else {
|
|
auto const _winrt_abi_type = *(
|
|
abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>**)this;
|
|
check_hresult(_winrt_abi_type->GetAt(index, &result));
|
|
}
|
|
return winrt::Windows::Foundation::IInspectable{result,
|
|
take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVectorView<D>::Size() const {
|
|
uint32_t value{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVectorView>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Size(&value));
|
|
} else {
|
|
auto const _winrt_abi_type = *(
|
|
abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>**)this;
|
|
check_hresult(_winrt_abi_type->get_Size(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_IBindableVectorView<D>::IndexOf(
|
|
winrt::Windows::Foundation::IInspectable const& value,
|
|
uint32_t& index) const {
|
|
bool returnValue{};
|
|
if constexpr (!std::is_same_v<
|
|
D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView, D const*>(
|
|
static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableVectorView>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->IndexOf(*(void**)(&value), &index, &returnValue));
|
|
} else {
|
|
auto const _winrt_abi_type = *(
|
|
abi_t<winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->IndexOf(*(void**)(&value), &index, &returnValue));
|
|
}
|
|
return returnValue;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChanged<
|
|
D>::CollectionChanged(winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventHandler const&
|
|
handler) const {
|
|
winrt::event_token token{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChanged,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->add_CollectionChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
} else {
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>**)this;
|
|
check_hresult(_winrt_abi_type->add_CollectionChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
}
|
|
return token;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChanged<
|
|
D>::CollectionChanged(auto_revoke_t,
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventHandler const&
|
|
handler) const {
|
|
return impl::make_event_revoker<D, CollectionChanged_revoker>(
|
|
this, CollectionChanged(handler));
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChanged<
|
|
D>::CollectionChanged(winrt::event_token const& token) const noexcept {
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChanged,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>**)&_winrt_casted_result;
|
|
_winrt_abi_type->remove_CollectionChanged(impl::bind_in(token));
|
|
} else {
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChanged>**)this;
|
|
_winrt_abi_type->remove_CollectionChanged(impl::bind_in(token));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgs<
|
|
D>::Action() const {
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedAction value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->get_Action(reinterpret_cast<int32_t*>(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->get_Action(reinterpret_cast<int32_t*>(&value)));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgs<
|
|
D>::NewItems() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_NewItems(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)this;
|
|
check_hresult(_winrt_abi_type->get_NewItems(&value));
|
|
}
|
|
return winrt::Microsoft::UI::Xaml::Interop::IBindableVector{
|
|
value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgs<
|
|
D>::OldItems() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_OldItems(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)this;
|
|
check_hresult(_winrt_abi_type->get_OldItems(&value));
|
|
}
|
|
return winrt::Microsoft::UI::Xaml::Interop::IBindableVector{
|
|
value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgs<
|
|
D>::NewStartingIndex() const {
|
|
int32_t value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_NewStartingIndex(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)this;
|
|
check_hresult(_winrt_abi_type->get_NewStartingIndex(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgs<
|
|
D>::OldStartingIndex() const {
|
|
int32_t value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,
|
|
D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_OldStartingIndex(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>**)this;
|
|
check_hresult(_winrt_abi_type->get_OldStartingIndex(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_UI_Xaml_Interop_INotifyCollectionChangedEventArgsFactory<
|
|
D>::
|
|
CreateInstanceWithAllParameters(
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedAction const& action,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& newItems,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& oldItems,
|
|
int32_t newIndex, int32_t oldIndex,
|
|
winrt::Windows::Foundation::IInspectable const& baseInterface,
|
|
winrt::Windows::Foundation::IInspectable& innerInterface) const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory,
|
|
D const*>(static_cast<D const*>(this),
|
|
_winrt_cast_result_code);
|
|
check_hresult(_winrt_cast_result_code);
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->CreateInstanceWithAllParameters(
|
|
static_cast<int32_t>(action), *(void**)(&newItems),
|
|
*(void**)(&oldItems), newIndex, oldIndex, *(void**)(&baseInterface),
|
|
impl::bind_out(innerInterface), &value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory>**)this;
|
|
check_hresult(_winrt_abi_type->CreateInstanceWithAllParameters(
|
|
static_cast<int32_t>(action), *(void**)(&newItems),
|
|
*(void**)(&oldItems), newIndex, oldIndex, *(void**)(&baseInterface),
|
|
impl::bind_out(innerInterface), &value));
|
|
}
|
|
return winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedEventArgs{
|
|
value, take_ownership_from_abi};
|
|
}
|
|
template <typename H>
|
|
struct delegate<
|
|
winrt::Microsoft::UI::Xaml::Interop::BindableVectorChangedEventHandler, H>
|
|
final : implements_delegate<winrt::Microsoft::UI::Xaml::Interop::
|
|
BindableVectorChangedEventHandler,
|
|
H> {
|
|
delegate(H&& handler)
|
|
: implements_delegate<winrt::Microsoft::UI::Xaml::Interop::
|
|
BindableVectorChangedEventHandler,
|
|
H>(std::forward<H>(handler)) {}
|
|
|
|
int32_t __stdcall Invoke(void* vector, void* e) noexcept final try {
|
|
(*this)(
|
|
*reinterpret_cast<winrt::Microsoft::UI::Xaml::Interop::
|
|
IBindableObservableVector const*>(&vector),
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(&e));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename H>
|
|
struct delegate<
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedEventHandler, H>
|
|
final : implements_delegate<winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventHandler,
|
|
H> {
|
|
delegate(H&& handler)
|
|
: implements_delegate<winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventHandler,
|
|
H>(std::forward<H>(handler)) {}
|
|
|
|
int32_t __stdcall Invoke(void* sender, void* e) noexcept final try {
|
|
(*this)(*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&sender),
|
|
*reinterpret_cast<winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventArgs const*>(&e));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::IBindableIterable>
|
|
: produce_base<D, winrt::Microsoft::UI::Xaml::Interop::IBindableIterable> {
|
|
int32_t __stdcall First(void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result =
|
|
detach_from<winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>(
|
|
this->shim().First());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>
|
|
: produce_base<D, winrt::Microsoft::UI::Xaml::Interop::IBindableIterator> {
|
|
int32_t __stdcall get_Current(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Foundation::IInspectable>(
|
|
this->shim().Current());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_HasCurrent(bool* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<bool>(this->shim().HasCurrent());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall MoveNext(bool* result) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*result = detach_from<bool>(this->shim().MoveNext());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector>
|
|
: produce_base<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector> {
|
|
int32_t __stdcall add_VectorChanged(void* handler,
|
|
winrt::event_token* token) noexcept final
|
|
try {
|
|
zero_abi<winrt::event_token>(token);
|
|
typename D::abi_guard guard(this->shim());
|
|
*token = detach_from<winrt::event_token>(this->shim().VectorChanged(
|
|
*reinterpret_cast<winrt::Microsoft::UI::Xaml::Interop::
|
|
BindableVectorChangedEventHandler const*>(
|
|
&handler)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall remove_VectorChanged(
|
|
winrt::event_token token) noexcept final {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().VectorChanged(
|
|
*reinterpret_cast<winrt::event_token const*>(&token));
|
|
return 0;
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector>
|
|
: produce_base<D, winrt::Microsoft::UI::Xaml::Interop::IBindableVector> {
|
|
int32_t __stdcall GetAt(uint32_t index, void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result = detach_from<winrt::Windows::Foundation::IInspectable>(
|
|
this->shim().GetAt(index));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_Size(uint32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<uint32_t>(this->shim().Size());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall GetView(void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result =
|
|
detach_from<winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>(
|
|
this->shim().GetView());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall IndexOf(void* value, uint32_t* index,
|
|
bool* returnValue) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*returnValue = detach_from<bool>(this->shim().IndexOf(
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&value),
|
|
*index));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall SetAt(uint32_t index, void* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().SetAt(
|
|
index,
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&value));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall InsertAt(uint32_t index, void* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().InsertAt(
|
|
index,
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&value));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall RemoveAt(uint32_t index) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().RemoveAt(index);
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Append(void* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Append(
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&value));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall RemoveAtEnd() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().RemoveAtEnd();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Clear() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Clear();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>
|
|
: produce_base<D,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView> {
|
|
int32_t __stdcall GetAt(uint32_t index, void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result = detach_from<winrt::Windows::Foundation::IInspectable>(
|
|
this->shim().GetAt(index));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_Size(uint32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<uint32_t>(this->shim().Size());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall IndexOf(void* value, uint32_t* index,
|
|
bool* returnValue) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*returnValue = detach_from<bool>(this->shim().IndexOf(
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&value),
|
|
*index));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChanged>
|
|
: produce_base<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChanged> {
|
|
int32_t __stdcall add_CollectionChanged(
|
|
void* handler, winrt::event_token* token) noexcept final try {
|
|
zero_abi<winrt::event_token>(token);
|
|
typename D::abi_guard guard(this->shim());
|
|
*token = detach_from<winrt::event_token>(this->shim().CollectionChanged(
|
|
*reinterpret_cast<winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventHandler const*>(
|
|
&handler)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall remove_CollectionChanged(
|
|
winrt::event_token token) noexcept final {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().CollectionChanged(
|
|
*reinterpret_cast<winrt::event_token const*>(&token));
|
|
return 0;
|
|
}
|
|
};
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D, winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs>
|
|
: produce_base<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs> {
|
|
int32_t __stdcall get_Action(int32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedAction>(
|
|
this->shim().Action());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_NewItems(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>(
|
|
this->shim().NewItems());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_OldItems(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>(
|
|
this->shim().OldItems());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_NewStartingIndex(int32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<int32_t>(this->shim().NewStartingIndex());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_OldStartingIndex(int32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<int32_t>(this->shim().OldStartingIndex());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory>
|
|
: produce_base<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory> {
|
|
int32_t __stdcall CreateInstanceWithAllParameters(
|
|
int32_t action, void* newItems, void* oldItems, int32_t newIndex,
|
|
int32_t oldIndex, void* baseInterface, void** innerInterface,
|
|
void** value) noexcept final try {
|
|
if (innerInterface) *innerInterface = nullptr;
|
|
winrt::Windows::Foundation::IInspectable winrt_impl_innerInterface;
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedEventArgs>(
|
|
this->shim().CreateInstanceWithAllParameters(
|
|
*reinterpret_cast<winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedAction const*>(
|
|
&action),
|
|
*reinterpret_cast<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const*>(
|
|
&newItems),
|
|
*reinterpret_cast<
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const*>(
|
|
&oldItems),
|
|
newIndex, oldIndex,
|
|
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
|
|
&baseInterface),
|
|
winrt_impl_innerInterface));
|
|
if (innerInterface) *innerInterface = detach_abi(winrt_impl_innerInterface);
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
} // namespace winrt::impl
|
|
WINRT_EXPORT namespace winrt::Microsoft::UI::Xaml::Interop {
|
|
inline NotifyCollectionChangedEventArgs::NotifyCollectionChangedEventArgs(
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedAction const&
|
|
action,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& newItems,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& oldItems,
|
|
int32_t newIndex, int32_t oldIndex) {
|
|
winrt::Windows::Foundation::IInspectable baseInterface, innerInterface;
|
|
*this = impl::call_factory<NotifyCollectionChangedEventArgs,
|
|
INotifyCollectionChangedEventArgsFactory>(
|
|
[&](INotifyCollectionChangedEventArgsFactory const& f) {
|
|
return f.CreateInstanceWithAllParameters(
|
|
action, newItems, oldItems, newIndex, oldIndex, baseInterface,
|
|
innerInterface);
|
|
});
|
|
}
|
|
template <typename L>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
L handler)
|
|
: BindableVectorChangedEventHandler(
|
|
impl::make_delegate<BindableVectorChangedEventHandler>(
|
|
std::forward<L>(handler))) {}
|
|
template <typename F>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(F *
|
|
handler)
|
|
: BindableVectorChangedEventHandler(
|
|
[=](auto&&... args) { return handler(args...); }) {}
|
|
template <typename O, typename M>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
O * object, M method)
|
|
: BindableVectorChangedEventHandler(
|
|
[=](auto&&... args) { return ((*object).*(method))(args...); }) {}
|
|
template <typename O, typename M>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
com_ptr<O> && object, M method)
|
|
: BindableVectorChangedEventHandler(
|
|
[o = std::move(object), method](auto&&... args) {
|
|
return ((*o).*(method))(args...);
|
|
}) {}
|
|
template <typename O, typename LM>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
weak_ref<O> && object, LM && lambda_or_method)
|
|
: BindableVectorChangedEventHandler(
|
|
[o = std::move(object),
|
|
lm = std::forward<LM>(lambda_or_method)](auto&&... args) {
|
|
if (auto s = o.get()) {
|
|
if constexpr (std::is_member_function_pointer_v<LM>)
|
|
((*s).*(lm))(args...);
|
|
else
|
|
lm(args...);
|
|
}
|
|
}) {}
|
|
template <typename O, typename M>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
std::shared_ptr<O> && object, M method)
|
|
: BindableVectorChangedEventHandler(
|
|
[o = std::move(object), method](auto&&... args) {
|
|
return ((*o).*(method))(args...);
|
|
}) {}
|
|
template <typename O, typename LM>
|
|
BindableVectorChangedEventHandler::BindableVectorChangedEventHandler(
|
|
std::weak_ptr<O> && object, LM && lambda_or_method)
|
|
: BindableVectorChangedEventHandler(
|
|
[o = std::move(object),
|
|
lm = std::forward<LM>(lambda_or_method)](auto&&... args) {
|
|
if (auto s = o.lock()) {
|
|
if constexpr (std::is_member_function_pointer_v<LM>)
|
|
((*s).*(lm))(args...);
|
|
else
|
|
lm(args...);
|
|
}
|
|
}) {}
|
|
inline auto BindableVectorChangedEventHandler::operator()(
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector const&
|
|
vector,
|
|
winrt::Windows::Foundation::IInspectable const& e) const {
|
|
check_hresult((*(impl::abi_t<BindableVectorChangedEventHandler>**)this)
|
|
->Invoke(*(void**)(&vector), *(void**)(&e)));
|
|
}
|
|
template <typename L>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
L handler)
|
|
: NotifyCollectionChangedEventHandler(
|
|
impl::make_delegate<NotifyCollectionChangedEventHandler>(
|
|
std::forward<L>(handler))) {}
|
|
template <typename F>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
F * handler)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[=](auto&&... args) { return handler(args...); }) {}
|
|
template <typename O, typename M>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
O * object, M method)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[=](auto&&... args) { return ((*object).*(method))(args...); }) {}
|
|
template <typename O, typename M>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
com_ptr<O> && object, M method)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[o = std::move(object), method](auto&&... args) {
|
|
return ((*o).*(method))(args...);
|
|
}) {}
|
|
template <typename O, typename LM>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
weak_ref<O> && object, LM && lambda_or_method)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[o = std::move(object),
|
|
lm = std::forward<LM>(lambda_or_method)](auto&&... args) {
|
|
if (auto s = o.get()) {
|
|
if constexpr (std::is_member_function_pointer_v<LM>)
|
|
((*s).*(lm))(args...);
|
|
else
|
|
lm(args...);
|
|
}
|
|
}) {}
|
|
template <typename O, typename M>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
std::shared_ptr<O> && object, M method)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[o = std::move(object), method](auto&&... args) {
|
|
return ((*o).*(method))(args...);
|
|
}) {}
|
|
template <typename O, typename LM>
|
|
NotifyCollectionChangedEventHandler::NotifyCollectionChangedEventHandler(
|
|
std::weak_ptr<O> && object, LM && lambda_or_method)
|
|
: NotifyCollectionChangedEventHandler(
|
|
[o = std::move(object),
|
|
lm = std::forward<LM>(lambda_or_method)](auto&&... args) {
|
|
if (auto s = o.lock()) {
|
|
if constexpr (std::is_member_function_pointer_v<LM>)
|
|
((*s).*(lm))(args...);
|
|
else
|
|
lm(args...);
|
|
}
|
|
}) {}
|
|
inline auto NotifyCollectionChangedEventHandler::operator()(
|
|
winrt::Windows::Foundation::IInspectable const& sender,
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedEventArgs const& e) const {
|
|
check_hresult((*(impl::abi_t<NotifyCollectionChangedEventHandler>**)this)
|
|
->Invoke(*(void**)(&sender), *(void**)(&e)));
|
|
}
|
|
template <typename D, typename... Interfaces>
|
|
struct NotifyCollectionChangedEventArgsT
|
|
: implements<D, winrt::Windows::Foundation::IInspectable, composing,
|
|
Interfaces...>,
|
|
impl::require<D, winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgs>,
|
|
impl::base<D, NotifyCollectionChangedEventArgs> {
|
|
using composable = NotifyCollectionChangedEventArgs;
|
|
|
|
protected:
|
|
NotifyCollectionChangedEventArgsT(
|
|
winrt::Microsoft::UI::Xaml::Interop::
|
|
NotifyCollectionChangedAction const& action,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& newItems,
|
|
winrt::Microsoft::UI::Xaml::Interop::IBindableVector const& oldItems,
|
|
int32_t newIndex, int32_t oldIndex) {
|
|
impl::call_factory<NotifyCollectionChangedEventArgs,
|
|
INotifyCollectionChangedEventArgsFactory>(
|
|
[&](INotifyCollectionChangedEventArgsFactory const& f) {
|
|
[[maybe_unused]] auto winrt_impl_discarded =
|
|
f.CreateInstanceWithAllParameters(action, newItems, oldItems,
|
|
newIndex, oldIndex, *this,
|
|
this->m_inner);
|
|
});
|
|
}
|
|
};
|
|
}
|
|
namespace std {
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::IBindableIterable>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::IBindableIterator>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::IBindableObservableVector>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::IBindableVector>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::IBindableVectorView>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChanged>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Microsoft::UI::Xaml::Interop::INotifyCollectionChangedEventArgs>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::UI::Xaml::Interop::
|
|
INotifyCollectionChangedEventArgsFactory>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Microsoft::UI::Xaml::Interop::NotifyCollectionChangedEventArgs>
|
|
: winrt::impl::hash_base {};
|
|
#endif
|
|
#ifdef __cpp_lib_format
|
|
#endif
|
|
} // namespace std
|
|
#endif
|