am: Allow applets to push multiple and different channels of data
This commit is contained in:
parent
3cf7246e37
commit
7cfb29de23
10 changed files with 62 additions and 64 deletions
|
@ -9,14 +9,12 @@
|
|||
namespace Core::Frontend {
|
||||
SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
|
||||
|
||||
bool DefaultSoftwareKeyboardApplet::GetText(SoftwareKeyboardParameters parameters,
|
||||
std::u16string& text) const {
|
||||
std::optional<std::u16string> 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 {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#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<std::u16string> 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<std::u16string> GetText(SoftwareKeyboardParameters parameters) const override;
|
||||
void SendTextCheckDialog(std::u16string error_message) const override;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue