// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Graphics_Display_H #define WINRT_Windows_Graphics_Display_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/Windows.Graphics.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Graphics.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Graphics.Display.2.h" namespace winrt::impl { template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::CurrentAdvancedColorKind() const { winrt::Windows::Graphics::Display::AdvancedColorKind 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_CurrentAdvancedColorKind(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CurrentAdvancedColorKind(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::RedPrimary() const { winrt::Windows::Foundation::Point 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_RedPrimary(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RedPrimary(put_abi(value))); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::GreenPrimary() const { winrt::Windows::Foundation::Point 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_GreenPrimary(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_GreenPrimary(put_abi(value))); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::BluePrimary() const { winrt::Windows::Foundation::Point 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_BluePrimary(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BluePrimary(put_abi(value))); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::WhitePoint() const { winrt::Windows::Foundation::Point 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_WhitePoint(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_WhitePoint(put_abi(value))); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::MaxLuminanceInNits() const { float 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_MaxLuminanceInNits(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxLuminanceInNits(&value)); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::MinLuminanceInNits() const { float 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_MinLuminanceInNits(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MinLuminanceInNits(&value)); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::MaxAverageFullFrameLuminanceInNits() const { float 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_MaxAverageFullFrameLuminanceInNits(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxAverageFullFrameLuminanceInNits(&value)); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::SdrWhiteLevelInNits() const { float 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_SdrWhiteLevelInNits(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SdrWhiteLevelInNits(&value)); } return value; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::IsHdrMetadataFormatCurrentlySupported(winrt::Windows::Graphics::Display::HdrMetadataFormat const& format) const { bool result{}; 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->IsHdrMetadataFormatCurrentlySupported(static_cast(format), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsHdrMetadataFormatCurrentlySupported(static_cast(format), &result)); } return result; } template auto consume_Windows_Graphics_Display_IAdvancedColorInfo::IsAdvancedColorKindAvailable(winrt::Windows::Graphics::Display::AdvancedColorKind const& kind) const { bool result{}; 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->IsAdvancedColorKindAvailable(static_cast(kind), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsAdvancedColorKindAvailable(static_cast(kind), &result)); } return result; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsSupported() 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_IsSupported(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsSupported(&value)); } return value; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsOverrideActive() 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_IsOverrideActive(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsOverrideActive(&value)); } return value; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::BrightnessLevel() const { double level{}; 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_BrightnessLevel(&level)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BrightnessLevel(&level)); } return level; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::SetBrightnessLevel(double brightnessLevel, winrt::Windows::Graphics::Display::DisplayBrightnessOverrideOptions const& options) 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->SetBrightnessLevel(brightnessLevel, static_cast(options))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetBrightnessLevel(brightnessLevel, static_cast(options))); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::SetBrightnessScenario(winrt::Windows::Graphics::Display::DisplayBrightnessScenario const& scenario, winrt::Windows::Graphics::Display::DisplayBrightnessOverrideOptions const& options) 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->SetBrightnessScenario(static_cast(scenario), static_cast(options))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetBrightnessScenario(static_cast(scenario), static_cast(options))); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::GetLevelForScenario(winrt::Windows::Graphics::Display::DisplayBrightnessScenario const& scenario) const { double brightnessLevel{}; 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->GetLevelForScenario(static_cast(scenario), &brightnessLevel)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetLevelForScenario(static_cast(scenario), &brightnessLevel)); } return brightnessLevel; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::StartOverride() 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->StartOverride()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StartOverride()); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::StopOverride() 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->StopOverride()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StopOverride()); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsSupportedChanged(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_IsSupportedChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_IsSupportedChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsSupportedChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, IsSupportedChanged(handler)); } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsSupportedChanged(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_IsSupportedChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_IsSupportedChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsOverrideActiveChanged(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_IsOverrideActiveChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_IsOverrideActiveChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsOverrideActiveChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, IsOverrideActiveChanged(handler)); } template auto consume_Windows_Graphics_Display_IBrightnessOverride::IsOverrideActiveChanged(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_IsOverrideActiveChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_IsOverrideActiveChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IBrightnessOverride::BrightnessLevelChanged(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_BrightnessLevelChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_BrightnessLevelChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IBrightnessOverride::BrightnessLevelChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, BrightnessLevelChanged(handler)); } template auto consume_Windows_Graphics_Display_IBrightnessOverride::BrightnessLevelChanged(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_BrightnessLevelChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_BrightnessLevelChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IBrightnessOverrideSettings::DesiredLevel() const { double 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_DesiredLevel(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DesiredLevel(&value)); } return value; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideSettings::DesiredNits() const { float 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_DesiredNits(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DesiredNits(&value)); } return value; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideSettingsStatics::CreateFromLevel(double level) const { void* result{}; 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->CreateFromLevel(level, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromLevel(level, &result)); } return winrt::Windows::Graphics::Display::BrightnessOverrideSettings{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideSettingsStatics::CreateFromNits(float nits) const { void* result{}; 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->CreateFromNits(nits, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromNits(nits, &result)); } return winrt::Windows::Graphics::Display::BrightnessOverrideSettings{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideSettingsStatics::CreateFromDisplayBrightnessOverrideScenario(winrt::Windows::Graphics::Display::DisplayBrightnessOverrideScenario const& overrideScenario) const { void* result{}; 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->CreateFromDisplayBrightnessOverrideScenario(static_cast(overrideScenario), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromDisplayBrightnessOverrideScenario(static_cast(overrideScenario), &result)); } return winrt::Windows::Graphics::Display::BrightnessOverrideSettings{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideStatics::GetDefaultForSystem() 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->GetDefaultForSystem(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDefaultForSystem(&value)); } return winrt::Windows::Graphics::Display::BrightnessOverride{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideStatics::GetForCurrentView() 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->GetForCurrentView(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForCurrentView(&value)); } return winrt::Windows::Graphics::Display::BrightnessOverride{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IBrightnessOverrideStatics::SaveForSystemAsync(winrt::Windows::Graphics::Display::BrightnessOverride const& value) const { void* operation{}; 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->SaveForSystemAsync(*(void**)(&value), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SaveForSystemAsync(*(void**)(&value), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IColorOverrideSettings::DesiredDisplayColorOverrideScenario() const { winrt::Windows::Graphics::Display::DisplayColorOverrideScenario 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_DesiredDisplayColorOverrideScenario(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DesiredDisplayColorOverrideScenario(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IColorOverrideSettingsStatics::CreateFromDisplayColorOverrideScenario(winrt::Windows::Graphics::Display::DisplayColorOverrideScenario const& overrideScenario) const { void* result{}; 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->CreateFromDisplayColorOverrideScenario(static_cast(overrideScenario), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromDisplayColorOverrideScenario(static_cast(overrideScenario), &result)); } return winrt::Windows::Graphics::Display::ColorOverrideSettings{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::ColorOverrideSettings() 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_ColorOverrideSettings(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ColorOverrideSettings(&value)); } return winrt::Windows::Graphics::Display::ColorOverrideSettings{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::ColorOverrideSettings(winrt::Windows::Graphics::Display::ColorOverrideSettings 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_ColorOverrideSettings(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ColorOverrideSettings(*(void**)(&value))); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::BrightnessOverrideSettings() 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_BrightnessOverrideSettings(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BrightnessOverrideSettings(&value)); } return winrt::Windows::Graphics::Display::BrightnessOverrideSettings{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::BrightnessOverrideSettings(winrt::Windows::Graphics::Display::BrightnessOverrideSettings 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_BrightnessOverrideSettings(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_BrightnessOverrideSettings(*(void**)(&value))); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::CanOverride() 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_CanOverride(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CanOverride(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::IsOverrideActive() 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_IsOverrideActive(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsOverrideActive(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::GetCurrentDisplayEnhancementOverrideCapabilities() 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->GetCurrentDisplayEnhancementOverrideCapabilities(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetCurrentDisplayEnhancementOverrideCapabilities(&value)); } return winrt::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::RequestOverride() 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->RequestOverride()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RequestOverride()); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::StopOverride() 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->StopOverride()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StopOverride()); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::CanOverrideChanged(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_CanOverrideChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_CanOverrideChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::CanOverrideChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, CanOverrideChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::CanOverrideChanged(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_CanOverrideChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_CanOverrideChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::IsOverrideActiveChanged(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_IsOverrideActiveChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_IsOverrideActiveChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::IsOverrideActiveChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, IsOverrideActiveChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::IsOverrideActiveChanged(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_IsOverrideActiveChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_IsOverrideActiveChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::DisplayEnhancementOverrideCapabilitiesChanged(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_DisplayEnhancementOverrideCapabilitiesChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DisplayEnhancementOverrideCapabilitiesChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::DisplayEnhancementOverrideCapabilitiesChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, DisplayEnhancementOverrideCapabilitiesChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverride::DisplayEnhancementOverrideCapabilitiesChanged(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_DisplayEnhancementOverrideCapabilitiesChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DisplayEnhancementOverrideCapabilitiesChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverrideCapabilities::IsBrightnessControlSupported() 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_IsBrightnessControlSupported(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsBrightnessControlSupported(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverrideCapabilities::IsBrightnessNitsControlSupported() 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_IsBrightnessNitsControlSupported(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsBrightnessNitsControlSupported(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverrideCapabilities::GetSupportedNitRanges() const { void* result{}; 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->GetSupportedNitRanges(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetSupportedNitRanges(&result)); } return winrt::Windows::Foundation::Collections::IVectorView{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverrideCapabilitiesChangedEventArgs::Capabilities() 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_Capabilities(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Capabilities(&value)); } return winrt::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayEnhancementOverrideStatics::GetForCurrentView() const { void* result{}; 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->GetForCurrentView(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForCurrentView(&result)); } return winrt::Windows::Graphics::Display::DisplayEnhancementOverride{ result, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayInformation::CurrentOrientation() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_CurrentOrientation(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CurrentOrientation(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::NativeOrientation() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_NativeOrientation(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_NativeOrientation(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::OrientationChanged(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_OrientationChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_OrientationChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformation::OrientationChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, OrientationChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformation::OrientationChanged(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_OrientationChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_OrientationChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayInformation::ResolutionScale() const { winrt::Windows::Graphics::Display::ResolutionScale 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_ResolutionScale(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ResolutionScale(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::LogicalDpi() const { float 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_LogicalDpi(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_LogicalDpi(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::RawDpiX() const { float 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_RawDpiX(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RawDpiX(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::RawDpiY() const { float 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_RawDpiY(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RawDpiY(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::DpiChanged(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_DpiChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DpiChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformation::DpiChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, DpiChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformation::DpiChanged(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_DpiChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DpiChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayInformation::StereoEnabled() 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_StereoEnabled(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_StereoEnabled(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation::StereoEnabledChanged(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_StereoEnabledChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_StereoEnabledChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformation::StereoEnabledChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, StereoEnabledChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformation::StereoEnabledChanged(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_StereoEnabledChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_StereoEnabledChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayInformation::GetColorProfileAsync() const { void* asyncInfo{}; 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->GetColorProfileAsync(&asyncInfo)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetColorProfileAsync(&asyncInfo)); } return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayInformation::ColorProfileChanged(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_ColorProfileChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ColorProfileChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformation::ColorProfileChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ColorProfileChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformation::ColorProfileChanged(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_ColorProfileChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ColorProfileChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayInformation2::RawPixelsPerViewPixel() const { double 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_RawPixelsPerViewPixel(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RawPixelsPerViewPixel(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation3::DiagonalSizeInInches() 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_DiagonalSizeInInches(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DiagonalSizeInInches(&value)); } return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayInformation4::ScreenWidthInRawPixels() const { uint32_t 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_ScreenWidthInRawPixels(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ScreenWidthInRawPixels(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation4::ScreenHeightInRawPixels() const { uint32_t 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_ScreenHeightInRawPixels(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ScreenHeightInRawPixels(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformation5::GetAdvancedColorInfo() 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->GetAdvancedColorInfo(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetAdvancedColorInfo(&value)); } return winrt::Windows::Graphics::Display::AdvancedColorInfo{ value, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayInformation5::AdvancedColorInfoChanged(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_AdvancedColorInfoChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_AdvancedColorInfoChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformation5::AdvancedColorInfoChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, AdvancedColorInfoChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformation5::AdvancedColorInfoChanged(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_AdvancedColorInfoChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_AdvancedColorInfoChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::GetForCurrentView() const { void* current{}; 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->GetForCurrentView(¤t)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForCurrentView(¤t)); } return winrt::Windows::Graphics::Display::DisplayInformation{ current, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::AutoRotationPreferences() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_AutoRotationPreferences(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AutoRotationPreferences(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::AutoRotationPreferences(winrt::Windows::Graphics::Display::DisplayOrientations 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_AutoRotationPreferences(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AutoRotationPreferences(static_cast(value))); } } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::DisplayContentsInvalidated(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_DisplayContentsInvalidated(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DisplayContentsInvalidated(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::DisplayContentsInvalidated(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, DisplayContentsInvalidated(handler)); } template auto consume_Windows_Graphics_Display_IDisplayInformationStatics::DisplayContentsInvalidated(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_DisplayContentsInvalidated(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DisplayContentsInvalidated(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::CurrentOrientation() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_CurrentOrientation(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CurrentOrientation(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::NativeOrientation() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_NativeOrientation(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_NativeOrientation(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::AutoRotationPreferences() const { winrt::Windows::Graphics::Display::DisplayOrientations 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_AutoRotationPreferences(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AutoRotationPreferences(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::AutoRotationPreferences(winrt::Windows::Graphics::Display::DisplayOrientations 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_AutoRotationPreferences(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AutoRotationPreferences(static_cast(value))); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::OrientationChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler 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_OrientationChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_OrientationChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::OrientationChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) const { return impl::make_event_revoker(this, OrientationChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::OrientationChanged(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_OrientationChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_OrientationChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::ResolutionScale() const { winrt::Windows::Graphics::Display::ResolutionScale 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_ResolutionScale(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ResolutionScale(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::LogicalDpi() const { float 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_LogicalDpi(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_LogicalDpi(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::LogicalDpiChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler 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_LogicalDpiChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_LogicalDpiChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::LogicalDpiChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) const { return impl::make_event_revoker(this, LogicalDpiChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::LogicalDpiChanged(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_LogicalDpiChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_LogicalDpiChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::StereoEnabled() 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_StereoEnabled(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_StereoEnabled(&value)); } return value; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::StereoEnabledChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler 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_StereoEnabledChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_StereoEnabledChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::StereoEnabledChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) const { return impl::make_event_revoker(this, StereoEnabledChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::StereoEnabledChanged(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_StereoEnabledChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_StereoEnabledChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::GetColorProfileAsync() const { void* asyncInfo{}; 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->GetColorProfileAsync(&asyncInfo)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetColorProfileAsync(&asyncInfo)); } return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::ColorProfileChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler 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_ColorProfileChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ColorProfileChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::ColorProfileChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) const { return impl::make_event_revoker(this, ColorProfileChanged(handler)); } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::ColorProfileChanged(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_ColorProfileChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ColorProfileChanged(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::DisplayContentsInvalidated(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler 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_DisplayContentsInvalidated(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DisplayContentsInvalidated(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::DisplayContentsInvalidated(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) const { return impl::make_event_revoker(this, DisplayContentsInvalidated(handler)); } template auto consume_Windows_Graphics_Display_IDisplayPropertiesStatics::DisplayContentsInvalidated(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_DisplayContentsInvalidated(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DisplayContentsInvalidated(impl::bind_in(token)); } } template auto consume_Windows_Graphics_Display_IDisplayServicesStatics::FindAll() const { uint32_t result_impl_size{}; struct struct_Windows_Graphics_DisplayId* result{}; 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->FindAll(&result_impl_size, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FindAll(&result_impl_size, &result)); } return com_array{ result, result_impl_size, take_ownership_from_abi }; } template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender) noexcept final try { (*this)(*reinterpret_cast(&sender)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_CurrentAdvancedColorKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CurrentAdvancedColorKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RedPrimary(winrt::Windows::Foundation::Point* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RedPrimary()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_GreenPrimary(winrt::Windows::Foundation::Point* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GreenPrimary()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BluePrimary(winrt::Windows::Foundation::Point* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BluePrimary()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_WhitePoint(winrt::Windows::Foundation::Point* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().WhitePoint()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxLuminanceInNits(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxLuminanceInNits()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinLuminanceInNits(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MinLuminanceInNits()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxAverageFullFrameLuminanceInNits(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxAverageFullFrameLuminanceInNits()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SdrWhiteLevelInNits(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SdrWhiteLevelInNits()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsHdrMetadataFormatCurrentlySupported(int32_t format, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsHdrMetadataFormatCurrentlySupported(*reinterpret_cast(&format))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsAdvancedColorKindAvailable(int32_t kind, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsAdvancedColorKindAvailable(*reinterpret_cast(&kind))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsOverrideActive(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsOverrideActive()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BrightnessLevel(double* level) noexcept final try { typename D::abi_guard guard(this->shim()); *level = detach_from(this->shim().BrightnessLevel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetBrightnessLevel(double brightnessLevel, uint32_t options) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetBrightnessLevel(brightnessLevel, *reinterpret_cast(&options)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetBrightnessScenario(int32_t scenario, uint32_t options) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetBrightnessScenario(*reinterpret_cast(&scenario), *reinterpret_cast(&options)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetLevelForScenario(int32_t scenario, double* brightnessLevel) noexcept final try { typename D::abi_guard guard(this->shim()); *brightnessLevel = detach_from(this->shim().GetLevelForScenario(*reinterpret_cast(&scenario))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StartOverride() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().StartOverride(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StopOverride() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().StopOverride(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_IsSupportedChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().IsSupportedChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_IsSupportedChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().IsSupportedChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_IsOverrideActiveChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().IsOverrideActiveChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_IsOverrideActiveChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().IsOverrideActiveChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_BrightnessLevelChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().BrightnessLevelChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_BrightnessLevelChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().BrightnessLevelChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DesiredLevel(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DesiredLevel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DesiredNits(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DesiredNits()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateFromLevel(double level, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateFromLevel(level)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateFromNits(float nits, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateFromNits(nits)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateFromDisplayBrightnessOverrideScenario(int32_t overrideScenario, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateFromDisplayBrightnessOverrideScenario(*reinterpret_cast(&overrideScenario))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefaultForSystem(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDefaultForSystem()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForCurrentView(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetForCurrentView()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SaveForSystemAsync(void* value, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().SaveForSystemAsync(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DesiredDisplayColorOverrideScenario(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DesiredDisplayColorOverrideScenario()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateFromDisplayColorOverrideScenario(int32_t overrideScenario, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateFromDisplayColorOverrideScenario(*reinterpret_cast(&overrideScenario))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ColorOverrideSettings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ColorOverrideSettings()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ColorOverrideSettings(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ColorOverrideSettings(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BrightnessOverrideSettings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BrightnessOverrideSettings()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_BrightnessOverrideSettings(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().BrightnessOverrideSettings(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CanOverride(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CanOverride()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsOverrideActive(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsOverrideActive()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetCurrentDisplayEnhancementOverrideCapabilities(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetCurrentDisplayEnhancementOverrideCapabilities()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestOverride() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RequestOverride(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StopOverride() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().StopOverride(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_CanOverrideChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().CanOverrideChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_CanOverrideChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().CanOverrideChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_IsOverrideActiveChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().IsOverrideActiveChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_IsOverrideActiveChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().IsOverrideActiveChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_DisplayEnhancementOverrideCapabilitiesChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DisplayEnhancementOverrideCapabilitiesChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DisplayEnhancementOverrideCapabilitiesChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DisplayEnhancementOverrideCapabilitiesChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsBrightnessControlSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsBrightnessControlSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsBrightnessNitsControlSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsBrightnessNitsControlSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSupportedNitRanges(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().GetSupportedNitRanges()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Capabilities(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Capabilities()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetForCurrentView(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetForCurrentView()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_CurrentOrientation(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CurrentOrientation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_NativeOrientation(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().NativeOrientation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_OrientationChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().OrientationChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_OrientationChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().OrientationChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_ResolutionScale(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ResolutionScale()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LogicalDpi(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LogicalDpi()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RawDpiX(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RawDpiX()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RawDpiY(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RawDpiY()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DpiChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DpiChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DpiChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DpiChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_StereoEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().StereoEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_StereoEnabledChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().StereoEnabledChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_StereoEnabledChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().StereoEnabledChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall GetColorProfileAsync(void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().GetColorProfileAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ColorProfileChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ColorProfileChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ColorProfileChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ColorProfileChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_RawPixelsPerViewPixel(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RawPixelsPerViewPixel()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DiagonalSizeInInches(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().DiagonalSizeInInches()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ScreenWidthInRawPixels(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ScreenWidthInRawPixels()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ScreenHeightInRawPixels(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ScreenHeightInRawPixels()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetAdvancedColorInfo(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetAdvancedColorInfo()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_AdvancedColorInfoChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().AdvancedColorInfoChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_AdvancedColorInfoChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().AdvancedColorInfoChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetForCurrentView(void** current) noexcept final try { clear_abi(current); typename D::abi_guard guard(this->shim()); *current = detach_from(this->shim().GetForCurrentView()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AutoRotationPreferences(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AutoRotationPreferences()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AutoRotationPreferences(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AutoRotationPreferences(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DisplayContentsInvalidated(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DisplayContentsInvalidated(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DisplayContentsInvalidated(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DisplayContentsInvalidated(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_CurrentOrientation(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CurrentOrientation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_NativeOrientation(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().NativeOrientation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AutoRotationPreferences(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AutoRotationPreferences()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AutoRotationPreferences(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AutoRotationPreferences(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_OrientationChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().OrientationChanged(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_OrientationChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().OrientationChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_ResolutionScale(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ResolutionScale()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LogicalDpi(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LogicalDpi()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_LogicalDpiChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().LogicalDpiChanged(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_LogicalDpiChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().LogicalDpiChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_StereoEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().StereoEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_StereoEnabledChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().StereoEnabledChanged(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_StereoEnabledChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().StereoEnabledChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall GetColorProfileAsync(void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().GetColorProfileAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ColorProfileChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ColorProfileChanged(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ColorProfileChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ColorProfileChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_DisplayContentsInvalidated(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DisplayContentsInvalidated(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DisplayContentsInvalidated(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DisplayContentsInvalidated(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall FindAll(uint32_t* __resultSize, struct struct_Windows_Graphics_DisplayId** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().FindAll()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Graphics::Display { constexpr auto operator|(DisplayBrightnessOverrideOptions const left, DisplayBrightnessOverrideOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(DisplayBrightnessOverrideOptions& left, DisplayBrightnessOverrideOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(DisplayBrightnessOverrideOptions const left, DisplayBrightnessOverrideOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(DisplayBrightnessOverrideOptions& left, DisplayBrightnessOverrideOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(DisplayBrightnessOverrideOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(DisplayBrightnessOverrideOptions const left, DisplayBrightnessOverrideOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(DisplayBrightnessOverrideOptions& left, DisplayBrightnessOverrideOptions const right) noexcept { left = left ^ right; return left; } constexpr auto operator|(DisplayOrientations const left, DisplayOrientations const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(DisplayOrientations& left, DisplayOrientations const right) noexcept { left = left | right; return left; } constexpr auto operator&(DisplayOrientations const left, DisplayOrientations const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(DisplayOrientations& left, DisplayOrientations const right) noexcept { left = left & right; return left; } constexpr auto operator~(DisplayOrientations const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(DisplayOrientations const left, DisplayOrientations const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(DisplayOrientations& left, DisplayOrientations const right) noexcept { left = left ^ right; return left; } inline auto BrightnessOverride::GetDefaultForSystem() { return impl::call_factory_cast([](IBrightnessOverrideStatics const& f) { return f.GetDefaultForSystem(); }); } inline auto BrightnessOverride::GetForCurrentView() { return impl::call_factory_cast([](IBrightnessOverrideStatics const& f) { return f.GetForCurrentView(); }); } inline auto BrightnessOverride::SaveForSystemAsync(winrt::Windows::Graphics::Display::BrightnessOverride const& value) { return impl::call_factory([&](IBrightnessOverrideStatics const& f) { return f.SaveForSystemAsync(value); }); } inline auto BrightnessOverrideSettings::CreateFromLevel(double level) { return impl::call_factory([&](IBrightnessOverrideSettingsStatics const& f) { return f.CreateFromLevel(level); }); } inline auto BrightnessOverrideSettings::CreateFromNits(float nits) { return impl::call_factory([&](IBrightnessOverrideSettingsStatics const& f) { return f.CreateFromNits(nits); }); } inline auto BrightnessOverrideSettings::CreateFromDisplayBrightnessOverrideScenario(winrt::Windows::Graphics::Display::DisplayBrightnessOverrideScenario const& overrideScenario) { return impl::call_factory([&](IBrightnessOverrideSettingsStatics const& f) { return f.CreateFromDisplayBrightnessOverrideScenario(overrideScenario); }); } inline auto ColorOverrideSettings::CreateFromDisplayColorOverrideScenario(winrt::Windows::Graphics::Display::DisplayColorOverrideScenario const& overrideScenario) { return impl::call_factory([&](IColorOverrideSettingsStatics const& f) { return f.CreateFromDisplayColorOverrideScenario(overrideScenario); }); } inline auto DisplayEnhancementOverride::GetForCurrentView() { return impl::call_factory_cast([](IDisplayEnhancementOverrideStatics const& f) { return f.GetForCurrentView(); }); } inline auto DisplayInformation::GetForCurrentView() { return impl::call_factory_cast([](IDisplayInformationStatics const& f) { return f.GetForCurrentView(); }); } inline auto DisplayInformation::AutoRotationPreferences() { return impl::call_factory_cast([](IDisplayInformationStatics const& f) { return f.AutoRotationPreferences(); }); } inline auto DisplayInformation::AutoRotationPreferences(winrt::Windows::Graphics::Display::DisplayOrientations const& value) { impl::call_factory([&](IDisplayInformationStatics const& f) { return f.AutoRotationPreferences(value); }); } inline auto DisplayInformation::DisplayContentsInvalidated(winrt::Windows::Foundation::TypedEventHandler const& handler) { return impl::call_factory([&](IDisplayInformationStatics const& f) { return f.DisplayContentsInvalidated(handler); }); } inline auto DisplayInformation::DisplayContentsInvalidated(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) { auto f = get_activation_factory(); return DisplayInformation::DisplayContentsInvalidated_revoker{ f, f.DisplayContentsInvalidated(handler) }; } inline auto DisplayInformation::DisplayContentsInvalidated(winrt::event_token const& token) { impl::call_factory([&](IDisplayInformationStatics const& f) { return f.DisplayContentsInvalidated(token); }); } inline auto DisplayProperties::CurrentOrientation() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.CurrentOrientation(); }); } inline auto DisplayProperties::NativeOrientation() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.NativeOrientation(); }); } inline auto DisplayProperties::AutoRotationPreferences() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.AutoRotationPreferences(); }); } inline auto DisplayProperties::AutoRotationPreferences(winrt::Windows::Graphics::Display::DisplayOrientations const& value) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.AutoRotationPreferences(value); }); } inline auto DisplayProperties::OrientationChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { return impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.OrientationChanged(handler); }); } inline auto DisplayProperties::OrientationChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { auto f = get_activation_factory(); return DisplayProperties::OrientationChanged_revoker{ f, f.OrientationChanged(handler) }; } inline auto DisplayProperties::OrientationChanged(winrt::event_token const& token) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.OrientationChanged(token); }); } inline auto DisplayProperties::ResolutionScale() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.ResolutionScale(); }); } inline auto DisplayProperties::LogicalDpi() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.LogicalDpi(); }); } inline auto DisplayProperties::LogicalDpiChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { return impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.LogicalDpiChanged(handler); }); } inline auto DisplayProperties::LogicalDpiChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { auto f = get_activation_factory(); return DisplayProperties::LogicalDpiChanged_revoker{ f, f.LogicalDpiChanged(handler) }; } inline auto DisplayProperties::LogicalDpiChanged(winrt::event_token const& token) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.LogicalDpiChanged(token); }); } inline auto DisplayProperties::StereoEnabled() { return impl::call_factory_cast([](IDisplayPropertiesStatics const& f) { return f.StereoEnabled(); }); } inline auto DisplayProperties::StereoEnabledChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { return impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.StereoEnabledChanged(handler); }); } inline auto DisplayProperties::StereoEnabledChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { auto f = get_activation_factory(); return DisplayProperties::StereoEnabledChanged_revoker{ f, f.StereoEnabledChanged(handler) }; } inline auto DisplayProperties::StereoEnabledChanged(winrt::event_token const& token) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.StereoEnabledChanged(token); }); } inline auto DisplayProperties::GetColorProfileAsync() { return impl::call_factory_cast(*)(IDisplayPropertiesStatics const&), DisplayProperties, IDisplayPropertiesStatics>([](IDisplayPropertiesStatics const& f) { return f.GetColorProfileAsync(); }); } inline auto DisplayProperties::ColorProfileChanged(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { return impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.ColorProfileChanged(handler); }); } inline auto DisplayProperties::ColorProfileChanged(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { auto f = get_activation_factory(); return DisplayProperties::ColorProfileChanged_revoker{ f, f.ColorProfileChanged(handler) }; } inline auto DisplayProperties::ColorProfileChanged(winrt::event_token const& token) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.ColorProfileChanged(token); }); } inline auto DisplayProperties::DisplayContentsInvalidated(winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { return impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.DisplayContentsInvalidated(handler); }); } inline auto DisplayProperties::DisplayContentsInvalidated(auto_revoke_t, winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler const& handler) { auto f = get_activation_factory(); return DisplayProperties::DisplayContentsInvalidated_revoker{ f, f.DisplayContentsInvalidated(handler) }; } inline auto DisplayProperties::DisplayContentsInvalidated(winrt::event_token const& token) { impl::call_factory([&](IDisplayPropertiesStatics const& f) { return f.DisplayContentsInvalidated(token); }); } inline auto DisplayServices::FindAll() { return impl::call_factory_cast(*)(IDisplayServicesStatics const&), DisplayServices, IDisplayServicesStatics>([](IDisplayServicesStatics const& f) { return f.FindAll(); }); } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(L handler) : DisplayPropertiesEventHandler(impl::make_delegate(std::forward(handler))) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(F* handler) : DisplayPropertiesEventHandler([=](auto&&... args) { return handler(args...); }) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(O* object, M method) : DisplayPropertiesEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(com_ptr&& object, M method) : DisplayPropertiesEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(weak_ref&& object, LM&& lambda_or_method) : DisplayPropertiesEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(std::shared_ptr&& object, M method) : DisplayPropertiesEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DisplayPropertiesEventHandler::DisplayPropertiesEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : DisplayPropertiesEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto DisplayPropertiesEventHandler::operator()(winrt::Windows::Foundation::IInspectable const& sender) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender))); } } 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 {}; 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 {}; 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