Skip to content

Conversation

@JSUYA
Copy link
Member

@JSUYA JSUYA commented May 27, 2022

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).

 TizenViewBase -> TizenView -> TizenViewElementary
                              -> TizenView{?}
                 -> TizenWindow -> TizenWindowElementary
                                -> TizenWindowEcore

related PR : flutter-tizen/flutter-tizen#373

@JSUYA JSUYA changed the title Introduce to TizenViewElementary Introduce TizenViewElementary May 27, 2022
@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from a1a960d to edc4b5d Compare May 27, 2022 07:44
@bbrto21
Copy link

bbrto21 commented May 27, 2022

In my opinion, I would recommend that you rebase this PR to the master after #291 is merged.

@swift-kim
Copy link
Member

The name TizenBaseHandle is somewhat ambiguous. We'll need to discuss about the class design and hierarchy.

@JSUYA
Copy link
Member Author

JSUYA commented May 27, 2022

The name TizenBaseHandle is somewhat ambiguous. We'll need to discuss about the class design and hierarchy.

Do you have a recommended class name and hierarchy?
I've been discussing names and hierarchy with @bbrto21.
Please let me know if there is a better way

@JSUYA
Copy link
Member Author

JSUYA commented May 31, 2022

contribute to flutter-tizen/flutter-tizen#351

@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from abaa673 to 70a663c Compare May 31, 2022 02:46
@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from 70a663c to a38eea4 Compare May 31, 2022 06:08
Copy link

@bbrto21 bbrto21 left a 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

JSUYA added 4 commits June 3, 2022 14:31
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.
@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from a38eea4 to 2df8308 Compare June 7, 2022 04:48
@JSUYA
Copy link
Member Author

JSUYA commented Jun 7, 2022

In my opinion, I would recommend that you rebase this PR to the master after #291 is merged.

@bbrto21
I rebased your #291

The name TizenBaseHandle is somewhat ambiguous. We'll need to discuss about the class design and hierarchy.

@swift-kim I renamed it to TizenViewBase as we discussed.
And I cleaned up the level of abstraction.
More reviews are needed. Could you please review it?

@JSUYA JSUYA force-pushed the dev/flutterview-elm branch 2 times, most recently from d04cc71 to f87e45f Compare June 7, 2022 08:47
@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from f87e45f to a1f8ba4 Compare June 7, 2022 08:48
@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from c228671 to 2c14b3a Compare June 8, 2022 02:16
TizenInputMethodContext* input_method_context() {
return input_method_context_.get();
}
std::string GetType() override { return "window"; };
Copy link
Member

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.

Copy link
Member Author

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.

@JSUYA JSUYA force-pushed the dev/flutterview-elm branch from 7d58102 to 0fa299f Compare June 13, 2022 06:24
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);
Copy link

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.

Copy link
Member

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlutterTizenView is simply an abstraction layer for a Flutter view and it should not be considered as a wrapper of TizenView.

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 :)

Copy link
Member Author

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);
Copy link

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link

@bbrto21 bbrto21 left a 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.

@swift-kim
Copy link
Member

swift-kim commented Jun 13, 2022

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.

@JSUYA
Copy link
Member Author

JSUYA commented Jun 13, 2022

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 Resolved as a simple expression of the comment("Done") that your review has been accepted.
If you have a reason just do Unresolved again.
If it is the rule of flutter-tizen that the reviewer checks Resolved, I will follow it.

@swift-kim
Copy link
Member

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.

@bbrto21
Copy link

bbrto21 commented Jun 14, 2022

@swift-kim Do you have anything more to discuss?

@bbrto21
Copy link

bbrto21 commented Jun 14, 2022

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.

Is this a common practice? for those who have just joined the project this can be an inconvenience.
If this is common practice, or if everyone agrees on it, it looks like it needs an addition to the development guide.

@swift-kim
Copy link
Member

swift-kim commented Jun 14, 2022

@bbrto21 No, my comment was specifically for him. It's not a rule that applies to everyone.

Do you have anything more to discuss?

It seems there are still some unresolved issues that have not been answered by the author.

Copy link
Member

@swift-kim swift-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bbrto21 bbrto21 merged commit b98c6b6 into flutter-tizen:flutter-3.0.0-tizen Jun 14, 2022
@JSUYA JSUYA deleted the dev/flutterview-elm branch June 20, 2022 01:40
swift-kim pushed a commit that referenced this pull request Aug 5, 2022
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.
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants