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

Remove callback guard #220

Merged
merged 3 commits into from
Jun 23, 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
2 changes: 1 addition & 1 deletion gir-files
1 change: 0 additions & 1 deletion src/auto/app_launch_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ impl<O: IsA<AppLaunchContext> + IsA<glib::object::Object>> AppLaunchContextExt f

unsafe extern "C" fn notify_display_trampoline<P>(this: *mut ffi::GdkAppLaunchContext, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppLaunchContext> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppLaunchContext::from_glib_borrow(this).downcast_unchecked())
}
2 changes: 0 additions & 2 deletions src/auto/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ impl<O: IsA<Cursor> + IsA<glib::object::Object>> CursorExt for O {

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

unsafe extern "C" fn notify_display_trampoline<P>(this: *mut ffi::GdkCursor, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Cursor> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Cursor::from_glib_borrow(this).downcast_unchecked())
}
17 changes: 0 additions & 17 deletions src/auto/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,126 +616,109 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {

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

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn tool_changed_trampoline<P>(this: *mut ffi::GdkDevice, tool: *mut ffi::GdkDeviceTool, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P, &DeviceTool) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(tool))
}

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

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn notify_axes_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}

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

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

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

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

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

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

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

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn notify_num_touches_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
unsafe extern "C" fn notify_product_id_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn notify_seat_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn notify_tool_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}

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

#[cfg(any(feature = "v3_16", feature = "dox"))]
unsafe extern "C" fn notify_vendor_id_trampoline<P>(this: *mut ffi::GdkDevice, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Device> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Device::from_glib_borrow(this).downcast_unchecked())
}
4 changes: 0 additions & 4 deletions src/auto/device_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,24 @@ impl<O: IsA<DeviceManager> + IsA<glib::object::Object>> DeviceManagerExt for O {

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

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

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

unsafe extern "C" fn notify_display_trampoline<P>(this: *mut ffi::GdkDeviceManager, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DeviceManager> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DeviceManager::from_glib_borrow(this).downcast_unchecked())
}
4 changes: 0 additions & 4 deletions src/auto/device_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,24 @@ impl<O: IsA<DeviceTool> + IsA<glib::object::Object>> DeviceToolExt for O {

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

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

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

unsafe extern "C" fn notify_tool_type_trampoline<P>(this: *mut ffi::GdkDeviceTool, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DeviceTool> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DeviceTool::from_glib_borrow(this).downcast_unchecked())
}
6 changes: 0 additions & 6 deletions src/auto/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,46 +531,40 @@ impl<O: IsA<Display> + IsA<glib::object::Object>> DisplayExt for O {

unsafe extern "C" fn closed_trampoline<P>(this: *mut ffi::GdkDisplay, is_error: glib_ffi::gboolean, f: glib_ffi::gpointer)
where P: IsA<Display> {
callback_guard!();
let f: &&(Fn(&P, bool) + 'static) = transmute(f);
f(&Display::from_glib_borrow(this).downcast_unchecked(), from_glib(is_error))
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn monitor_added_trampoline<P>(this: *mut ffi::GdkDisplay, monitor: *mut ffi::GdkMonitor, f: glib_ffi::gpointer)
where P: IsA<Display> {
callback_guard!();
let f: &&(Fn(&P, &Monitor) + 'static) = transmute(f);
f(&Display::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(monitor))
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn monitor_removed_trampoline<P>(this: *mut ffi::GdkDisplay, monitor: *mut ffi::GdkMonitor, f: glib_ffi::gpointer)
where P: IsA<Display> {
callback_guard!();
let f: &&(Fn(&P, &Monitor) + 'static) = transmute(f);
f(&Display::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(monitor))
}

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

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn seat_added_trampoline<P>(this: *mut ffi::GdkDisplay, seat: *mut ffi::GdkSeat, f: glib_ffi::gpointer)
where P: IsA<Display> {
callback_guard!();
let f: &&(Fn(&P, &Seat) + 'static) = transmute(f);
f(&Display::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(seat))
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn seat_removed_trampoline<P>(this: *mut ffi::GdkDisplay, seat: *mut ffi::GdkSeat, f: glib_ffi::gpointer)
where P: IsA<Display> {
callback_guard!();
let f: &&(Fn(&P, &Seat) + 'static) = transmute(f);
f(&Display::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(seat))
}
2 changes: 0 additions & 2 deletions src/auto/display_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ impl<O: IsA<DisplayManager> + IsA<glib::object::Object>> DisplayManagerExt for O

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

unsafe extern "C" fn notify_default_display_trampoline<P>(this: *mut ffi::GdkDisplayManager, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DisplayManager> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DisplayManager::from_glib_borrow(this).downcast_unchecked())
}
4 changes: 0 additions & 4 deletions src/auto/drag_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,31 +195,27 @@ impl<O: IsA<DragContext> + IsA<glib::object::Object>> DragContextExt for O {
#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn action_changed_trampoline<P>(this: *mut ffi::GdkDragContext, action: ffi::GdkDragAction, f: glib_ffi::gpointer)
where P: IsA<DragContext> {
callback_guard!();
let f: &&(Fn(&P, DragAction) + 'static) = transmute(f);
f(&DragContext::from_glib_borrow(this).downcast_unchecked(), from_glib(action))
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn cancel_trampoline<P>(this: *mut ffi::GdkDragContext, reason: ffi::GdkDragCancelReason, f: glib_ffi::gpointer)
where P: IsA<DragContext> {
callback_guard!();
let f: &&(Fn(&P, DragCancelReason) + 'static) = transmute(f);
f(&DragContext::from_glib_borrow(this).downcast_unchecked(), from_glib(reason))
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn dnd_finished_trampoline<P>(this: *mut ffi::GdkDragContext, f: glib_ffi::gpointer)
where P: IsA<DragContext> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DragContext::from_glib_borrow(this).downcast_unchecked())
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
unsafe extern "C" fn drop_performed_trampoline<P>(this: *mut ffi::GdkDragContext, time: libc::c_int, f: glib_ffi::gpointer)
where P: IsA<DragContext> {
callback_guard!();
let f: &&(Fn(&P, i32) + 'static) = transmute(f);
f(&DragContext::from_glib_borrow(this).downcast_unchecked(), time)
}
2 changes: 0 additions & 2 deletions src/auto/drawing_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ impl<O: IsA<DrawingContext> + IsA<glib::object::Object>> DrawingContextExt for O
#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn notify_clip_trampoline<P>(this: *mut ffi::GdkDrawingContext, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DrawingContext> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DrawingContext::from_glib_borrow(this).downcast_unchecked())
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
unsafe extern "C" fn notify_window_trampoline<P>(this: *mut ffi::GdkDrawingContext, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<DrawingContext> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&DrawingContext::from_glib_borrow(this).downcast_unchecked())
}
2 changes: 1 addition & 1 deletion src/auto/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bitflags! {
const SMOOTH_SCROLL_MASK = 8388608;
const TOUCHPAD_GESTURE_MASK = 16777216;
const TABLET_PAD_MASK = 33554432;
const ALL_EVENTS_MASK = 16777214;
const ALL_EVENTS_MASK = 67108862;
}
}

Expand Down
7 changes: 0 additions & 7 deletions src/auto/frame_clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,49 +184,42 @@ impl<O: IsA<FrameClock> + IsA<glib::object::Object>> FrameClockExt for O {

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

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

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

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

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

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

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