[Applets] Properly expose nextParameter

This commit is contained in:
wheremyfoodat 2023-11-11 20:35:10 +02:00
parent 135c8cb508
commit 60b565273e
5 changed files with 15 additions and 4 deletions

View file

@ -72,7 +72,9 @@ namespace Applets {
};
class AppletBase {
protected:
Memory& mem;
std::optional<Parameter>& nextParameter;
public:
virtual const char* name() = 0;
@ -83,6 +85,6 @@ namespace Applets {
virtual Result::HorizonResult receiveParameter() = 0;
virtual void reset() = 0;
AppletBase(Memory& mem) : mem(mem) {}
AppletBase(Memory& mem, std::optional<Parameter>& nextParam) : mem(mem), nextParameter(nextParam) {}
};
} // namespace Applets

View file

@ -8,6 +8,6 @@ namespace Applets {
virtual Result::HorizonResult receiveParameter() override;
virtual void reset() override;
MiiSelectorApplet(Memory& memory) : AppletBase(memory) {}
MiiSelectorApplet(Memory& memory, std::optional<Parameter>& nextParam) : AppletBase(memory, nextParam) {}
};
} // namespace Applets

View file

@ -8,6 +8,6 @@ namespace Applets {
virtual Result::HorizonResult receiveParameter() override;
virtual void reset() override;
SoftwareKeyboardApplet(Memory& memory) : AppletBase(memory) {}
SoftwareKeyboardApplet(Memory& memory, std::optional<Parameter>& nextParam) : AppletBase(memory, nextParam) {}
};
} // namespace Applets

View file

@ -4,7 +4,7 @@
using namespace Applets;
AppletManager::AppletManager(Memory& mem) : miiSelector(mem), swkbd(mem) {}
AppletManager::AppletManager(Memory& mem) : miiSelector(mem, nextParameter), swkbd(mem, nextParameter) {}
void AppletManager::reset() {
miiSelector.reset();

View file

@ -7,5 +7,14 @@ Result::HorizonResult SoftwareKeyboardApplet::start() { return Result::Success;
Result::HorizonResult SoftwareKeyboardApplet::receiveParameter() {
Helpers::warn("Software keyboard: Unimplemented ReceiveParameter");
Applets::Parameter param = Applets::Parameter{
.senderID = AppletIDs::SoftwareKeyboard,
.destID = AppletIDs::Application,
.signal = APTSignal::Response,
.data = {},
};
nextParameter = param;
return Result::Success;
}