Skip to content

Add tizen_interop_callbacks #19

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
merged 51 commits into from
May 31, 2023
Merged

Add tizen_interop_callbacks #19

merged 51 commits into from
May 31, 2023

Conversation

wiertel
Copy link
Member

@wiertel wiertel commented Dec 30, 2022

closes #10

The mechanism implemented in this plugins allows receiving callbacks from other threads of native API.

@wiertel wiertel requested a review from WonyoungChoi January 3, 2023 15:44
@wiertel wiertel marked this pull request as ready for review January 3, 2023 15:44
@wiertel
Copy link
Member Author

wiertel commented Jan 3, 2023

The callbacks are working nice. The thing that I don't like is the fact that the way it is implemented building this plugin depends on all the API headers. I was even thinking about separating packages like tizen_interop_callbacks (for common), tizen_interop_callbacks_iot, tizen_interop_callbacks_tv and publish versions multiple versions of the package (4.0.x, 5.0.x, 6.0.x, 6.5.x, 7.0.x).
It would be nice if target platform version and profile could be determined during native part (cc file) compilation. This way proper set of callbacks could be used automatically.

@wiertel
Copy link
Member Author

wiertel commented Jan 4, 2023

I got the idea for removing build time dependency - the compiler only needs to know some parameter types, those can be included in the file. Will investigate and implement it.

@wiertel wiertel marked this pull request as draft January 4, 2023 11:31
js3576 and others added 22 commits January 4, 2023 17:41
Two approaches (code, macros) are presented. Example app works.
Only the parser is included. Old code used in previous approaches
was removed.
The plugin has been moved to packages/ directory too.
TizenInteropCallbacks.register() will be able to auto choose
non-blocking if possible - i.e. if user does not specify blocking, and
there is a non-blocking proxy, a non blocking callback will be
registed.
Change exported native function names to include TizenInteropCallbacks
prefix.
Mentioned that there can be only 5 callbacks registered.
Added a feature of generator to prepend a header include with other
header include - that solves iotcon headers issue that iotcon-client.h
depends on iotcon-errors.h but does not include it itself.
This time use the parameters passed by flutter-tizen do determine where
the headers are. The user doesn't need to have FLUTTER_ROOT set, so
better not rely on that.
This is to prepare for adding more examples.
This removes dependency on Native API headers.
@swift-kim
Copy link
Member

@wiertel Is ./generate_callbacks.sh verify always expected to fail? How can I get it to run without the "unknown type name" error?

@wiertel
Copy link
Member Author

wiertel commented May 4, 2023

@wiertel Is ./generate_callbacks.sh verify always expected to fail? How can I get it to run without the "unknown type name" error?

I tried to run it now and got such errors in API header (contacts_filter_h, contacts_list_h) - I'm pretty sure that one means the header is written in such a way that including it fails unless other header was already included and it's not an indication of an issue with generator. I will change the code used for verification in such a way that running it will not fail. Maybe by applying some changes to header includes or changing platform/version to be used by default. And add some more description about it.

There is comment about it: https://github.com/flutter-tizen/tizen_interop/pull/19/files#diff-7dcd916636fc9f3b3d75cbcad9087d52ab5c7087ea780a34c39effc6818ca11dR19

@swift-kim
Copy link
Member

@wiertel Headers for public APIs supported by tizen_interop are listed in entrypoints.h files. Maybe you can use these files to avoid unexpected inclusion of internal headers.

Some description have been added.
The `verify` mode now succeeds in default configuration and prints summary.
@wiertel wiertel requested a review from swift-kim May 31, 2023 05:54
@swift-kim swift-kim merged commit 3c9b795 into main May 31, 2023
@swift-kim swift-kim deleted the callbacks branch May 31, 2023 06:20
@swift-kim
Copy link
Member

Thank you!

@swift-kim swift-kim restored the callbacks branch May 31, 2023 06:20
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.

Can't use async callback
3 participants