// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Lights_H #define WINRT_Windows_Devices_Lights_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Devices.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Numerics.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.UI.2.h" #include "winrt/impl/Windows.Devices.Lights.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Lights_ILamp::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILamp::IsEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->get_IsEnabled(&value)); return value; } template auto consume_Windows_Devices_Lights_ILamp::IsEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->put_IsEnabled(value)); } template auto consume_Windows_Devices_Lights_ILamp::BrightnessLevel() const { float value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->get_BrightnessLevel(&value)); return value; } template auto consume_Windows_Devices_Lights_ILamp::BrightnessLevel(float value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->put_BrightnessLevel(value)); } template auto consume_Windows_Devices_Lights_ILamp::IsColorSettable() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->get_IsColorSettable(&value)); return value; } template auto consume_Windows_Devices_Lights_ILamp::Color() const { winrt::Windows::UI::Color value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->get_Color(put_abi(value))); return value; } template auto consume_Windows_Devices_Lights_ILamp::Color(winrt::Windows::UI::Color const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->put_Color(impl::bind_in(value))); } template auto consume_Windows_Devices_Lights_ILamp::AvailabilityChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->add_AvailabilityChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Lights_ILamp::AvailabilityChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, AvailabilityChanged(handler)); } template auto consume_Windows_Devices_Lights_ILamp::AvailabilityChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILamp)->remove_AvailabilityChanged(impl::bind_in(token)); } template auto consume_Windows_Devices_Lights_ILampArray::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray::HardwareVendorId() const { uint16_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_HardwareVendorId(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::HardwareProductId() const { uint16_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_HardwareProductId(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::HardwareVersion() const { uint16_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_HardwareVersion(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::LampArrayKind() const { winrt::Windows::Devices::Lights::LampArrayKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_LampArrayKind(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Lights_ILampArray::LampCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_LampCount(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::MinUpdateInterval() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_MinUpdateInterval(put_abi(value))); return value; } template auto consume_Windows_Devices_Lights_ILampArray::BoundingBox() const { winrt::Windows::Foundation::Numerics::float3 value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_BoundingBox(put_abi(value))); return value; } template auto consume_Windows_Devices_Lights_ILampArray::IsEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_IsEnabled(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::IsEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->put_IsEnabled(value)); } template auto consume_Windows_Devices_Lights_ILampArray::BrightnessLevel() const { double value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_BrightnessLevel(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::BrightnessLevel(double value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->put_BrightnessLevel(value)); } template auto consume_Windows_Devices_Lights_ILampArray::IsConnected() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_IsConnected(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::SupportsVirtualKeys() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->get_SupportsVirtualKeys(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray::GetLampInfo(int32_t lampIndex) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->GetLampInfo(lampIndex, &result)); return winrt::Windows::Devices::Lights::LampInfo{ result, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray::GetIndicesForKey(winrt::Windows::System::VirtualKey const& key) const { uint32_t result_impl_size{}; int32_t* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->GetIndicesForKey(static_cast(key), &result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray::GetIndicesForPurposes(winrt::Windows::Devices::Lights::LampPurposes const& purposes) const { uint32_t result_impl_size{}; int32_t* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->GetIndicesForPurposes(static_cast(purposes), &result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray::SetColor(winrt::Windows::UI::Color const& desiredColor) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColor(impl::bind_in(desiredColor))); } template auto consume_Windows_Devices_Lights_ILampArray::SetColorForIndex(int32_t lampIndex, winrt::Windows::UI::Color const& desiredColor) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColorForIndex(lampIndex, impl::bind_in(desiredColor))); } template auto consume_Windows_Devices_Lights_ILampArray::SetSingleColorForIndices(winrt::Windows::UI::Color const& desiredColor, array_view lampIndexes) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetSingleColorForIndices(impl::bind_in(desiredColor), lampIndexes.size(), get_abi(lampIndexes))); } template auto consume_Windows_Devices_Lights_ILampArray::SetColorsForIndices(array_view desiredColors, array_view lampIndexes) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColorsForIndices(desiredColors.size(), get_abi(desiredColors), lampIndexes.size(), get_abi(lampIndexes))); } template auto consume_Windows_Devices_Lights_ILampArray::SetColorsForKey(winrt::Windows::UI::Color const& desiredColor, winrt::Windows::System::VirtualKey const& key) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColorsForKey(impl::bind_in(desiredColor), static_cast(key))); } template auto consume_Windows_Devices_Lights_ILampArray::SetColorsForKeys(array_view desiredColors, array_view keys) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColorsForKeys(desiredColors.size(), get_abi(desiredColors), keys.size(), get_abi(keys))); } template auto consume_Windows_Devices_Lights_ILampArray::SetColorsForPurposes(winrt::Windows::UI::Color const& desiredColor, winrt::Windows::Devices::Lights::LampPurposes const& purposes) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SetColorsForPurposes(impl::bind_in(desiredColor), static_cast(purposes))); } template auto consume_Windows_Devices_Lights_ILampArray::SendMessageAsync(int32_t messageId, winrt::Windows::Storage::Streams::IBuffer const& message) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->SendMessageAsync(messageId, *(void**)(&message), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray::RequestMessageAsync(int32_t messageId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray)->RequestMessageAsync(messageId, &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArray2::IsAvailable() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray2)->get_IsAvailable(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampArray2::AvailabilityChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray2)->add_AvailabilityChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Lights_ILampArray2::AvailabilityChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, AvailabilityChanged(handler)); } template auto consume_Windows_Devices_Lights_ILampArray2::AvailabilityChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArray2)->remove_AvailabilityChanged(impl::bind_in(token)); } template auto consume_Windows_Devices_Lights_ILampArrayStatics::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArrayStatics)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampArrayStatics::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampArrayStatics)->FromIdAsync(*(void**)(&deviceId), &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampAvailabilityChangedEventArgs::IsAvailable() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampAvailabilityChangedEventArgs)->get_IsAvailable(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::Index() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_Index(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::Purposes() const { winrt::Windows::Devices::Lights::LampPurposes value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_Purposes(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::Position() const { winrt::Windows::Foundation::Numerics::float3 value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_Position(put_abi(value))); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::RedLevelCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_RedLevelCount(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::GreenLevelCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_GreenLevelCount(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::BlueLevelCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_BlueLevelCount(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::GainLevelCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_GainLevelCount(&value)); return value; } template auto consume_Windows_Devices_Lights_ILampInfo::FixedColor() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_FixedColor(&value)); return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampInfo::GetNearestSupportedColor(winrt::Windows::UI::Color const& desiredColor) const { winrt::Windows::UI::Color result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->GetNearestSupportedColor(impl::bind_in(desiredColor), put_abi(result))); return result; } template auto consume_Windows_Devices_Lights_ILampInfo::UpdateLatency() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampInfo)->get_UpdateLatency(put_abi(value))); return value; } template auto consume_Windows_Devices_Lights_ILampStatics::GetDeviceSelector() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampStatics)->GetDeviceSelector(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampStatics::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampStatics)->FromIdAsync(*(void**)(&deviceId), &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Lights_ILampStatics::GetDefaultAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Lights::ILampStatics)->GetDefaultAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsEnabled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BrightnessLevel(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BrightnessLevel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_BrightnessLevel(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().BrightnessLevel(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsColorSettable(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsColorSettable()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Color(struct struct_Windows_UI_Color* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Color()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Color(struct struct_Windows_UI_Color value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Color(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_AvailabilityChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().AvailabilityChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_AvailabilityChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().AvailabilityChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareVendorId(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareVendorId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareProductId(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareProductId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareVersion(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareVersion()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LampArrayKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LampArrayKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LampCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LampCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinUpdateInterval(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MinUpdateInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BoundingBox(winrt::Windows::Foundation::Numerics::float3* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BoundingBox()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsEnabled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BrightnessLevel(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BrightnessLevel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_BrightnessLevel(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().BrightnessLevel(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsConnected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsConnected()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportsVirtualKeys(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SupportsVirtualKeys()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetLampInfo(int32_t lampIndex, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetLampInfo(lampIndex)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetIndicesForKey(int32_t key, uint32_t* __resultSize, int32_t** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetIndicesForKey(*reinterpret_cast(&key))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetIndicesForPurposes(uint32_t purposes, uint32_t* __resultSize, int32_t** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetIndicesForPurposes(*reinterpret_cast(&purposes))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColor(struct struct_Windows_UI_Color desiredColor) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColor(*reinterpret_cast(&desiredColor)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColorForIndex(int32_t lampIndex, struct struct_Windows_UI_Color desiredColor) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColorForIndex(lampIndex, *reinterpret_cast(&desiredColor)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetSingleColorForIndices(struct struct_Windows_UI_Color desiredColor, uint32_t __lampIndexesSize, int32_t* lampIndexes) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetSingleColorForIndices(*reinterpret_cast(&desiredColor), array_view(reinterpret_cast(lampIndexes), reinterpret_cast(lampIndexes) + __lampIndexesSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColorsForIndices(uint32_t __desiredColorsSize, struct struct_Windows_UI_Color* desiredColors, uint32_t __lampIndexesSize, int32_t* lampIndexes) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColorsForIndices(array_view(reinterpret_cast(desiredColors), reinterpret_cast(desiredColors) + __desiredColorsSize), array_view(reinterpret_cast(lampIndexes), reinterpret_cast(lampIndexes) + __lampIndexesSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColorsForKey(struct struct_Windows_UI_Color desiredColor, int32_t key) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColorsForKey(*reinterpret_cast(&desiredColor), *reinterpret_cast(&key)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColorsForKeys(uint32_t __desiredColorsSize, struct struct_Windows_UI_Color* desiredColors, uint32_t __keysSize, int32_t* keys) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColorsForKeys(array_view(reinterpret_cast(desiredColors), reinterpret_cast(desiredColors) + __desiredColorsSize), array_view(reinterpret_cast(keys), reinterpret_cast(keys) + __keysSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetColorsForPurposes(struct struct_Windows_UI_Color desiredColor, uint32_t purposes) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetColorsForPurposes(*reinterpret_cast(&desiredColor), *reinterpret_cast(&purposes)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendMessageAsync(int32_t messageId, void* message, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().SendMessageAsync(messageId, *reinterpret_cast(&message))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestMessageAsync(int32_t messageId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().RequestMessageAsync(messageId)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsAvailable(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsAvailable()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_AvailabilityChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().AvailabilityChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_AvailabilityChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().AvailabilityChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsAvailable(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsAvailable()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Index(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Index()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Purposes(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Purposes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Position(winrt::Windows::Foundation::Numerics::float3* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Position()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RedLevelCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RedLevelCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_GreenLevelCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GreenLevelCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BlueLevelCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BlueLevelCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_GainLevelCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GainLevelCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FixedColor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().FixedColor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetNearestSupportedColor(struct struct_Windows_UI_Color desiredColor, struct struct_Windows_UI_Color* result) noexcept final try { zero_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetNearestSupportedColor(*reinterpret_cast(&desiredColor))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UpdateLatency(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UpdateLatency()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefaultAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetDefaultAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Lights { constexpr auto operator|(LampPurposes const left, LampPurposes const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(LampPurposes& left, LampPurposes const right) noexcept { left = left | right; return left; } constexpr auto operator&(LampPurposes const left, LampPurposes const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(LampPurposes& left, LampPurposes const right) noexcept { left = left & right; return left; } constexpr auto operator~(LampPurposes const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(LampPurposes const left, LampPurposes const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(LampPurposes& left, LampPurposes const right) noexcept { left = left ^ right; return left; } inline auto Lamp::GetDeviceSelector() { return impl::call_factory_cast([](ILampStatics const& f) { return f.GetDeviceSelector(); }); } inline auto Lamp::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory([&](ILampStatics const& f) { return f.FromIdAsync(deviceId); }); } inline auto Lamp::GetDefaultAsync() { return impl::call_factory_cast(*)(ILampStatics const&), Lamp, ILampStatics>([](ILampStatics const& f) { return f.GetDefaultAsync(); }); } inline auto LampArray::GetDeviceSelector() { return impl::call_factory_cast([](ILampArrayStatics const& f) { return f.GetDeviceSelector(); }); } inline auto LampArray::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory([&](ILampArrayStatics const& f) { return f.FromIdAsync(deviceId); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif