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

More types #694

Merged
merged 2 commits into from
Sep 3, 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: 2 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ ignore = [

manual = [
"cairo.Context",
"cairo.FontOptions",
"cairo.RectangleInt",
"cairo.Region",
"cairo.Surface",
Expand All @@ -259,6 +260,7 @@ manual = [
"Gdk.EventProximity",
"Gdk.EventScroll",
"Gdk.EventSelection",
"Gdk.EventSequence",
"Gdk.EventVisibility",
"Gdk.EventWindowState",
"Gdk.FrameClock",
Expand Down
220 changes: 148 additions & 72 deletions src/auto/gesture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use EventSequenceState;
use ffi;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use gdk;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use gdk_ffi;
use glib;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use glib::StaticType;
Expand Down Expand Up @@ -51,29 +53,29 @@ pub trait GestureExt {
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_group(&self) -> Vec<Gesture>;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_last_event(&self, sequence: /*Ignored*/&gdk::EventSequence) -> Option<gdk::Event>;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_last_event(&self, sequence: &gdk::EventSequence) -> Option<gdk::Event>;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_last_updated_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence>;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_last_updated_sequence(&self) -> Option<gdk::EventSequence>;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_point<'a, P: Into<Option<&'a /*Ignored*/gdk::EventSequence>>>(&self, sequence: P) -> Option<(f64, f64)>;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_point<'a, P: Into<Option<&'a gdk::EventSequence>>>(&self, sequence: P) -> Option<(f64, f64)>;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_sequence_state(&self, sequence: /*Ignored*/&gdk::EventSequence) -> EventSequenceState;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_sequence_state(&self, sequence: &gdk::EventSequence) -> EventSequenceState;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_sequences(&self) -> /*Ignored*/Vec<gdk::EventSequence>;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_sequences(&self) -> Vec<gdk::EventSequence>;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_window(&self) -> Option<gdk::Window>;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn group<P: IsA<Gesture>>(&self, gesture: &P);

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn handles_sequence<'a, P: Into<Option<&'a /*Ignored*/gdk::EventSequence>>>(&self, sequence: P) -> bool;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn handles_sequence<'a, P: Into<Option<&'a gdk::EventSequence>>>(&self, sequence: P) -> bool;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn is_active(&self) -> bool;
Expand All @@ -84,8 +86,8 @@ pub trait GestureExt {
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn is_recognized(&self) -> bool;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn set_sequence_state(&self, sequence: /*Ignored*/&gdk::EventSequence, state: EventSequenceState) -> bool;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn set_sequence_state(&self, sequence: &gdk::EventSequence, state: EventSequenceState) -> bool;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn set_state(&self, state: EventSequenceState) -> bool;
Expand All @@ -99,20 +101,20 @@ pub trait GestureExt {
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_property_n_points(&self) -> u32;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_begin<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_begin<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_cancel<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_cancel<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_end<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_end<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_sequence_state_changed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_sequence_state_changed<F: Fn(&Self, &gdk::EventSequence, EventSequenceState) + 'static>(&self, f: F) -> SignalHandlerId;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_update<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_update<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_property_n_points_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
Expand Down Expand Up @@ -155,30 +157,44 @@ impl<O: IsA<Gesture> + IsA<glib::object::Object>> GestureExt for O {
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_last_event(&self, sequence: /*Ignored*/&gdk::EventSequence) -> Option<gdk::Event> {
// unsafe { TODO: call ffi::gtk_gesture_get_last_event() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_last_event(&self, sequence: &gdk::EventSequence) -> Option<gdk::Event> {
unsafe {
from_glib_none(ffi::gtk_gesture_get_last_event(self.to_glib_none().0, mut_override(sequence.to_glib_none().0)))
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_last_updated_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence> {
// unsafe { TODO: call ffi::gtk_gesture_get_last_updated_sequence() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_last_updated_sequence(&self) -> Option<gdk::EventSequence> {
unsafe {
from_glib_none(ffi::gtk_gesture_get_last_updated_sequence(self.to_glib_none().0))
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_point<'a, P: Into<Option<&'a /*Ignored*/gdk::EventSequence>>>(&self, sequence: P) -> Option<(f64, f64)> {
// unsafe { TODO: call ffi::gtk_gesture_get_point() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_point<'a, P: Into<Option<&'a gdk::EventSequence>>>(&self, sequence: P) -> Option<(f64, f64)> {
let sequence = sequence.into();
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
let ret = from_glib(ffi::gtk_gesture_get_point(self.to_glib_none().0, mut_override(sequence.to_glib_none().0), &mut x, &mut y));
if ret { Some((x, y)) } else { None }
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_sequence_state(&self, sequence: /*Ignored*/&gdk::EventSequence) -> EventSequenceState {
// unsafe { TODO: call ffi::gtk_gesture_get_sequence_state() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_sequence_state(&self, sequence: &gdk::EventSequence) -> EventSequenceState {
unsafe {
from_glib(ffi::gtk_gesture_get_sequence_state(self.to_glib_none().0, mut_override(sequence.to_glib_none().0)))
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_sequences(&self) -> /*Ignored*/Vec<gdk::EventSequence> {
// unsafe { TODO: call ffi::gtk_gesture_get_sequences() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_sequences(&self) -> Vec<gdk::EventSequence> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::gtk_gesture_get_sequences(self.to_glib_none().0))
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_window(&self) -> Option<gdk::Window> {
Expand All @@ -194,10 +210,13 @@ impl<O: IsA<Gesture> + IsA<glib::object::Object>> GestureExt for O {
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn handles_sequence<'a, P: Into<Option<&'a /*Ignored*/gdk::EventSequence>>>(&self, sequence: P) -> bool {
// unsafe { TODO: call ffi::gtk_gesture_handles_sequence() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn handles_sequence<'a, P: Into<Option<&'a gdk::EventSequence>>>(&self, sequence: P) -> bool {
let sequence = sequence.into();
unsafe {
from_glib(ffi::gtk_gesture_handles_sequence(self.to_glib_none().0, mut_override(sequence.to_glib_none().0)))
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn is_active(&self) -> bool {
Expand All @@ -220,10 +239,12 @@ impl<O: IsA<Gesture> + IsA<glib::object::Object>> GestureExt for O {
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn set_sequence_state(&self, sequence: /*Ignored*/&gdk::EventSequence, state: EventSequenceState) -> bool {
// unsafe { TODO: call ffi::gtk_gesture_set_sequence_state() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn set_sequence_state(&self, sequence: &gdk::EventSequence, state: EventSequenceState) -> bool {
unsafe {
from_glib(ffi::gtk_gesture_set_sequence_state(self.to_glib_none().0, mut_override(sequence.to_glib_none().0), state.to_glib()))
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn set_state(&self, state: EventSequenceState) -> bool {
Expand Down Expand Up @@ -257,30 +278,50 @@ impl<O: IsA<Gesture> + IsA<glib::object::Object>> GestureExt for O {
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_begin<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored sequence: Gdk.EventSequence
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_begin<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &gdk::EventSequence) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "begin",
transmute(begin_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_cancel<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored sequence: Gdk.EventSequence
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_cancel<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &gdk::EventSequence) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "cancel",
transmute(cancel_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_end<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored sequence: Gdk.EventSequence
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_end<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &gdk::EventSequence) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "end",
transmute(end_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_sequence_state_changed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored sequence: Gdk.EventSequence
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_sequence_state_changed<F: Fn(&Self, &gdk::EventSequence, EventSequenceState) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &gdk::EventSequence, EventSequenceState) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "sequence-state-changed",
transmute(sequence_state_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn connect_update<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored sequence: Gdk.EventSequence
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_update<F: Fn(&Self, &gdk::EventSequence) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &gdk::EventSequence) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "update",
transmute(update_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn connect_property_n_points_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
Expand All @@ -301,6 +342,41 @@ impl<O: IsA<Gesture> + IsA<glib::object::Object>> GestureExt for O {
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn begin_trampoline<P>(this: *mut ffi::GtkGesture, sequence: *mut gdk_ffi::GdkEventSequence, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
let f: &&(Fn(&P, &gdk::EventSequence) + 'static) = transmute(f);
f(&Gesture::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(sequence))
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn cancel_trampoline<P>(this: *mut ffi::GtkGesture, sequence: *mut gdk_ffi::GdkEventSequence, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
let f: &&(Fn(&P, &gdk::EventSequence) + 'static) = transmute(f);
f(&Gesture::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(sequence))
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn end_trampoline<P>(this: *mut ffi::GtkGesture, sequence: *mut gdk_ffi::GdkEventSequence, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
let f: &&(Fn(&P, &gdk::EventSequence) + 'static) = transmute(f);
f(&Gesture::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(sequence))
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn sequence_state_changed_trampoline<P>(this: *mut ffi::GtkGesture, sequence: *mut gdk_ffi::GdkEventSequence, state: ffi::GtkEventSequenceState, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
let f: &&(Fn(&P, &gdk::EventSequence, EventSequenceState) + 'static) = transmute(f);
f(&Gesture::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(sequence), from_glib(state))
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn update_trampoline<P>(this: *mut ffi::GtkGesture, sequence: *mut gdk_ffi::GdkEventSequence, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
let f: &&(Fn(&P, &gdk::EventSequence) + 'static) = transmute(f);
f(&Gesture::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(sequence))
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
unsafe extern "C" fn notify_n_points_trampoline<P>(this: *mut ffi::GtkGesture, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Gesture> {
Expand Down
16 changes: 10 additions & 6 deletions src/auto/gesture_single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use EventController;
use Gesture;
use ffi;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use gdk;
use glib;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use glib::object::Downcast;
Expand Down Expand Up @@ -38,8 +40,8 @@ pub trait GestureSingleExt {
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_current_button(&self) -> u32;

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_current_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence>;
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_current_sequence(&self) -> Option<gdk::EventSequence>;

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_exclusive(&self) -> bool;
Expand Down Expand Up @@ -81,10 +83,12 @@ impl<O: IsA<GestureSingle> + IsA<glib::object::Object>> GestureSingleExt for O {
}
}

//#[cfg(any(feature = "v3_14", feature = "dox"))]
//fn get_current_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence> {
// unsafe { TODO: call ffi::gtk_gesture_single_get_current_sequence() }
//}
#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_current_sequence(&self) -> Option<gdk::EventSequence> {
unsafe {
from_glib_full(ffi::gtk_gesture_single_get_current_sequence(self.to_glib_none().0))
}
}

#[cfg(any(feature = "v3_14", feature = "dox"))]
fn get_exclusive(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 04c26a8)
Generated by gir (https://github.com/gtk-rs/gir @ d3116ca)
from gir-files (https://github.com/gtk-rs/gir-files @ b8f5ef1)
Loading