diff options
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 40 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applets.h | 7 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/controller.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/error.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/general_backend.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/profile_select.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/software_keyboard.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/web_browser.cpp | 2 |
10 files changed, 56 insertions, 22 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index c59054468..4c8216b47 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -619,16 +619,20 @@ std::size_t AppletMessageQueue::GetMessageCount() const { | |||
| 619 | return messages.size(); | 619 | return messages.size(); |
| 620 | } | 620 | } |
| 621 | 621 | ||
| 622 | void AppletMessageQueue::RequestExit() { | ||
| 623 | PushMessage(AppletMessage::ExitRequested); | ||
| 624 | } | ||
| 625 | |||
| 626 | void AppletMessageQueue::FocusStateChanged() { | ||
| 627 | PushMessage(AppletMessage::FocusStateChanged); | ||
| 628 | } | ||
| 629 | |||
| 622 | void AppletMessageQueue::OperationModeChanged() { | 630 | void AppletMessageQueue::OperationModeChanged() { |
| 623 | PushMessage(AppletMessage::OperationModeChanged); | 631 | PushMessage(AppletMessage::OperationModeChanged); |
| 624 | PushMessage(AppletMessage::PerformanceModeChanged); | 632 | PushMessage(AppletMessage::PerformanceModeChanged); |
| 625 | on_operation_mode_changed->GetWritableEvent()->Signal(); | 633 | on_operation_mode_changed->GetWritableEvent()->Signal(); |
| 626 | } | 634 | } |
| 627 | 635 | ||
| 628 | void AppletMessageQueue::RequestExit() { | ||
| 629 | PushMessage(AppletMessage::ExitRequested); | ||
| 630 | } | ||
| 631 | |||
| 632 | ICommonStateGetter::ICommonStateGetter(Core::System& system_, | 636 | ICommonStateGetter::ICommonStateGetter(Core::System& system_, |
| 633 | std::shared_ptr<AppletMessageQueue> msg_queue_) | 637 | std::shared_ptr<AppletMessageQueue> msg_queue_) |
| 634 | : ServiceFramework{system_, "ICommonStateGetter"}, msg_queue{std::move(msg_queue_)} { | 638 | : ServiceFramework{system_, "ICommonStateGetter"}, msg_queue{std::move(msg_queue_)} { |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index aefbdf0d5..756434716 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -61,8 +61,9 @@ public: | |||
| 61 | void PushMessage(AppletMessage msg); | 61 | void PushMessage(AppletMessage msg); |
| 62 | AppletMessage PopMessage(); | 62 | AppletMessage PopMessage(); |
| 63 | std::size_t GetMessageCount() const; | 63 | std::size_t GetMessageCount() const; |
| 64 | void OperationModeChanged(); | ||
| 65 | void RequestExit(); | 64 | void RequestExit(); |
| 65 | void FocusStateChanged(); | ||
| 66 | void OperationModeChanged(); | ||
| 66 | 67 | ||
| 67 | private: | 68 | private: |
| 68 | std::queue<AppletMessage> messages; | 69 | std::queue<AppletMessage> messages; |
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 6a15947cf..a56df6a7e 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | #include "core/hle/kernel/k_writable_event.h" | 17 | #include "core/hle/kernel/k_writable_event.h" |
| 18 | #include "core/hle/kernel/server_session.h" | 18 | #include "core/hle/kernel/server_session.h" |
| 19 | #include "core/hle/service/am/am.h" | 19 | #include "core/hle/service/am/am.h" |
| 20 | #include "core/hle/service/am/applet_ae.h" | ||
| 21 | #include "core/hle/service/am/applet_oe.h" | ||
| 20 | #include "core/hle/service/am/applets/applets.h" | 22 | #include "core/hle/service/am/applets/applets.h" |
| 21 | #include "core/hle/service/am/applets/controller.h" | 23 | #include "core/hle/service/am/applets/controller.h" |
| 22 | #include "core/hle/service/am/applets/error.h" | 24 | #include "core/hle/service/am/applets/error.h" |
| @@ -24,17 +26,20 @@ | |||
| 24 | #include "core/hle/service/am/applets/profile_select.h" | 26 | #include "core/hle/service/am/applets/profile_select.h" |
| 25 | #include "core/hle/service/am/applets/software_keyboard.h" | 27 | #include "core/hle/service/am/applets/software_keyboard.h" |
| 26 | #include "core/hle/service/am/applets/web_browser.h" | 28 | #include "core/hle/service/am/applets/web_browser.h" |
| 29 | #include "core/hle/service/sm/sm.h" | ||
| 27 | 30 | ||
| 28 | namespace Service::AM::Applets { | 31 | namespace Service::AM::Applets { |
| 29 | 32 | ||
| 30 | AppletDataBroker::AppletDataBroker(Kernel::KernelCore& kernel) { | 33 | AppletDataBroker::AppletDataBroker(Core::System& system_, LibraryAppletMode applet_mode_) |
| 34 | : system{system_}, applet_mode{applet_mode_} { | ||
| 31 | state_changed_event = | 35 | state_changed_event = |
| 32 | Kernel::KEvent::Create(kernel, "ILibraryAppletAccessor:StateChangedEvent"); | 36 | Kernel::KEvent::Create(system.Kernel(), "ILibraryAppletAccessor:StateChangedEvent"); |
| 33 | state_changed_event->Initialize(); | 37 | state_changed_event->Initialize(); |
| 34 | pop_out_data_event = Kernel::KEvent::Create(kernel, "ILibraryAppletAccessor:PopDataOutEvent"); | 38 | pop_out_data_event = |
| 39 | Kernel::KEvent::Create(system.Kernel(), "ILibraryAppletAccessor:PopDataOutEvent"); | ||
| 35 | pop_out_data_event->Initialize(); | 40 | pop_out_data_event->Initialize(); |
| 36 | pop_interactive_out_data_event = | 41 | pop_interactive_out_data_event = Kernel::KEvent::Create( |
| 37 | Kernel::KEvent::Create(kernel, "ILibraryAppletAccessor:PopInteractiveDataOutEvent"); | 42 | system.Kernel(), "ILibraryAppletAccessor:PopInteractiveDataOutEvent"); |
| 38 | pop_interactive_out_data_event->Initialize(); | 43 | pop_interactive_out_data_event->Initialize(); |
| 39 | } | 44 | } |
| 40 | 45 | ||
| @@ -114,6 +119,27 @@ void AppletDataBroker::PushInteractiveDataFromApplet(std::shared_ptr<IStorage>&& | |||
| 114 | 119 | ||
| 115 | void AppletDataBroker::SignalStateChanged() const { | 120 | void AppletDataBroker::SignalStateChanged() const { |
| 116 | state_changed_event->GetWritableEvent()->Signal(); | 121 | state_changed_event->GetWritableEvent()->Signal(); |
| 122 | |||
| 123 | switch (applet_mode) { | ||
| 124 | case LibraryAppletMode::AllForeground: | ||
| 125 | case LibraryAppletMode::AllForegroundInitiallyHidden: { | ||
| 126 | auto applet_oe = system.ServiceManager().GetService<AppletOE>("appletOE"); | ||
| 127 | auto applet_ae = system.ServiceManager().GetService<AppletAE>("appletAE"); | ||
| 128 | |||
| 129 | if (applet_oe) { | ||
| 130 | applet_oe->GetMessageQueue()->FocusStateChanged(); | ||
| 131 | break; | ||
| 132 | } | ||
| 133 | |||
| 134 | if (applet_ae) { | ||
| 135 | applet_ae->GetMessageQueue()->FocusStateChanged(); | ||
| 136 | break; | ||
| 137 | } | ||
| 138 | break; | ||
| 139 | } | ||
| 140 | default: | ||
| 141 | break; | ||
| 142 | } | ||
| 117 | } | 143 | } |
| 118 | 144 | ||
| 119 | std::shared_ptr<Kernel::KReadableEvent> AppletDataBroker::GetNormalDataEvent() const { | 145 | std::shared_ptr<Kernel::KReadableEvent> AppletDataBroker::GetNormalDataEvent() const { |
| @@ -128,8 +154,8 @@ std::shared_ptr<Kernel::KReadableEvent> AppletDataBroker::GetStateChangedEvent() | |||
| 128 | return state_changed_event->GetReadableEvent(); | 154 | return state_changed_event->GetReadableEvent(); |
| 129 | } | 155 | } |
| 130 | 156 | ||
| 131 | Applet::Applet(Kernel::KernelCore& kernel_, LibraryAppletMode applet_mode_) | 157 | Applet::Applet(Core::System& system_, LibraryAppletMode applet_mode_) |
| 132 | : broker{kernel_}, applet_mode{applet_mode_} {} | 158 | : broker{system_, applet_mode_}, applet_mode{applet_mode_} {} |
| 133 | 159 | ||
| 134 | Applet::~Applet() = default; | 160 | Applet::~Applet() = default; |
| 135 | 161 | ||
diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 49a561813..4215d2232 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h | |||
| @@ -72,7 +72,7 @@ enum class LibraryAppletMode : u32 { | |||
| 72 | 72 | ||
| 73 | class AppletDataBroker final { | 73 | class AppletDataBroker final { |
| 74 | public: | 74 | public: |
| 75 | explicit AppletDataBroker(Kernel::KernelCore& kernel_); | 75 | explicit AppletDataBroker(Core::System& system_, LibraryAppletMode applet_mode_); |
| 76 | ~AppletDataBroker(); | 76 | ~AppletDataBroker(); |
| 77 | 77 | ||
| 78 | struct RawChannelData { | 78 | struct RawChannelData { |
| @@ -102,6 +102,9 @@ public: | |||
| 102 | std::shared_ptr<Kernel::KReadableEvent> GetStateChangedEvent() const; | 102 | std::shared_ptr<Kernel::KReadableEvent> GetStateChangedEvent() const; |
| 103 | 103 | ||
| 104 | private: | 104 | private: |
| 105 | Core::System& system; | ||
| 106 | LibraryAppletMode applet_mode; | ||
| 107 | |||
| 105 | // Queues are named from applet's perspective | 108 | // Queues are named from applet's perspective |
| 106 | 109 | ||
| 107 | // PopNormalDataToApplet and PushNormalDataFromGame | 110 | // PopNormalDataToApplet and PushNormalDataFromGame |
| @@ -127,7 +130,7 @@ private: | |||
| 127 | 130 | ||
| 128 | class Applet { | 131 | class Applet { |
| 129 | public: | 132 | public: |
| 130 | explicit Applet(Kernel::KernelCore& kernel_, LibraryAppletMode applet_mode_); | 133 | explicit Applet(Core::System& system_, LibraryAppletMode applet_mode_); |
| 131 | virtual ~Applet(); | 134 | virtual ~Applet(); |
| 132 | 135 | ||
| 133 | virtual void Initialize(); | 136 | virtual void Initialize(); |
diff --git a/src/core/hle/service/am/applets/controller.cpp b/src/core/hle/service/am/applets/controller.cpp index baaac6446..218c8d1e4 100644 --- a/src/core/hle/service/am/applets/controller.cpp +++ b/src/core/hle/service/am/applets/controller.cpp | |||
| @@ -47,7 +47,7 @@ static Core::Frontend::ControllerParameters ConvertToFrontendParameters( | |||
| 47 | 47 | ||
| 48 | Controller::Controller(Core::System& system_, LibraryAppletMode applet_mode_, | 48 | Controller::Controller(Core::System& system_, LibraryAppletMode applet_mode_, |
| 49 | const Core::Frontend::ControllerApplet& frontend_) | 49 | const Core::Frontend::ControllerApplet& frontend_) |
| 50 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 50 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 51 | 51 | ||
| 52 | Controller::~Controller() = default; | 52 | Controller::~Controller() = default; |
| 53 | 53 | ||
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp index 28d7f8e24..23e30aa45 100644 --- a/src/core/hle/service/am/applets/error.cpp +++ b/src/core/hle/service/am/applets/error.cpp | |||
| @@ -88,7 +88,7 @@ ResultCode Decode64BitError(u64 error) { | |||
| 88 | 88 | ||
| 89 | Error::Error(Core::System& system_, LibraryAppletMode applet_mode_, | 89 | Error::Error(Core::System& system_, LibraryAppletMode applet_mode_, |
| 90 | const Core::Frontend::ErrorApplet& frontend_) | 90 | const Core::Frontend::ErrorApplet& frontend_) |
| 91 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 91 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 92 | 92 | ||
| 93 | Error::~Error() = default; | 93 | Error::~Error() = default; |
| 94 | 94 | ||
diff --git a/src/core/hle/service/am/applets/general_backend.cpp b/src/core/hle/service/am/applets/general_backend.cpp index 6a37c9e14..b26abad36 100644 --- a/src/core/hle/service/am/applets/general_backend.cpp +++ b/src/core/hle/service/am/applets/general_backend.cpp | |||
| @@ -39,7 +39,7 @@ static void LogCurrentStorage(AppletDataBroker& broker, std::string_view prefix) | |||
| 39 | 39 | ||
| 40 | Auth::Auth(Core::System& system_, LibraryAppletMode applet_mode_, | 40 | Auth::Auth(Core::System& system_, LibraryAppletMode applet_mode_, |
| 41 | Core::Frontend::ParentalControlsApplet& frontend_) | 41 | Core::Frontend::ParentalControlsApplet& frontend_) |
| 42 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 42 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 43 | 43 | ||
| 44 | Auth::~Auth() = default; | 44 | Auth::~Auth() = default; |
| 45 | 45 | ||
| @@ -155,7 +155,7 @@ void Auth::AuthFinished(bool is_successful) { | |||
| 155 | 155 | ||
| 156 | PhotoViewer::PhotoViewer(Core::System& system_, LibraryAppletMode applet_mode_, | 156 | PhotoViewer::PhotoViewer(Core::System& system_, LibraryAppletMode applet_mode_, |
| 157 | const Core::Frontend::PhotoViewerApplet& frontend_) | 157 | const Core::Frontend::PhotoViewerApplet& frontend_) |
| 158 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 158 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 159 | 159 | ||
| 160 | PhotoViewer::~PhotoViewer() = default; | 160 | PhotoViewer::~PhotoViewer() = default; |
| 161 | 161 | ||
| @@ -205,7 +205,7 @@ void PhotoViewer::ViewFinished() { | |||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | StubApplet::StubApplet(Core::System& system_, AppletId id_, LibraryAppletMode applet_mode_) | 207 | StubApplet::StubApplet(Core::System& system_, AppletId id_, LibraryAppletMode applet_mode_) |
| 208 | : Applet{system_.Kernel(), applet_mode_}, id{id_}, system{system_} {} | 208 | : Applet{system_, applet_mode_}, id{id_}, system{system_} {} |
| 209 | 209 | ||
| 210 | StubApplet::~StubApplet() = default; | 210 | StubApplet::~StubApplet() = default; |
| 211 | 211 | ||
diff --git a/src/core/hle/service/am/applets/profile_select.cpp b/src/core/hle/service/am/applets/profile_select.cpp index b691406b4..c91a9776a 100644 --- a/src/core/hle/service/am/applets/profile_select.cpp +++ b/src/core/hle/service/am/applets/profile_select.cpp | |||
| @@ -17,7 +17,7 @@ constexpr ResultCode ERR_USER_CANCELLED_SELECTION{ErrorModule::Account, 1}; | |||
| 17 | 17 | ||
| 18 | ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_, | 18 | ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_, |
| 19 | const Core::Frontend::ProfileSelectApplet& frontend_) | 19 | const Core::Frontend::ProfileSelectApplet& frontend_) |
| 20 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 20 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 21 | 21 | ||
| 22 | ProfileSelect::~ProfileSelect() = default; | 22 | ProfileSelect::~ProfileSelect() = default; |
| 23 | 23 | ||
diff --git a/src/core/hle/service/am/applets/software_keyboard.cpp b/src/core/hle/service/am/applets/software_keyboard.cpp index ed5f8162d..73a06def1 100644 --- a/src/core/hle/service/am/applets/software_keyboard.cpp +++ b/src/core/hle/service/am/applets/software_keyboard.cpp | |||
| @@ -44,7 +44,7 @@ void SetReplyBase(std::vector<u8>& reply, SwkbdState state, SwkbdReplyType reply | |||
| 44 | 44 | ||
| 45 | SoftwareKeyboard::SoftwareKeyboard(Core::System& system_, LibraryAppletMode applet_mode_, | 45 | SoftwareKeyboard::SoftwareKeyboard(Core::System& system_, LibraryAppletMode applet_mode_, |
| 46 | Core::Frontend::SoftwareKeyboardApplet& frontend_) | 46 | Core::Frontend::SoftwareKeyboardApplet& frontend_) |
| 47 | : Applet{system_.Kernel(), applet_mode_}, frontend{frontend_}, system{system_} {} | 47 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| 48 | 48 | ||
| 49 | SoftwareKeyboard::~SoftwareKeyboard() = default; | 49 | SoftwareKeyboard::~SoftwareKeyboard() = default; |
| 50 | 50 | ||
diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp index 0db9592ec..2404921fd 100644 --- a/src/core/hle/service/am/applets/web_browser.cpp +++ b/src/core/hle/service/am/applets/web_browser.cpp | |||
| @@ -210,7 +210,7 @@ void ExtractSharedFonts(Core::System& system) { | |||
| 210 | 210 | ||
| 211 | WebBrowser::WebBrowser(Core::System& system_, LibraryAppletMode applet_mode_, | 211 | WebBrowser::WebBrowser(Core::System& system_, LibraryAppletMode applet_mode_, |
| 212 | const Core::Frontend::WebBrowserApplet& frontend_) | 212 | const Core::Frontend::WebBrowserApplet& frontend_) |
| 213 | : Applet{system_.Kernel(), applet_mode_}, frontend(frontend_), system{system_} {} | 213 | : Applet{system_, applet_mode_}, frontend(frontend_), system{system_} {} |
| 214 | 214 | ||
| 215 | WebBrowser::~WebBrowser() = default; | 215 | WebBrowser::~WebBrowser() = default; |
| 216 | 216 | ||