Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TextInputChannel's dependency on FlutterTizenEngine #162

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions shell/platform/tizen/channels/text_input_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ bool IsASCIIPrintableKey(char c) {

} // namespace

TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
FlutterTizenEngine* engine)
TextInputChannel::TextInputChannel(
BinaryMessenger* messenger,
std::unique_ptr<TizenInputMethodContext> input_method_context)
: channel_(std::make_unique<MethodChannel<rapidjson::Document>>(
messenger,
kChannelName,
&JsonMethodCodec::GetInstance())),
input_method_context_(std::make_unique<TizenInputMethodContext>(engine)) {
input_method_context_(std::move(input_method_context)) {
channel_->SetMethodCallHandler(
[this](const MethodCall<rapidjson::Document>& call,
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
Expand Down
7 changes: 3 additions & 4 deletions shell/platform/tizen/channels/text_input_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

namespace flutter {

class FlutterTizenEngine;

enum class EditStatus { kNone, kPreeditStart, kPreeditEnd, kCommit };

struct TextEditingContext {
Expand All @@ -36,8 +34,9 @@ struct TextEditingContext {

class TextInputChannel {
public:
explicit TextInputChannel(BinaryMessenger* messenger,
FlutterTizenEngine* engine);
explicit TextInputChannel(
BinaryMessenger* messenger,
std::unique_ptr<TizenInputMethodContext> input_method_context);
virtual ~TextInputChannel();

bool IsSoftwareKeyboardShowing() { return is_software_keyboard_showing_; }
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/system_utils.h"
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"

namespace flutter {

Expand Down Expand Up @@ -257,7 +258,8 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) {
navigation_channel = std::make_unique<NavigationChannel>(
internal_plugin_registrar_->messenger());
text_input_channel = std::make_unique<TextInputChannel>(
internal_plugin_registrar_->messenger(), this);
internal_plugin_registrar_->messenger(),
std::make_unique<TizenInputMethodContext>(this));
platform_view_channel = std::make_unique<PlatformViewChannel>(
internal_plugin_registrar_->messenger());
key_event_handler_ = std::make_unique<KeyEventHandler>(this);
Expand Down