forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 17
Introduce TizenViewNui #328
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
Merged
JSUYA
merged 13 commits into
flutter-tizen:flutter-3.0.5-tizen
from
JSUYA:dev/tizenviewnui
Aug 31, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fd7eb23
Introduce TizenViewNui
JSUYA 3cf0100
Configure tizen/BUILD.gn
swift-kim 9d129a7
Fix rebase conflict
JSUYA a2879eb
fix typo
JSUYA e22c8b5
Clean up build config
JSUYA e3dbea9
Clean up code
JSUYA 0d81548
Change callback function name
JSUYA e134709
Change parameter type int32_t instead of int
JSUYA 25571dd
Clean up code
JSUYA fd0b68c
Fix name
JSUYA ab0dea5
Change the location of the RequestRendering call
JSUYA 7dd6bec
Compare view size to avoid duplicate resize
JSUYA 7bfd4ea
Revert "Compare view size to avoid duplicate resize"
JSUYA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #include "public/flutter_tizen.h" | ||
|
|
||
| #include <dali-toolkit/public-api/controls/image-view/image-view.h> | ||
| #include <dali/devel-api/adaptor-framework/native-image-source-queue.h> | ||
|
|
||
| #include <memory> | ||
|
|
||
| #include "flutter/shell/platform/tizen/flutter_tizen_engine.h" | ||
| #include "flutter/shell/platform/tizen/flutter_tizen_view.h" | ||
| #include "flutter/shell/platform/tizen/tizen_view_nui.h" | ||
|
|
||
| namespace { | ||
|
|
||
| // Returns the engine corresponding to the given opaque API handle. | ||
| flutter::FlutterTizenEngine* EngineFromHandle(FlutterDesktopEngineRef ref) { | ||
| return reinterpret_cast<flutter::FlutterTizenEngine*>(ref); | ||
| } | ||
|
|
||
| FlutterDesktopViewRef HandleForView(flutter::FlutterTizenView* view) { | ||
| return reinterpret_cast<FlutterDesktopViewRef>(view); | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| FlutterDesktopViewRef FlutterDesktopViewCreateFromImageView( | ||
| const FlutterDesktopViewProperties& view_properties, | ||
| FlutterDesktopEngineRef engine, | ||
| void* image_view, | ||
| void* native_image_queue, | ||
| int32_t default_window_id) { | ||
| std::unique_ptr<flutter::TizenViewBase> tizen_view = | ||
| std::make_unique<flutter::TizenViewNui>( | ||
| view_properties.width, view_properties.height, | ||
| reinterpret_cast<Dali::Toolkit::ImageView*>(image_view), | ||
| reinterpret_cast<Dali::NativeImageSourceQueue*>(native_image_queue), | ||
| default_window_id); | ||
|
|
||
| auto view = | ||
| std::make_unique<flutter::FlutterTizenView>(std::move(tizen_view)); | ||
|
|
||
| // Take ownership of the engine, starting it if necessary. | ||
| view->SetEngine( | ||
| std::unique_ptr<flutter::FlutterTizenEngine>(EngineFromHandle(engine))); | ||
| view->CreateRenderSurface(FlutterDesktopRendererType::kEGL); | ||
| if (!view->engine()->IsRunning()) { | ||
| if (!view->engine()->RunEngine()) { | ||
| return nullptr; | ||
| } | ||
| } | ||
|
|
||
| view->SendInitialGeometry(); | ||
|
|
||
| return HandleForView(view.release()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,12 @@ typedef enum { | |
| kEGL, | ||
| } FlutterDesktopRendererType; | ||
|
|
||
| typedef enum { | ||
| kMouseDown, | ||
| kMouseUp, | ||
| kMouseMove, | ||
| } FlutterDesktopPointerEventType; | ||
|
|
||
| // Properties for configuring the initial settings of a Flutter window. | ||
| typedef struct { | ||
| // The x-coordinate of the top left corner of the window. | ||
|
|
@@ -154,13 +160,25 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow( | |
|
|
||
| // Creates a view that hosts and displays the given engine instance. | ||
| // | ||
| // The type of parent should be Evas_Object*, Cast Evas_Object* to void*. | ||
| // The type of |parent| must be Evas_Object*. | ||
| // @warning This API is a work-in-progress and may change. | ||
| FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromElmParent( | ||
| const FlutterDesktopViewProperties& view_properties, | ||
| FlutterDesktopEngineRef engine, | ||
| void* parent); | ||
|
|
||
| // 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. | ||
|
|
@@ -183,6 +201,21 @@ 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); | ||
|
Comment on lines
+204
to
+210
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't NUI support scroll events?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't checked dali's scroll event yet. |
||
|
|
||
| FLUTTER_EXPORT void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view, | ||
| const char* key, | ||
| const char* string, | ||
| uint32_t modifiers, | ||
| uint32_t scan_code, | ||
| bool is_down); | ||
|
|
||
| // ========== Plugin Registrar (extensions) ========== | ||
|
|
||
| // Returns the view associated with this registrar's engine instance. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a way to skip this part either. Actually I don't understand why the "undefined reference" error occurs for accessibility-related classes only.