From 11f6754a926af4466874afcff67d86f954384d62 Mon Sep 17 00:00:00 2001 From: Boram Bae Date: Mon, 11 Jul 2022 15:52:18 +0900 Subject: [PATCH 1/3] Add FlutterDesktopViewDestroy * The engine owned by the view will also be shut down implicitly. Signed-off-by: Boram Bae --- shell/platform/tizen/flutter_tizen.cc | 5 +++++ shell/platform/tizen/public/flutter_tizen.h | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/shell/platform/tizen/flutter_tizen.cc b/shell/platform/tizen/flutter_tizen.cc index cf29309bede6b..fed2bc47c06ed 100644 --- a/shell/platform/tizen/flutter_tizen.cc +++ b/shell/platform/tizen/flutter_tizen.cc @@ -181,6 +181,11 @@ void FlutterDesktopEngineNotifyAppIsDetached(FlutterDesktopEngineRef engine) { EngineFromHandle(engine)->lifecycle_channel()->AppIsDetached(); } +void FlutterDesktopViewDestroy(FlutterDesktopViewRef view_ref) { + flutter::FlutterTizenView* view = ViewFromHandle(view_ref); + delete view; +} + void FlutterDesktopViewResize(FlutterDesktopViewRef view, int32_t width, int32_t height) { diff --git a/shell/platform/tizen/public/flutter_tizen.h b/shell/platform/tizen/public/flutter_tizen.h index 051ae3bd6d765..e748b38364648 100644 --- a/shell/platform/tizen/public/flutter_tizen.h +++ b/shell/platform/tizen/public/flutter_tizen.h @@ -138,12 +138,12 @@ FLUTTER_EXPORT void FlutterDesktopEngineNotifyAppIsDetached( // ========== View ========== -// Creates a view that hosts and displays the given engine instance. +// Creates the view that hosts and displays the given engine instance. FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow( const FlutterDesktopWindowProperties& window_properties, FlutterDesktopEngineRef engine); -// Creates a view that hosts and displays the given engine instance. +// Creates the view that hosts and displays the given engine instance. // // The type of parent should be Evas_Object*, Cast Evas_Object* to void*. // @warning This API is a work-in-progress and may change. @@ -152,6 +152,12 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromElmParent( FlutterDesktopEngineRef engine, void* parent); +// Destroys the view. +// +// The engine owned by the view will also be shut down implicitly. +// @warning This API is a work-in-progress and may change. +FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view); + // Returns a handle to evas object that the FlutterView is drawn to. // // Cast the returned void* to Evas_Object*. @@ -159,7 +165,7 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromElmParent( FLUTTER_EXPORT void* FlutterDesktopViewGetEvasObject( FlutterDesktopViewRef view); -// Resize the FlutterView. +// Resize the view. // @warning This API is a work-in-progress and may change. FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view, int32_t width, From 304602d1b515eb49a502e58c7401234e30cf9acd Mon Sep 17 00:00:00 2001 From: Boram Bae Date: Mon, 11 Jul 2022 16:17:43 +0900 Subject: [PATCH 2/3] Fix a comment Signed-off-by: Boram Bae --- shell/platform/tizen/public/flutter_tizen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/tizen/public/flutter_tizen.h b/shell/platform/tizen/public/flutter_tizen.h index e748b38364648..6b5b46275b288 100644 --- a/shell/platform/tizen/public/flutter_tizen.h +++ b/shell/platform/tizen/public/flutter_tizen.h @@ -138,12 +138,12 @@ FLUTTER_EXPORT void FlutterDesktopEngineNotifyAppIsDetached( // ========== View ========== -// Creates the view that hosts and displays the given engine instance. +// Creates a view that hosts and displays the given engine instance. FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow( const FlutterDesktopWindowProperties& window_properties, FlutterDesktopEngineRef engine); -// Creates the view that hosts and displays the given engine instance. +// Creates a view that hosts and displays the given engine instance. // // The type of parent should be Evas_Object*, Cast Evas_Object* to void*. // @warning This API is a work-in-progress and may change. From ab0361cc2017fca2772da8c7675f4f3bea173bfb Mon Sep 17 00:00:00 2001 From: Boram Bae Date: Tue, 12 Jul 2022 11:14:24 +0900 Subject: [PATCH 3/3] Update based on review Signed-off-by: Boram Bae --- shell/platform/tizen/public/flutter_tizen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/tizen/public/flutter_tizen.h b/shell/platform/tizen/public/flutter_tizen.h index 6b5b46275b288..1e7d41b934aa2 100644 --- a/shell/platform/tizen/public/flutter_tizen.h +++ b/shell/platform/tizen/public/flutter_tizen.h @@ -165,7 +165,7 @@ FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view); FLUTTER_EXPORT void* FlutterDesktopViewGetEvasObject( FlutterDesktopViewRef view); -// Resize the view. +// Resizes the view. // @warning This API is a work-in-progress and may change. FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view, int32_t width,