diff options
Diffstat (limited to 'src/core/hle/applets/applet.cpp')
| -rw-r--r-- | src/core/hle/applets/applet.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp new file mode 100644 index 000000000..1f447e5fc --- /dev/null +++ b/src/core/hle/applets/applet.cpp | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/assert.h" | ||
| 6 | #include "common/logging/log.h" | ||
| 7 | |||
| 8 | #include "core/hle/applets/applet.h" | ||
| 9 | #include "core/hle/applets/swkbd.h" | ||
| 10 | |||
| 11 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 12 | |||
| 13 | namespace HLE { | ||
| 14 | namespace Applets { | ||
| 15 | |||
| 16 | static std::unordered_map<Service::APT::AppletId, std::shared_ptr<Applet>> applets; | ||
| 17 | |||
| 18 | ResultCode Applet::Create(Service::APT::AppletId id) { | ||
| 19 | switch (id) { | ||
| 20 | case Service::APT::AppletId::SoftwareKeyboard1: | ||
| 21 | case Service::APT::AppletId::SoftwareKeyboard2: | ||
| 22 | applets[id] = std::make_shared<SoftwareKeyboard>(id); | ||
| 23 | break; | ||
| 24 | default: | ||
| 25 | // TODO(Subv): Find the right error code | ||
| 26 | return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotSupported, ErrorLevel::Permanent); | ||
| 27 | } | ||
| 28 | |||
| 29 | return RESULT_SUCCESS; | ||
| 30 | } | ||
| 31 | |||
| 32 | std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) { | ||
| 33 | auto itr = applets.find(id); | ||
| 34 | if (itr != applets.end()) | ||
| 35 | return itr->second; | ||
| 36 | return nullptr; | ||
| 37 | } | ||
| 38 | |||
| 39 | } | ||
| 40 | } // namespace | ||