Merge pull request #61 from Rodrigo-Todescatto/main

Implemented more CoreApplication stuff.
This commit is contained in:
Tyler Jaacks 2024-10-14 16:39:19 -05:00 committed by GitHub
commit 001450dc3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 97 additions and 2 deletions

View File

@ -36,6 +36,7 @@ INT32 CoreApplicationX::_abi_remove_Suspending(EventRegistrationToken token)
return m_IapplicationCore->remove_Suspending(token);
}
//INT32 CoreApplicationX::_abi_get_ResourceAvailability(Windows::ApplicationModel::Core::ResourceAvailability*)
INT32 CoreApplicationX::_abi_get_ResourceAvailability()
{
//Stubbed at this moment.
@ -54,6 +55,36 @@ INT32 CoreApplicationX::_abi_remove_ResourceAvailabilityChanged(EventRegistratio
return 0;
}
INT32 CoreApplicationX::_abi_get_CoreWindow(ABI::Windows::UI::Core::ICoreWindow** Window)
{
return m_IapplicationCoreView->get_CoreWindow(Window);
}
INT32 CoreApplicationX::_abi_add_Activated(__FITypedEventHandler_2_Windows__CApplicationModel__CCore__CCoreApplicationView_Windows__CApplicationModel__CActivation__CIActivatedEventArgs* handler, EventRegistrationToken* token)
{
return m_IapplicationCoreView->add_Activated(handler, token);
}
INT32 CoreApplicationX::_abi_remove_Activated(EventRegistrationToken token)
{
return m_IapplicationCoreView->remove_Activated(token);
}
INT32 CoreApplicationX::_abi_Exit()
{
return m_applicationCoreExit->Exit();
}
INT32 CoreApplicationX::_abi_add_Exiting(__FIEventHandler_1_IInspectable* handler, EventRegistrationToken* token)
{
return m_applicationCoreExit->add_Exiting(handler, token);
}
INT32 CoreApplicationX::_abi_remove_Exiting(EventRegistrationToken token)
{
return m_applicationCoreExit->remove_Exiting(token);
}
INT32 CoreApplicationX::_abi_RunWithActivationFactories(ABI::Windows::Foundation::IGetActivationFactory* activationFactoryCallback)
{
return m_IapplicationCore->RunWithActivationFactories(activationFactoryCallback);
@ -84,6 +115,36 @@ INT32 CoreApplicationX::_abi_get_Properties(ABI::Windows::Foundation::Collection
return m_IapplicationCore->get_Properties(value);
}
INT32 CoreApplicationX::_abi_Initialize(ABI::Windows::ApplicationModel::Core::ICoreApplicationView* application)
{
return m_IFrameworkView->Initialize(application);
}
INT32 CoreApplicationX::_abi_SetWindow(ICoreWindow* window)
{
return m_IFrameworkView->SetWindow(window);
}
INT32 CoreApplicationX::_abi_Load(HSTRING string)
{
return m_IFrameworkView->Load(string);
}
INT32 CoreApplicationX::__abi_Run()
{
return m_IFrameworkView->Run();
}
INT32 CoreApplicationX::_abi_Uninitialize()
{
return m_IFrameworkView->Uninitialize();
}
INT32 CoreApplicationX::_abi_CreateView(ABI::Windows::ApplicationModel::Core::IFrameworkView** view)
{
return m_IFrameworkViewSource->CreateView(view);
}
HRESULT CoreApplicationX::QueryInterface(const IID& riid, void** ppvObject)
{
return m_coreWindow->QueryInterface(riid, ppvObject);

View File

@ -8,7 +8,12 @@ public:
{
m_applicationCore = reinterpret_cast<winrt::Windows::ApplicationModel::Core::CoreApplication*>(application);
m_IapplicationCore = reinterpret_cast<ABI::Windows::ApplicationModel::Core::ICoreApplication*>(application);
m_IapplicationCoreView = reinterpret_cast<ABI::Windows::ApplicationModel::Core::ICoreApplicationView*>(application);
m_applicationCoreView = reinterpret_cast<ABI::Windows::ApplicationModel::Core::CoreApplicationView*>(application);
m_applicationCoreExit = reinterpret_cast<ABI::Windows::ApplicationModel::Core::ICoreApplicationExit*>(application);
m_coreWindow = reinterpret_cast<ABI::Windows::UI::Core::ICoreWindow*>(application);
m_IFrameworkView = reinterpret_cast<ABI::Windows::ApplicationModel::Core::IFrameworkView*>(application);
m_IFrameworkViewSource = reinterpret_cast<ABI::Windows::ApplicationModel::Core::IFrameworkViewSource*>(application);
}
public:
@ -22,13 +27,24 @@ public:
INT32 _abi_get_ResourceAvailability() override;
INT32 _abi_add_ResourceAvailabilityChanged(winrt::Windows::Foundation::EventHandler<IInspectable>* handler, EventRegistrationToken* token) override;
INT32 _abi_remove_ResourceAvailabilityChanged(EventRegistrationToken token) override;
INT32 _abi_get_CoreWindow(ABI::Windows::UI::Core::ICoreWindow**) override;
INT32 _abi_add_Activated(__FITypedEventHandler_2_Windows__CApplicationModel__CCore__CCoreApplicationView_Windows__CApplicationModel__CActivation__CIActivatedEventArgs* handler, EventRegistrationToken* token) override;
INT32 _abi_remove_Activated(EventRegistrationToken token) override;
INT32 _abi_Exit() override;
INT32 _abi_add_Exiting(__FIEventHandler_1_IInspectable* handler, EventRegistrationToken* token) override;
INT32 _abi_remove_Exiting(EventRegistrationToken token) override;
INT32 _abi_RunWithActivationFactories(ABI::Windows::Foundation::IGetActivationFactory* activationFactoryCallback) override;
INT32 _abi_GetCurrentView(ABI::Windows::ApplicationModel::Core::ICoreApplicationView** value) override;
INT32 _abi_Run(ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* viewSource) override;
INT32 Run(ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* viewSource) override;
INT32 _abi_get_Id(HSTRING* value) override;
INT32 _abi_get_Properties(ABI::Windows::Foundation::Collections::IPropertySet** value) override;
INT32 _abi_Initialize(ABI::Windows::ApplicationModel::Core::ICoreApplicationView* application) override;
INT32 _abi_SetWindow(ICoreWindow* window) override;
INT32 _abi_Load(HSTRING string) override;
INT32 __abi_Run() override;
INT32 _abi_Uninitialize() override;
INT32 _abi_CreateView(ABI::Windows::ApplicationModel::Core::IFrameworkView** view) override;
HRESULT QueryInterface(const IID& riid, void** ppvObject) override;
ULONG AddRef() override;
@ -37,6 +53,11 @@ public:
private:
winrt::Windows::ApplicationModel::Core::CoreApplication* m_applicationCore;
ABI::Windows::ApplicationModel::Core::ICoreApplication* m_IapplicationCore;
ABI::Windows::ApplicationModel::Core::ICoreApplicationView* m_IapplicationCoreView;
ABI::Windows::ApplicationModel::Core::CoreApplicationView* m_applicationCoreView;
ABI::Windows::ApplicationModel::Core::ICoreApplicationExit* m_applicationCoreExit;
ABI::Windows::UI::Core::ICoreWindow* m_coreWindow;
ABI::Windows::ApplicationModel::Core::IFrameworkView* m_IFrameworkView;
ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* m_IFrameworkViewSource;
};

View File

@ -16,18 +16,31 @@ public:
virtual INT32 _abi_remove_Resuming(EventRegistrationToken token) = 0;
virtual INT32 _abi_add_Suspending(__FIEventHandler_1_Windows__CApplicationModel__CSuspendingEventArgs* handler, EventRegistrationToken* token) = 0;
virtual INT32 _abi_remove_Suspending(EventRegistrationToken token) = 0;
//virtual INT32 _abi_get_ResourceAvailability(Windows::ApplicationModel::Core::ResourceAvailability*) = 0;
virtual INT32 _abi_get_ResourceAvailability() = 0;
virtual INT32 _abi_add_ResourceAvailabilityChanged(winrt::Windows::Foundation::EventHandler<IInspectable>* handler, EventRegistrationToken* token) = 0;
virtual INT32 _abi_remove_ResourceAvailabilityChanged(EventRegistrationToken token) = 0;
virtual INT32 _abi_get_CoreWindow(ABI::Windows::UI::Core::ICoreWindow**) = 0;
virtual INT32 _abi_add_Activated(__FITypedEventHandler_2_Windows__CApplicationModel__CCore__CCoreApplicationView_Windows__CApplicationModel__CActivation__CIActivatedEventArgs* handler, EventRegistrationToken* token) = 0;
virtual INT32 _abi_remove_Activated(EventRegistrationToken token) = 0;
virtual INT32 _abi_Exit() = 0;
virtual INT32 _abi_add_Exiting(__FIEventHandler_1_IInspectable* handler, EventRegistrationToken* token) = 0;
virtual INT32 _abi_remove_Exiting(EventRegistrationToken token) = 0;
virtual INT32 _abi_RunWithActivationFactories(ABI::Windows::Foundation::IGetActivationFactory* activationFactoryCallback) = 0;
virtual INT32 _abi_GetCurrentView(ABI::Windows::ApplicationModel::Core::ICoreApplicationView** value) = 0;
virtual INT32 _abi_Run(ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* viewSource) = 0;
virtual INT32 Run(ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* viewSource) = 0;
virtual INT32 _abi_get_Id(HSTRING* value) = 0;
virtual INT32 _abi_get_Properties(ABI::Windows::Foundation::Collections::IPropertySet** value) = 0;
virtual INT32 _abi_Initialize(ABI::Windows::ApplicationModel::Core::ICoreApplicationView* application) = 0;
virtual INT32 _abi_SetWindow(ICoreWindow* window) = 0;
virtual INT32 _abi_Load(HSTRING string) = 0;
virtual INT32 __abi_Run() = 0;
virtual INT32 _abi_Uninitialize() = 0;
virtual INT32 _abi_CreateView(ABI::Windows::ApplicationModel::Core::IFrameworkView** view) = 0;
virtual HRESULT QueryInterface(const IID& riid, void** ppvObject) override = 0;
virtual ULONG AddRef() override = 0;
virtual ULONG Release() override = 0;
};