Skip to content
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The Flutter embedder for Tizen.

- 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`.
- 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`.
- Building NUI-related code requires a sysroot for Tizen 6.5 or above and the `--api-version 6.5` option.

## Repository structure

Expand Down
20 changes: 2 additions & 18 deletions flutter/shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ config("flutter_tizen_config") {
include_dirs = [
"${sysroot_path}/usr/include/appfw",
"${sysroot_path}/usr/include/base",
"${sysroot_path}/usr/include/dali",
"${sysroot_path}/usr/include/dali-adaptor",
"${sysroot_path}/usr/include/dali-toolkit",
"${sysroot_path}/usr/include/dlog",
"${sysroot_path}/usr/include/ecore-1",
"${sysroot_path}/usr/include/ecore-imf-1",
Expand Down Expand Up @@ -158,22 +155,9 @@ template("embedder") {
}

if (api_version != "6.0") {
sources += [
"flutter_tizen_nui.cc",
"tizen_clipboard.cc",
"tizen_renderer_nui_gl.cc",
"tizen_view_nui.cc",
]

libs += [
"dali2-adaptor",
"dali2-core",
]
sources += [ "tizen_clipboard.cc" ]

defines += [
"NUI_SUPPORT",
"CLIPBOARD_SUPPORT",
]
defines += [ "CLIPBOARD_SUPPORT" ]
}

configs += [
Expand Down
7 changes: 1 addition & 6 deletions flutter/shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "flutter/shell/platform/tizen/channels/tizen_shell.h"
#endif
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/tizen_view.h"
#include "flutter/shell/platform/tizen/tizen_window.h"

namespace flutter {
Expand Down Expand Up @@ -244,11 +243,7 @@ void PlatformChannel::HandleMethodCall(
}

void PlatformChannel::SystemNavigatorPop() {
if (auto* view = dynamic_cast<TizenView*>(view_)) {
view->SetFocus(false);
} else {
ui_app_exit();
}
ui_app_exit();
}

void PlatformChannel::PlaySystemSound(const std::string& sound_type) {
Expand Down
80 changes: 0 additions & 80 deletions flutter/shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
#include "flutter/shell/platform/tizen/flutter_tizen_view.h"
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
#include "flutter/shell/platform/tizen/tizen_view.h"
#ifdef NUI_SUPPORT
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
#endif
#include "flutter/shell/platform/tizen/tizen_window.h"
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"

Expand Down Expand Up @@ -224,86 +219,11 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
return HandleForView(view.release());
}

void* FlutterDesktopViewGetNativeHandle(FlutterDesktopViewRef view_ref) {
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
return view->tizen_view()->GetNativeHandle();
}

uint32_t FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view_ref) {
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
return view->tizen_view()->GetResourceId();
}

void FlutterDesktopViewResize(FlutterDesktopViewRef view,
int32_t width,
int32_t height) {
ViewFromHandle(view)->Resize(width, height);
}

void FlutterDesktopViewOnPointerEvent(FlutterDesktopViewRef view,
FlutterDesktopPointerEventType type,
double x,
double y,
size_t timestamp,
int32_t device_id) {
// TODO(swift-kim): Add support for mouse devices.
FlutterPointerDeviceKind device_kind = kFlutterPointerDeviceKindTouch;
FlutterPointerMouseButtons button = kFlutterPointerButtonMousePrimary;

switch (type) {
case FlutterDesktopPointerEventType::kMouseDown:
default:
ViewFromHandle(view)->OnPointerDown(x, y, button, timestamp, device_kind,
device_id);
break;
case FlutterDesktopPointerEventType::kMouseUp:
ViewFromHandle(view)->OnPointerUp(x, y, button, timestamp, device_kind,
device_id);
break;
case FlutterDesktopPointerEventType::kMouseMove:
ViewFromHandle(view)->OnPointerMove(x, y, timestamp, device_kind,
device_id);
break;
}
}

void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
const char* device_name,
uint32_t device_class,
uint32_t device_subclass,
const char* key,
const char* string,
uint32_t modifiers,
uint32_t scan_code,
size_t timestamp,
bool is_down) {
#ifdef NUI_SUPPORT
Comment thread
JSUYA marked this conversation as resolved.
if (auto* nui_view = dynamic_cast<flutter::TizenViewNui*>(
ViewFromHandle(view)->tizen_view())) {
nui_view->OnKey(device_name, device_class, device_subclass, key, string,
nullptr, modifiers, scan_code, timestamp, is_down);
}
#else
ViewFromHandle(view)->OnKey(key, string, nullptr, modifiers, scan_code,
device_name, is_down);
#endif
}

void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view, bool focused) {
if (auto* tizen_view = dynamic_cast<flutter::TizenView*>(
ViewFromHandle(view)->tizen_view())) {
tizen_view->SetFocus(focused);
}
}

bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view) {
if (auto* tizen_view = dynamic_cast<flutter::TizenView*>(
ViewFromHandle(view)->tizen_view())) {
return tizen_view->focused();
}
return false;
}

void FlutterDesktopRegisterViewFactory(
FlutterDesktopPluginRegistrarRef registrar,
const char* view_type,
Expand Down
12 changes: 0 additions & 12 deletions flutter/shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "flutter/shell/platform/tizen/tizen_renderer_vulkan.h"
#endif

#ifdef NUI_SUPPORT
#include "flutter/shell/platform/tizen/tizen_renderer_nui_gl.h"
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
#endif

namespace flutter {

namespace {
Expand Down Expand Up @@ -90,13 +85,6 @@ std::unique_ptr<TizenRenderer> FlutterTizenEngine::CreateRenderer(
FlutterDesktopRendererType renderer_type) {
switch (renderer_type) {
case FlutterDesktopRendererType::kEGL:
#ifdef NUI_SUPPORT
if (auto* nui_view =
dynamic_cast<flutter::TizenViewNui*>(view_->tizen_view())) {
return std::make_unique<TizenRendererNuiGL>(
nui_view, project_->HasArgument("--enable-impeller"));
}
#endif
return std::make_unique<TizenRendererEgl>(
view_->tizen_view(), project_->HasArgument("--enable-impeller"));
case FlutterDesktopRendererType::kEVulkan:
Expand Down
56 changes: 0 additions & 56 deletions flutter/shell/platform/tizen/flutter_tizen_nui.cc

This file was deleted.

11 changes: 0 additions & 11 deletions flutter/shell/platform/tizen/flutter_tizen_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/system_utils.h"
#include "flutter/shell/platform/tizen/tizen_view.h"
#ifdef NUI_SUPPORT
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
#endif
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
#include "flutter/shell/platform/tizen/tizen_window.h"

Expand Down Expand Up @@ -100,13 +96,6 @@ void FlutterTizenView::SetupChannels() {
messenger, tizen_view_->input_method_context());
}

void FlutterTizenView::Resize(int32_t width, int32_t height) {
TizenGeometry geometry = tizen_view_->GetGeometry();
geometry.width = width;
geometry.height = height;
tizen_view_->SetGeometry(geometry);
}

void FlutterTizenView::OnResize(int32_t left,
int32_t top,
int32_t width,
Expand Down
2 changes: 0 additions & 2 deletions flutter/shell/platform/tizen/flutter_tizen_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class FlutterTizenView : public TizenViewEventHandlerDelegate {

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

void Resize(int32_t width, int32_t height);

void OnResize(int32_t left,
int32_t top,
int32_t width,
Expand Down
64 changes: 0 additions & 64 deletions flutter/shell/platform/tizen/public/flutter_tizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ typedef enum {
kEVulkan
} FlutterDesktopRendererType;

typedef enum {
kMouseDown,
kMouseUp,
kMouseMove,
} FlutterDesktopPointerEventType;

typedef enum {
// No external output.
kNone,
Expand Down Expand Up @@ -83,14 +77,6 @@ typedef struct {
bool floating_menu_support;
} FlutterDesktopWindowProperties;

// Properties for configuring the initial settings of a Flutter view.
typedef struct {
// The width of the view, or the maximum width if the value is zero.
int32_t width;
// The height of the view, or the maximum height if the value is zero.
int32_t height;
} FlutterDesktopViewProperties;

// Properties for configuring a Flutter engine instance.
typedef struct {
// The path to the flutter_assets folder for the application to be run.
Expand Down Expand Up @@ -185,66 +171,16 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
const FlutterDesktopWindowProperties& window_properties,
FlutterDesktopEngineRef engine);

// Creates a view that hosts and displays the given engine instance.
//
// The type of |image_view| must be Dali::Toolkit::ImageView*.
// The type of |native_image_queue| must be Dali::NativeImageSourceQueue*.
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromImageView(
const FlutterDesktopViewProperties& view_properties,
FlutterDesktopEngineRef engine,
void* image_view,
void* native_image_queue,
int32_t default_window_id);

// 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 native UI toolkit handle for manipulation in host application.
//
// Cast the returned void*
// - window ecore wl2 : to Ecore_Wl2_Window*
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void* FlutterDesktopViewGetNativeHandle(
FlutterDesktopViewRef view);

// Returns the resource id of current window.
FLUTTER_EXPORT uint32_t
FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view);

// Resizes the view.
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view,
int32_t width,
int32_t height);

FLUTTER_EXPORT void FlutterDesktopViewOnPointerEvent(
FlutterDesktopViewRef view,
FlutterDesktopPointerEventType type,
double x,
double y,
size_t timestamp,
int32_t device_id);

FLUTTER_EXPORT void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
const char* device_name,
uint32_t device_class,
uint32_t device_subclass,
const char* key,
const char* string,
uint32_t modifiers,
uint32_t scan_code,
size_t timestamp,
bool is_down);

FLUTTER_EXPORT void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view,
bool focused);

FLUTTER_EXPORT bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view);

// ========== Plugin Registrar (extensions) ==========

// Returns the view associated with this registrar's engine instance.
Expand Down
Loading
Loading