more winrt

This commit is contained in:
Serenity
2025-05-24 06:06:42 -04:00
parent 55bc6934b1
commit 45baceef74
7 changed files with 35 additions and 72 deletions
@@ -2,33 +2,17 @@
#include "Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.h"
#include "Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
namespace winrt::Windows::Xbox::ApplicationModel::Core::implementation
{
static winrt::Windows::Xbox::System::User g_currentUser{ nullptr };
static winrt::Windows::Xbox::System::User g_previousUser{ nullptr };
winrt::Windows::Xbox::System::User CoreApplicationContext::CurrentUser()
{
return NULL;
return g_currentUser;
}
winrt::Windows::Xbox::System::User CoreApplicationContext::PreviousUser()
winrt::Windows::Xbox::System::User winrt::Windows::Xbox::ApplicationModel::Core::implementation::CoreApplicationContext::PreviousUser( )
{
return NULL;
return g_previousUser;
}
winrt::event_token CoreApplicationContext::CurrentUserChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler)
{
@@ -40,11 +24,14 @@ namespace winrt::Windows::Xbox::ApplicationModel::Core::implementation
}
void CoreApplicationContext::SetCurrentUser(winrt::Windows::Xbox::System::User const& value)
{
throw hresult_not_implemented();
g_previousUser = g_currentUser;
g_currentUser = value;
//CurrentUserChanged(winrt::event_token{});
// Optional: fire CurrentUserChanged event here if implemented
}
winrt::Windows::Xbox::System::User CoreApplicationContext::CurrentSystemUser()
{
return NULL;
return g_currentUser;
}
winrt::event_token CoreApplicationContext::CurrentSystemUserChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler)
{
@@ -1,26 +1,9 @@
#pragma once
#include "Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
namespace winrt::Windows::Xbox::ApplicationModel::Core::implementation
{
struct CoreApplicationContext
{
CoreApplicationContext() = default;
@@ -1,25 +1,6 @@
#pragma once
#include "Windows.Xbox.Management.Deployment.PackageTransferManager.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//////////
namespace winrt::Windows::Xbox::Management::Deployment::implementation
{
struct PackageTransferManager : PackageTransferManagerT<PackageTransferManager>
@@ -85,10 +85,17 @@ namespace winrt::Windows::Xbox::Media::implementation
{
m_gameTransportControlsButtonPressedEventArgs.remove(token);
}
winrt::event_token GameTransportControls::PropertyChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Media::GameTransportControls, winrt::Windows::Xbox::Media::GameTransportControlsPropertyChangedEventArgs> const& handler)
winrt::event_token GameTransportControls::PropertyChanged(
winrt::Windows::Foundation::TypedEventHandler<
winrt::Windows::Xbox::Media::GameTransportControls,
winrt::Windows::Xbox::Media::GameTransportControlsPropertyChangedEventArgs> const& handler)
{
// Optional debug logging
wprintf(L"[GameTransportControls] PropertyChanged handler added\n");
return m_gameTransportControlsPropertyChangedEventArgs.add(handler);
}
void GameTransportControls::PropertyChanged(winrt::event_token const& token) noexcept
{
m_gameTransportControlsPropertyChangedEventArgs.remove(token);
@@ -36,6 +36,7 @@ namespace winrt::Windows::Xbox::Media::implementation
bool IsPlayEnabled();
void IsPlayEnabled(bool value);
bool IsPauseEnabled();
void IsPauseEnabled(bool value);
bool IsMenuEnabled();
void IsMenuEnabled(bool value);
@@ -4,10 +4,8 @@
namespace winrt::Windows::Xbox::Media::implementation
{
winrt::Windows::Xbox::Media::GameTransportControlsProperty GameTransportControlsPropertyChangedEventArgs::Property()
{
GameTransportControlsProperty prop{};
return prop;
}
winrt::Windows::Xbox::Media::GameTransportControlsProperty GameTransportControlsPropertyChangedEventArgs::Property( )
{
return m_property;
}
}
@@ -3,10 +3,16 @@
namespace winrt::Windows::Xbox::Media::implementation
{
struct GameTransportControlsPropertyChangedEventArgs : GameTransportControlsPropertyChangedEventArgsT<GameTransportControlsPropertyChangedEventArgs>
{
GameTransportControlsPropertyChangedEventArgs() = default;
struct GameTransportControlsPropertyChangedEventArgs :
GameTransportControlsPropertyChangedEventArgsT<GameTransportControlsPropertyChangedEventArgs>
{
GameTransportControlsPropertyChangedEventArgs(winrt::Windows::Xbox::Media::GameTransportControlsProperty property)
: m_property(property) {
}
winrt::Windows::Xbox::Media::GameTransportControlsProperty Property();
};
winrt::Windows::Xbox::Media::GameTransportControlsProperty Property( );
private:
winrt::Windows::Xbox::Media::GameTransportControlsProperty m_property{};
};
}