Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Restore callback guard #631

Merged
merged 2 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ git = "https://github.com/gtk-rs/lgpl-docs"
[dependencies]
libc = "0.2"
bitflags = "1.0"
lazy_static = "1.0"

[dependencies.cairo-sys-rs]
version = "0.5.0"
Expand Down
2 changes: 2 additions & 0 deletions src/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ impl<O: IsA<Assistant>> AssistantExtManual for O {
}

unsafe extern "C" fn forward_page_trampoline(current_page: i32, f: glib_ffi::gpointer) -> i32 {
callback_guard!();
let f: &&(Fn(i32) -> i32 + 'static) = transmute(f);
f(current_page)
}

unsafe extern "C" fn destroy_closure(ptr: glib_ffi::gpointer) {
callback_guard!();
Box_::<Box_<Fn(i32) -> i32 + 'static>>::from_raw(ptr as *mut _);
}
18 changes: 17 additions & 1 deletion src/auto/about_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -481,96 +481,112 @@ impl<O: IsA<AboutDialog> + IsA<glib::object::Object>> AboutDialogExt for O {

unsafe extern "C" fn activate_link_trampoline<P>(this: *mut ffi::GtkAboutDialog, uri: *mut libc::c_char, f: glib_ffi::gpointer) -> glib_ffi::gboolean
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P, &str) -> Inhibit + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(uri)).to_glib()
}

unsafe extern "C" fn notify_artists_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_authors_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_comments_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_copyright_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_documenters_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_license_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_license_type_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_logo_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_logo_icon_name_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_program_name_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_translator_credits_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_version_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_website_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_website_label_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_wrap_license_trampoline<P>(this: *mut ffi::GtkAboutDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AboutDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AboutDialog::from_glib_borrow(this).downcast_unchecked())
}
5 changes: 4 additions & 1 deletion src/auto/accel_group.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -158,18 +158,21 @@ impl<O: IsA<AccelGroup> + IsA<glib::object::Object>> AccelGroupExt for O {

unsafe extern "C" fn accel_activate_trampoline<P>(this: *mut ffi::GtkAccelGroup, acceleratable: *mut gobject_ffi::GObject, keyval: libc::c_uint, modifier: gdk_ffi::GdkModifierType, f: glib_ffi::gpointer) -> glib_ffi::gboolean
where P: IsA<AccelGroup> {
callback_guard!();
let f: &&(Fn(&P, &glib::Object, u32, gdk::ModifierType) -> bool + 'static) = transmute(f);
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(acceleratable), keyval, from_glib(modifier)).to_glib()
}

unsafe extern "C" fn notify_is_locked_trampoline<P>(this: *mut ffi::GtkAccelGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AccelGroup> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_modifier_mask_trampoline<P>(this: *mut ffi::GtkAccelGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AccelGroup> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AccelGroup::from_glib_borrow(this).downcast_unchecked())
}
2 changes: 1 addition & 1 deletion src/auto/action_bar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down
3 changes: 2 additions & 1 deletion src/auto/actionable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -90,6 +90,7 @@ impl<O: IsA<Actionable> + IsA<glib::object::Object>> ActionableExt for O {

unsafe extern "C" fn notify_action_name_trampoline<P>(this: *mut ffi::GtkActionable, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Actionable> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Actionable::from_glib_borrow(this).downcast_unchecked())
}
10 changes: 9 additions & 1 deletion src/auto/adjustment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -257,48 +257,56 @@ impl<O: IsA<Adjustment> + IsA<glib::object::Object>> AdjustmentExt for O {

unsafe extern "C" fn changed_trampoline<P>(this: *mut ffi::GtkAdjustment, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn value_changed_trampoline<P>(this: *mut ffi::GtkAdjustment, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_lower_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_page_increment_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_page_size_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_step_increment_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_upper_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_value_trampoline<P>(this: *mut ffi::GtkAdjustment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Adjustment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Adjustment::from_glib_borrow(this).downcast_unchecked())
}
10 changes: 9 additions & 1 deletion src/auto/alignment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -326,48 +326,56 @@ impl<O: IsA<Alignment> + IsA<glib::object::Object>> AlignmentExt for O {

unsafe extern "C" fn notify_bottom_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_left_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_right_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_top_padding_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_xalign_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_xscale_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_yalign_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_yscale_trampoline<P>(this: *mut ffi::GtkAlignment, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Alignment> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Alignment::from_glib_borrow(this).downcast_unchecked())
}
6 changes: 5 additions & 1 deletion src/auto/app_chooser_button.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -161,24 +161,28 @@ impl<O: IsA<AppChooserButton> + IsA<glib::object::Object>> AppChooserButtonExt f

unsafe extern "C" fn custom_item_activated_trampoline<P>(this: *mut ffi::GtkAppChooserButton, item_name: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P, &str) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(item_name))
}

unsafe extern "C" fn notify_heading_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_show_default_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_show_dialog_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}
4 changes: 3 additions & 1 deletion src/auto/app_chooser_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// DO NOT EDIT

Expand Down Expand Up @@ -115,12 +115,14 @@ impl<O: IsA<AppChooserDialog> + IsA<glib::object::Object>> AppChooserDialogExt f

unsafe extern "C" fn notify_gfile_trampoline<P>(this: *mut ffi::GtkAppChooserDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserDialog::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_heading_trampoline<P>(this: *mut ffi::GtkAppChooserDialog, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserDialog> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserDialog::from_glib_borrow(this).downcast_unchecked())
}
Loading