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

Some fixes in the Signals handling #240

Merged
merged 2 commits into from Oct 14, 2017

Conversation

Projects
None yet
4 participants
@thiblahute
Contributor

thiblahute commented Oct 12, 2017

Namely:

  • Make all the Signal related APIs usable as Object methods
  • Fix signal_handler_(un)block arguments

@thiblahute thiblahute changed the title from Some fixed in the Signals handling to Some fixes in the Signals handling Oct 12, 2017

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Oct 12, 2017

Member

Wo nice!

Member

GuillaumeGomez commented Oct 12, 2017

Wo nice!

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Oct 12, 2017

Member

👍 as discussed on irc earlier :) thanks!

Member

sdroege commented Oct 12, 2017

👍 as discussed on irc earlier :) thanks!

Show outdated Hide outdated src/object.rs Outdated
Show outdated Hide outdated src/object.rs Outdated
@@ -57,13 +57,13 @@ pub unsafe fn connect(receiver: *mut gobject_ffi::GObject, signal_name: &str, tr
from_glib(handle)
}
pub fn signal_handler_block<T: IsA<Object>>(instance: &T, handler_id: SignalHandlerId) {
pub fn signal_handler_block<T: IsA<Object>>(instance: &T, handler_id: &SignalHandlerId) {

This comment has been minimized.

@EPashkin

EPashkin Oct 12, 2017

Member

Why & added?

@EPashkin

EPashkin Oct 12, 2017

Member

Why & added?

This comment has been minimized.

@EPashkin

EPashkin Oct 12, 2017

Member

Sorry, now understand, it because it non-copy.

@EPashkin

EPashkin Oct 12, 2017

Member

Sorry, now understand, it because it non-copy.

thiblahute added some commits Oct 12, 2017

signal: Require a &SignalHandlerId to block/unblock the emission
The only method that requires the actual value is disconnect() so
that the lifetime of the handler is represented by it SignalHandlerId.
object: Add methods to block/unblock/stop/disconnect signal emissions
Making it inline with the connect() method and other GObject
method related to an instance.

I kept the signal::handle_* variants as signals can potentially
be used on "instances" which are not objects.
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Oct 12, 2017

Member

Good to be merged IMHO

Member

sdroege commented Oct 12, 2017

Good to be merged IMHO

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Oct 12, 2017

Member

For me too. What about you @EPashkin?

Member

GuillaumeGomez commented Oct 12, 2017

For me too. What about you @EPashkin?

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Oct 13, 2017

Member

👍 too

Member

EPashkin commented Oct 13, 2017

👍 too

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Oct 13, 2017

Member

@GuillaumeGomez let's get it in then :)

Member

sdroege commented Oct 13, 2017

@GuillaumeGomez let's get it in then :)

@GuillaumeGomez GuillaumeGomez merged commit 28c3211 into gtk-rs:master Oct 14, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment