diff --git a/shell/platform/tizen/channels/app_control.cc b/shell/platform/tizen/channels/app_control.cc index b16a7bd0e0fe4..19a520847277d 100644 --- a/shell/platform/tizen/channels/app_control.cc +++ b/shell/platform/tizen/channels/app_control.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "app_control.h" -#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_stream_handler_functions.h" + #include "flutter/shell/platform/tizen/channels/app_control_channel.h" namespace flutter { @@ -109,8 +109,8 @@ AppControlResult AppControl::SetExtraData(const EncodableMap& map) { return AppControlResult(); } -void AppControl::SetManager(AppControlChannel* m) { - manager_ = m; +void AppControl::SetManager(AppControlChannel* manager) { + manager_ = manager; } AppControlChannel* AppControl::GetManager() { diff --git a/shell/platform/tizen/channels/app_control.h b/shell/platform/tizen/channels/app_control.h index ac6c55fd9a4cc..24258254c5aea 100644 --- a/shell/platform/tizen/channels/app_control.h +++ b/shell/platform/tizen/channels/app_control.h @@ -6,14 +6,9 @@ #define EMBEDDER_APP_CONTROL_H_ #include -#include -#include -#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h" #include "flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h" #include "flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h" -#include "flutter/shell/platform/common/client_wrapper/include/flutter/method_channel.h" -#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h" #include "flutter/shell/platform/tizen/logger.h" namespace flutter { diff --git a/shell/platform/tizen/channels/app_control_channel.cc b/shell/platform/tizen/channels/app_control_channel.cc index 5b85193d2317a..65f558d259cfd 100644 --- a/shell/platform/tizen/channels/app_control_channel.cc +++ b/shell/platform/tizen/channels/app_control_channel.cc @@ -2,18 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include - -#include "app_control.h" #include "app_control_channel.h" #include "flutter/shell/platform/common/client_wrapper/include/flutter/event_stream_handler_functions.h" +#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h" namespace flutter { -static constexpr char kChannelName[] = "tizen/internal/app_control_method"; -static constexpr char kEventChannelName[] = "tizen/internal/app_control_event"; -static constexpr char kReplyChannelName[] = "tizen/internal/app_control_reply"; +namespace { + +constexpr char kChannelName[] = "tizen/internal/app_control_method"; +constexpr char kEventChannelName[] = "tizen/internal/app_control_event"; +constexpr char kReplyChannelName[] = "tizen/internal/app_control_reply"; + +} // namespace AppControlChannel::AppControlChannel(BinaryMessenger* messenger) { method_channel_ = std::make_unique>( diff --git a/shell/platform/tizen/channels/app_control_channel.h b/shell/platform/tizen/channels/app_control_channel.h index c94bd3de3c70b..6e3f60fdd488a 100644 --- a/shell/platform/tizen/channels/app_control_channel.h +++ b/shell/platform/tizen/channels/app_control_channel.h @@ -5,6 +5,7 @@ #ifndef EMBEDDER_APP_CONTROL_CHANNEL_H_ #define EMBEDDER_APP_CONTROL_CHANNEL_H_ +#include #include #include @@ -12,11 +13,9 @@ #include "flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h" #include "flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h" #include "flutter/shell/platform/common/client_wrapper/include/flutter/method_channel.h" -#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h" +#include "flutter/shell/platform/tizen/channels/app_control.h" #include "flutter/shell/platform/tizen/logger.h" -#include "app_control.h" - namespace flutter { class AppControlChannel { @@ -33,13 +32,11 @@ class AppControlChannel { private: void HandleMethodCall(const MethodCall& method_call, std::unique_ptr> result); - void RegisterEventHandler( - std::unique_ptr> events); + void RegisterEventHandler(std::unique_ptr> events); void UnregisterEventHandler(); void SendAlreadyQueuedEvents(); - void RegisterReplyHandler( - std::unique_ptr> events); + void RegisterReplyHandler(std::unique_ptr> events); void UnregisterReplyHandler(); template diff --git a/shell/platform/tizen/flutter_tizen.cc b/shell/platform/tizen/flutter_tizen.cc index e08b7f182888f..50c609bcbfd3a 100644 --- a/shell/platform/tizen/flutter_tizen.cc +++ b/shell/platform/tizen/flutter_tizen.cc @@ -56,7 +56,8 @@ void FlutterDesktopShutdownEngine(FlutterDesktopEngineRef engine_ref) { void FlutterDesktopPluginRegistrarEnableInputBlocking( FlutterDesktopPluginRegistrarRef registrar, const char* channel) { - registrar->engine->message_dispatcher->EnableInputBlockingForChannel(channel); + registrar->engine->message_dispatcher()->EnableInputBlockingForChannel( + channel); } FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar( @@ -65,17 +66,17 @@ FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar( // Currently, one registrar acts as the registrar for all plugins, so the // name is ignored. It is part of the API to reduce churn in the future when // aligning more closely with the Flutter registrar system. - return EngineFromHandle(engine)->GetPluginRegistrar(); + return EngineFromHandle(engine)->plugin_registrar(); } FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger( FlutterDesktopEngineRef engine) { - return EngineFromHandle(engine)->messenger.get(); + return EngineFromHandle(engine)->messenger(); } FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger( FlutterDesktopPluginRegistrarRef registrar) { - return registrar->engine->messenger.get(); + return registrar->engine->messenger(); } void FlutterDesktopPluginRegistrarSetDestructionHandler( @@ -114,14 +115,15 @@ void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, const char* channel, FlutterDesktopMessageCallback callback, void* user_data) { - messenger->engine->message_dispatcher->SetMessageCallback(channel, callback, - user_data); + messenger->engine->message_dispatcher()->SetMessageCallback(channel, callback, + user_data); } void FlutterDesktopNotifyAppControl(FlutterDesktopEngineRef engine, void* app_control) { #ifndef __X64_SHELL__ - EngineFromHandle(engine)->app_control_channel->NotifyAppControl(app_control); + EngineFromHandle(engine)->app_control_channel()->NotifyAppControl( + app_control); #endif } @@ -134,27 +136,27 @@ void FlutterDesktopNotifyLowMemoryWarning(FlutterDesktopEngineRef engine) { } void FlutterDesktopNotifyAppIsInactive(FlutterDesktopEngineRef engine) { - EngineFromHandle(engine)->lifecycle_channel->AppIsInactive(); + EngineFromHandle(engine)->lifecycle_channel()->AppIsInactive(); } void FlutterDesktopNotifyAppIsResumed(FlutterDesktopEngineRef engine) { - EngineFromHandle(engine)->lifecycle_channel->AppIsResumed(); + EngineFromHandle(engine)->lifecycle_channel()->AppIsResumed(); } void FlutterDesktopNotifyAppIsPaused(FlutterDesktopEngineRef engine) { - EngineFromHandle(engine)->lifecycle_channel->AppIsPaused(); + EngineFromHandle(engine)->lifecycle_channel()->AppIsPaused(); } void FlutterDesktopNotifyAppIsDetached(FlutterDesktopEngineRef engine) { - EngineFromHandle(engine)->lifecycle_channel->AppIsDetached(); + EngineFromHandle(engine)->lifecycle_channel()->AppIsDetached(); } void FlutterRegisterViewFactory( FlutterDesktopPluginRegistrarRef registrar, const char* view_type, std::unique_ptr view_factory) { - view_factory->SetWindow(registrar->engine->renderer->GetWindowHandle()); - registrar->engine->platform_view_channel->ViewFactories().insert( + view_factory->SetWindow(registrar->engine->renderer()->GetWindowHandle()); + registrar->engine->platform_view_channel()->ViewFactories().insert( std::pair>( view_type, std::move(view_factory))); } @@ -173,7 +175,7 @@ static FlutterDesktopTextureRegistrarRef HandleForTextureRegistrar( FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar( FlutterDesktopPluginRegistrarRef registrar) { - return HandleForTextureRegistrar(registrar->engine->GetTextureRegistrar()); + return HandleForTextureRegistrar(registrar->engine->texture_registrar()); } int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture( diff --git a/shell/platform/tizen/flutter_tizen_engine.cc b/shell/platform/tizen/flutter_tizen_engine.cc index d766a512b54a2..4d6b20c39a3dd 100644 --- a/shell/platform/tizen/flutter_tizen_engine.cc +++ b/shell/platform/tizen/flutter_tizen_engine.cc @@ -70,17 +70,17 @@ FlutterTizenEngine::FlutterTizenEngine(const FlutterProjectBundle& project) } }); - messenger = std::make_unique(); - messenger->engine = this; - message_dispatcher = - std::make_unique(messenger.get()); + messenger_ = std::make_unique(); + messenger_->engine = this; + message_dispatcher_ = + std::make_unique(messenger_.get()); plugin_registrar_ = std::make_unique(); plugin_registrar_->engine = this; } FlutterTizenEngine::~FlutterTizenEngine() { - renderer = nullptr; + renderer_ = nullptr; } void FlutterTizenEngine::InitializeRenderer(int32_t x, @@ -92,8 +92,8 @@ void FlutterTizenEngine::InitializeRenderer(int32_t x, TizenRenderer::WindowGeometry geometry = {x, y, width, height}; #ifdef TIZEN_RENDERER_EVAS_GL - renderer = std::make_unique(geometry, transparent, - focusable, *this); + renderer_ = std::make_unique(geometry, transparent, + focusable, *this); render_loop_ = std::make_unique( std::this_thread::get_id(), // main thread @@ -103,10 +103,10 @@ void FlutterTizenEngine::InitializeRenderer(int32_t x, FT_LOG(Error) << "Could not post an engine task."; } }, - renderer.get()); + renderer_.get()); #else - renderer = std::make_unique(geometry, transparent, - focusable, *this); + renderer_ = std::make_unique(geometry, transparent, + focusable, *this); tizen_vsync_waiter_ = std::make_unique(this); #endif @@ -117,7 +117,7 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) { FT_LOG(Error) << "The engine has already started."; return false; } - if (IsHeaded() && !renderer->IsValid()) { + if (IsHeaded() && !renderer_->IsValid()) { FT_LOG(Error) << "The display was not valid."; return false; } @@ -212,7 +212,7 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) { } auto engine = reinterpret_cast(user_data); auto message = engine->ConvertToDesktopMessage(*engine_message); - engine->message_dispatcher->HandleMessage(message); + engine->message_dispatcher_->HandleMessage(message); }; args.custom_task_runners = &custom_task_runners; #ifndef TIZEN_RENDERER_EVAS_GL @@ -226,7 +226,6 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) { if (aot_data_) { args.aot_data = aot_data_.get(); } - if (entrypoint) { args.custom_dart_entrypoint = entrypoint; } @@ -243,29 +242,28 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) { internal_plugin_registrar_ = std::make_unique(plugin_registrar_.get()); - #ifndef __X64_SHELL__ - app_control_channel = std::make_unique( + app_control_channel_ = std::make_unique( internal_plugin_registrar_->messenger()); #endif - platform_channel = std::make_unique( - internal_plugin_registrar_->messenger(), renderer.get()); - settings_channel = std::make_unique( + lifecycle_channel_ = std::make_unique( internal_plugin_registrar_->messenger()); - lifecycle_channel = std::make_unique( + platform_channel_ = std::make_unique( + internal_plugin_registrar_->messenger(), renderer_.get()); + settings_channel_ = std::make_unique( internal_plugin_registrar_->messenger()); if (IsHeaded()) { texture_registrar_ = std::make_unique(this); - key_event_channel = std::make_unique( + key_event_channel_ = std::make_unique( internal_plugin_registrar_->messenger()); - navigation_channel = std::make_unique( + navigation_channel_ = std::make_unique( internal_plugin_registrar_->messenger()); - text_input_channel = std::make_unique( + platform_view_channel_ = std::make_unique( + internal_plugin_registrar_->messenger()); + text_input_channel_ = std::make_unique( internal_plugin_registrar_->messenger(), std::make_unique(this)); - platform_view_channel = std::make_unique( - internal_plugin_registrar_->messenger()); key_event_handler_ = std::make_unique(this); touch_event_handler_ = std::make_unique(this); @@ -279,8 +277,8 @@ bool FlutterTizenEngine::RunEngine(const char* entrypoint) { bool FlutterTizenEngine::StopEngine() { if (engine_) { - if (platform_view_channel) { - platform_view_channel->Dispose(); + if (platform_view_channel_) { + platform_view_channel_->Dispose(); } if (plugin_registrar_destruction_callback_) { plugin_registrar_destruction_callback_(plugin_registrar_.get()); @@ -292,14 +290,6 @@ bool FlutterTizenEngine::StopEngine() { return false; } -FlutterDesktopPluginRegistrarRef FlutterTizenEngine::GetPluginRegistrar() { - return plugin_registrar_.get(); -} - -FlutterTizenTextureRegistrar* FlutterTizenEngine::GetTextureRegistrar() { - return texture_registrar_.get(); -} - void FlutterTizenEngine::SetPluginRegistrarDestructionCallback( FlutterDesktopOnPluginRegistrarDestroyed callback) { plugin_registrar_destruction_callback_ = callback; @@ -364,7 +354,7 @@ void FlutterTizenEngine::SendWindowMetrics(int32_t width, #ifdef TV_PROFILE double dpi = 72.0; #else - double dpi = static_cast(renderer->GetDpi()); + double dpi = static_cast(renderer_->GetDpi()); #endif double scale_factor = dpi / 90.0 * kProfileFactor; event.pixel_ratio = std::max(scale_factor, 1.0); @@ -377,14 +367,14 @@ void FlutterTizenEngine::SendWindowMetrics(int32_t width, // This must be called at least once in order to initialize the value of // transformation_. void FlutterTizenEngine::SetWindowOrientation(int32_t degree) { - if (!renderer) { + if (!renderer_->IsValid()) { return; } - renderer->SetRotate(degree); + renderer_->SetRotate(degree); // Compute renderer transformation based on the angle of rotation. double rad = (360 - degree) * M_PI / 180; - auto geometry = renderer->GetCurrentGeometry(); + auto geometry = renderer_->GetCurrentGeometry(); double width = geometry.w; double height = geometry.h; @@ -404,10 +394,12 @@ void FlutterTizenEngine::SetWindowOrientation(int32_t degree) { }; touch_event_handler_->rotation = degree; if (degree == 90 || degree == 270) { - renderer->ResizeWithRotation(geometry.x, geometry.y, height, width, degree); + renderer_->ResizeWithRotation(geometry.x, geometry.y, height, width, + degree); SendWindowMetrics(height, width, 0.0); } else { - renderer->ResizeWithRotation(geometry.x, geometry.y, width, height, degree); + renderer_->ResizeWithRotation(geometry.x, geometry.y, width, height, + degree); SendWindowMetrics(width, height, 0.0); } } @@ -483,23 +475,23 @@ FlutterRendererConfig FlutterTizenEngine::GetRendererConfig() { config.open_gl.struct_size = sizeof(config.open_gl); config.open_gl.make_current = [](void* user_data) -> bool { return reinterpret_cast(user_data) - ->renderer->OnMakeCurrent(); + ->renderer_->OnMakeCurrent(); }; config.open_gl.make_resource_current = [](void* user_data) -> bool { return reinterpret_cast(user_data) - ->renderer->OnMakeResourceCurrent(); + ->renderer_->OnMakeResourceCurrent(); }; config.open_gl.clear_current = [](void* user_data) -> bool { return reinterpret_cast(user_data) - ->renderer->OnClearCurrent(); + ->renderer_->OnClearCurrent(); }; config.open_gl.present = [](void* user_data) -> bool { return reinterpret_cast(user_data) - ->renderer->OnPresent(); + ->renderer_->OnPresent(); }; config.open_gl.fbo_callback = [](void* user_data) -> uint32_t { return reinterpret_cast(user_data) - ->renderer->OnGetFBO(); + ->renderer_->OnGetFBO(); }; config.open_gl.surface_transformation = [](void* user_data) -> FlutterTransformation { @@ -508,17 +500,17 @@ FlutterRendererConfig FlutterTizenEngine::GetRendererConfig() { config.open_gl.gl_proc_resolver = [](void* user_data, const char* name) -> void* { return reinterpret_cast(user_data) - ->renderer->OnProcResolver(name); + ->renderer_->OnProcResolver(name); }; config.open_gl.gl_external_texture_frame_callback = [](void* user_data, int64_t texture_id, size_t width, size_t height, FlutterOpenGLTexture* texture) -> bool { auto engine = reinterpret_cast(user_data); - if (!engine->GetTextureRegistrar()) { + if (!engine->texture_registrar()) { return false; } - return engine->GetTextureRegistrar()->PopulateTexture(texture_id, width, - height, texture); + return engine->texture_registrar()->PopulateTexture(texture_id, width, + height, texture); }; } else { config.type = kSoftware; diff --git a/shell/platform/tizen/flutter_tizen_engine.h b/shell/platform/tizen/flutter_tizen_engine.h index 5fe82def58503..f9b03864d00c5 100644 --- a/shell/platform/tizen/flutter_tizen_engine.h +++ b/shell/platform/tizen/flutter_tizen_engine.h @@ -78,10 +78,39 @@ class FlutterTizenEngine : public TizenRenderer::Delegate { // Stops the engine. bool StopEngine(); - // Returns the currently configured Plugin Registrar. - FlutterDesktopPluginRegistrarRef GetPluginRegistrar(); + FlutterDesktopMessengerRef messenger() { return messenger_.get(); } - FlutterTizenTextureRegistrar* GetTextureRegistrar(); + IncomingMessageDispatcher* message_dispatcher() { + return message_dispatcher_.get(); + } + + FlutterDesktopPluginRegistrarRef plugin_registrar() { + return plugin_registrar_.get(); + } + + FlutterTizenTextureRegistrar* texture_registrar() { + return texture_registrar_.get(); + } + + TizenRenderer* renderer() { return renderer_.get(); } + +#ifndef __X64_SHELL__ + AppControlChannel* app_control_channel() { + return app_control_channel_.get(); + } +#endif + + KeyEventChannel* key_event_channel() { return key_event_channel_.get(); } + + LifecycleChannel* lifecycle_channel() { return lifecycle_channel_.get(); } + + NavigationChannel* navigation_channel() { return navigation_channel_.get(); } + + PlatformViewChannel* platform_view_channel() { + return platform_view_channel_.get(); + } + + TextInputChannel* text_input_channel() { return text_input_channel_.get(); } // Sets |callback| to be called when the plugin registrar is destroyed. void SetPluginRegistrarDestructionCallback( @@ -130,32 +159,11 @@ class FlutterTizenEngine : public TizenRenderer::Delegate { // given |texture_id|. bool MarkExternalTextureFrameAvailable(int64_t texture_id); - // The plugin messenger handle given to API clients. - std::unique_ptr messenger; - - // Message dispatch manager for messages from the Flutter engine. - std::unique_ptr message_dispatcher; - - // The interface between the Flutter rasterizer and the platform. - std::unique_ptr renderer; - - // The system channels for communicating between Flutter and the platform. -#ifndef __X64_SHELL__ - std::unique_ptr app_control_channel; -#endif - std::unique_ptr key_event_channel; - std::unique_ptr lifecycle_channel; - std::unique_ptr navigation_channel; - std::unique_ptr platform_channel; - std::unique_ptr settings_channel; - std::unique_ptr text_input_channel; - std::unique_ptr platform_view_channel; - private: friend class EngineModifier; // Whether the engine is running in headed or headless mode. - bool IsHeaded() { return renderer != nullptr; } + bool IsHeaded() { return renderer_ != nullptr; } FlutterDesktopMessage ConvertToDesktopMessage( const FlutterPlatformMessage& engine_message); @@ -178,10 +186,18 @@ class FlutterTizenEngine : public TizenRenderer::Delegate { // AOT data for this engine instance, if applicable. UniqueAotDataPtr aot_data_; - // The handlers listening to platform events. + // An event dispatcher for Ecore key events. std::unique_ptr key_event_handler_; + + // An event dispatcher for Ecore mouse events. std::unique_ptr touch_event_handler_; + // The plugin messenger handle given to API clients. + std::unique_ptr messenger_; + + // Message dispatch manager for messages from the Flutter engine. + std::unique_ptr message_dispatcher_; + // The plugin registrar handle given to API clients. std::unique_ptr plugin_registrar_; @@ -196,6 +212,32 @@ class FlutterTizenEngine : public TizenRenderer::Delegate { // The plugin registrar managing internal plugins. std::unique_ptr internal_plugin_registrar_; +#ifndef __X64_SHELL__ + // A plugin that implements Tizen app_control channels. + std::unique_ptr app_control_channel_; +#endif + + // A plugin that implements the Flutter keyevent channel. + std::unique_ptr key_event_channel_; + + // A plugin that implements the Flutter lifecycle channel. + std::unique_ptr lifecycle_channel_; + + // A plugin that implements the Flutter navigation channel. + std::unique_ptr navigation_channel_; + + // A plugin that implements the Flutter platform channel. + std::unique_ptr platform_channel_; + + // A plugin that implements the Flutter platform_views channel. + std::unique_ptr platform_view_channel_; + + // A plugin that implements the Flutter settings channel. + std::unique_ptr settings_channel_; + + // A plugin that implements the Flutter textinput channel. + std::unique_ptr text_input_channel_; + // The event loop for the main thread that allows for delayed task execution. std::unique_ptr event_loop_; @@ -203,6 +245,9 @@ class FlutterTizenEngine : public TizenRenderer::Delegate { std::unique_ptr render_loop_; #endif + // An interface between the Flutter rasterizer and the platform. + std::unique_ptr renderer_; + #ifndef TIZEN_RENDERER_EVAS_GL // The vsync waiter for the embedder. std::unique_ptr tizen_vsync_waiter_; diff --git a/shell/platform/tizen/flutter_tizen_engine_unittest.cc b/shell/platform/tizen/flutter_tizen_engine_unittest.cc index b5a9f4fc656f9..6dabbbb07db9a 100644 --- a/shell/platform/tizen/flutter_tizen_engine_unittest.cc +++ b/shell/platform/tizen/flutter_tizen_engine_unittest.cc @@ -71,18 +71,18 @@ TEST_F(FlutterTizenEngineTest, Stop_Twice) { TEST_F(FlutterTizenEngineTest, GetPluginRegistrar) { EXPECT_TRUE(engine_->RunEngine(nullptr)); - EXPECT_TRUE(engine_->GetPluginRegistrar() != nullptr); + EXPECT_TRUE(engine_->plugin_registrar() != nullptr); } TEST_F(FlutterTizenEngineTest, GetTextureRegistrar) { EXPECT_TRUE(engine_->RunEngine(nullptr)); - EXPECT_TRUE(engine_->GetTextureRegistrar() == nullptr); + EXPECT_TRUE(engine_->texture_registrar() == nullptr); } // Disabled for headless testing. TEST_F(FlutterTizenEngineTestHeaded, DISABLED_GetTextureRegistrar) { EXPECT_TRUE(engine_->RunEngine(nullptr)); - EXPECT_TRUE(engine_->GetTextureRegistrar() != nullptr); + EXPECT_TRUE(engine_->texture_registrar() != nullptr); } TEST_F(FlutterTizenEngineTest, RunDoesExpectedInitialization) { diff --git a/shell/platform/tizen/key_event_handler.cc b/shell/platform/tizen/key_event_handler.cc index cc9adfdcbfb1e..9dc97c6cb479f 100644 --- a/shell/platform/tizen/key_event_handler.cc +++ b/shell/platform/tizen/key_event_handler.cc @@ -44,26 +44,26 @@ Eina_Bool KeyEventHandler::OnKey(void* data, int type, void* event) { FT_LOG(Info) << "Key pressed: " << key->key << "(" << key->keycode << ")"; } - if (engine->text_input_channel) { - if (engine->text_input_channel->SendKeyEvent(key, is_down)) { + if (engine->text_input_channel()) { + if (engine->text_input_channel()->SendKeyEvent(key, is_down)) { return ECORE_CALLBACK_PASS_ON; } } - if (engine->platform_view_channel) { - engine->platform_view_channel->SendKeyEvent(key, is_down); + if (engine->platform_view_channel()) { + engine->platform_view_channel()->SendKeyEvent(key, is_down); } - if (engine->key_event_channel) { - engine->key_event_channel->SendKeyEvent( + if (engine->key_event_channel()) { + engine->key_event_channel()->SendKeyEvent( key, is_down, [engine, keyname = std::string(key->keyname), is_down](bool handled) { if (handled) { return; } if (keyname == kBackKey && !is_down) { - if (engine->navigation_channel) { - engine->navigation_channel->PopRoute(); + if (engine->navigation_channel()) { + engine->navigation_channel()->PopRoute(); } } else if (keyname == kExitKey && !is_down) { #ifndef __X64_SHELL__ diff --git a/shell/platform/tizen/tizen_input_method_context.cc b/shell/platform/tizen/tizen_input_method_context.cc index 8edd198599c3d..eca5e9b86bc8a 100644 --- a/shell/platform/tizen/tizen_input_method_context.cc +++ b/shell/platform/tizen/tizen_input_method_context.cc @@ -172,7 +172,8 @@ void TizenInputMethodContext::Init() { } ecore_imf_context_client_window_set( - imf_context_, reinterpret_cast(engine_->renderer->GetWindowId())); + imf_context_, + reinterpret_cast(engine_->renderer()->GetWindowId())); SetContextOptions(); SetInputPannelOptions(); RegisterEventCallbacks(); diff --git a/shell/platform/tizen/touch_event_handler.cc b/shell/platform/tizen/touch_event_handler.cc index 98345554d34e1..a33481be5d4e0 100644 --- a/shell/platform/tizen/touch_event_handler.cc +++ b/shell/platform/tizen/touch_event_handler.cc @@ -38,7 +38,7 @@ void TouchEventHandler::SendFlutterPointerEvent(FlutterPointerPhase phase, size_t timestamp, int device_id = 0) { // Correct errors caused by window rotation. - auto geometry = engine_->renderer->GetCurrentGeometry(); + auto geometry = engine_->renderer()->GetCurrentGeometry(); double width = geometry.w; double height = geometry.h; double new_x = x, new_y = y;