From 7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 11 Nov 2018 20:16:38 -0500 Subject: am: Allow applets to push multiple and different channels of data --- src/core/frontend/applets/software_keyboard.cpp | 10 ++++------ src/core/frontend/applets/software_keyboard.h | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/core/frontend/applets') diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp index cf5e2ea31..2445a980d 100644 --- a/src/core/frontend/applets/software_keyboard.cpp +++ b/src/core/frontend/applets/software_keyboard.cpp @@ -9,14 +9,12 @@ namespace Core::Frontend { SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default; -bool DefaultSoftwareKeyboardApplet::GetText(SoftwareKeyboardParameters parameters, - std::u16string& text) const { +std::optional DefaultSoftwareKeyboardApplet::GetText( + SoftwareKeyboardParameters parameters) const { if (parameters.initial_text.empty()) - text = u"yuzu"; - else - text = parameters.initial_text; + return u"yuzu"; - return true; + return parameters.initial_text; } void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(std::u16string error_message) const { diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 0a82aac0d..7387ee8d7 100644 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include "common/bit_field.h" #include "common/common_types.h" @@ -35,13 +36,13 @@ class SoftwareKeyboardApplet { public: virtual ~SoftwareKeyboardApplet(); - virtual bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const = 0; + virtual std::optional GetText(SoftwareKeyboardParameters parameters) const = 0; virtual void SendTextCheckDialog(std::u16string error_message) const = 0; }; class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet { public: - bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const override; + std::optional GetText(SoftwareKeyboardParameters parameters) const override; void SendTextCheckDialog(std::u16string error_message) const override; }; -- cgit v1.2.3