// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Gaming_UI_H #define WINRT_Windows_Gaming_UI_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/impl/Windows.ApplicationModel.Activation.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Gaming.UI.2.h" namespace winrt::impl { template auto consume_Windows_Gaming_UI_IGameBarStatics::VisibilityChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_VisibilityChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_VisibilityChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Gaming_UI_IGameBarStatics::VisibilityChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, VisibilityChanged(handler)); } template auto consume_Windows_Gaming_UI_IGameBarStatics::VisibilityChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_VisibilityChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_VisibilityChanged(impl::bind_in(token)); } } template auto consume_Windows_Gaming_UI_IGameBarStatics::IsInputRedirectedChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_IsInputRedirectedChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_IsInputRedirectedChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Gaming_UI_IGameBarStatics::IsInputRedirectedChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, IsInputRedirectedChanged(handler)); } template auto consume_Windows_Gaming_UI_IGameBarStatics::IsInputRedirectedChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_IsInputRedirectedChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_IsInputRedirectedChanged(impl::bind_in(token)); } } template auto consume_Windows_Gaming_UI_IGameBarStatics::Visible() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Visible(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Visible(&value)); } return value; } template auto consume_Windows_Gaming_UI_IGameBarStatics::IsInputRedirected() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_IsInputRedirected(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsInputRedirected(&value)); } return value; } template auto consume_Windows_Gaming_UI_IGameChatMessageReceivedEventArgs::AppId() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_AppId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AppId(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameChatMessageReceivedEventArgs::AppDisplayName() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_AppDisplayName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AppDisplayName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameChatMessageReceivedEventArgs::SenderName() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SenderName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SenderName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameChatMessageReceivedEventArgs::Message() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Message(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Message(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameChatMessageReceivedEventArgs::Origin() const { winrt::Windows::Gaming::UI::GameChatMessageOrigin value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Origin(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Origin(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_UI_IGameChatOverlay::DesiredPosition() const { winrt::Windows::Gaming::UI::GameChatOverlayPosition value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_DesiredPosition(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DesiredPosition(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_UI_IGameChatOverlay::DesiredPosition(winrt::Windows::Gaming::UI::GameChatOverlayPosition const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_DesiredPosition(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_DesiredPosition(static_cast(value))); } } template auto consume_Windows_Gaming_UI_IGameChatOverlay::AddMessage(param::hstring const& sender, param::hstring const& message, winrt::Windows::Gaming::UI::GameChatMessageOrigin const& origin) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->AddMessage(*(void**)(&sender), *(void**)(&message), static_cast(origin))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddMessage(*(void**)(&sender), *(void**)(&message), static_cast(origin))); } } template auto consume_Windows_Gaming_UI_IGameChatOverlayMessageSource::MessageReceived(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_MessageReceived(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_MessageReceived(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Gaming_UI_IGameChatOverlayMessageSource::MessageReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, MessageReceived(handler)); } template auto consume_Windows_Gaming_UI_IGameChatOverlayMessageSource::MessageReceived(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_MessageReceived(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_MessageReceived(impl::bind_in(token)); } } template auto consume_Windows_Gaming_UI_IGameChatOverlayMessageSource::SetDelayBeforeClosingAfterMessageReceived(winrt::Windows::Foundation::TimeSpan const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SetDelayBeforeClosingAfterMessageReceived(impl::bind_in(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetDelayBeforeClosingAfterMessageReceived(impl::bind_in(value))); } } template auto consume_Windows_Gaming_UI_IGameChatOverlayStatics::GetDefault() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetDefault(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDefault(&value)); } return winrt::Windows::Gaming::UI::GameChatOverlay{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameUIProviderActivatedEventArgs::GameUIArgs() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_GameUIArgs(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_GameUIArgs(&value)); } return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_UI_IGameUIProviderActivatedEventArgs::ReportCompleted(winrt::Windows::Foundation::Collections::ValueSet const& results) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReportCompleted(*(void**)(&results))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReportCompleted(*(void**)(&results))); } } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_VisibilityChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().VisibilityChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_VisibilityChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().VisibilityChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_IsInputRedirectedChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().IsInputRedirectedChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_IsInputRedirectedChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().IsInputRedirectedChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_Visible(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Visible()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsInputRedirected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsInputRedirected()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_AppId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AppId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AppDisplayName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AppDisplayName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SenderName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SenderName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Message(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Message()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Origin(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Origin()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DesiredPosition(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DesiredPosition()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_DesiredPosition(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DesiredPosition(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddMessage(void* sender, void* message, int32_t origin) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddMessage(*reinterpret_cast(&sender), *reinterpret_cast(&message), *reinterpret_cast(&origin)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_MessageReceived(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().MessageReceived(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_MessageReceived(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().MessageReceived(*reinterpret_cast(&token)); return 0; } int32_t __stdcall SetDelayBeforeClosingAfterMessageReceived(int64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetDelayBeforeClosingAfterMessageReceived(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefault(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_GameUIArgs(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GameUIArgs()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReportCompleted(void* results) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportCompleted(*reinterpret_cast(&results)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Gaming::UI { inline auto GameBar::VisibilityChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IGameBarStatics const& f) { return f.VisibilityChanged(handler); }); } inline auto GameBar::VisibilityChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return GameBar::VisibilityChanged_revoker{ f, f.VisibilityChanged(handler) }; } inline auto GameBar::VisibilityChanged(winrt::event_token const& token) { impl::call_factory([&](IGameBarStatics const& f) { return f.VisibilityChanged(token); }); } inline auto GameBar::IsInputRedirectedChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IGameBarStatics const& f) { return f.IsInputRedirectedChanged(handler); }); } inline auto GameBar::IsInputRedirectedChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return GameBar::IsInputRedirectedChanged_revoker{ f, f.IsInputRedirectedChanged(handler) }; } inline auto GameBar::IsInputRedirectedChanged(winrt::event_token const& token) { impl::call_factory([&](IGameBarStatics const& f) { return f.IsInputRedirectedChanged(token); }); } inline auto GameBar::Visible() { return impl::call_factory_cast([](IGameBarStatics const& f) { return f.Visible(); }); } inline auto GameBar::IsInputRedirected() { return impl::call_factory_cast([](IGameBarStatics const& f) { return f.IsInputRedirected(); }); } inline auto GameChatOverlay::GetDefault() { return impl::call_factory_cast([](IGameChatOverlayStatics const& f) { return f.GetDefault(); }); } inline GameChatOverlayMessageSource::GameChatOverlayMessageSource() : GameChatOverlayMessageSource(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif