Skip to content
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

Use glib::Closure for signal connector functions #474

Open
Tracked by #137
sdroege opened this issue Oct 1, 2017 · 5 comments
Open
Tracked by #137

Use glib::Closure for signal connector functions #474

sdroege opened this issue Oct 1, 2017 · 5 comments

Comments

@sdroege
Copy link
Member

sdroege commented Oct 1, 2017

No need to use unsafe trampolines anymore.

@sdroege
Copy link
Member Author

sdroege commented Oct 29, 2017

I implemented something like this here manually for a signal: sdroege/gstreamer-rs@b58f4cd

The cast for the first argument could be improved to not require all the runtime checks, otherwise we just need to change gir to emit code like this

@sdroege sdroege mentioned this issue Oct 29, 2017
@sdroege
Copy link
Member Author

sdroege commented Nov 4, 2017

Any comments on this, should we generate code like this (or how should it be different?) instead of all the unsafe trampoline magic?

@sdroege
Copy link
Member Author

sdroege commented Nov 25, 2017

@EPashkin What do you think? Would you be interested in working on this, it seems like all the trampoline code is yours so it's probably fastest if you look into this. I expect a lot of code (also generally in the code generator) to be possible to remove after this, it could be a major cleanup of gir.

@EPashkin
Copy link
Member

@sdroege It interesting, but I prefer postpone this until next release.
Not sure that result code will be better as instead unsafe trampoline there be unsafe parameter casting,
same for gir

@GuillaumeGomez
Copy link
Member

After a discussion with @sdroege, he gave me a few extra information that might be useful to solve this issue:

We want to use connect_local() for non-Send/Sync objects and connect() otherwise, and apart from that it's GValue transformations.

We also need to add some more GValue API to have some kind of borrowing get() function.

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

No branches or pull requests

3 participants