summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp5
-rw-r--r--src/core/frontend/applets/software_keyboard.h32
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp5
-rw-r--r--src/yuzu/applets/qt_software_keyboard.h16
4 files changed, 23 insertions, 35 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index 020c7fa5e..a3720f4d7 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -15,10 +15,7 @@ DefaultSoftwareKeyboardApplet::~DefaultSoftwareKeyboardApplet() = default;
void DefaultSoftwareKeyboardApplet::InitializeKeyboard(
bool is_inline, KeyboardInitializeParameters initialize_parameters,
- std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback_,
- std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback_) {
+ SubmitNormalCallback submit_normal_callback_, SubmitInlineCallback submit_inline_callback_) {
if (is_inline) {
LOG_WARNING(
Service_AM,
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h
index 094d1e713..8aef103d3 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -54,14 +54,17 @@ struct InlineTextParameters {
class SoftwareKeyboardApplet {
public:
+ using SubmitInlineCallback =
+ std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>;
+ using SubmitNormalCallback =
+ std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>;
+
virtual ~SoftwareKeyboardApplet();
- virtual void InitializeKeyboard(
- bool is_inline, KeyboardInitializeParameters initialize_parameters,
- std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback_,
- std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback_) = 0;
+ virtual void InitializeKeyboard(bool is_inline,
+ KeyboardInitializeParameters initialize_parameters,
+ SubmitNormalCallback submit_normal_callback_,
+ SubmitInlineCallback submit_inline_callback_) = 0;
virtual void ShowNormalKeyboard() const = 0;
@@ -81,12 +84,9 @@ class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet {
public:
~DefaultSoftwareKeyboardApplet() override;
- void InitializeKeyboard(
- bool is_inline, KeyboardInitializeParameters initialize_parameters,
- std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback_,
- std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback_) override;
+ void InitializeKeyboard(bool is_inline, KeyboardInitializeParameters initialize_parameters,
+ SubmitNormalCallback submit_normal_callback_,
+ SubmitInlineCallback submit_inline_callback_) override;
void ShowNormalKeyboard() const override;
@@ -105,12 +105,10 @@ private:
void SubmitNormalText(std::u16string text) const;
void SubmitInlineText(std::u16string_view text) const;
- KeyboardInitializeParameters parameters;
+ KeyboardInitializeParameters parameters{};
- mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback;
- mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback;
+ mutable SubmitNormalCallback submit_normal_callback;
+ mutable SubmitInlineCallback submit_inline_callback;
};
} // namespace Core::Frontend
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index e60506197..734b0ea40 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -1566,10 +1566,7 @@ QtSoftwareKeyboard::~QtSoftwareKeyboard() = default;
void QtSoftwareKeyboard::InitializeKeyboard(
bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters,
- std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback_,
- std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback_) {
+ SubmitNormalCallback submit_normal_callback_, SubmitInlineCallback submit_inline_callback_) {
if (is_inline) {
submit_inline_callback = std::move(submit_inline_callback_);
} else {
diff --git a/src/yuzu/applets/qt_software_keyboard.h b/src/yuzu/applets/qt_software_keyboard.h
index 35d4ee2ef..30ac8ecf6 100644
--- a/src/yuzu/applets/qt_software_keyboard.h
+++ b/src/yuzu/applets/qt_software_keyboard.h
@@ -233,12 +233,10 @@ public:
explicit QtSoftwareKeyboard(GMainWindow& parent);
~QtSoftwareKeyboard() override;
- void InitializeKeyboard(
- bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters,
- std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback_,
- std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback_) override;
+ void InitializeKeyboard(bool is_inline,
+ Core::Frontend::KeyboardInitializeParameters initialize_parameters,
+ SubmitNormalCallback submit_normal_callback_,
+ SubmitInlineCallback submit_inline_callback_) override;
void ShowNormalKeyboard() const override;
@@ -279,8 +277,6 @@ private:
void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type,
std::u16string submitted_text, s32 cursor_position) const;
- mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
- submit_normal_callback;
- mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
- submit_inline_callback;
+ mutable SubmitNormalCallback submit_normal_callback;
+ mutable SubmitInlineCallback submit_inline_callback;
};