Skip to content

Plugin Support #20

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 9 commits into from
Nov 4, 2018
Merged

Plugin Support #20

merged 9 commits into from
Nov 4, 2018

Conversation

pchampio
Copy link
Member

@pchampio pchampio commented Oct 29, 2018

Changes have been made to the Engine's callback system.
Rather than storing in the "C" glfw.Window a user pointer to the "Golang" flutter.EngineOpenGL, the "C" user pointer is now storing an int.
This improves the code segmentation, and remove the famous

panic: runtime error: cgo argument has Go pointer to Go pointer

The user pointer int is then later used to associate the C callback to the correct flutter.EngineOpenGL. The Embedder can open one Flutter app at the time, work needs to be done to allow 'multiplexing'

The user can register a Plugin using the gutter.OptionAddPluginReceiver function, I have not look too much at MessageChannel, MethodChannel, Codec stuff.
The whole method channel/plugin API doesn't match the existing Flutter API
For now, only string messages can be sent/received by the plugin system, please use the JSONMethodCodec on the Dart side.

Drakirus added 7 commits September 13, 2018 23:17
Former-commit-id: 1669fb76e1f394c7fdcac9c9772342080b75f422
Changes have been made to the Engine's callback system.
Rather than storing in the "C" glfw.Window a user pointer to the "Golang" `flutter.EngineOpenGL`, the "C" user pointer is now storing an `int`.
This improves the code segmentation, and remove the famous
> panic: runtime error: cgo argument has Go pointer to Go pointer
The user pointer `int` is then later used to associate the C callback to the correct flutter.EngineOpenGL. The Embedder can open one Flutter app at the time, work needs to be done to allow 'multiplexing'

The user can register a Plugin using the `gutter.OptionAddPluginReceiver` function, I have not look too much at `MessageChannel`,  `MethodChannel`, Codec stuff.
**The whole method channel/plugin API doesn't match the existing Flutter API**
For now, only `string` messages can be sent/received by the plugin system, please use the `JSONMethodCodec` on the Dart side.
@pchampio pchampio mentioned this pull request Oct 29, 2018
@pchampio
Copy link
Member Author

The simpleDemo example has been updated!
It shows the plugin interaction.

@pchampio pchampio merged commit 9b06731 into master Nov 4, 2018
@pchampio pchampio deleted the plugin branch November 4, 2018 19:45
This was referenced Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant