-
Notifications
You must be signed in to change notification settings - Fork 17
Introduce TizenViewElementary #292
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
Introduce TizenViewElementary #292
Conversation
a1a960d to
edc4b5d
Compare
|
In my opinion, I would recommend that you rebase this PR to the master after #291 is merged. |
|
The name |
Do you have a recommended class name and hierarchy? |
|
contribute to flutter-tizen/flutter-tizen#351 |
abaa673 to
70a663c
Compare
70a663c to
a38eea4
Compare
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.
please rebase to flutter-3.0.0-tizen
There are two ways to draw FlutterTizenView in Tizen. (TizenWindowElementary and TizenWindowEcore)
Both ways are drawing on Window component(surface).
We try to draw FlutterTizenView on the appropriate component
provided by Tizen UIFW and support it to be place with other components.
To do that, we created a TizenView class on the same level as TizenWindow
and abstracted common methods to TizenBaseHandle.
we can add FlutterTizenView to other UIFW of Tizen while adding TizenView{?}(maybe Tizen NUI).
TizenBaseHandle -> TizenView -> TizenViewElementary
-> TizenView{?}
-> TizenWindow -> TizenWindowElementary
-> TizenWindowEcore
There are a few unimplemented things. This is a plan to be added later.
- We need to add API related to App Event (Resume, etc..).
- The plans for key input are not yet cleared up.
a38eea4 to
2df8308
Compare
@swift-kim I renamed it to TizenViewBase as we discussed. |
d04cc71 to
f87e45f
Compare
f87e45f to
a1f8ba4
Compare
c228671 to
2c14b3a
Compare
shell/platform/tizen/tizen_window.h
Outdated
| TizenInputMethodContext* input_method_context() { | ||
| return input_method_context_.get(); | ||
| } | ||
| std::string GetType() override { return "window"; }; |
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.
Can we use a dedicated enum instead of a string to represent the type?
Actually this kind of runtime type check is discouraged by the style guide. We may need to either redesign our class hierarchy, or refactor the code so that the type check becomes unnecessary.
Do not hand-implement an RTTI-like workaround. The arguments against RTTI apply just as much to workarounds like class hierarchies with type tags.
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 modified it to use enum.
7d58102 to
0fa299f
Compare
| int32_t height) { | ||
| auto* view = reinterpret_cast<flutter::FlutterTizenView*>(view_ref); | ||
| flutter::TizenGeometry view_geometry = {0, 0, width, height}; | ||
| view->tizen_view()->OnGeometryChanged(view_geometry); |
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.
In my opinion, the embedder APIs related to View should be something like C wrapper of FlutterTizenView interface.
so, I believe that to provide the resizing, it has to work internally through FlutterTizenView's interface.
This is the basic design I was initially thinking of, so it's open for discussion and you don't need to fix it right away. I'm curious about your opinion.
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 don't agree. FlutterTizenView is simply an abstraction layer for a Flutter view and it should not be considered as a wrapper of TizenView.
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.
FlutterTizenViewis simply an abstraction layer for a Flutter view and it should not be considered as a wrapper ofTizenView.
What you said is a simple principle I came up with when I first designed it.
When I first designed FlutterDeskopViewXXX APIs, I had the following design in mind.
void FlutterDesktopViewXXX()
{
...
view->XXX()
...
}
Currently, FlutterTizenView may have different detailed behaviors depending on TizenViewType.
So I think this idea may not be suitable. That's why I was curious about your thoughts :)
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 agree to reduce the abstraction level (depth) of required FlutterDesktopViewXXX.
In the case of resize rather than simple property change, I think it is better to handle it with view->Rsize().
If the ViewType check is handled inside the FlutterTizenView, I think it is easy to fix when the type check is no longer needed through refactoring.
| FlutterTizenView::FlutterTizenView(std::unique_ptr<TizenViewBase> tizen_view) | ||
| : tizen_view_(std::move(tizen_view)) { | ||
| tizen_view_->SetView(this); | ||
| tizen_view_->BindKeys(kBindableSystemKeys); |
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.
When the type of tizen_view_ is not window, I don't think this is the role of the Embedder anymore. I think it should be fixed 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.
Yes, that makes sense. I think we can move BindKeys from TizenViewBase to TizenWindow.
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 think the view also needs a bind to a special key.
We may also need the TV remote's back key or other special key inside the View.
Since key binding is platform dependent, I think that the information provided for VD profile can be same with either Window or View.
This has already been talked about in private chats.
If necessary, I hope this is discussed in a separate PR regarding special key bindings.
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.
Yes, we can handle it in another PR.
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 think the view also needs a bind to a special key.
We may also need the TV remote's back key or other special key inside the View.
Since key binding is platform dependent, I think that the information provided for VD profile can be same with either Window or View.
Sorry. I don't still get why it should be the embedder's role to register the special keys. Isn't is possible for the parent app to call eext_win_keygrab_set with its own window as necessary?
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.
Sorry. I don't still get why it should be the embedder's role to register the special keys. Isn't is possible for the parent app to call eext_win_keygrab_set with its own window as necessary?
Using eext_win_keygrab_set, the app user can also bind a key to the app window.
my opinion is that the flutter app(window and view) created with flutter-tizen can provide the same key bind within the VD profile. If the user has experienced that BackKey works in flutter-app (win), but does not add it to the app in the view, it may not work. Of course, not binding to the app's window may mean that a special key is not used.
This is just my opinion.
however, it seems problematic for the view to modify the properties of the window.
I can also delete the view's bind code from this PR. Should I do that now?
@bbrto21 told me on chat that he would proceed with the modify related to key bind.
bbrto21
left a comment
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 think there are a few things to discuss, but it seems to be solvable in further PR.
and it seems to work just as the creator intended. LGTM.
|
Please don't mark my comment as "resolved" by yourself. I'll do that when necessary. If I checked your code and didn't close the corresponding comment, there's always a reason for it. |
um... I think of |
|
I told because you were keeping closing comments that I had set as "unresolved". Please leave a simple comment such as "Done" if the issue has been resolved. |
|
@swift-kim Do you have anything more to discuss? |
Is this a common practice? for those who have just joined the project this can be an inconvenience. |
|
@bbrto21 No, my comment was specifically for him. It's not a rule that applies to everyone.
It seems there are still some unresolved issues that have not been answered by the author. |
Co-authored-by: Swift Kim <[email protected]>
swift-kim
left a comment
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.
Thank you!
There are two ways to draw FlutterTizenView in Tizen. (TizenWindowElementary and TizenWindowEcore) Both ways are drawing on Window component(surface). We try to draw FlutterTizenView on the appropriate component provided by Tizen UIFW and support it to be place with other components. To do that, we created a TizenView class on the same level as TizenWindow and abstracted common methods to TizenViewBase.
There are two ways to draw FlutterTizenView in Tizen. (TizenWindowElementary and TizenWindowEcore) Both ways are drawing on Window component(surface). We try to draw FlutterTizenView on the appropriate component provided by Tizen UIFW and support it to be place with other components. To do that, we created a TizenView class on the same level as TizenWindow and abstracted common methods to TizenViewBase.
There are two ways to draw FlutterTizenView in Tizen. (TizenWindowElementary and TizenWindowEcore)
Both ways are drawing on Window component(surface).
We try to draw FlutterTizenView on the appropriate component
provided by Tizen UIFW and support it to be place with other components.
To do that, we created a TizenView class on the same level as TizenWindow
and abstracted common methods to TizenViewBase.
we can add FlutterTizenView to other UIFW of Tizen while adding TizenView{?}(maybe Tizen NUI).
related PR : flutter-tizen/flutter-tizen#373