feat: added Windows.Xbox.ApplicationModel

This commit is contained in:
CT5
2026-02-04 19:15:19 +11:00
parent b99f4f5776
commit 22a1c9329d
10 changed files with 310 additions and 0 deletions

View File

@@ -0,0 +1,111 @@
import "Windows.Xbox.System.idl";
namespace Windows.Xbox.ApplicationModel
{
[flags]
enum PrivilegeCheckResult
{
NoIssue = 0x0,
PurchaseRequired = 0x1,
Aborted = 0x2,
Banned = 0x4,
Restricted = 0x8,
};
namespace Core
{
[interface_name("ICoreApplicationContext", 99999999-8888-7777-6666-555555555555)]
runtimeclass CoreApplicationContext
{
CoreApplicationContext();
Windows.Xbox.System.User CurrentUser { get; };
event Windows.Foundation.EventHandler<IInspectable> CurrentUserChanged;
}
}
[static_name("IHelp", 98999999-8888-7777-6666-555555555555)]
runtimeclass Help
{
static Windows.Foundation.IAsyncAction Show(Windows.Xbox.System.User usr);
static Windows.Foundation.IAsyncAction ShowForError(String unk, String unka);
}
namespace Store
{
[flags]
enum ProductItemTypes
{
Game = 0x1,
App = 0x2,
Consumable = 0x4,
Durable = 0x8,
GameDemo = 0x10,
};
[flags]
enum PrivilegeCheckResult
{
NoIssue = 0x0,
PurchaseRequired = 0x1,
Aborted = 0x2,
Banned = 0x4,
Restricted = 0x8,
};
enum KnownPrivileges
{
XPRIVILEGE_BROADCAST = 0xbe,
XPRIVILEGE_FREE_CONTENT = 0xc1,
XPRIVILEGE_VIEW_FRIENDS_LIST = 0xc5,
XPRIVILEGE_GAME_DVR = 0xc6,
XPRIVILEGE_SHARE_KINECT_CONTENT = 0xc7,
XPRIVILEGE_MULTIPLAYER_PARTIES = 0xcb,
XPRIVILEGE_COMMUNICATION_VOICE_INGAME = 0xcd,
XPRIVILEGE_COMMUNICATION_VOICE_SKYPE = 0xce,
XPRIVILEGE_CLOUD_GAMING_MANAGE_SESSION = 0xcf,
XPRIVILEGE_CLOUD_GAMING_JOIN_SESSION = 0xd0,
XPRIVILEGE_CLOUD_SAVED_GAMES = 0xd1,
XPRIVILEGE_SHARE_CONTENT = 0xd3,
XPRIVILEGE_PREMIUM_CONTENT = 0xd6,
XPRIVILEGE_NOUPSELL = 0xd7,
XPRIVILEGE_SUBSCRIPTION_CONTENT = 0xdb,
XPRIVILEGE_SOCIAL_NETWORK_SHARING = 0xdc,
XPRIVILEGE_PREMIUM_VIDEO = 0xe0,
XPRIVILEGE_VIDEO_COMMUNICATIONS = 0xeb,
XPRIVILEGE_PURCHASE_CONTENT = 0xf5,
XPRIVILEGE_USER_CREATED_CONTENT = 0xf7,
XPRIVILEGE_PROFILE_VIEWING = 0xf9,
XPRIVILEGE_COMMUNICATIONS = 0xfc,
XPRIVILEGE_MULTIPLAYER_SESSIONS = 0xfe,
XPRIVILEGE_ADD_FRIEND = 0xff,
};
[interface_name("IProductPurchasedEventArgs", 98888899-8888-7777-6666-555555555555)]
runtimeclass ProductPurchasedEventArgs
{
String Receipt();
}
[uuid(98888888-8888-7777-6666-555555555555)]
delegate HRESULT ProductPurchasedEventHandler(ProductPurchasedEventArgs unk);
[static_name("IProductStatics", 98888888-7888-7777-6666-555555555555)]
runtimeclass Product
{
static Windows.Foundation.IAsyncAction ShowPurchaseAsync(Windows.Xbox.System.User unk, String unka);
static Windows.Foundation.IAsyncAction ShowDetailsAsync(Windows.Xbox.System.User unk, String unka);
static Windows.Foundation.IAsyncAction ShowMarketplaceAsync(Windows.Xbox.System.User unk, ProductItemTypes unka, String unkaa, ProductItemTypes unkaaa);
static Windows.Foundation.IAsyncAction ShowRedeemCodeAsync(Windows.Xbox.System.User unk, String unka);
static Windows.Foundation.IAsyncAction ShowSubscriptionAsync(Windows.Xbox.System.User unk, String unka, UInt32 unkaa);
static Windows.Foundation.IAsyncOperation<PrivilegeCheckResult> CheckPrivilegeAsync(Windows.Xbox.System.User unk, UInt32 unka, Boolean unkaa, String unkaaa);
static Windows.Foundation.IAsyncOperation<PrivilegeCheckResult> CheckPrivilegesAsync(Windows.Xbox.System.User unk, Windows.Foundation.Collections.IVectorView<UInt32> unka, Boolean unkaa, String unkaaa);
static event ProductPurchasedEventHandler ProductPurchased;
[static_name("IProductStaticsV2", 98888888-7788-7777-6666-555555555555)]
{
static Windows.Foundation.IAsyncAction ShowPurchaseForStoreIdAsync(Windows.Xbox.System.User unk, String unka);
static Windows.Foundation.IAsyncAction ShowDetailsForStoreIdAsync(Windows.Xbox.System.User unk, String unka);
}
}
}
}

View File

@@ -57,6 +57,10 @@ set(FILES
"src/Windows/Xbox/Management/Deployment/Windows.Xbox.Management.Deployment.PackageTransferManagerForChunkSpecifiers.cpp"
"src/Windows/Xbox/Management/Deployment/Windows.Xbox.Management.Deployment.PackageTransferWatcher.cpp"
"src/Windows/Xbox/Management/Deployment/Windows.Xbox.Management.Deployment.PackageTransferWatcherForContentPackages.cpp"
"src/Windows/Xbox/ApplicationModel/Core/Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.cpp"
"src/Windows/Xbox/ApplicationModel/Store/Windows.Xbox.ApplicationModel.Store.Product.cpp"
"src/Windows/Xbox/ApplicationModel/Store/Windows.Xbox.ApplicationModel.Store.ProductPurchasedEventArgs.cpp"
"src/Windows/Xbox/ApplicationModel/Windows.Xbox.ApplicationModel.Help.cpp"
"src/WinDurangoWinRT.cpp"
)
@@ -74,6 +78,9 @@ target_include_directories(WinDurango.WinRT PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/System"
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/Input"
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/Management/Deployment"
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/ApplicationModel"
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/ApplicationModel/Core"
"${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.WinRT/Windows/Xbox/ApplicationModel/Store"
"${CMAKE_CURRENT_SOURCE_DIR}/Generated Files"
"${CMAKE_SOURCE_DIR}/projects/WinDurango.Common/include"
)

View File

@@ -0,0 +1,23 @@
#pragma once
#include "Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.g.h"
#include <winrt/Windows.Foundation.h>
namespace winrt::Windows::Xbox::ApplicationModel::Core::implementation
{
struct CoreApplicationContext : CoreApplicationContextT<CoreApplicationContext>
{
CoreApplicationContext() = default;
winrt::Windows::Xbox::System::User CurrentUser();
winrt::event_token CurrentUserChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler);
void CurrentUserChanged(winrt::event_token const& token) noexcept;
private:
winrt::event<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>> e_CurrentUserChanged;
};
}
namespace winrt::Windows::Xbox::ApplicationModel::Core::factory_implementation
{
struct CoreApplicationContext : CoreApplicationContextT<CoreApplicationContext, implementation::CoreApplicationContext>
{
};
}

View File

@@ -0,0 +1,30 @@
#pragma once
#include "Windows.Xbox.ApplicationModel.Store.Product.g.h"
namespace winrt::Windows::Xbox::ApplicationModel::Store::implementation
{
struct Product
{
Product() = default;
static winrt::Windows::Foundation::IAsyncAction ShowPurchaseAsync(winrt::Windows::Xbox::System::User unk, hstring unka);
static winrt::Windows::Foundation::IAsyncAction ShowDetailsAsync(winrt::Windows::Xbox::System::User unk, hstring unka);
static winrt::Windows::Foundation::IAsyncAction ShowMarketplaceAsync(winrt::Windows::Xbox::System::User unk, winrt::Windows::Xbox::ApplicationModel::Store::ProductItemTypes unka, hstring unkaa, winrt::Windows::Xbox::ApplicationModel::Store::ProductItemTypes unkaaa);
static winrt::Windows::Foundation::IAsyncAction ShowRedeemCodeAsync(winrt::Windows::Xbox::System::User unk, hstring unka);
static winrt::Windows::Foundation::IAsyncAction ShowSubscriptionAsync(winrt::Windows::Xbox::System::User unk, hstring unka, uint32_t unkaa);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::ApplicationModel::Store::PrivilegeCheckResult> CheckPrivilegeAsync(winrt::Windows::Xbox::System::User unk, uint32_t unka, bool unkaa, hstring unkaaa);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::ApplicationModel::Store::PrivilegeCheckResult> CheckPrivilegesAsync(winrt::Windows::Xbox::System::User unk, winrt::Windows::Foundation::Collections::IVectorView<uint32_t> unka, bool unkaa, hstring unkaaa);
static winrt::event_token ProductPurchased(winrt::Windows::Xbox::ApplicationModel::Store::ProductPurchasedEventHandler const& handler);
static void ProductPurchased(winrt::event_token const& token) noexcept;
static winrt::Windows::Foundation::IAsyncAction ShowPurchaseForStoreIdAsync(winrt::Windows::Xbox::System::User unk, hstring unka);
static winrt::Windows::Foundation::IAsyncAction ShowDetailsForStoreIdAsync(winrt::Windows::Xbox::System::User unk, hstring unka);
private:
static winrt::event<winrt::Windows::Xbox::ApplicationModel::Store::ProductPurchasedEventHandler> e_ProductPurchased;
};
}
namespace winrt::Windows::Xbox::ApplicationModel::Store::factory_implementation
{
struct Product : ProductT<Product, implementation::Product>
{
};
}

View File

@@ -0,0 +1,15 @@
#pragma once
#include "Windows.Xbox.ApplicationModel.Store.ProductPurchasedEventArgs.g.h"
namespace winrt::Windows::Xbox::ApplicationModel::Store::implementation
{
struct ProductPurchasedEventArgs : ProductPurchasedEventArgsT<ProductPurchasedEventArgs>
{
ProductPurchasedEventArgs() = default;
ProductPurchasedEventArgs(hstring receipt) : receipt(receipt) {}
hstring Receipt();
private:
hstring receipt;
};
}

View File

@@ -0,0 +1,19 @@
#pragma once
#include "Windows.Xbox.ApplicationModel.Help.g.h"
namespace winrt::Windows::Xbox::ApplicationModel::implementation
{
struct Help
{
Help() = default;
static winrt::Windows::Foundation::IAsyncAction Show(winrt::Windows::Xbox::System::User usr);
static winrt::Windows::Foundation::IAsyncAction ShowForError(hstring unk, hstring unka);
};
}
namespace winrt::Windows::Xbox::ApplicationModel::factory_implementation
{
struct Help : HelpT<Help, implementation::Help>
{
};
}

View File

@@ -0,0 +1,19 @@
#include "Windows.Xbox.ApplicationModel.Core.CoreApplicationContext.h"
#include "WinDurangoWinRT.h"
namespace winrt::Windows::Xbox::ApplicationModel::Core::implementation
{
winrt::Windows::Xbox::System::User CoreApplicationContext::CurrentUser()
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: CurrentUser");
throw hresult_not_implemented();
}
winrt::event_token CoreApplicationContext::CurrentUserChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler)
{
return e_CurrentUserChanged.add(handler);
}
void CoreApplicationContext::CurrentUserChanged(winrt::event_token const& token) noexcept
{
e_CurrentUserChanged.remove(token);
}
}

View File

@@ -0,0 +1,61 @@
#include "Windows.Xbox.ApplicationModel.Store.Product.h"
#include "WinDurangoWinRT.h"
namespace winrt::Windows::Xbox::ApplicationModel::Store::implementation
{
winrt::Windows::Foundation::IAsyncAction Product::ShowPurchaseAsync(winrt::Windows::Xbox::System::User unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Store", "Unimplemented: ShowPurchaseAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Product::ShowDetailsAsync(winrt::Windows::Xbox::System::User unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowDetailsAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Product::ShowMarketplaceAsync(winrt::Windows::Xbox::System::User unk, winrt::Windows::Xbox::ApplicationModel::Store::ProductItemTypes unka, hstring unkaa, winrt::Windows::Xbox::ApplicationModel::Store::ProductItemTypes unkaaa)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowMarketplaceAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Product::ShowRedeemCodeAsync(winrt::Windows::Xbox::System::User unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowRedeemCodeAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Product::ShowSubscriptionAsync(winrt::Windows::Xbox::System::User unk, hstring unka, uint32_t unkaa)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowSubscriptionAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::ApplicationModel::Store::PrivilegeCheckResult> Product::CheckPrivilegeAsync(winrt::Windows::Xbox::System::User unk, uint32_t unka, bool unkaa, hstring unkaaa)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: CheckPrivilegeAsync(User, uint32_t, bool, hstring)");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::ApplicationModel::Store::PrivilegeCheckResult> Product::CheckPrivilegesAsync(winrt::Windows::Xbox::System::User unk, winrt::Windows::Foundation::Collections::IVectorView<uint32_t> unka, bool unkaa, hstring unkaaa)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: CheckPrivilegesAsync");
throw hresult_not_implemented();
}
winrt::event_token Product::ProductPurchased(winrt::Windows::Xbox::ApplicationModel::Store::ProductPurchasedEventHandler const& handler)
{
return e_ProductPurchased.add(handler);
}
void Product::ProductPurchased(winrt::event_token const& token) noexcept
{
e_ProductPurchased.remove(token);
}
winrt::Windows::Foundation::IAsyncAction Product::ShowPurchaseForStoreIdAsync(winrt::Windows::Xbox::System::User unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowPurchaseForStoreIdAsync");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Product::ShowDetailsForStoreIdAsync(winrt::Windows::Xbox::System::User unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowDetailsForStoreIdAsync");
throw hresult_not_implemented();
}
winrt::event<winrt::Windows::Xbox::ApplicationModel::Store::ProductPurchasedEventHandler> Product::e_ProductPurchased{};
}

View File

@@ -0,0 +1,9 @@
#include "Windows.Xbox.ApplicationModel.Store.ProductPurchasedEventArgs.h"
namespace winrt::Windows::Xbox::ApplicationModel::Store::implementation
{
hstring ProductPurchasedEventArgs::Receipt()
{
return receipt;
}
}

View File

@@ -0,0 +1,16 @@
#include "Windows.Xbox.ApplicationModel.Help.h"
#include "WinDurangoWinRT.h"
namespace winrt::Windows::Xbox::ApplicationModel::implementation
{
winrt::Windows::Foundation::IAsyncAction Help::Show(winrt::Windows::Xbox::System::User usr)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: Show");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction Help::ShowForError(hstring unk, hstring unka)
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::ApplicationModel::Core", "Unimplemented: ShowForError");
throw hresult_not_implemented();
}
}