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

New types #678

Merged
merged 4 commits into from Jul 30, 2018

Conversation

Projects
None yet
2 participants
@GuillaumeGomez
Member

GuillaumeGomez commented Jul 21, 2018

//pub fn from_accel_closure(closure: /*Ignored*/&glib::Closure) -> Option<AccelGroup> {
// unsafe { TODO: call ffi::gtk_accel_group_from_accel_closure() }
//}
pub fn from_accel_closure(closure: &glib::Closure) -> Option<AccelGroup> {

This comment has been minimized.

@sdroege

sdroege Jul 23, 2018

Member

Instead of having a plain GClosure here it would be nicer to implement this manually around the actual type that is expected from the closure. Fn(&AccelGroup, &Object, u32, gdk::ModifierType) -> bool (GtkAccelGroupActivate) from what I can see

@sdroege

sdroege Jul 23, 2018

Member

Instead of having a plain GClosure here it would be nicer to implement this manually around the actual type that is expected from the closure. Fn(&AccelGroup, &Object, u32, gdk::ModifierType) -> bool (GtkAccelGroupActivate) from what I can see

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 27, 2018

Member

Since this one is supposed to return an AccelGroup for the matching Closure, I wonder it would work then...

@GuillaumeGomez

GuillaumeGomez Jul 27, 2018

Member

Since this one is supposed to return an AccelGroup for the matching Closure, I wonder it would work then...

This comment has been minimized.

@sdroege

sdroege Jul 30, 2018

Member

It wouldn't indeed, unless we let gtk_accel_group_connect() return the closure that we internally created. This API is really nice 🤦‍♂️

@sdroege

sdroege Jul 30, 2018

Member

It wouldn't indeed, unless we let gtk_accel_group_connect() return the closure that we internally created. This API is really nice 🤦‍♂️

@@ -49,11 +53,11 @@ impl Default for AccelGroup {
pub trait AccelGroupExt {
//fn activate<P: IsA<glib::Object>>(&self, accel_quark: /*Ignored*/glib::Quark, acceleratable: &P, accel_key: u32, accel_mods: gdk::ModifierType) -> bool;
//fn connect(&self, accel_key: u32, accel_mods: gdk::ModifierType, accel_flags: AccelFlags, closure: /*Ignored*/&glib::Closure);
fn connect(&self, accel_key: u32, accel_mods: gdk::ModifierType, accel_flags: AccelFlags, closure: &glib::Closure);

This comment has been minimized.

@sdroege

sdroege Jul 23, 2018

Member

Same here

@sdroege

sdroege Jul 23, 2018

Member

Same here

This comment has been minimized.

@sdroege

sdroege Jul 23, 2018

Member

And basically everywhere where a GClosure appears but the API actually expects a specific signature

@sdroege

sdroege Jul 23, 2018

Member

And basically everywhere where a GClosure appears but the API actually expects a specific signature

@@ -49,11 +53,11 @@ impl Default for AccelGroup {
pub trait AccelGroupExt {
//fn activate<P: IsA<glib::Object>>(&self, accel_quark: /*Ignored*/glib::Quark, acceleratable: &P, accel_key: u32, accel_mods: gdk::ModifierType) -> bool;

This comment has been minimized.

@sdroege

sdroege Jul 23, 2018

Member

We should probably really add GQuark bindings at some point. Easy enough and appearing in so many places of APIs.

@sdroege

sdroege Jul 23, 2018

Member

We should probably really add GQuark bindings at some point. Easy enough and appearing in so many places of APIs.

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 24, 2018

Member

My next glib PR I suppose. ;)

@GuillaumeGomez

GuillaumeGomez Jul 24, 2018

Member

My next glib PR I suppose. ;)

Show outdated Hide outdated src/page_range.rs

@GuillaumeGomez GuillaumeGomez merged commit fb9610a into gtk-rs:master Jul 30, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@GuillaumeGomez GuillaumeGomez deleted the GuillaumeGomez:new-types branch Jul 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment