diff options
author | Michael Scire <SciresM@gmail.com> | 2019-05-23 09:55:56 +0200 |
---|---|---|
committer | Michael Scire <SciresM@gmail.com> | 2019-05-23 09:55:56 +0200 |
commit | 7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2 (patch) | |
tree | 020e199743748138d062cd07c40f13f028c06bef /src/core/hle/service/ns/ns.h | |
parent | shader/decode/memory: Remove left in debug pragma (diff) | |
download | yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar.gz yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar.bz2 yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar.lz yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar.xz yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.tar.zst yuzu-7dbf4c1ae5fbe6287575e7ac1b0f93dbb16843c2.zip |
Diffstat (limited to 'src/core/hle/service/ns/ns.h')
-rw-r--r-- | src/core/hle/service/ns/ns.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index b81ca8f1e..a2b35e795 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h @@ -5,9 +5,83 @@ #pragma once #include "core/hle/service/service.h" +#include "core/hle/service/set/set.h" namespace Service::NS { +class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> { +public: + explicit IAccountProxyInterface(); +}; + +class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> { +public: + explicit IApplicationManagerInterface(); + + ResultVal<u8> GetApplicationDesiredLanguage(u32 supported_languages); + ResultVal<u64> ConvertApplicationLanguageToLanguageCode(u8 application_language); + +private: + void GetApplicationControlData(Kernel::HLERequestContext& ctx); + void GetApplicationDesiredLanguage(Kernel::HLERequestContext& ctx); + void ConvertApplicationLanguageToLanguageCode(Kernel::HLERequestContext& ctx); +}; + +class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> { +public: + explicit IApplicationVersionInterface(); +}; + +class IContentManagerInterface final : public ServiceFramework<IContentManagerInterface> { +public: + explicit IContentManagerInterface(); +}; + +class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { +public: + explicit IDocumentInterface(); +}; + +class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> { +public: + explicit IDownloadTaskInterface(); +}; + +class IECommerceInterface final : public ServiceFramework<IECommerceInterface> { +public: + explicit IECommerceInterface(); +}; + +class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> { +public: + explicit IFactoryResetInterface(); +}; + +class NS final : public ServiceFramework<NS> { +public: + explicit NS(const char* name); + + std::shared_ptr<IApplicationManagerInterface> GetApplicationManagerInterface(); + +private: + template <typename T> + void PushInterface(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_NS, "called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<T>(); + } + + template<typename T> + std::shared_ptr<T> GetInterface() { + static_assert(std::is_base_of_v<Kernel::SessionRequestHandler, T>, + "Not a base of ServiceFrameworkBase"); + + return std::make_shared<T>(); + } +}; + /// Registers all NS services with the specified service manager. void InstallInterfaces(SM::ServiceManager& service_manager); |