Skip to content

Commit bcc65fc

Browse files
authored
Remove FlutterView (NUI/Dali embedding) support (#184)
1 parent ee9f5f2 commit bcc65fc

20 files changed

Lines changed: 10 additions & 657 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ The Flutter embedder for Tizen.
5959

6060
- To build an app (TPK) with the embedder generated in the above, copy the output artifacts (`libflutter_tizen*.so`) into the [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen) tool's cached artifacts directory (`flutter/bin/cache/artifacts/engine`) and run `flutter-tizen run` or `flutter-tizen build tpk`.
6161
- To use the embedder's built-in libc++ (`third_party/libcxx`) instead of the target device's `libstdc++.so`, provide the `--no-system-cxx` option to `tools/gn`.
62-
- Building NUI-related code requires a sysroot for Tizen 6.5 or above and the `--api-version 6.5` option.
6362

6463
## Repository structure
6564

flutter/shell/platform/tizen/BUILD.gn

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ config("flutter_tizen_config") {
1313
include_dirs = [
1414
"${sysroot_path}/usr/include/appfw",
1515
"${sysroot_path}/usr/include/base",
16-
"${sysroot_path}/usr/include/dali",
17-
"${sysroot_path}/usr/include/dali-adaptor",
18-
"${sysroot_path}/usr/include/dali-toolkit",
1916
"${sysroot_path}/usr/include/dlog",
2017
"${sysroot_path}/usr/include/ecore-1",
2118
"${sysroot_path}/usr/include/ecore-imf-1",
@@ -158,22 +155,9 @@ template("embedder") {
158155
}
159156

160157
if (api_version != "6.0") {
161-
sources += [
162-
"flutter_tizen_nui.cc",
163-
"tizen_clipboard.cc",
164-
"tizen_renderer_nui_gl.cc",
165-
"tizen_view_nui.cc",
166-
]
167-
168-
libs += [
169-
"dali2-adaptor",
170-
"dali2-core",
171-
]
158+
sources += [ "tizen_clipboard.cc" ]
172159

173-
defines += [
174-
"NUI_SUPPORT",
175-
"CLIPBOARD_SUPPORT",
176-
]
160+
defines += [ "CLIPBOARD_SUPPORT" ]
177161
}
178162

179163
configs += [

flutter/shell/platform/tizen/channels/platform_channel.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "flutter/shell/platform/tizen/channels/tizen_shell.h"
1717
#endif
1818
#include "flutter/shell/platform/tizen/logger.h"
19-
#include "flutter/shell/platform/tizen/tizen_view.h"
2019
#include "flutter/shell/platform/tizen/tizen_window.h"
2120

2221
namespace flutter {
@@ -244,11 +243,7 @@ void PlatformChannel::HandleMethodCall(
244243
}
245244

246245
void PlatformChannel::SystemNavigatorPop() {
247-
if (auto* view = dynamic_cast<TizenView*>(view_)) {
248-
view->SetFocus(false);
249-
} else {
250-
ui_app_exit();
251-
}
246+
ui_app_exit();
252247
}
253248

254249
void PlatformChannel::PlaySystemSound(const std::string& sound_type) {

flutter/shell/platform/tizen/flutter_tizen.cc

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
#include "flutter/shell/platform/tizen/flutter_tizen_view.h"
1515
#include "flutter/shell/platform/tizen/logger.h"
1616
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
17-
#include "flutter/shell/platform/tizen/tizen_view.h"
18-
#ifdef NUI_SUPPORT
19-
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
20-
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
21-
#endif
2217
#include "flutter/shell/platform/tizen/tizen_window.h"
2318
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"
2419

@@ -224,86 +219,11 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
224219
return HandleForView(view.release());
225220
}
226221

227-
void* FlutterDesktopViewGetNativeHandle(FlutterDesktopViewRef view_ref) {
228-
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
229-
return view->tizen_view()->GetNativeHandle();
230-
}
231-
232222
uint32_t FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view_ref) {
233223
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
234224
return view->tizen_view()->GetResourceId();
235225
}
236226

237-
void FlutterDesktopViewResize(FlutterDesktopViewRef view,
238-
int32_t width,
239-
int32_t height) {
240-
ViewFromHandle(view)->Resize(width, height);
241-
}
242-
243-
void FlutterDesktopViewOnPointerEvent(FlutterDesktopViewRef view,
244-
FlutterDesktopPointerEventType type,
245-
double x,
246-
double y,
247-
size_t timestamp,
248-
int32_t device_id) {
249-
// TODO(swift-kim): Add support for mouse devices.
250-
FlutterPointerDeviceKind device_kind = kFlutterPointerDeviceKindTouch;
251-
FlutterPointerMouseButtons button = kFlutterPointerButtonMousePrimary;
252-
253-
switch (type) {
254-
case FlutterDesktopPointerEventType::kMouseDown:
255-
default:
256-
ViewFromHandle(view)->OnPointerDown(x, y, button, timestamp, device_kind,
257-
device_id);
258-
break;
259-
case FlutterDesktopPointerEventType::kMouseUp:
260-
ViewFromHandle(view)->OnPointerUp(x, y, button, timestamp, device_kind,
261-
device_id);
262-
break;
263-
case FlutterDesktopPointerEventType::kMouseMove:
264-
ViewFromHandle(view)->OnPointerMove(x, y, timestamp, device_kind,
265-
device_id);
266-
break;
267-
}
268-
}
269-
270-
void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
271-
const char* device_name,
272-
uint32_t device_class,
273-
uint32_t device_subclass,
274-
const char* key,
275-
const char* string,
276-
uint32_t modifiers,
277-
uint32_t scan_code,
278-
size_t timestamp,
279-
bool is_down) {
280-
#ifdef NUI_SUPPORT
281-
if (auto* nui_view = dynamic_cast<flutter::TizenViewNui*>(
282-
ViewFromHandle(view)->tizen_view())) {
283-
nui_view->OnKey(device_name, device_class, device_subclass, key, string,
284-
nullptr, modifiers, scan_code, timestamp, is_down);
285-
}
286-
#else
287-
ViewFromHandle(view)->OnKey(key, string, nullptr, modifiers, scan_code,
288-
device_name, is_down);
289-
#endif
290-
}
291-
292-
void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view, bool focused) {
293-
if (auto* tizen_view = dynamic_cast<flutter::TizenView*>(
294-
ViewFromHandle(view)->tizen_view())) {
295-
tizen_view->SetFocus(focused);
296-
}
297-
}
298-
299-
bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view) {
300-
if (auto* tizen_view = dynamic_cast<flutter::TizenView*>(
301-
ViewFromHandle(view)->tizen_view())) {
302-
return tizen_view->focused();
303-
}
304-
return false;
305-
}
306-
307227
void FlutterDesktopRegisterViewFactory(
308228
FlutterDesktopPluginRegistrarRef registrar,
309229
const char* view_type,

flutter/shell/platform/tizen/flutter_tizen_engine.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include "flutter/shell/platform/tizen/tizen_renderer_vulkan.h"
2323
#endif
2424

25-
#ifdef NUI_SUPPORT
26-
#include "flutter/shell/platform/tizen/tizen_renderer_nui_gl.h"
27-
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
28-
#endif
29-
3025
namespace flutter {
3126

3227
namespace {
@@ -90,13 +85,6 @@ std::unique_ptr<TizenRenderer> FlutterTizenEngine::CreateRenderer(
9085
FlutterDesktopRendererType renderer_type) {
9186
switch (renderer_type) {
9287
case FlutterDesktopRendererType::kEGL:
93-
#ifdef NUI_SUPPORT
94-
if (auto* nui_view =
95-
dynamic_cast<flutter::TizenViewNui*>(view_->tizen_view())) {
96-
return std::make_unique<TizenRendererNuiGL>(
97-
nui_view, project_->HasArgument("--enable-impeller"));
98-
}
99-
#endif
10088
return std::make_unique<TizenRendererEgl>(
10189
view_->tizen_view(), project_->HasArgument("--enable-impeller"));
10290
case FlutterDesktopRendererType::kEVulkan:

flutter/shell/platform/tizen/flutter_tizen_nui.cc

Lines changed: 0 additions & 56 deletions
This file was deleted.

flutter/shell/platform/tizen/flutter_tizen_view.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
#include "flutter/shell/platform/tizen/logger.h"
99
#include "flutter/shell/platform/tizen/system_utils.h"
10-
#include "flutter/shell/platform/tizen/tizen_view.h"
11-
#ifdef NUI_SUPPORT
12-
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
13-
#endif
1410
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
1511
#include "flutter/shell/platform/tizen/tizen_window.h"
1612

@@ -100,13 +96,6 @@ void FlutterTizenView::SetupChannels() {
10096
messenger, tizen_view_->input_method_context());
10197
}
10298

103-
void FlutterTizenView::Resize(int32_t width, int32_t height) {
104-
TizenGeometry geometry = tizen_view_->GetGeometry();
105-
geometry.width = width;
106-
geometry.height = height;
107-
tizen_view_->SetGeometry(geometry);
108-
}
109-
11099
void FlutterTizenView::OnResize(int32_t left,
111100
int32_t top,
112101
int32_t width,

flutter/shell/platform/tizen/flutter_tizen_view.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class FlutterTizenView : public TizenViewEventHandlerDelegate {
4444

4545
TizenViewBase* tizen_view() { return tizen_view_.get(); }
4646

47-
void Resize(int32_t width, int32_t height);
48-
4947
void OnResize(int32_t left,
5048
int32_t top,
5149
int32_t width,

flutter/shell/platform/tizen/public/flutter_tizen.h

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ typedef enum {
3232
kEVulkan
3333
} FlutterDesktopRendererType;
3434

35-
typedef enum {
36-
kMouseDown,
37-
kMouseUp,
38-
kMouseMove,
39-
} FlutterDesktopPointerEventType;
40-
4135
typedef enum {
4236
// No external output.
4337
kNone,
@@ -83,14 +77,6 @@ typedef struct {
8377
bool floating_menu_support;
8478
} FlutterDesktopWindowProperties;
8579

86-
// Properties for configuring the initial settings of a Flutter view.
87-
typedef struct {
88-
// The width of the view, or the maximum width if the value is zero.
89-
int32_t width;
90-
// The height of the view, or the maximum height if the value is zero.
91-
int32_t height;
92-
} FlutterDesktopViewProperties;
93-
9480
// Properties for configuring a Flutter engine instance.
9581
typedef struct {
9682
// The path to the flutter_assets folder for the application to be run.
@@ -185,66 +171,16 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
185171
const FlutterDesktopWindowProperties& window_properties,
186172
FlutterDesktopEngineRef engine);
187173

188-
// Creates a view that hosts and displays the given engine instance.
189-
//
190-
// The type of |image_view| must be Dali::Toolkit::ImageView*.
191-
// The type of |native_image_queue| must be Dali::NativeImageSourceQueue*.
192-
// @warning This API is a work-in-progress and may change.
193-
FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromImageView(
194-
const FlutterDesktopViewProperties& view_properties,
195-
FlutterDesktopEngineRef engine,
196-
void* image_view,
197-
void* native_image_queue,
198-
int32_t default_window_id);
199-
200174
// Destroys the view.
201175
//
202176
// The engine owned by the view will also be shut down implicitly.
203177
// @warning This API is a work-in-progress and may change.
204178
FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view);
205179

206-
// Returns a native UI toolkit handle for manipulation in host application.
207-
//
208-
// Cast the returned void*
209-
// - window ecore wl2 : to Ecore_Wl2_Window*
210-
// @warning This API is a work-in-progress and may change.
211-
FLUTTER_EXPORT void* FlutterDesktopViewGetNativeHandle(
212-
FlutterDesktopViewRef view);
213-
214180
// Returns the resource id of current window.
215181
FLUTTER_EXPORT uint32_t
216182
FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view);
217183

218-
// Resizes the view.
219-
// @warning This API is a work-in-progress and may change.
220-
FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view,
221-
int32_t width,
222-
int32_t height);
223-
224-
FLUTTER_EXPORT void FlutterDesktopViewOnPointerEvent(
225-
FlutterDesktopViewRef view,
226-
FlutterDesktopPointerEventType type,
227-
double x,
228-
double y,
229-
size_t timestamp,
230-
int32_t device_id);
231-
232-
FLUTTER_EXPORT void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
233-
const char* device_name,
234-
uint32_t device_class,
235-
uint32_t device_subclass,
236-
const char* key,
237-
const char* string,
238-
uint32_t modifiers,
239-
uint32_t scan_code,
240-
size_t timestamp,
241-
bool is_down);
242-
243-
FLUTTER_EXPORT void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view,
244-
bool focused);
245-
246-
FLUTTER_EXPORT bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view);
247-
248184
// ========== Plugin Registrar (extensions) ==========
249185

250186
// Returns the view associated with this registrar's engine instance.

0 commit comments

Comments
 (0)