Last active
May 29, 2018 18:47
-
-
Save vhdirk/58fbf5e3c2092d51a8c14dbb7406b50a to your computer and use it in GitHub Desktop.
gtk-subclass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AccelGroupImpl<T: AccelGroupBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn accel_changed(&self, accel_group: &T, keyval: u32, modifier: /*Ignored*/gdk::ModifierType, accel_closure: /*Ignored*/&glib::Closure){ | |
accel_group.parent_accel_changed(keyval, modifier, accel_closure) | |
} | |
} | |
pub trait AccelGroupImplExt<T> {} | |
} | |
impl<S: AccelGroupImpl<T>, T: ObjectType >> AccelGroupImplExt<T> for S {} | |
any_impl!(AccelGroupBase, AccelGroupImpl); | |
pub unsafe trait AccelGroupBase: ObjectType { | |
fn parent_accel_changed(&self, keyval: u32, modifier: /*Ignored*/gdk::ModifierType, accel_closure: /*Ignored*/&glib::Closure){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAccelGroupClass; | |
(*parent_klass) | |
.accel_changed | |
.map(|f|{ f(self.to_glib_none().0,keyval,modifier.to_glib(),accel_closure.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait AccelGroupClassExt<T: AccelGroupBase> | |
where | |
T::ImplType: AccelGroupImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAccelGroupClass); | |
klass.accel_changed = Some(accelgroup_accel_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct AccelGroup(Object<InstanceStruct<AccelGroup>>) ; | |
match fn { | |
get_type => || get_type::<AccelGroup>(), | |
} | |
} | |
unsafe impl<T: ObjectType > AccelGroupBase for T {} | |
pub type AccelGroupClass = ClassStruct<AccelGroup>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_accelgroup_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::accel_group::AccelGroupBase> $crate::accel_group::AccelGroupImpl<T> for Box<$name<T>>{ | |
fn accel_changed(&self, accel_group: &T, keyval: u32, modifier: /*Ignored*/gdk::ModifierType, accel_closure: /*Ignored*/&glib::Closure){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.accel_changed(keyval, modifier, accel_closure) | |
} | |
} | |
} | |
); | |
impl ObjectType for AccelGroup{ | |
const NAME: &'static str = "RsGtk.AccelGroup"; | |
type ImplType = Box<AccelGroupImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AccelGroupClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn accelgroup_accel_changed<T: AccelGroupBase> | |
(ptr: *mut GtkAccelGroup, keyval: c_uint, modifier: gdk::GdkModifierType, accel_closure: *mut gobject::GClosure) | |
where | |
T::ImplType: AccelGroupImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let accelgroup = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = accelgroup.get_impl(); | |
imp.accel_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ActionBarImpl<T: ActionBarBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ActionBarImplExt<T> {} | |
} | |
impl<S: ActionBarImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ActionBarImplExt<T> for S {} | |
any_impl!(ActionBarBase, ActionBarImpl); | |
pub unsafe trait ActionBarBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait ActionBarClassExt<T: ActionBarBase> | |
where | |
T::ImplType: ActionBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkActionBarClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ActionBar(Object<InstanceStruct<ActionBar>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<ActionBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ActionBarBase for T {} | |
pub type ActionBarClass = ClassStruct<ActionBar>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<ActionBar> for ActionBarClass {} | |
unsafe impl ContainerClassExt<ActionBar> for ActionBarClass {} | |
unsafe impl WidgetClassExt<ActionBar> for ActionBarClass {} | |
unsafe impl InitiallyUnownedClassExt<ActionBar> for ActionBarClass {} | |
unsafe impl ImplementorIfaceClassExt<ActionBar> for ActionBarClass {} | |
unsafe impl BuildableClassExt<ActionBar> for ActionBarClass {} | |
#[macro_export] | |
macro_rules! box_actionbar_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::action_bar::ActionBarBase> $crate::action_bar::ActionBarImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ActionBar{ | |
const NAME: &'static str = "RsGtk.ActionBar"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ActionBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ActionBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn get_action_name(&self, actionable: &T) -> Option<String>{ | |
actionable.parent_get_action_name() | |
} | |
fn get_action_target_value(&self, actionable: &T) -> Option<glib::Variant>{ | |
actionable.parent_get_action_target_value() | |
} | |
fn set_action_name(&self, actionable: &T, action_name: Option<&str>){ | |
actionable.parent_set_action_name(action_name) | |
} | |
fn set_action_target_value(&self, actionable: &T, target_value: &glib::Variant){ | |
actionable.parent_set_action_target_value(target_value) | |
} | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_get_action_name(&self) -> Option<String>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkActionableInterface; | |
(*parent_klass) | |
.get_action_name | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_action_target_value(&self) -> Option<glib::Variant>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkActionableInterface; | |
(*parent_klass) | |
.get_action_target_value | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_action_name(&self, action_name: Option<&str>){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkActionableInterface; | |
(*parent_klass) | |
.set_action_name | |
.map(|f|{ f(self.to_glib_none().0,action_name.0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_action_target_value(&self, target_value: &glib::Variant){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkActionableInterface; | |
(*parent_klass) | |
.set_action_target_value | |
.map(|f|{ f(self.to_glib_none().0,target_value.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ActionableInterfaceExt<T: > | |
where | |
T::ImplType: <T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkActionableInterface); | |
klass.get_action_name = Some(actionable_get_action_name::<T>); | |
klass.get_action_target_value = Some(actionable_get_action_target_value::<T>); | |
klass.set_action_name = Some(actionable_set_action_name::<T>); | |
klass.set_action_target_value = Some(actionable_set_action_target_value::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Actionable(Object<InstanceStruct<Actionable>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Actionable>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> for T {} | |
pub type ActionableClass = ClassStruct<Actionable>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<Actionable> for ActionableClass {} | |
unsafe impl InitiallyUnownedClassExt<Actionable> for ActionableClass {} | |
unsafe impl ImplementorIfaceClassExt<Actionable> for ActionableClass {} | |
unsafe impl BuildableClassExt<Actionable> for ActionableClass {} | |
#[macro_export] | |
macro_rules! box_actionable_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::actionable::> $crate::actionable::<T> for Box<$name<T>>{ | |
fn get_action_name(&self, actionable: &T) -> Option<String>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_action_name() | |
} | |
fn get_action_target_value(&self, actionable: &T) -> Option<glib::Variant>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_action_target_value() | |
} | |
fn set_action_name(&self, actionable: &T, action_name: Option<&str>){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_action_name(action_name) | |
} | |
fn set_action_target_value(&self, actionable: &T, target_value: &glib::Variant){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_action_target_value(target_value) | |
} | |
} | |
} | |
); | |
impl ObjectType for Actionable{ | |
const NAME: &'static str = "RsGtk.Actionable"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ActionableClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn actionable_get_action_name<T: > | |
(ptr: *mut GtkActionable) -> *const c_char | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let actionable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = actionable.get_impl(); | |
imp.get_action_name() | |
} | |
unsafe extern "C" fn actionable_get_action_target_value<T: > | |
(ptr: *mut GtkActionable) -> *mut glib::GVariant | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let actionable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = actionable.get_impl(); | |
imp.get_action_target_value() | |
} | |
unsafe extern "C" fn actionable_set_action_name<T: > | |
(ptr: *mut GtkActionable, action_name: *const c_char) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let actionable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = actionable.get_impl(); | |
imp.set_action_name() | |
} | |
unsafe extern "C" fn actionable_set_action_target_value<T: > | |
(ptr: *mut GtkActionable, target_value: *mut glib::GVariant) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let actionable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = actionable.get_impl(); | |
imp.set_action_target_value() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AdjustmentImpl<T: AdjustmentBase>: gobject_subclass::InitiallyUnownedImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn changed(&self, adjustment: &T){ | |
adjustment.parent_changed() | |
} | |
fn value_changed(&self, adjustment: &T){ | |
adjustment.parent_value_changed() | |
} | |
} | |
pub trait AdjustmentImplExt<T> {} | |
} | |
impl<S: AdjustmentImpl<T>, T: ObjectType + glib::IsA<gobject::InitiallyUnowned>>> AdjustmentImplExt<T> for S {} | |
any_impl!(AdjustmentBase, AdjustmentImpl); | |
pub unsafe trait AdjustmentBase: ObjectType + glib::IsA<gobject::InitiallyUnowned>{ | |
fn parent_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAdjustmentClass; | |
(*parent_klass) | |
.changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_value_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAdjustmentClass; | |
(*parent_klass) | |
.value_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait AdjustmentClassExt<T: AdjustmentBase> | |
where | |
T::ImplType: AdjustmentImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAdjustmentClass); | |
klass.changed = Some(adjustment_changed::<T>); | |
klass.value_changed = Some(adjustment_value_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Adjustment(Object<InstanceStruct<Adjustment>>):[ | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned] ; | |
match fn { | |
get_type => || get_type::<Adjustment>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gobject::InitiallyUnowned>> AdjustmentBase for T {} | |
pub type AdjustmentClass = ClassStruct<Adjustment>; | |
// FIXME: Boilerplate | |
unsafe impl InitiallyUnownedClassExt<Adjustment> for AdjustmentClass {} | |
#[macro_export] | |
macro_rules! box_adjustment_impl( | |
($name:ident) => { | |
impl<T: $crate::adjustment::AdjustmentBase> $crate::adjustment::AdjustmentImpl<T> for Box<$name<T>>{ | |
fn changed(&self, adjustment: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.changed() | |
} | |
fn value_changed(&self, adjustment: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.value_changed() | |
} | |
} | |
} | |
); | |
impl ObjectType for Adjustment{ | |
const NAME: &'static str = "RsGtk.Adjustment"; | |
type ImplType = Box<AdjustmentImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AdjustmentClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn adjustment_changed<T: AdjustmentBase> | |
(ptr: *mut GtkAdjustment) | |
where | |
T::ImplType: AdjustmentImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let adjustment = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = adjustment.get_impl(); | |
imp.changed() | |
} | |
unsafe extern "C" fn adjustment_value_changed<T: AdjustmentBase> | |
(ptr: *mut GtkAdjustment) | |
where | |
T::ImplType: AdjustmentImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let adjustment = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = adjustment.get_impl(); | |
imp.value_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AlignmentImpl<T: AlignmentBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait AlignmentImplExt<T> {} | |
} | |
impl<S: AlignmentImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> AlignmentImplExt<T> for S {} | |
any_impl!(AlignmentBase, AlignmentImpl); | |
pub unsafe trait AlignmentBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait AlignmentClassExt<T: AlignmentBase> | |
where | |
T::ImplType: AlignmentImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAlignmentClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Alignment(Object<InstanceStruct<Alignment>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Alignment>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> AlignmentBase for T {} | |
pub type AlignmentClass = ClassStruct<Alignment>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Alignment> for AlignmentClass {} | |
unsafe impl ContainerClassExt<Alignment> for AlignmentClass {} | |
unsafe impl WidgetClassExt<Alignment> for AlignmentClass {} | |
unsafe impl InitiallyUnownedClassExt<Alignment> for AlignmentClass {} | |
unsafe impl ImplementorIfaceClassExt<Alignment> for AlignmentClass {} | |
unsafe impl BuildableClassExt<Alignment> for AlignmentClass {} | |
#[macro_export] | |
macro_rules! box_alignment_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::alignment::AlignmentBase> $crate::alignment::AlignmentImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Alignment{ | |
const NAME: &'static str = "RsGtk.Alignment"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<AlignmentImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AlignmentClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Dialog; | |
use DialogFlags; | |
use Widget; | |
use Window; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AppChooserDialogImpl<T: AppChooserDialogBase>: gtk_subclass::DialogImpl<T> + gtk_subclass::WindowImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::AppChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait AppChooserDialogImplExt<T> {} | |
} | |
impl<S: AppChooserDialogImpl<T>, T: ObjectType + glib::IsA<gtk::Dialog> + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::AppChooser>>> AppChooserDialogImplExt<T> for S {} | |
any_impl!(AppChooserDialogBase, AppChooserDialogImpl); | |
pub unsafe trait AppChooserDialogBase: ObjectType + glib::IsA<gtk::Dialog> + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::AppChooser>{ | |
} | |
pub unsafe trait AppChooserDialogClassExt<T: AppChooserDialogBase> | |
where | |
T::ImplType: AppChooserDialogImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAppChooserDialogClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct AppChooserDialog(Object<InstanceStruct<AppChooserDialog>>):[ | |
gtk::Dialog => gtk_ffi::GtkDialog | |
gtk::Window => gtk_ffi::GtkWindow | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::AppChooser => gtk_ffi::GtkAppChooser] ; | |
match fn { | |
get_type => || get_type::<AppChooserDialog>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Dialog> + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::AppChooser>> AppChooserDialogBase for T {} | |
pub type AppChooserDialogClass = ClassStruct<AppChooserDialog>; | |
// FIXME: Boilerplate | |
unsafe impl DialogClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl WindowClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl BinClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl ContainerClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl WidgetClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl InitiallyUnownedClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl ImplementorIfaceClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl BuildableClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
unsafe impl AppChooserClassExt<AppChooserDialog> for AppChooserDialogClass {} | |
#[macro_export] | |
macro_rules! box_appchooserdialog_impl( | |
($name:ident) => { | |
box_dialog_impl!($name); | |
box_window_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::app_chooser_dialog::AppChooserDialogBase> $crate::app_chooser_dialog::AppChooserDialogImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for AppChooserDialog{ | |
const NAME: &'static str = "RsGtk.AppChooserDialog"; | |
type ParentType = gtk::Dialog; | |
type ImplType = Box<AppChooserDialogImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AppChooserDialogClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
DialogClassExt::override_vfuncs(klass, token); | |
WindowClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
AppChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AppChooserWidgetImpl<T: AppChooserWidgetBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::AppChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn application_activated(&self, self: &T, app_info: /*Ignored*/&gio::AppInfo){ | |
self.parent_application_activated(app_info) | |
} | |
fn application_selected(&self, self: &T, app_info: /*Ignored*/&gio::AppInfo){ | |
self.parent_application_selected(app_info) | |
} | |
fn populate_popup(&self, self: &T, menu: &Menu, app_info: /*Ignored*/&gio::AppInfo){ | |
self.parent_populate_popup(menu, app_info) | |
} | |
} | |
pub trait AppChooserWidgetImplExt<T> {} | |
} | |
impl<S: AppChooserWidgetImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::AppChooser>>> AppChooserWidgetImplExt<T> for S {} | |
any_impl!(AppChooserWidgetBase, AppChooserWidgetImpl); | |
pub unsafe trait AppChooserWidgetBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::AppChooser>{ | |
fn parent_application_activated(&self, app_info: /*Ignored*/&gio::AppInfo){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAppChooserWidgetClass; | |
(*parent_klass) | |
.application_activated | |
.map(|f|{ f(self.to_glib_none().0,app_info.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_application_selected(&self, app_info: /*Ignored*/&gio::AppInfo){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAppChooserWidgetClass; | |
(*parent_klass) | |
.application_selected | |
.map(|f|{ f(self.to_glib_none().0,app_info.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_populate_popup(&self, menu: &Menu, app_info: /*Ignored*/&gio::AppInfo){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkAppChooserWidgetClass; | |
(*parent_klass) | |
.populate_popup | |
.map(|f|{ f(self.to_glib_none().0,menu.to_glib_none().0,app_info.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait AppChooserWidgetClassExt<T: AppChooserWidgetBase> | |
where | |
T::ImplType: AppChooserWidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAppChooserWidgetClass); | |
klass.application_activated = Some(appchooserwidget_application_activated::<T>); | |
klass.application_selected = Some(appchooserwidget_application_selected::<T>); | |
klass.populate_popup = Some(appchooserwidget_populate_popup::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct AppChooserWidget(Object<InstanceStruct<AppChooserWidget>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::AppChooser => gtk_ffi::GtkAppChooser] ; | |
match fn { | |
get_type => || get_type::<AppChooserWidget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::AppChooser>> AppChooserWidgetBase for T {} | |
pub type AppChooserWidgetClass = ClassStruct<AppChooserWidget>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl ContainerClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl WidgetClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl InitiallyUnownedClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl BuildableClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl OrientableClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
unsafe impl AppChooserClassExt<AppChooserWidget> for AppChooserWidgetClass {} | |
#[macro_export] | |
macro_rules! box_appchooserwidget_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::app_chooser_widget::AppChooserWidgetBase> $crate::app_chooser_widget::AppChooserWidgetImpl<T> for Box<$name<T>>{ | |
fn application_activated(&self, self: &T, app_info: /*Ignored*/&gio::AppInfo){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.application_activated(app_info) | |
} | |
fn application_selected(&self, self: &T, app_info: /*Ignored*/&gio::AppInfo){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.application_selected(app_info) | |
} | |
fn populate_popup(&self, self: &T, menu: &Menu, app_info: /*Ignored*/&gio::AppInfo){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.populate_popup(menu, app_info) | |
} | |
} | |
} | |
); | |
impl ObjectType for AppChooserWidget{ | |
const NAME: &'static str = "RsGtk.AppChooserWidget"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<AppChooserWidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AppChooserWidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
AppChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn appchooserwidget_application_activated<T: AppChooserWidgetBase> | |
(ptr: *mut GtkAppChooserWidget, app_info: *mut gio::GAppInfo) | |
where | |
T::ImplType: AppChooserWidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let appchooserwidget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = appchooserwidget.get_impl(); | |
imp.application_activated() | |
} | |
unsafe extern "C" fn appchooserwidget_application_selected<T: AppChooserWidgetBase> | |
(ptr: *mut GtkAppChooserWidget, app_info: *mut gio::GAppInfo) | |
where | |
T::ImplType: AppChooserWidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let appchooserwidget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = appchooserwidget.get_impl(); | |
imp.application_selected() | |
} | |
unsafe extern "C" fn appchooserwidget_populate_popup<T: AppChooserWidgetBase> | |
(ptr: *mut GtkAppChooserWidget, menu: *mut GtkMenu, app_info: *mut gio::GAppInfo) | |
where | |
T::ImplType: AppChooserWidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let appchooserwidget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = appchooserwidget.get_impl(); | |
imp.populate_popup() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ApplicationInhibitFlags; | |
use Window; | |
use ffi; | |
use gio; | |
use gio_ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ApplicationImpl<T: ApplicationBase>: gio_subclass::ApplicationImpl<T> + gio_subclass::ActionGroupImpl<T> + gio_subclass::ActionMapImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn window_added(&self, application: &T, window: &Window){ | |
application.parent_window_added(window) | |
} | |
fn window_removed(&self, application: &T, window: &Window){ | |
application.parent_window_removed(window) | |
} | |
} | |
pub trait ApplicationImplExt<T> {} | |
} | |
impl<S: ApplicationImpl<T>, T: ObjectType + glib::IsA<gio::Application> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>>> ApplicationImplExt<T> for S {} | |
any_impl!(ApplicationBase, ApplicationImpl); | |
pub unsafe trait ApplicationBase: ObjectType + glib::IsA<gio::Application> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>{ | |
fn parent_window_added(&self, window: &Window){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkApplicationClass; | |
(*parent_klass) | |
.window_added | |
.map(|f|{ f(self.to_glib_none().0,window.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_window_removed(&self, window: &Window){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkApplicationClass; | |
(*parent_klass) | |
.window_removed | |
.map(|f|{ f(self.to_glib_none().0,window.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ApplicationClassExt<T: ApplicationBase> | |
where | |
T::ImplType: ApplicationImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkApplicationClass); | |
klass.window_added = Some(application_window_added::<T>); | |
klass.window_removed = Some(application_window_removed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Application(Object<InstanceStruct<Application>>):[ | |
gio::Application => gio_ffi::GApplication | |
gio::ActionGroup => gio_ffi::GActionGroup | |
gio::ActionMap => gio_ffi::GActionMap] ; | |
match fn { | |
get_type => || get_type::<Application>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gio::Application> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>> ApplicationBase for T {} | |
pub type ApplicationClass = ClassStruct<Application>; | |
// FIXME: Boilerplate | |
unsafe impl ApplicationClassExt<Application> for ApplicationClass {} | |
unsafe impl ActionGroupClassExt<Application> for ApplicationClass {} | |
unsafe impl ActionMapClassExt<Application> for ApplicationClass {} | |
#[macro_export] | |
macro_rules! box_application_impl( | |
($name:ident) => { | |
box_application_impl!($name); | |
impl<T: $crate::application::ApplicationBase> $crate::application::ApplicationImpl<T> for Box<$name<T>>{ | |
fn window_added(&self, application: &T, window: &Window){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.window_added(window) | |
} | |
fn window_removed(&self, application: &T, window: &Window){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.window_removed(window) | |
} | |
} | |
} | |
); | |
impl ObjectType for Application{ | |
const NAME: &'static str = "RsGtk.Application"; | |
type ParentType = gio::Application; | |
type ImplType = Box<ApplicationImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ApplicationClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ApplicationClassExt::override_vfuncs(klass, token); | |
ActionGroupClassExt::override_vfuncs(klass, token); | |
ActionMapClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn application_window_added<T: ApplicationBase> | |
(ptr: *mut GtkApplication, window: *mut GtkWindow) | |
where | |
T::ImplType: ApplicationImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let application = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = application.get_impl(); | |
imp.window_added() | |
} | |
unsafe extern "C" fn application_window_removed<T: ApplicationBase> | |
(ptr: *mut GtkApplication, window: *mut GtkWindow) | |
where | |
T::ImplType: ApplicationImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let application = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = application.get_impl(); | |
imp.window_removed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Application; | |
use Bin; | |
use Container; | |
use Widget; | |
use Window; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ApplicationWindowImpl<T: ApplicationWindowBase>: gtk_subclass::WindowImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gio_subclass::ActionGroupImpl<T> + gio_subclass::ActionMapImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ApplicationWindowImplExt<T> {} | |
} | |
impl<S: ApplicationWindowImpl<T>, T: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>>> ApplicationWindowImplExt<T> for S {} | |
any_impl!(ApplicationWindowBase, ApplicationWindowImpl); | |
pub unsafe trait ApplicationWindowBase: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>{ | |
} | |
pub unsafe trait ApplicationWindowClassExt<T: ApplicationWindowBase> | |
where | |
T::ImplType: ApplicationWindowImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkApplicationWindowClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ApplicationWindow(Object<InstanceStruct<ApplicationWindow>>):[ | |
gtk::Window => gtk_ffi::GtkWindow | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gio::ActionGroup => gio_ffi::GActionGroup | |
gio::ActionMap => gio_ffi::GActionMap] ; | |
match fn { | |
get_type => || get_type::<ApplicationWindow>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gio::ActionGroup> + glib::IsA<gio::ActionMap>> ApplicationWindowBase for T {} | |
pub type ApplicationWindowClass = ClassStruct<ApplicationWindow>; | |
// FIXME: Boilerplate | |
unsafe impl WindowClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl BinClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl ContainerClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl WidgetClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl InitiallyUnownedClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl ImplementorIfaceClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl BuildableClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl ActionGroupClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
unsafe impl ActionMapClassExt<ApplicationWindow> for ApplicationWindowClass {} | |
#[macro_export] | |
macro_rules! box_applicationwindow_impl( | |
($name:ident) => { | |
box_window_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::application_window::ApplicationWindowBase> $crate::application_window::ApplicationWindowImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ApplicationWindow{ | |
const NAME: &'static str = "RsGtk.ApplicationWindow"; | |
type ParentType = gtk::Window; | |
type ImplType = Box<ApplicationWindowImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ApplicationWindowClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WindowClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ActionGroupClassExt::override_vfuncs(klass, token); | |
ActionMapClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ArrowType; | |
use Misc; | |
use ShadowType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ArrowImpl<T: ArrowBase>: gtk_subclass::MiscImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ArrowImplExt<T> {} | |
} | |
impl<S: ArrowImpl<T>, T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ArrowImplExt<T> for S {} | |
any_impl!(ArrowBase, ArrowImpl); | |
pub unsafe trait ArrowBase: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait ArrowClassExt<T: ArrowBase> | |
where | |
T::ImplType: ArrowImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkArrowClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Arrow(Object<InstanceStruct<Arrow>>):[ | |
gtk::Misc => gtk_ffi::GtkMisc | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Arrow>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ArrowBase for T {} | |
pub type ArrowClass = ClassStruct<Arrow>; | |
// FIXME: Boilerplate | |
unsafe impl MiscClassExt<Arrow> for ArrowClass {} | |
unsafe impl WidgetClassExt<Arrow> for ArrowClass {} | |
unsafe impl InitiallyUnownedClassExt<Arrow> for ArrowClass {} | |
unsafe impl ImplementorIfaceClassExt<Arrow> for ArrowClass {} | |
unsafe impl BuildableClassExt<Arrow> for ArrowClass {} | |
#[macro_export] | |
macro_rules! box_arrow_impl( | |
($name:ident) => { | |
box_misc_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::arrow::ArrowBase> $crate::arrow::ArrowImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Arrow{ | |
const NAME: &'static str = "RsGtk.Arrow"; | |
type ParentType = gtk::Misc; | |
type ImplType = Box<ArrowImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ArrowClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
MiscClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Frame; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait AspectFrameImpl<T: AspectFrameBase>: gtk_subclass::FrameImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait AspectFrameImplExt<T> {} | |
} | |
impl<S: AspectFrameImpl<T>, T: ObjectType + glib::IsA<gtk::Frame> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> AspectFrameImplExt<T> for S {} | |
any_impl!(AspectFrameBase, AspectFrameImpl); | |
pub unsafe trait AspectFrameBase: ObjectType + glib::IsA<gtk::Frame> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait AspectFrameClassExt<T: AspectFrameBase> | |
where | |
T::ImplType: AspectFrameImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkAspectFrameClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct AspectFrame(Object<InstanceStruct<AspectFrame>>):[ | |
gtk::Frame => gtk_ffi::GtkFrame | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<AspectFrame>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Frame> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> AspectFrameBase for T {} | |
pub type AspectFrameClass = ClassStruct<AspectFrame>; | |
// FIXME: Boilerplate | |
unsafe impl FrameClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl BinClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl ContainerClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl WidgetClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl InitiallyUnownedClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl ImplementorIfaceClassExt<AspectFrame> for AspectFrameClass {} | |
unsafe impl BuildableClassExt<AspectFrame> for AspectFrameClass {} | |
#[macro_export] | |
macro_rules! box_aspectframe_impl( | |
($name:ident) => { | |
box_frame_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::aspect_frame::AspectFrameBase> $crate::aspect_frame::AspectFrameImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for AspectFrame{ | |
const NAME: &'static str = "RsGtk.AspectFrame"; | |
type ParentType = gtk::Frame; | |
type ImplType = Box<AspectFrameImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut AspectFrameClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
FrameClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use Widget; | |
use ffi; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait BinImpl<T: BinBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait BinImplExt<T> {} | |
} | |
impl<S: BinImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> BinImplExt<T> for S {} | |
any_impl!(BinBase, BinImpl); | |
pub unsafe trait BinBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait BinClassExt<T: BinBase> | |
where | |
T::ImplType: BinImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkBinClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Bin(Object<InstanceStruct<Bin>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Bin>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> BinBase for T {} | |
pub type BinClass = ClassStruct<Bin>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Bin> for BinClass {} | |
unsafe impl WidgetClassExt<Bin> for BinClass {} | |
unsafe impl InitiallyUnownedClassExt<Bin> for BinClass {} | |
unsafe impl ImplementorIfaceClassExt<Bin> for BinClass {} | |
unsafe impl BuildableClassExt<Bin> for BinClass {} | |
#[macro_export] | |
macro_rules! box_bin_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::bin::BinBase> $crate::bin::BinImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Bin{ | |
const NAME: &'static str = "RsGtk.Bin"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<BinImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut BinClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use BaselinePosition; | |
use Container; | |
use Orientable; | |
use Orientation; | |
use PackType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait BoxImpl<T: BoxBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait BoxImplExt<T> {} | |
} | |
impl<S: BoxImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> BoxImplExt<T> for S {} | |
any_impl!(BoxBase, BoxImpl); | |
pub unsafe trait BoxBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
} | |
pub unsafe trait BoxClassExt<T: BoxBase> | |
where | |
T::ImplType: BoxImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkBoxClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Box(Object<InstanceStruct<Box>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Box>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> BoxBase for T {} | |
pub type BoxClass = ClassStruct<Box>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Box> for BoxClass {} | |
unsafe impl WidgetClassExt<Box> for BoxClass {} | |
unsafe impl InitiallyUnownedClassExt<Box> for BoxClass {} | |
unsafe impl ImplementorIfaceClassExt<Box> for BoxClass {} | |
unsafe impl BuildableClassExt<Box> for BoxClass {} | |
unsafe impl OrientableClassExt<Box> for BoxClass {} | |
#[macro_export] | |
macro_rules! box_box_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::box_::BoxBase> $crate::box_::BoxImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Box{ | |
const NAME: &'static str = "RsGtk.Box"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<BoxImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut BoxClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use Application; | |
use Error; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait BuilderImpl<T: BuilderBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn get_type_from_name(&self, builder: &T, type_name: &str) -> glib::types::Type{ | |
builder.parent_get_type_from_name(type_name) | |
} | |
} | |
pub trait BuilderImplExt<T> {} | |
} | |
impl<S: BuilderImpl<T>, T: ObjectType >> BuilderImplExt<T> for S {} | |
any_impl!(BuilderBase, BuilderImpl); | |
pub unsafe trait BuilderBase: ObjectType { | |
fn parent_get_type_from_name(&self, type_name: &str) -> glib::types::Type{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkBuilderClass; | |
(*parent_klass) | |
.get_type_from_name | |
.map(|f|{ f(self.to_glib_none().0,type_name.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait BuilderClassExt<T: BuilderBase> | |
where | |
T::ImplType: BuilderImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkBuilderClass); | |
klass.get_type_from_name = Some(builder_get_type_from_name::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Builder(Object<InstanceStruct<Builder>>) ; | |
match fn { | |
get_type => || get_type::<Builder>(), | |
} | |
} | |
unsafe impl<T: ObjectType > BuilderBase for T {} | |
pub type BuilderClass = ClassStruct<Builder>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_builder_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::builder::BuilderBase> $crate::builder::BuilderImpl<T> for Box<$name<T>>{ | |
fn get_type_from_name(&self, builder: &T, type_name: &str) -> glib::types::Type{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_type_from_name(type_name) | |
} | |
} | |
} | |
); | |
impl ObjectType for Builder{ | |
const NAME: &'static str = "RsGtk.Builder"; | |
type ImplType = Box<BuilderImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut BuilderClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn builder_get_type_from_name<T: BuilderBase> | |
(ptr: *mut GtkBuilder, type_name: *const c_char) -> GType | |
where | |
T::ImplType: BuilderImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let builder = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = builder.get_impl(); | |
imp.get_type_from_name() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use CalendarDisplayOptions; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait CalendarImpl<T: CalendarBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn day_selected(&self, calendar: &T){ | |
calendar.parent_day_selected() | |
} | |
fn day_selected_double_click(&self, calendar: &T){ | |
calendar.parent_day_selected_double_click() | |
} | |
fn month_changed(&self, calendar: &T){ | |
calendar.parent_month_changed() | |
} | |
fn next_month(&self, calendar: &T){ | |
calendar.parent_next_month() | |
} | |
fn next_year(&self, calendar: &T){ | |
calendar.parent_next_year() | |
} | |
fn prev_month(&self, calendar: &T){ | |
calendar.parent_prev_month() | |
} | |
fn prev_year(&self, calendar: &T){ | |
calendar.parent_prev_year() | |
} | |
} | |
pub trait CalendarImplExt<T> {} | |
} | |
impl<S: CalendarImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> CalendarImplExt<T> for S {} | |
any_impl!(CalendarBase, CalendarImpl); | |
pub unsafe trait CalendarBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_day_selected(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.day_selected | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_day_selected_double_click(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.day_selected_double_click | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_month_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.month_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_next_month(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.next_month | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_next_year(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.next_year | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_prev_month(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.prev_month | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_prev_year(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCalendarClass; | |
(*parent_klass) | |
.prev_year | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait CalendarClassExt<T: CalendarBase> | |
where | |
T::ImplType: CalendarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkCalendarClass); | |
klass.day_selected = Some(calendar_day_selected::<T>); | |
klass.day_selected_double_click = Some(calendar_day_selected_double_click::<T>); | |
klass.month_changed = Some(calendar_month_changed::<T>); | |
klass.next_month = Some(calendar_next_month::<T>); | |
klass.next_year = Some(calendar_next_year::<T>); | |
klass.prev_month = Some(calendar_prev_month::<T>); | |
klass.prev_year = Some(calendar_prev_year::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Calendar(Object<InstanceStruct<Calendar>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Calendar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> CalendarBase for T {} | |
pub type CalendarClass = ClassStruct<Calendar>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<Calendar> for CalendarClass {} | |
unsafe impl InitiallyUnownedClassExt<Calendar> for CalendarClass {} | |
unsafe impl ImplementorIfaceClassExt<Calendar> for CalendarClass {} | |
unsafe impl BuildableClassExt<Calendar> for CalendarClass {} | |
#[macro_export] | |
macro_rules! box_calendar_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::calendar::CalendarBase> $crate::calendar::CalendarImpl<T> for Box<$name<T>>{ | |
fn day_selected(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.day_selected() | |
} | |
fn day_selected_double_click(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.day_selected_double_click() | |
} | |
fn month_changed(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.month_changed() | |
} | |
fn next_month(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.next_month() | |
} | |
fn next_year(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.next_year() | |
} | |
fn prev_month(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.prev_month() | |
} | |
fn prev_year(&self, calendar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.prev_year() | |
} | |
} | |
} | |
); | |
impl ObjectType for Calendar{ | |
const NAME: &'static str = "RsGtk.Calendar"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<CalendarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut CalendarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn calendar_day_selected<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.day_selected() | |
} | |
unsafe extern "C" fn calendar_day_selected_double_click<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.day_selected_double_click() | |
} | |
unsafe extern "C" fn calendar_month_changed<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.month_changed() | |
} | |
unsafe extern "C" fn calendar_next_month<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.next_month() | |
} | |
unsafe extern "C" fn calendar_next_year<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.next_year() | |
} | |
unsafe extern "C" fn calendar_prev_month<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.prev_month() | |
} | |
unsafe extern "C" fn calendar_prev_year<T: CalendarBase> | |
(ptr: *mut GtkCalendar) | |
where | |
T::ImplType: CalendarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let calendar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = calendar.get_impl(); | |
imp.prev_year() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use TextBuffer; | |
use ffi; | |
use gdk_pixbuf; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ClipboardImpl<T: ClipboardBase>: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ClipboardImplExt<T> {} | |
} | |
impl<S: ClipboardImpl<T>, T: ObjectType >> ClipboardImplExt<T> for S {} | |
any_impl!(ClipboardBase, ClipboardImpl); | |
pub unsafe trait ClipboardBase: ObjectType { | |
} | |
glib_wrapper! { | |
pub struct Clipboard(Object<InstanceStruct<Clipboard>>) ; | |
match fn { | |
get_type => || get_type::<Clipboard>(), | |
} | |
} | |
unsafe impl<T: ObjectType > ClipboardBase for T {} | |
pub type ClipboardClass = ClassStruct<Clipboard>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_clipboard_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::clipboard::ClipboardBase> $crate::clipboard::ClipboardImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Clipboard{ | |
const NAME: &'static str = "RsGtk.Clipboard"; | |
type ImplType = Box<ClipboardImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ClipboardClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ColorChooserWidgetImpl<T: ColorChooserWidgetBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::ColorChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ColorChooserWidgetImplExt<T> {} | |
} | |
impl<S: ColorChooserWidgetImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ColorChooser>>> ColorChooserWidgetImplExt<T> for S {} | |
any_impl!(ColorChooserWidgetBase, ColorChooserWidgetImpl); | |
pub unsafe trait ColorChooserWidgetBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ColorChooser>{ | |
} | |
pub unsafe trait ColorChooserWidgetClassExt<T: ColorChooserWidgetBase> | |
where | |
T::ImplType: ColorChooserWidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkColorChooserWidgetClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ColorChooserWidget(Object<InstanceStruct<ColorChooserWidget>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::ColorChooser => gtk_ffi::GtkColorChooser] ; | |
match fn { | |
get_type => || get_type::<ColorChooserWidget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ColorChooser>> ColorChooserWidgetBase for T {} | |
pub type ColorChooserWidgetClass = ClassStruct<ColorChooserWidget>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl ContainerClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl WidgetClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl InitiallyUnownedClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl BuildableClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl OrientableClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
unsafe impl ColorChooserClassExt<ColorChooserWidget> for ColorChooserWidgetClass {} | |
#[macro_export] | |
macro_rules! box_colorchooserwidget_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::color_chooser_widget::ColorChooserWidgetBase> $crate::color_chooser_widget::ColorChooserWidgetImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ColorChooserWidget{ | |
const NAME: &'static str = "RsGtk.ColorChooserWidget"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<ColorChooserWidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ColorChooserWidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
ColorChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use ScrollType; | |
use SensitivityType; | |
use TreeIter; | |
use TreeModel; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ComboBoxImpl<T: ComboBoxBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::CellEditableImpl<T> + gtk_subclass::CellLayoutImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn changed(&self, combo_box: &T){ | |
combo_box.parent_changed() | |
} | |
fn format_entry_text(&self, combo_box: &T, path: &str) -> Option<String>{ | |
combo_box.parent_format_entry_text(path) | |
} | |
} | |
pub trait ComboBoxImplExt<T> {} | |
} | |
impl<S: ComboBoxImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>>> ComboBoxImplExt<T> for S {} | |
any_impl!(ComboBoxBase, ComboBoxImpl); | |
pub unsafe trait ComboBoxBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>{ | |
fn parent_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkComboBoxClass; | |
(*parent_klass) | |
.changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_format_entry_text(&self, path: &str) -> Option<String>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkComboBoxClass; | |
(*parent_klass) | |
.format_entry_text | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ComboBoxClassExt<T: ComboBoxBase> | |
where | |
T::ImplType: ComboBoxImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkComboBoxClass); | |
klass.changed = Some(combobox_changed::<T>); | |
klass.format_entry_text = Some(combobox_format_entry_text::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ComboBox(Object<InstanceStruct<ComboBox>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::CellEditable => gtk_ffi::GtkCellEditable | |
gtk::CellLayout => gtk_ffi::GtkCellLayout] ; | |
match fn { | |
get_type => || get_type::<ComboBox>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>> ComboBoxBase for T {} | |
pub type ComboBoxClass = ClassStruct<ComboBox>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl ContainerClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl WidgetClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl InitiallyUnownedClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl ImplementorIfaceClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl BuildableClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl CellEditableClassExt<ComboBox> for ComboBoxClass {} | |
unsafe impl CellLayoutClassExt<ComboBox> for ComboBoxClass {} | |
#[macro_export] | |
macro_rules! box_combobox_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::combo_box::ComboBoxBase> $crate::combo_box::ComboBoxImpl<T> for Box<$name<T>>{ | |
fn changed(&self, combo_box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.changed() | |
} | |
fn format_entry_text(&self, combo_box: &T, path: &str) -> Option<String>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.format_entry_text(path) | |
} | |
} | |
} | |
); | |
impl ObjectType for ComboBox{ | |
const NAME: &'static str = "RsGtk.ComboBox"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ComboBoxImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ComboBoxClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
CellEditableClassExt::override_vfuncs(klass, token); | |
CellLayoutClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn combobox_changed<T: ComboBoxBase> | |
(ptr: *mut GtkComboBox) | |
where | |
T::ImplType: ComboBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let combobox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = combobox.get_impl(); | |
imp.changed() | |
} | |
unsafe extern "C" fn combobox_format_entry_text<T: ComboBoxBase> | |
(ptr: *mut GtkComboBox, path: *const c_char) -> *mut c_char | |
where | |
T::ImplType: ComboBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let combobox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = combobox.get_impl(); | |
imp.format_entry_text() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use ComboBox; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ComboBoxTextImpl<T: ComboBoxTextBase>: gtk_subclass::ComboBoxImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::CellEditableImpl<T> + gtk_subclass::CellLayoutImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ComboBoxTextImplExt<T> {} | |
} | |
impl<S: ComboBoxTextImpl<T>, T: ObjectType + glib::IsA<gtk::ComboBox> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>>> ComboBoxTextImplExt<T> for S {} | |
any_impl!(ComboBoxTextBase, ComboBoxTextImpl); | |
pub unsafe trait ComboBoxTextBase: ObjectType + glib::IsA<gtk::ComboBox> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>{ | |
} | |
pub unsafe trait ComboBoxTextClassExt<T: ComboBoxTextBase> | |
where | |
T::ImplType: ComboBoxTextImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkComboBoxTextClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ComboBoxText(Object<InstanceStruct<ComboBoxText>>):[ | |
gtk::ComboBox => gtk_ffi::GtkComboBox | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::CellEditable => gtk_ffi::GtkCellEditable | |
gtk::CellLayout => gtk_ffi::GtkCellLayout] ; | |
match fn { | |
get_type => || get_type::<ComboBoxText>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::ComboBox> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::CellLayout>> ComboBoxTextBase for T {} | |
pub type ComboBoxTextClass = ClassStruct<ComboBoxText>; | |
// FIXME: Boilerplate | |
unsafe impl ComboBoxClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl BinClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl ContainerClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl WidgetClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl InitiallyUnownedClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl ImplementorIfaceClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl BuildableClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl CellEditableClassExt<ComboBoxText> for ComboBoxTextClass {} | |
unsafe impl CellLayoutClassExt<ComboBoxText> for ComboBoxTextClass {} | |
#[macro_export] | |
macro_rules! box_comboboxtext_impl( | |
($name:ident) => { | |
box_combobox_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::combo_box_text::ComboBoxTextBase> $crate::combo_box_text::ComboBoxTextImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ComboBoxText{ | |
const NAME: &'static str = "RsGtk.ComboBoxText"; | |
type ParentType = gtk::ComboBox; | |
type ImplType = Box<ComboBoxTextImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ComboBoxTextClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ComboBoxClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
CellEditableClassExt::override_vfuncs(klass, token); | |
CellLayoutClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use ResizeMode; | |
use Widget; | |
use WidgetPath; | |
use ffi; | |
use glib; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ContainerImpl<T: ContainerBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn add(&self, container: &T, widget: &Widget){ | |
container.parent_add(widget) | |
} | |
fn check_resize(&self, container: &T){ | |
container.parent_check_resize() | |
} | |
fn child_type(&self, container: &T) -> glib::types::Type{ | |
container.parent_child_type() | |
} | |
fn composite_name(&self, container: &T, child: &Widget) -> Option<String>{ | |
container.parent_composite_name(child) | |
} | |
fn forall(&self, container: &T, include_internals: bool, callback: /*Unknown conversion*//*Unimplemented*/Callback, callback_data: /*Unimplemented*/Option<Fundamental: Pointer>){ | |
container.parent_forall(include_internals, callback, callback_data) | |
} | |
fn get_child_property(&self, container: &T, child: &Widget, property_id: u32, value: &mut glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
container.parent_get_child_property(child, property_id, value, pspec) | |
} | |
fn get_path_for_child(&self, container: &T, child: &Widget) -> Option<WidgetPath>{ | |
container.parent_get_path_for_child(child) | |
} | |
fn remove(&self, container: &T, widget: &Widget){ | |
container.parent_remove(widget) | |
} | |
fn set_child_property(&self, container: &T, child: &Widget, property_id: u32, value: &glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
container.parent_set_child_property(child, property_id, value, pspec) | |
} | |
fn set_focus_child(&self, container: &T, child: Option<&Widget>){ | |
container.parent_set_focus_child(child) | |
} | |
} | |
pub trait ContainerImplExt<T> {} | |
} | |
impl<S: ContainerImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ContainerImplExt<T> for S {} | |
any_impl!(ContainerBase, ContainerImpl); | |
pub unsafe trait ContainerBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_add(&self, widget: &Widget){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.add | |
.map(|f|{ f(self.to_glib_none().0,widget.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_check_resize(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.check_resize | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_child_type(&self) -> glib::types::Type{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.child_type | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_composite_name(&self, child: &Widget) -> Option<String>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.composite_name | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_forall(&self, include_internals: bool, callback: /*Unknown conversion*//*Unimplemented*/Callback, callback_data: /*Unimplemented*/Option<Fundamental: Pointer>){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.forall | |
.map(|f|{ f(self.to_glib_none().0,include_internals.to_glib(),/*Unknown conversion*/callback,callback_data.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_child_property(&self, child: &Widget, property_id: u32, value: &mut glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.get_child_property | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,property_id,value.to_glib_none_mut().0,pspec.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_path_for_child(&self, child: &Widget) -> Option<WidgetPath>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.get_path_for_child | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_remove(&self, widget: &Widget){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.remove | |
.map(|f|{ f(self.to_glib_none().0,widget.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_child_property(&self, child: &Widget, property_id: u32, value: &glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.set_child_property | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,property_id,value.to_glib_none().0,pspec.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_focus_child(&self, child: Option<&Widget>){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkContainerClass; | |
(*parent_klass) | |
.set_focus_child | |
.map(|f|{ f(self.to_glib_none().0,child.0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ContainerClassExt<T: ContainerBase> | |
where | |
T::ImplType: ContainerImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkContainerClass); | |
klass.add = Some(container_add::<T>); | |
klass.check_resize = Some(container_check_resize::<T>); | |
klass.child_type = Some(container_child_type::<T>); | |
klass.composite_name = Some(container_composite_name::<T>); | |
klass.forall = Some(container_forall::<T>); | |
klass.get_child_property = Some(container_get_child_property::<T>); | |
klass.get_path_for_child = Some(container_get_path_for_child::<T>); | |
klass.remove = Some(container_remove::<T>); | |
klass.set_child_property = Some(container_set_child_property::<T>); | |
klass.set_focus_child = Some(container_set_focus_child::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Container(Object<InstanceStruct<Container>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Container>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ContainerBase for T {} | |
pub type ContainerClass = ClassStruct<Container>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<Container> for ContainerClass {} | |
unsafe impl InitiallyUnownedClassExt<Container> for ContainerClass {} | |
unsafe impl ImplementorIfaceClassExt<Container> for ContainerClass {} | |
unsafe impl BuildableClassExt<Container> for ContainerClass {} | |
#[macro_export] | |
macro_rules! box_container_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::container::ContainerBase> $crate::container::ContainerImpl<T> for Box<$name<T>>{ | |
fn add(&self, container: &T, widget: &Widget){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.add(widget) | |
} | |
fn check_resize(&self, container: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.check_resize() | |
} | |
fn child_type(&self, container: &T) -> glib::types::Type{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.child_type() | |
} | |
fn composite_name(&self, container: &T, child: &Widget) -> Option<String>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.composite_name(child) | |
} | |
fn forall(&self, container: &T, include_internals: bool, callback: /*Unknown conversion*//*Unimplemented*/Callback, callback_data: /*Unimplemented*/Option<Fundamental: Pointer>){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.forall(include_internals, callback, callback_data) | |
} | |
fn get_child_property(&self, container: &T, child: &Widget, property_id: u32, value: &mut glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_child_property(child, property_id, value, pspec) | |
} | |
fn get_path_for_child(&self, container: &T, child: &Widget) -> Option<WidgetPath>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_path_for_child(child) | |
} | |
fn remove(&self, container: &T, widget: &Widget){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.remove(widget) | |
} | |
fn set_child_property(&self, container: &T, child: &Widget, property_id: u32, value: &glib::Value, pspec: /*Ignored*/&glib::ParamSpec){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_child_property(child, property_id, value, pspec) | |
} | |
fn set_focus_child(&self, container: &T, child: Option<&Widget>){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_focus_child(child) | |
} | |
} | |
} | |
); | |
impl ObjectType for Container{ | |
const NAME: &'static str = "RsGtk.Container"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<ContainerImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ContainerClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn container_add<T: ContainerBase> | |
(ptr: *mut GtkContainer, widget: *mut GtkWidget) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.add() | |
} | |
unsafe extern "C" fn container_check_resize<T: ContainerBase> | |
(ptr: *mut GtkContainer) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.check_resize() | |
} | |
unsafe extern "C" fn container_child_type<T: ContainerBase> | |
(ptr: *mut GtkContainer) -> GType | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.child_type() | |
} | |
unsafe extern "C" fn container_composite_name<T: ContainerBase> | |
(ptr: *mut GtkContainer, child: *mut GtkWidget) -> *mut c_char | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.composite_name() | |
} | |
unsafe extern "C" fn container_forall<T: ContainerBase> | |
(ptr: *mut GtkContainer, include_internals: gboolean, callback: GtkCallback, callback_data: gpointer) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.forall() | |
} | |
unsafe extern "C" fn container_get_child_property<T: ContainerBase> | |
(ptr: *mut GtkContainer, child: *mut GtkWidget, property_id: c_uint, value: *mut gobject::GValue, pspec: *mut gobject::GParamSpec) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.get_child_property() | |
} | |
unsafe extern "C" fn container_get_path_for_child<T: ContainerBase> | |
(ptr: *mut GtkContainer, child: *mut GtkWidget) -> *mut GtkWidgetPath | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.get_path_for_child() | |
} | |
unsafe extern "C" fn container_remove<T: ContainerBase> | |
(ptr: *mut GtkContainer, widget: *mut GtkWidget) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.remove() | |
} | |
unsafe extern "C" fn container_set_child_property<T: ContainerBase> | |
(ptr: *mut GtkContainer, child: *mut GtkWidget, property_id: c_uint, value: *const gobject::GValue, pspec: *mut gobject::GParamSpec) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.set_child_property() | |
} | |
unsafe extern "C" fn container_set_focus_child<T: ContainerBase> | |
(ptr: *mut GtkContainer, child: *mut GtkWidget) | |
where | |
T::ImplType: ContainerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let container = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = container.get_impl(); | |
imp.set_focus_child() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use ffi; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::fmt; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait CssProviderImpl<T: CssProviderBase>: gtk_subclass::StyleProviderImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn parsing_error(&self, provider: &T, section: /*Ignored*/&CssSection, error: &Error){ | |
provider.parent_parsing_error(section, error) | |
} | |
} | |
pub trait CssProviderImplExt<T> {} | |
} | |
impl<S: CssProviderImpl<T>, T: ObjectType + glib::IsA<gtk::StyleProvider>>> CssProviderImplExt<T> for S {} | |
any_impl!(CssProviderBase, CssProviderImpl); | |
pub unsafe trait CssProviderBase: ObjectType + glib::IsA<gtk::StyleProvider>{ | |
fn parent_parsing_error(&self, section: /*Ignored*/&CssSection, error: &Error){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkCssProviderClass; | |
(*parent_klass) | |
.parsing_error | |
.map(|f|{ f(self.to_glib_none().0,section.to_glib_none().0,error.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait CssProviderClassExt<T: CssProviderBase> | |
where | |
T::ImplType: CssProviderImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkCssProviderClass); | |
klass.parsing_error = Some(cssprovider_parsing_error::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct CssProvider(Object<InstanceStruct<CssProvider>>):[ | |
gtk::StyleProvider => gtk_ffi::GtkStyleProvider] ; | |
match fn { | |
get_type => || get_type::<CssProvider>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::StyleProvider>> CssProviderBase for T {} | |
pub type CssProviderClass = ClassStruct<CssProvider>; | |
// FIXME: Boilerplate | |
unsafe impl StyleProviderClassExt<CssProvider> for CssProviderClass {} | |
#[macro_export] | |
macro_rules! box_cssprovider_impl( | |
($name:ident) => { | |
impl<T: $crate::css_provider::CssProviderBase> $crate::css_provider::CssProviderImpl<T> for Box<$name<T>>{ | |
fn parsing_error(&self, provider: &T, section: /*Ignored*/&CssSection, error: &Error){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.parsing_error(section, error) | |
} | |
} | |
} | |
); | |
impl ObjectType for CssProvider{ | |
const NAME: &'static str = "RsGtk.CssProvider"; | |
type ImplType = Box<CssProviderImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut CssProviderClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
StyleProviderClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn cssprovider_parsing_error<T: CssProviderBase> | |
(ptr: *mut GtkCssProvider, section: *mut GtkCssSection, error: *const glib::GError) | |
where | |
T::ImplType: CssProviderImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let cssprovider = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = cssprovider.get_impl(); | |
imp.parsing_error() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Box; | |
use Container; | |
use Widget; | |
use Window; | |
use ffi; | |
use glib; | |
#[cfg(any(feature = "v3_12", feature = "dox"))] | |
use glib::StaticType; | |
#[cfg(any(feature = "v3_12", feature = "dox"))] | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait DialogImpl<T: DialogBase>: gtk_subclass::WindowImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn close(&self, dialog: &T){ | |
dialog.parent_close() | |
} | |
fn response(&self, dialog: &T, response_id: i32){ | |
dialog.parent_response(response_id) | |
} | |
} | |
pub trait DialogImplExt<T> {} | |
} | |
impl<S: DialogImpl<T>, T: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> DialogImplExt<T> for S {} | |
any_impl!(DialogBase, DialogImpl); | |
pub unsafe trait DialogBase: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_close(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkDialogClass; | |
(*parent_klass) | |
.close | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_response(&self, response_id: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkDialogClass; | |
(*parent_klass) | |
.response | |
.map(|f|{ f(self.to_glib_none().0,response_id) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait DialogClassExt<T: DialogBase> | |
where | |
T::ImplType: DialogImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkDialogClass); | |
klass.close = Some(dialog_close::<T>); | |
klass.response = Some(dialog_response::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Dialog(Object<InstanceStruct<Dialog>>):[ | |
gtk::Window => gtk_ffi::GtkWindow | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Dialog>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Window> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> DialogBase for T {} | |
pub type DialogClass = ClassStruct<Dialog>; | |
// FIXME: Boilerplate | |
unsafe impl WindowClassExt<Dialog> for DialogClass {} | |
unsafe impl BinClassExt<Dialog> for DialogClass {} | |
unsafe impl ContainerClassExt<Dialog> for DialogClass {} | |
unsafe impl WidgetClassExt<Dialog> for DialogClass {} | |
unsafe impl InitiallyUnownedClassExt<Dialog> for DialogClass {} | |
unsafe impl ImplementorIfaceClassExt<Dialog> for DialogClass {} | |
unsafe impl BuildableClassExt<Dialog> for DialogClass {} | |
#[macro_export] | |
macro_rules! box_dialog_impl( | |
($name:ident) => { | |
box_window_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::dialog::DialogBase> $crate::dialog::DialogImpl<T> for Box<$name<T>>{ | |
fn close(&self, dialog: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.close() | |
} | |
fn response(&self, dialog: &T, response_id: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.response(response_id) | |
} | |
} | |
} | |
); | |
impl ObjectType for Dialog{ | |
const NAME: &'static str = "RsGtk.Dialog"; | |
type ParentType = gtk::Window; | |
type ImplType = Box<DialogImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut DialogClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WindowClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn dialog_close<T: DialogBase> | |
(ptr: *mut GtkDialog) | |
where | |
T::ImplType: DialogImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let dialog = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = dialog.get_impl(); | |
imp.close() | |
} | |
unsafe extern "C" fn dialog_response<T: DialogBase> | |
(ptr: *mut GtkDialog, response_id: c_int) | |
where | |
T::ImplType: DialogImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let dialog = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = dialog.get_impl(); | |
imp.response() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait DrawingAreaImpl<T: DrawingAreaBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait DrawingAreaImplExt<T> {} | |
} | |
impl<S: DrawingAreaImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> DrawingAreaImplExt<T> for S {} | |
any_impl!(DrawingAreaBase, DrawingAreaImpl); | |
pub unsafe trait DrawingAreaBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait DrawingAreaClassExt<T: DrawingAreaBase> | |
where | |
T::ImplType: DrawingAreaImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkDrawingAreaClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct DrawingArea(Object<InstanceStruct<DrawingArea>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<DrawingArea>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> DrawingAreaBase for T {} | |
pub type DrawingAreaClass = ClassStruct<DrawingArea>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<DrawingArea> for DrawingAreaClass {} | |
unsafe impl InitiallyUnownedClassExt<DrawingArea> for DrawingAreaClass {} | |
unsafe impl ImplementorIfaceClassExt<DrawingArea> for DrawingAreaClass {} | |
unsafe impl BuildableClassExt<DrawingArea> for DrawingAreaClass {} | |
#[macro_export] | |
macro_rules! box_drawingarea_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::drawing_area::DrawingAreaBase> $crate::drawing_area::DrawingAreaImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for DrawingArea{ | |
const NAME: &'static str = "RsGtk.DrawingArea"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<DrawingAreaImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut DrawingAreaClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait EventBoxImpl<T: EventBoxBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait EventBoxImplExt<T> {} | |
} | |
impl<S: EventBoxImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> EventBoxImplExt<T> for S {} | |
any_impl!(EventBoxBase, EventBoxImpl); | |
pub unsafe trait EventBoxBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait EventBoxClassExt<T: EventBoxBase> | |
where | |
T::ImplType: EventBoxImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkEventBoxClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct EventBox(Object<InstanceStruct<EventBox>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<EventBox>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> EventBoxBase for T {} | |
pub type EventBoxClass = ClassStruct<EventBox>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<EventBox> for EventBoxClass {} | |
unsafe impl ContainerClassExt<EventBox> for EventBoxClass {} | |
unsafe impl WidgetClassExt<EventBox> for EventBoxClass {} | |
unsafe impl InitiallyUnownedClassExt<EventBox> for EventBoxClass {} | |
unsafe impl ImplementorIfaceClassExt<EventBox> for EventBoxClass {} | |
unsafe impl BuildableClassExt<EventBox> for EventBoxClass {} | |
#[macro_export] | |
macro_rules! box_eventbox_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::event_box::EventBoxBase> $crate::event_box::EventBoxImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for EventBox{ | |
const NAME: &'static str = "RsGtk.EventBox"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<EventBoxImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut EventBoxClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ExpanderImpl<T: ExpanderBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate(&self, expander: &T){ | |
expander.parent_activate() | |
} | |
} | |
pub trait ExpanderImplExt<T> {} | |
} | |
impl<S: ExpanderImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ExpanderImplExt<T> for S {} | |
any_impl!(ExpanderBase, ExpanderImpl); | |
pub unsafe trait ExpanderBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_activate(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkExpanderClass; | |
(*parent_klass) | |
.activate | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ExpanderClassExt<T: ExpanderBase> | |
where | |
T::ImplType: ExpanderImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkExpanderClass); | |
klass.activate = Some(expander_activate::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Expander(Object<InstanceStruct<Expander>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Expander>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ExpanderBase for T {} | |
pub type ExpanderClass = ClassStruct<Expander>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Expander> for ExpanderClass {} | |
unsafe impl ContainerClassExt<Expander> for ExpanderClass {} | |
unsafe impl WidgetClassExt<Expander> for ExpanderClass {} | |
unsafe impl InitiallyUnownedClassExt<Expander> for ExpanderClass {} | |
unsafe impl ImplementorIfaceClassExt<Expander> for ExpanderClass {} | |
unsafe impl BuildableClassExt<Expander> for ExpanderClass {} | |
#[macro_export] | |
macro_rules! box_expander_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::expander::ExpanderBase> $crate::expander::ExpanderImpl<T> for Box<$name<T>>{ | |
fn activate(&self, expander: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate() | |
} | |
} | |
} | |
); | |
impl ObjectType for Expander{ | |
const NAME: &'static str = "RsGtk.Expander"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ExpanderImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ExpanderClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn expander_activate<T: ExpanderBase> | |
(ptr: *mut GtkExpander) | |
where | |
T::ImplType: ExpanderImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let expander = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = expander.get_impl(); | |
imp.activate() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use FileChooserAction; | |
use FileChooserConfirmation; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType >> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType { | |
} | |
glib_wrapper! { | |
pub struct FileChooser(Object<InstanceStruct<FileChooser>>) ; | |
match fn { | |
get_type => || get_type::<FileChooser>(), | |
} | |
} | |
unsafe impl<T: ObjectType > for T {} | |
pub type FileChooserClass = ClassStruct<FileChooser>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_filechooser_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::file_chooser::> $crate::file_chooser::<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for FileChooser{ | |
const NAME: &'static str = "RsGtk.FileChooser"; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FileChooserClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use FileChooser; | |
use FileChooserAction; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FileChooserWidgetImpl<T: FileChooserWidgetBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::FileChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait FileChooserWidgetImplExt<T> {} | |
} | |
impl<S: FileChooserWidgetImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FileChooser>>> FileChooserWidgetImplExt<T> for S {} | |
any_impl!(FileChooserWidgetBase, FileChooserWidgetImpl); | |
pub unsafe trait FileChooserWidgetBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FileChooser>{ | |
} | |
pub unsafe trait FileChooserWidgetClassExt<T: FileChooserWidgetBase> | |
where | |
T::ImplType: FileChooserWidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFileChooserWidgetClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct FileChooserWidget(Object<InstanceStruct<FileChooserWidget>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::FileChooser => gtk_ffi::GtkFileChooser] ; | |
match fn { | |
get_type => || get_type::<FileChooserWidget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FileChooser>> FileChooserWidgetBase for T {} | |
pub type FileChooserWidgetClass = ClassStruct<FileChooserWidget>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl ContainerClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl WidgetClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl InitiallyUnownedClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl BuildableClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl OrientableClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
unsafe impl FileChooserClassExt<FileChooserWidget> for FileChooserWidgetClass {} | |
#[macro_export] | |
macro_rules! box_filechooserwidget_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
box_filechooser_impl!($name); | |
impl<T: $crate::file_chooser_widget::FileChooserWidgetBase> $crate::file_chooser_widget::FileChooserWidgetImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for FileChooserWidget{ | |
const NAME: &'static str = "RsGtk.FileChooserWidget"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<FileChooserWidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FileChooserWidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
FileChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FixedImpl<T: FixedBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait FixedImplExt<T> {} | |
} | |
impl<S: FixedImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> FixedImplExt<T> for S {} | |
any_impl!(FixedBase, FixedImpl); | |
pub unsafe trait FixedBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait FixedClassExt<T: FixedBase> | |
where | |
T::ImplType: FixedImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFixedClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Fixed(Object<InstanceStruct<Fixed>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Fixed>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> FixedBase for T {} | |
pub type FixedClass = ClassStruct<Fixed>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Fixed> for FixedClass {} | |
unsafe impl WidgetClassExt<Fixed> for FixedClass {} | |
unsafe impl InitiallyUnownedClassExt<Fixed> for FixedClass {} | |
unsafe impl ImplementorIfaceClassExt<Fixed> for FixedClass {} | |
unsafe impl BuildableClassExt<Fixed> for FixedClass {} | |
#[macro_export] | |
macro_rules! box_fixed_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::fixed::FixedBase> $crate::fixed::FixedImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Fixed{ | |
const NAME: &'static str = "RsGtk.Fixed"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<FixedImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FixedClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_12", feature = "dox"))] | |
use Adjustment; | |
use Container; | |
use FlowBoxChild; | |
use MovementStep; | |
use Orientable; | |
use SelectionMode; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FlowBoxImpl<T: FlowBoxBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate_cursor_child(&self, box: &T){ | |
box.parent_activate_cursor_child() | |
} | |
fn child_activated(&self, box: &T, child: &FlowBoxChild){ | |
box.parent_child_activated(child) | |
} | |
fn move_cursor(&self, box: &T, step: MovementStep, count: i32) -> bool{ | |
box.parent_move_cursor(step, count) | |
} | |
fn select_all(&self, box: &T){ | |
box.parent_select_all() | |
} | |
fn selected_children_changed(&self, box: &T){ | |
box.parent_selected_children_changed() | |
} | |
fn toggle_cursor_child(&self, box: &T){ | |
box.parent_toggle_cursor_child() | |
} | |
fn unselect_all(&self, box: &T){ | |
box.parent_unselect_all() | |
} | |
} | |
pub trait FlowBoxImplExt<T> {} | |
} | |
impl<S: FlowBoxImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> FlowBoxImplExt<T> for S {} | |
any_impl!(FlowBoxBase, FlowBoxImpl); | |
pub unsafe trait FlowBoxBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_activate_cursor_child(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.activate_cursor_child | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_child_activated(&self, child: &FlowBoxChild){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.child_activated | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_cursor(&self, step: MovementStep, count: i32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.move_cursor | |
.map(|f|{ f(self.to_glib_none().0,step.to_glib(),count) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_all(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.select_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selected_children_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.selected_children_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_toggle_cursor_child(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.toggle_cursor_child | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unselect_all(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxClass; | |
(*parent_klass) | |
.unselect_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait FlowBoxClassExt<T: FlowBoxBase> | |
where | |
T::ImplType: FlowBoxImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFlowBoxClass); | |
klass.activate_cursor_child = Some(flowbox_activate_cursor_child::<T>); | |
klass.child_activated = Some(flowbox_child_activated::<T>); | |
klass.move_cursor = Some(flowbox_move_cursor::<T>); | |
klass.select_all = Some(flowbox_select_all::<T>); | |
klass.selected_children_changed = Some(flowbox_selected_children_changed::<T>); | |
klass.toggle_cursor_child = Some(flowbox_toggle_cursor_child::<T>); | |
klass.unselect_all = Some(flowbox_unselect_all::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct FlowBox(Object<InstanceStruct<FlowBox>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<FlowBox>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> FlowBoxBase for T {} | |
pub type FlowBoxClass = ClassStruct<FlowBox>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<FlowBox> for FlowBoxClass {} | |
unsafe impl WidgetClassExt<FlowBox> for FlowBoxClass {} | |
unsafe impl InitiallyUnownedClassExt<FlowBox> for FlowBoxClass {} | |
unsafe impl ImplementorIfaceClassExt<FlowBox> for FlowBoxClass {} | |
unsafe impl BuildableClassExt<FlowBox> for FlowBoxClass {} | |
unsafe impl OrientableClassExt<FlowBox> for FlowBoxClass {} | |
#[macro_export] | |
macro_rules! box_flowbox_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::flow_box::FlowBoxBase> $crate::flow_box::FlowBoxImpl<T> for Box<$name<T>>{ | |
fn activate_cursor_child(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate_cursor_child() | |
} | |
fn child_activated(&self, box: &T, child: &FlowBoxChild){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.child_activated(child) | |
} | |
fn move_cursor(&self, box: &T, step: MovementStep, count: i32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_cursor(step, count) | |
} | |
fn select_all(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_all() | |
} | |
fn selected_children_changed(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selected_children_changed() | |
} | |
fn toggle_cursor_child(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.toggle_cursor_child() | |
} | |
fn unselect_all(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unselect_all() | |
} | |
} | |
} | |
); | |
impl ObjectType for FlowBox{ | |
const NAME: &'static str = "RsGtk.FlowBox"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<FlowBoxImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FlowBoxClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn flowbox_activate_cursor_child<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.activate_cursor_child() | |
} | |
unsafe extern "C" fn flowbox_child_activated<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox, child: *mut GtkFlowBoxChild) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.child_activated() | |
} | |
unsafe extern "C" fn flowbox_move_cursor<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox, step: GtkMovementStep, count: c_int) -> gboolean | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.move_cursor() | |
} | |
unsafe extern "C" fn flowbox_select_all<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.select_all() | |
} | |
unsafe extern "C" fn flowbox_selected_children_changed<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.selected_children_changed() | |
} | |
unsafe extern "C" fn flowbox_toggle_cursor_child<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.toggle_cursor_child() | |
} | |
unsafe extern "C" fn flowbox_unselect_all<T: FlowBoxBase> | |
(ptr: *mut GtkFlowBox) | |
where | |
T::ImplType: FlowBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowbox.get_impl(); | |
imp.unselect_all() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FlowBoxChildImpl<T: FlowBoxChildBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate(&self, child: &T){ | |
child.parent_activate() | |
} | |
} | |
pub trait FlowBoxChildImplExt<T> {} | |
} | |
impl<S: FlowBoxChildImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> FlowBoxChildImplExt<T> for S {} | |
any_impl!(FlowBoxChildBase, FlowBoxChildImpl); | |
pub unsafe trait FlowBoxChildBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_activate(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFlowBoxChildClass; | |
(*parent_klass) | |
.activate | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait FlowBoxChildClassExt<T: FlowBoxChildBase> | |
where | |
T::ImplType: FlowBoxChildImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFlowBoxChildClass); | |
klass.activate = Some(flowboxchild_activate::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct FlowBoxChild(Object<InstanceStruct<FlowBoxChild>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<FlowBoxChild>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> FlowBoxChildBase for T {} | |
pub type FlowBoxChildClass = ClassStruct<FlowBoxChild>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
unsafe impl ContainerClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
unsafe impl WidgetClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
unsafe impl InitiallyUnownedClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
unsafe impl ImplementorIfaceClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
unsafe impl BuildableClassExt<FlowBoxChild> for FlowBoxChildClass {} | |
#[macro_export] | |
macro_rules! box_flowboxchild_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::flow_box_child::FlowBoxChildBase> $crate::flow_box_child::FlowBoxChildImpl<T> for Box<$name<T>>{ | |
fn activate(&self, child: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate() | |
} | |
} | |
} | |
); | |
impl ObjectType for FlowBoxChild{ | |
const NAME: &'static str = "RsGtk.FlowBoxChild"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<FlowBoxChildImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FlowBoxChildClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn flowboxchild_activate<T: FlowBoxChildBase> | |
(ptr: *mut GtkFlowBoxChild) | |
where | |
T::ImplType: FlowBoxChildImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let flowboxchild = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = flowboxchild.get_impl(); | |
imp.activate() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: ObjectImpl<T> + AnyImpl + 'static { | |
fn font_activated(&self, chooser: &T, fontname: &str){ | |
chooser.parent_font_activated(fontname) | |
} | |
fn get_font_face(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontFace>{ | |
fontchooser.parent_get_font_face() | |
} | |
fn get_font_family(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontFamily>{ | |
fontchooser.parent_get_font_family() | |
} | |
fn get_font_map(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontMap>{ | |
fontchooser.parent_get_font_map() | |
} | |
fn get_font_size(&self, fontchooser: &T) -> i32{ | |
fontchooser.parent_get_font_size() | |
} | |
fn set_filter_func(&self, fontchooser: &T, filter: /*Unknown conversion*//*Unimplemented*/FontFilterFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
fontchooser.parent_set_filter_func(filter, destroy) | |
} | |
fn set_font_map(&self, fontchooser: &T, fontmap: /*Ignored*/Option<&pango::FontMap>){ | |
fontchooser.parent_set_font_map(fontmap) | |
} | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType >> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType { | |
fn parent_font_activated(&self, fontname: &str){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.font_activated | |
.map(|f|{ f(self.to_glib_none().0,fontname.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_font_face(&self) -> /*Ignored*/Option<pango::FontFace>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.get_font_face | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_font_family(&self) -> /*Ignored*/Option<pango::FontFamily>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.get_font_family | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_font_map(&self) -> /*Ignored*/Option<pango::FontMap>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.get_font_map | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_font_size(&self) -> i32{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.get_font_size | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_filter_func(&self, filter: /*Unknown conversion*//*Unimplemented*/FontFilterFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.set_filter_func | |
.map(|f|{ f(self.to_glib_none().0,/*Unknown conversion*/filter,Box::into_raw(user_data) as *mut _,/*Unknown conversion*/destroy) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_font_map(&self, fontmap: /*Ignored*/Option<&pango::FontMap>){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFontChooserIface; | |
(*parent_klass) | |
.set_font_map | |
.map(|f|{ f(self.to_glib_none().0,fontmap.0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait FontChooserIfaceExt<T: > | |
where | |
T::ImplType: <T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFontChooserIface); | |
klass.font_activated = Some(fontchooser_font_activated::<T>); | |
klass.get_font_face = Some(fontchooser_get_font_face::<T>); | |
klass.get_font_family = Some(fontchooser_get_font_family::<T>); | |
klass.get_font_map = Some(fontchooser_get_font_map::<T>); | |
klass.get_font_size = Some(fontchooser_get_font_size::<T>); | |
klass.set_filter_func = Some(fontchooser_set_filter_func::<T>); | |
klass.set_font_map = Some(fontchooser_set_font_map::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct FontChooser(Object<InstanceStruct<FontChooser>>) ; | |
match fn { | |
get_type => || get_type::<FontChooser>(), | |
} | |
} | |
unsafe impl<T: ObjectType > for T {} | |
pub type FontChooserClass = ClassStruct<FontChooser>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_fontchooser_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::font_chooser::> $crate::font_chooser::<T> for Box<$name<T>>{ | |
fn font_activated(&self, chooser: &T, fontname: &str){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.font_activated(fontname) | |
} | |
fn get_font_face(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontFace>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_font_face() | |
} | |
fn get_font_family(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontFamily>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_font_family() | |
} | |
fn get_font_map(&self, fontchooser: &T) -> /*Ignored*/Option<pango::FontMap>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_font_map() | |
} | |
fn get_font_size(&self, fontchooser: &T) -> i32{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_font_size() | |
} | |
fn set_filter_func(&self, fontchooser: &T, filter: /*Unknown conversion*//*Unimplemented*/FontFilterFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_filter_func(filter, destroy) | |
} | |
fn set_font_map(&self, fontchooser: &T, fontmap: /*Ignored*/Option<&pango::FontMap>){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_font_map(fontmap) | |
} | |
} | |
} | |
); | |
impl ObjectType for FontChooser{ | |
const NAME: &'static str = "RsGtk.FontChooser"; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FontChooserClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn fontchooser_font_activated<T: > | |
(ptr: *mut GtkFontChooser, fontname: *const c_char) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.font_activated() | |
} | |
unsafe extern "C" fn fontchooser_get_font_face<T: > | |
(ptr: *mut GtkFontChooser) -> *mut pango::PangoFontFace | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.get_font_face() | |
} | |
unsafe extern "C" fn fontchooser_get_font_family<T: > | |
(ptr: *mut GtkFontChooser) -> *mut pango::PangoFontFamily | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.get_font_family() | |
} | |
unsafe extern "C" fn fontchooser_get_font_map<T: > | |
(ptr: *mut GtkFontChooser) -> *mut pango::PangoFontMap | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.get_font_map() | |
} | |
unsafe extern "C" fn fontchooser_get_font_size<T: > | |
(ptr: *mut GtkFontChooser) -> c_int | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.get_font_size() | |
} | |
unsafe extern "C" fn fontchooser_set_filter_func<T: > | |
(ptr: *mut GtkFontChooser, filter: GtkFontFilterFunc, user_data: gpointer, destroy: glib::GDestroyNotify) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.set_filter_func() | |
} | |
unsafe extern "C" fn fontchooser_set_font_map<T: > | |
(ptr: *mut GtkFontChooser, fontmap: *mut pango::PangoFontMap) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let fontchooser = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = fontchooser.get_impl(); | |
imp.set_font_map() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use FontChooser; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FontChooserWidgetImpl<T: FontChooserWidgetBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::FontChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait FontChooserWidgetImplExt<T> {} | |
} | |
impl<S: FontChooserWidgetImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FontChooser>>> FontChooserWidgetImplExt<T> for S {} | |
any_impl!(FontChooserWidgetBase, FontChooserWidgetImpl); | |
pub unsafe trait FontChooserWidgetBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FontChooser>{ | |
} | |
pub unsafe trait FontChooserWidgetClassExt<T: FontChooserWidgetBase> | |
where | |
T::ImplType: FontChooserWidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFontChooserWidgetClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct FontChooserWidget(Object<InstanceStruct<FontChooserWidget>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::FontChooser => gtk_ffi::GtkFontChooser] ; | |
match fn { | |
get_type => || get_type::<FontChooserWidget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::FontChooser>> FontChooserWidgetBase for T {} | |
pub type FontChooserWidgetClass = ClassStruct<FontChooserWidget>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl ContainerClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl WidgetClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl InitiallyUnownedClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl BuildableClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl OrientableClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
unsafe impl FontChooserClassExt<FontChooserWidget> for FontChooserWidgetClass {} | |
#[macro_export] | |
macro_rules! box_fontchooserwidget_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
box_fontchooser_impl!($name); | |
impl<T: $crate::font_chooser_widget::FontChooserWidgetBase> $crate::font_chooser_widget::FontChooserWidgetImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for FontChooserWidget{ | |
const NAME: &'static str = "RsGtk.FontChooserWidget"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<FontChooserWidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FontChooserWidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
FontChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Allocation; | |
use Bin; | |
use Container; | |
use ShadowType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait FrameImpl<T: FrameBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn compute_child_allocation(&self, frame: &T, allocation: &mut Allocation){ | |
frame.parent_compute_child_allocation(allocation) | |
} | |
} | |
pub trait FrameImplExt<T> {} | |
} | |
impl<S: FrameImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> FrameImplExt<T> for S {} | |
any_impl!(FrameBase, FrameImpl); | |
pub unsafe trait FrameBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_compute_child_allocation(&self, allocation: &mut Allocation){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkFrameClass; | |
(*parent_klass) | |
.compute_child_allocation | |
.map(|f|{ f(self.to_glib_none().0,allocation.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait FrameClassExt<T: FrameBase> | |
where | |
T::ImplType: FrameImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkFrameClass); | |
klass.compute_child_allocation = Some(frame_compute_child_allocation::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Frame(Object<InstanceStruct<Frame>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Frame>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> FrameBase for T {} | |
pub type FrameClass = ClassStruct<Frame>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Frame> for FrameClass {} | |
unsafe impl ContainerClassExt<Frame> for FrameClass {} | |
unsafe impl WidgetClassExt<Frame> for FrameClass {} | |
unsafe impl InitiallyUnownedClassExt<Frame> for FrameClass {} | |
unsafe impl ImplementorIfaceClassExt<Frame> for FrameClass {} | |
unsafe impl BuildableClassExt<Frame> for FrameClass {} | |
#[macro_export] | |
macro_rules! box_frame_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::frame::FrameBase> $crate::frame::FrameImpl<T> for Box<$name<T>>{ | |
fn compute_child_allocation(&self, frame: &T, allocation: &mut Allocation){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.compute_child_allocation(allocation) | |
} | |
} | |
} | |
); | |
impl ObjectType for Frame{ | |
const NAME: &'static str = "RsGtk.Frame"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<FrameImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut FrameClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn frame_compute_child_allocation<T: FrameBase> | |
(ptr: *mut GtkFrame, allocation: *mut GtkAllocation) | |
where | |
T::ImplType: FrameImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let frame = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = frame.get_impl(); | |
imp.compute_child_allocation() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use Error; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use glib::signal::SignalHandlerId; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use libc; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use std::boxed::Box as Box_; | |
use std::mem; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait GLAreaImpl<T: GLAreaBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn create_context(&self, area: &T) -> /*Ignored*/Option<gdk::GLContext>{ | |
area.parent_create_context() | |
} | |
fn render(&self, area: &T, context: /*Ignored*/&gdk::GLContext) -> bool{ | |
area.parent_render(context) | |
} | |
fn resize(&self, area: &T, width: i32, height: i32){ | |
area.parent_resize(width, height) | |
} | |
} | |
pub trait GLAreaImplExt<T> {} | |
} | |
impl<S: GLAreaImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> GLAreaImplExt<T> for S {} | |
any_impl!(GLAreaBase, GLAreaImpl); | |
pub unsafe trait GLAreaBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_create_context(&self) -> /*Ignored*/Option<gdk::GLContext>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkGLAreaClass; | |
(*parent_klass) | |
.create_context | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_render(&self, context: /*Ignored*/&gdk::GLContext) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkGLAreaClass; | |
(*parent_klass) | |
.render | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_resize(&self, width: i32, height: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkGLAreaClass; | |
(*parent_klass) | |
.resize | |
.map(|f|{ f(self.to_glib_none().0,width,height) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait GLAreaClassExt<T: GLAreaBase> | |
where | |
T::ImplType: GLAreaImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkGLAreaClass); | |
klass.create_context = Some(glarea_create_context::<T>); | |
klass.render = Some(glarea_render::<T>); | |
klass.resize = Some(glarea_resize::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct GLArea(Object<InstanceStruct<GLArea>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<GLArea>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> GLAreaBase for T {} | |
pub type GLAreaClass = ClassStruct<GLArea>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<GLArea> for GLAreaClass {} | |
unsafe impl InitiallyUnownedClassExt<GLArea> for GLAreaClass {} | |
unsafe impl ImplementorIfaceClassExt<GLArea> for GLAreaClass {} | |
unsafe impl BuildableClassExt<GLArea> for GLAreaClass {} | |
#[macro_export] | |
macro_rules! box_glarea_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::gl_area::GLAreaBase> $crate::gl_area::GLAreaImpl<T> for Box<$name<T>>{ | |
fn create_context(&self, area: &T) -> /*Ignored*/Option<gdk::GLContext>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.create_context() | |
} | |
fn render(&self, area: &T, context: /*Ignored*/&gdk::GLContext) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.render(context) | |
} | |
fn resize(&self, area: &T, width: i32, height: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.resize(width, height) | |
} | |
} | |
} | |
); | |
impl ObjectType for GLArea{ | |
const NAME: &'static str = "RsGtk.GLArea"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<GLAreaImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut GLAreaClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn glarea_create_context<T: GLAreaBase> | |
(ptr: *mut GtkGLArea) -> *mut gdk::GdkGLContext | |
where | |
T::ImplType: GLAreaImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let glarea = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = glarea.get_impl(); | |
imp.create_context() | |
} | |
unsafe extern "C" fn glarea_render<T: GLAreaBase> | |
(ptr: *mut GtkGLArea, context: *mut gdk::GdkGLContext) -> gboolean | |
where | |
T::ImplType: GLAreaImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let glarea = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = glarea.get_impl(); | |
imp.render() | |
} | |
unsafe extern "C" fn glarea_resize<T: GLAreaBase> | |
(ptr: *mut GtkGLArea, width: c_int, height: c_int) | |
where | |
T::ImplType: GLAreaImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let glarea = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = glarea.get_impl(); | |
imp.resize() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use BaselinePosition; | |
use Container; | |
use Orientable; | |
use PositionType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait GridImpl<T: GridBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait GridImplExt<T> {} | |
} | |
impl<S: GridImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> GridImplExt<T> for S {} | |
any_impl!(GridBase, GridImpl); | |
pub unsafe trait GridBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
} | |
pub unsafe trait GridClassExt<T: GridBase> | |
where | |
T::ImplType: GridImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkGridClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Grid(Object<InstanceStruct<Grid>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Grid>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> GridBase for T {} | |
pub type GridClass = ClassStruct<Grid>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Grid> for GridClass {} | |
unsafe impl WidgetClassExt<Grid> for GridClass {} | |
unsafe impl InitiallyUnownedClassExt<Grid> for GridClass {} | |
unsafe impl ImplementorIfaceClassExt<Grid> for GridClass {} | |
unsafe impl BuildableClassExt<Grid> for GridClass {} | |
unsafe impl OrientableClassExt<Grid> for GridClass {} | |
#[macro_export] | |
macro_rules! box_grid_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::grid::GridBase> $crate::grid::GridImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Grid{ | |
const NAME: &'static str = "RsGtk.Grid"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<GridImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut GridClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait HeaderBarImpl<T: HeaderBarBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait HeaderBarImplExt<T> {} | |
} | |
impl<S: HeaderBarImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> HeaderBarImplExt<T> for S {} | |
any_impl!(HeaderBarBase, HeaderBarImpl); | |
pub unsafe trait HeaderBarBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait HeaderBarClassExt<T: HeaderBarBase> | |
where | |
T::ImplType: HeaderBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkHeaderBarClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct HeaderBar(Object<InstanceStruct<HeaderBar>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<HeaderBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> HeaderBarBase for T {} | |
pub type HeaderBarClass = ClassStruct<HeaderBar>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<HeaderBar> for HeaderBarClass {} | |
unsafe impl WidgetClassExt<HeaderBar> for HeaderBarClass {} | |
unsafe impl InitiallyUnownedClassExt<HeaderBar> for HeaderBarClass {} | |
unsafe impl ImplementorIfaceClassExt<HeaderBar> for HeaderBarClass {} | |
unsafe impl BuildableClassExt<HeaderBar> for HeaderBarClass {} | |
#[macro_export] | |
macro_rules! box_headerbar_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::header_bar::HeaderBarBase> $crate::header_bar::HeaderBarImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for HeaderBar{ | |
const NAME: &'static str = "RsGtk.HeaderBar"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<HeaderBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut HeaderBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use ffi; | |
use gdk; | |
use gdk_pixbuf; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait IconInfoImpl<T: IconInfoBase>: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait IconInfoImplExt<T> {} | |
} | |
impl<S: IconInfoImpl<T>, T: ObjectType >> IconInfoImplExt<T> for S {} | |
any_impl!(IconInfoBase, IconInfoImpl); | |
pub unsafe trait IconInfoBase: ObjectType { | |
} | |
pub unsafe trait IconInfoClassExt<T: IconInfoBase> | |
where | |
T::ImplType: IconInfoImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkIconInfoClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct IconInfo(Object<InstanceStruct<IconInfo>>) ; | |
match fn { | |
get_type => || get_type::<IconInfo>(), | |
} | |
} | |
unsafe impl<T: ObjectType > IconInfoBase for T {} | |
pub type IconInfoClass = ClassStruct<IconInfo>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_iconinfo_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::icon_info::IconInfoBase> $crate::icon_info::IconInfoImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for IconInfo{ | |
const NAME: &'static str = "RsGtk.IconInfo"; | |
type ImplType = Box<IconInfoImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut IconInfoClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ImageType; | |
use Misc; | |
use Widget; | |
use ffi; | |
use gdk_pixbuf; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ImageImpl<T: ImageBase>: gtk_subclass::MiscImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ImageImplExt<T> {} | |
} | |
impl<S: ImageImpl<T>, T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ImageImplExt<T> for S {} | |
any_impl!(ImageBase, ImageImpl); | |
pub unsafe trait ImageBase: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait ImageClassExt<T: ImageBase> | |
where | |
T::ImplType: ImageImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkImageClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Image(Object<InstanceStruct<Image>>):[ | |
gtk::Misc => gtk_ffi::GtkMisc | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Image>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ImageBase for T {} | |
pub type ImageClass = ClassStruct<Image>; | |
// FIXME: Boilerplate | |
unsafe impl MiscClassExt<Image> for ImageClass {} | |
unsafe impl WidgetClassExt<Image> for ImageClass {} | |
unsafe impl InitiallyUnownedClassExt<Image> for ImageClass {} | |
unsafe impl ImplementorIfaceClassExt<Image> for ImageClass {} | |
unsafe impl BuildableClassExt<Image> for ImageClass {} | |
#[macro_export] | |
macro_rules! box_image_impl( | |
($name:ident) => { | |
box_misc_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::image::ImageBase> $crate::image::ImageImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Image{ | |
const NAME: &'static str = "RsGtk.Image"; | |
type ParentType = gtk::Misc; | |
type ImplType = Box<ImageImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ImageClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
MiscClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Button; | |
use Container; | |
use MessageType; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait InfoBarImpl<T: InfoBarBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn close(&self, info_bar: &T){ | |
info_bar.parent_close() | |
} | |
fn response(&self, info_bar: &T, response_id: i32){ | |
info_bar.parent_response(response_id) | |
} | |
} | |
pub trait InfoBarImplExt<T> {} | |
} | |
impl<S: InfoBarImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> InfoBarImplExt<T> for S {} | |
any_impl!(InfoBarBase, InfoBarImpl); | |
pub unsafe trait InfoBarBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_close(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkInfoBarClass; | |
(*parent_klass) | |
.close | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_response(&self, response_id: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkInfoBarClass; | |
(*parent_klass) | |
.response | |
.map(|f|{ f(self.to_glib_none().0,response_id) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait InfoBarClassExt<T: InfoBarBase> | |
where | |
T::ImplType: InfoBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkInfoBarClass); | |
klass.close = Some(infobar_close::<T>); | |
klass.response = Some(infobar_response::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct InfoBar(Object<InstanceStruct<InfoBar>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<InfoBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> InfoBarBase for T {} | |
pub type InfoBarClass = ClassStruct<InfoBar>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl ContainerClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl WidgetClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl InitiallyUnownedClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl ImplementorIfaceClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl BuildableClassExt<InfoBar> for InfoBarClass {} | |
unsafe impl OrientableClassExt<InfoBar> for InfoBarClass {} | |
#[macro_export] | |
macro_rules! box_infobar_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::info_bar::InfoBarBase> $crate::info_bar::InfoBarImpl<T> for Box<$name<T>>{ | |
fn close(&self, info_bar: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.close() | |
} | |
fn response(&self, info_bar: &T, response_id: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.response(response_id) | |
} | |
} | |
} | |
); | |
impl ObjectType for InfoBar{ | |
const NAME: &'static str = "RsGtk.InfoBar"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<InfoBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut InfoBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn infobar_close<T: InfoBarBase> | |
(ptr: *mut GtkInfoBar) | |
where | |
T::ImplType: InfoBarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let infobar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = infobar.get_impl(); | |
imp.close() | |
} | |
unsafe extern "C" fn infobar_response<T: InfoBarBase> | |
(ptr: *mut GtkInfoBar, response_id: c_int) | |
where | |
T::ImplType: InfoBarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let infobar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = infobar.get_impl(); | |
imp.response() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Justification; | |
use Menu; | |
use Misc; | |
use MovementStep; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use signal::Inhibit; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait LabelImpl<T: LabelBase>: gtk_subclass::MiscImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate_link(&self, label: &T, uri: &str) -> bool{ | |
label.parent_activate_link(uri) | |
} | |
fn copy_clipboard(&self, label: &T){ | |
label.parent_copy_clipboard() | |
} | |
fn move_cursor(&self, label: &T, step: MovementStep, count: i32, extend_selection: bool){ | |
label.parent_move_cursor(step, count, extend_selection) | |
} | |
fn populate_popup(&self, label: &T, menu: &Menu){ | |
label.parent_populate_popup(menu) | |
} | |
} | |
pub trait LabelImplExt<T> {} | |
} | |
impl<S: LabelImpl<T>, T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> LabelImplExt<T> for S {} | |
any_impl!(LabelBase, LabelImpl); | |
pub unsafe trait LabelBase: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_activate_link(&self, uri: &str) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkLabelClass; | |
(*parent_klass) | |
.activate_link | |
.map(|f|{ f(self.to_glib_none().0,uri.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_copy_clipboard(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkLabelClass; | |
(*parent_klass) | |
.copy_clipboard | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_cursor(&self, step: MovementStep, count: i32, extend_selection: bool){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkLabelClass; | |
(*parent_klass) | |
.move_cursor | |
.map(|f|{ f(self.to_glib_none().0,step.to_glib(),count,extend_selection.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_populate_popup(&self, menu: &Menu){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkLabelClass; | |
(*parent_klass) | |
.populate_popup | |
.map(|f|{ f(self.to_glib_none().0,menu.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait LabelClassExt<T: LabelBase> | |
where | |
T::ImplType: LabelImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkLabelClass); | |
klass.activate_link = Some(label_activate_link::<T>); | |
klass.copy_clipboard = Some(label_copy_clipboard::<T>); | |
klass.move_cursor = Some(label_move_cursor::<T>); | |
klass.populate_popup = Some(label_populate_popup::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Label(Object<InstanceStruct<Label>>):[ | |
gtk::Misc => gtk_ffi::GtkMisc | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Label>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Misc> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> LabelBase for T {} | |
pub type LabelClass = ClassStruct<Label>; | |
// FIXME: Boilerplate | |
unsafe impl MiscClassExt<Label> for LabelClass {} | |
unsafe impl WidgetClassExt<Label> for LabelClass {} | |
unsafe impl InitiallyUnownedClassExt<Label> for LabelClass {} | |
unsafe impl ImplementorIfaceClassExt<Label> for LabelClass {} | |
unsafe impl BuildableClassExt<Label> for LabelClass {} | |
#[macro_export] | |
macro_rules! box_label_impl( | |
($name:ident) => { | |
box_misc_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::label::LabelBase> $crate::label::LabelImpl<T> for Box<$name<T>>{ | |
fn activate_link(&self, label: &T, uri: &str) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate_link(uri) | |
} | |
fn copy_clipboard(&self, label: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.copy_clipboard() | |
} | |
fn move_cursor(&self, label: &T, step: MovementStep, count: i32, extend_selection: bool){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_cursor(step, count, extend_selection) | |
} | |
fn populate_popup(&self, label: &T, menu: &Menu){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.populate_popup(menu) | |
} | |
} | |
} | |
); | |
impl ObjectType for Label{ | |
const NAME: &'static str = "RsGtk.Label"; | |
type ParentType = gtk::Misc; | |
type ImplType = Box<LabelImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut LabelClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
MiscClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn label_activate_link<T: LabelBase> | |
(ptr: *mut GtkLabel, uri: *const c_char) -> gboolean | |
where | |
T::ImplType: LabelImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let label = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = label.get_impl(); | |
imp.activate_link() | |
} | |
unsafe extern "C" fn label_copy_clipboard<T: LabelBase> | |
(ptr: *mut GtkLabel) | |
where | |
T::ImplType: LabelImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let label = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = label.get_impl(); | |
imp.copy_clipboard() | |
} | |
unsafe extern "C" fn label_move_cursor<T: LabelBase> | |
(ptr: *mut GtkLabel, step: GtkMovementStep, count: c_int, extend_selection: gboolean) | |
where | |
T::ImplType: LabelImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let label = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = label.get_impl(); | |
imp.move_cursor() | |
} | |
unsafe extern "C" fn label_populate_popup<T: LabelBase> | |
(ptr: *mut GtkLabel, menu: *mut GtkMenu) | |
where | |
T::ImplType: LabelImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let label = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = label.get_impl(); | |
imp.populate_popup() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Container; | |
use Widget; | |
use ffi; | |
use gdk; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait LayoutImpl<T: LayoutBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ScrollableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait LayoutImplExt<T> {} | |
} | |
impl<S: LayoutImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>>> LayoutImplExt<T> for S {} | |
any_impl!(LayoutBase, LayoutImpl); | |
pub unsafe trait LayoutBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>{ | |
} | |
pub unsafe trait LayoutClassExt<T: LayoutBase> | |
where | |
T::ImplType: LayoutImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkLayoutClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Layout(Object<InstanceStruct<Layout>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Scrollable => gtk_ffi::GtkScrollable] ; | |
match fn { | |
get_type => || get_type::<Layout>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>> LayoutBase for T {} | |
pub type LayoutClass = ClassStruct<Layout>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Layout> for LayoutClass {} | |
unsafe impl WidgetClassExt<Layout> for LayoutClass {} | |
unsafe impl InitiallyUnownedClassExt<Layout> for LayoutClass {} | |
unsafe impl ImplementorIfaceClassExt<Layout> for LayoutClass {} | |
unsafe impl BuildableClassExt<Layout> for LayoutClass {} | |
unsafe impl ScrollableClassExt<Layout> for LayoutClass {} | |
#[macro_export] | |
macro_rules! box_layout_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::layout::LayoutBase> $crate::layout::LayoutImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Layout{ | |
const NAME: &'static str = "RsGtk.Layout"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<LayoutImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut LayoutClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ScrollableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use LevelBarMode; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use glib::signal::SignalHandlerId; | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use libc; | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use std::boxed::Box as Box_; | |
use std::mem; | |
#[cfg(any(feature = "v3_6", feature = "dox"))] | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait LevelBarImpl<T: LevelBarBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn offset_changed(&self, self: &T, name: &str){ | |
self.parent_offset_changed(name) | |
} | |
} | |
pub trait LevelBarImplExt<T> {} | |
} | |
impl<S: LevelBarImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> LevelBarImplExt<T> for S {} | |
any_impl!(LevelBarBase, LevelBarImpl); | |
pub unsafe trait LevelBarBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_offset_changed(&self, name: &str){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkLevelBarClass; | |
(*parent_klass) | |
.offset_changed | |
.map(|f|{ f(self.to_glib_none().0,name.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait LevelBarClassExt<T: LevelBarBase> | |
where | |
T::ImplType: LevelBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkLevelBarClass); | |
klass.offset_changed = Some(levelbar_offset_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct LevelBar(Object<InstanceStruct<LevelBar>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<LevelBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> LevelBarBase for T {} | |
pub type LevelBarClass = ClassStruct<LevelBar>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<LevelBar> for LevelBarClass {} | |
unsafe impl InitiallyUnownedClassExt<LevelBar> for LevelBarClass {} | |
unsafe impl ImplementorIfaceClassExt<LevelBar> for LevelBarClass {} | |
unsafe impl BuildableClassExt<LevelBar> for LevelBarClass {} | |
unsafe impl OrientableClassExt<LevelBar> for LevelBarClass {} | |
#[macro_export] | |
macro_rules! box_levelbar_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::level_bar::LevelBarBase> $crate::level_bar::LevelBarImpl<T> for Box<$name<T>>{ | |
fn offset_changed(&self, self: &T, name: &str){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.offset_changed(name) | |
} | |
} | |
} | |
); | |
impl ObjectType for LevelBar{ | |
const NAME: &'static str = "RsGtk.LevelBar"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<LevelBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut LevelBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn levelbar_offset_changed<T: LevelBarBase> | |
(ptr: *mut GtkLevelBar, name: *const c_char) | |
where | |
T::ImplType: LevelBarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let levelbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = levelbar.get_impl(); | |
imp.offset_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use Adjustment; | |
use Container; | |
use ListBoxRow; | |
use MovementStep; | |
use SelectionMode; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ListBoxImpl<T: ListBoxBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate_cursor_row(&self, box: &T){ | |
box.parent_activate_cursor_row() | |
} | |
fn move_cursor(&self, box: &T, step: MovementStep, count: i32){ | |
box.parent_move_cursor(step, count) | |
} | |
fn row_activated(&self, box: &T, row: &ListBoxRow){ | |
box.parent_row_activated(row) | |
} | |
fn row_selected(&self, box: &T, row: &ListBoxRow){ | |
box.parent_row_selected(row) | |
} | |
fn select_all(&self, box: &T){ | |
box.parent_select_all() | |
} | |
fn selected_rows_changed(&self, box: &T){ | |
box.parent_selected_rows_changed() | |
} | |
fn toggle_cursor_row(&self, box: &T){ | |
box.parent_toggle_cursor_row() | |
} | |
fn unselect_all(&self, box: &T){ | |
box.parent_unselect_all() | |
} | |
} | |
pub trait ListBoxImplExt<T> {} | |
} | |
impl<S: ListBoxImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ListBoxImplExt<T> for S {} | |
any_impl!(ListBoxBase, ListBoxImpl); | |
pub unsafe trait ListBoxBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_activate_cursor_row(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.activate_cursor_row | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_cursor(&self, step: MovementStep, count: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.move_cursor | |
.map(|f|{ f(self.to_glib_none().0,step.to_glib(),count) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_activated(&self, row: &ListBoxRow){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.row_activated | |
.map(|f|{ f(self.to_glib_none().0,row.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_selected(&self, row: &ListBoxRow){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.row_selected | |
.map(|f|{ f(self.to_glib_none().0,row.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_all(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.select_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selected_rows_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.selected_rows_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_toggle_cursor_row(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.toggle_cursor_row | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unselect_all(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxClass; | |
(*parent_klass) | |
.unselect_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ListBoxClassExt<T: ListBoxBase> | |
where | |
T::ImplType: ListBoxImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkListBoxClass); | |
klass.activate_cursor_row = Some(listbox_activate_cursor_row::<T>); | |
klass.move_cursor = Some(listbox_move_cursor::<T>); | |
klass.row_activated = Some(listbox_row_activated::<T>); | |
klass.row_selected = Some(listbox_row_selected::<T>); | |
klass.select_all = Some(listbox_select_all::<T>); | |
klass.selected_rows_changed = Some(listbox_selected_rows_changed::<T>); | |
klass.toggle_cursor_row = Some(listbox_toggle_cursor_row::<T>); | |
klass.unselect_all = Some(listbox_unselect_all::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ListBox(Object<InstanceStruct<ListBox>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<ListBox>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ListBoxBase for T {} | |
pub type ListBoxClass = ClassStruct<ListBox>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<ListBox> for ListBoxClass {} | |
unsafe impl WidgetClassExt<ListBox> for ListBoxClass {} | |
unsafe impl InitiallyUnownedClassExt<ListBox> for ListBoxClass {} | |
unsafe impl ImplementorIfaceClassExt<ListBox> for ListBoxClass {} | |
unsafe impl BuildableClassExt<ListBox> for ListBoxClass {} | |
#[macro_export] | |
macro_rules! box_listbox_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::list_box::ListBoxBase> $crate::list_box::ListBoxImpl<T> for Box<$name<T>>{ | |
fn activate_cursor_row(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate_cursor_row() | |
} | |
fn move_cursor(&self, box: &T, step: MovementStep, count: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_cursor(step, count) | |
} | |
fn row_activated(&self, box: &T, row: &ListBoxRow){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_activated(row) | |
} | |
fn row_selected(&self, box: &T, row: &ListBoxRow){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_selected(row) | |
} | |
fn select_all(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_all() | |
} | |
fn selected_rows_changed(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selected_rows_changed() | |
} | |
fn toggle_cursor_row(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.toggle_cursor_row() | |
} | |
fn unselect_all(&self, box: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unselect_all() | |
} | |
} | |
} | |
); | |
impl ObjectType for ListBox{ | |
const NAME: &'static str = "RsGtk.ListBox"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<ListBoxImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ListBoxClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn listbox_activate_cursor_row<T: ListBoxBase> | |
(ptr: *mut GtkListBox) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.activate_cursor_row() | |
} | |
unsafe extern "C" fn listbox_move_cursor<T: ListBoxBase> | |
(ptr: *mut GtkListBox, step: GtkMovementStep, count: c_int) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.move_cursor() | |
} | |
unsafe extern "C" fn listbox_row_activated<T: ListBoxBase> | |
(ptr: *mut GtkListBox, row: *mut GtkListBoxRow) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.row_activated() | |
} | |
unsafe extern "C" fn listbox_row_selected<T: ListBoxBase> | |
(ptr: *mut GtkListBox, row: *mut GtkListBoxRow) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.row_selected() | |
} | |
unsafe extern "C" fn listbox_select_all<T: ListBoxBase> | |
(ptr: *mut GtkListBox) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.select_all() | |
} | |
unsafe extern "C" fn listbox_selected_rows_changed<T: ListBoxBase> | |
(ptr: *mut GtkListBox) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.selected_rows_changed() | |
} | |
unsafe extern "C" fn listbox_toggle_cursor_row<T: ListBoxBase> | |
(ptr: *mut GtkListBox) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.toggle_cursor_row() | |
} | |
unsafe extern "C" fn listbox_unselect_all<T: ListBoxBase> | |
(ptr: *mut GtkListBox) | |
where | |
T::ImplType: ListBoxImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listbox = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listbox.get_impl(); | |
imp.unselect_all() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Actionable; | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use glib::signal::SignalHandlerId; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use std::boxed::Box as Box_; | |
use std::mem; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ListBoxRowImpl<T: ListBoxRowBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ActionableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate(&self, row: &T){ | |
row.parent_activate() | |
} | |
} | |
pub trait ListBoxRowImplExt<T> {} | |
} | |
impl<S: ListBoxRowImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Actionable>>> ListBoxRowImplExt<T> for S {} | |
any_impl!(ListBoxRowBase, ListBoxRowImpl); | |
pub unsafe trait ListBoxRowBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Actionable>{ | |
fn parent_activate(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkListBoxRowClass; | |
(*parent_klass) | |
.activate | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ListBoxRowClassExt<T: ListBoxRowBase> | |
where | |
T::ImplType: ListBoxRowImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkListBoxRowClass); | |
klass.activate = Some(listboxrow_activate::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ListBoxRow(Object<InstanceStruct<ListBoxRow>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Actionable => gtk_ffi::GtkActionable] ; | |
match fn { | |
get_type => || get_type::<ListBoxRow>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Actionable>> ListBoxRowBase for T {} | |
pub type ListBoxRowClass = ClassStruct<ListBoxRow>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl ContainerClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl WidgetClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl InitiallyUnownedClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl ImplementorIfaceClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl BuildableClassExt<ListBoxRow> for ListBoxRowClass {} | |
unsafe impl ActionableClassExt<ListBoxRow> for ListBoxRowClass {} | |
#[macro_export] | |
macro_rules! box_listboxrow_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_actionable_impl!($name); | |
impl<T: $crate::list_box_row::ListBoxRowBase> $crate::list_box_row::ListBoxRowImpl<T> for Box<$name<T>>{ | |
fn activate(&self, row: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate() | |
} | |
} | |
} | |
); | |
impl ObjectType for ListBoxRow{ | |
const NAME: &'static str = "RsGtk.ListBoxRow"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ListBoxRowImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ListBoxRowClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ActionableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn listboxrow_activate<T: ListBoxRowBase> | |
(ptr: *mut GtkListBoxRow) | |
where | |
T::ImplType: ListBoxRowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let listboxrow = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = listboxrow.get_impl(); | |
imp.activate() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait MiscImpl<T: MiscBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait MiscImplExt<T> {} | |
} | |
impl<S: MiscImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> MiscImplExt<T> for S {} | |
any_impl!(MiscBase, MiscImpl); | |
pub unsafe trait MiscBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait MiscClassExt<T: MiscBase> | |
where | |
T::ImplType: MiscImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkMiscClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Misc(Object<InstanceStruct<Misc>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Misc>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> MiscBase for T {} | |
pub type MiscClass = ClassStruct<Misc>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<Misc> for MiscClass {} | |
unsafe impl InitiallyUnownedClassExt<Misc> for MiscClass {} | |
unsafe impl ImplementorIfaceClassExt<Misc> for MiscClass {} | |
unsafe impl BuildableClassExt<Misc> for MiscClass {} | |
#[macro_export] | |
macro_rules! box_misc_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::misc::MiscBase> $crate::misc::MiscImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Misc{ | |
const NAME: &'static str = "RsGtk.Misc"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<MiscImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut MiscClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use DirectionType; | |
use NotebookTab; | |
use PackType; | |
use PositionType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait NotebookImpl<T: NotebookBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn change_current_page(&self, notebook: &T, offset: i32) -> bool{ | |
notebook.parent_change_current_page(offset) | |
} | |
fn create_window(&self, notebook: &T, page: &Widget, x: i32, y: i32) -> Option<Notebook>{ | |
notebook.parent_create_window(page, x, y) | |
} | |
fn focus_tab(&self, notebook: &T, type_: NotebookTab) -> bool{ | |
notebook.parent_focus_tab(type_) | |
} | |
fn insert_page(&self, notebook: &T, child: &Widget, tab_label: &Widget, menu_label: &Widget, position: i32) -> i32{ | |
notebook.parent_insert_page(child, tab_label, menu_label, position) | |
} | |
fn move_focus_out(&self, notebook: &T, direction: DirectionType){ | |
notebook.parent_move_focus_out(direction) | |
} | |
fn page_added(&self, notebook: &T, child: &Widget, page_num: u32){ | |
notebook.parent_page_added(child, page_num) | |
} | |
fn page_removed(&self, notebook: &T, child: &Widget, page_num: u32){ | |
notebook.parent_page_removed(child, page_num) | |
} | |
fn page_reordered(&self, notebook: &T, child: &Widget, page_num: u32){ | |
notebook.parent_page_reordered(child, page_num) | |
} | |
fn reorder_tab(&self, notebook: &T, direction: DirectionType, move_to_last: bool) -> bool{ | |
notebook.parent_reorder_tab(direction, move_to_last) | |
} | |
fn select_page(&self, notebook: &T, move_focus: bool) -> bool{ | |
notebook.parent_select_page(move_focus) | |
} | |
fn switch_page(&self, notebook: &T, page: &Widget, page_num: u32){ | |
notebook.parent_switch_page(page, page_num) | |
} | |
} | |
pub trait NotebookImplExt<T> {} | |
} | |
impl<S: NotebookImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> NotebookImplExt<T> for S {} | |
any_impl!(NotebookBase, NotebookImpl); | |
pub unsafe trait NotebookBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_change_current_page(&self, offset: i32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.change_current_page | |
.map(|f|{ f(self.to_glib_none().0,offset) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_create_window(&self, page: &Widget, x: i32, y: i32) -> Option<Notebook>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.create_window | |
.map(|f|{ f(self.to_glib_none().0,page.to_glib_none().0,x,y) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_focus_tab(&self, type_: NotebookTab) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.focus_tab | |
.map(|f|{ f(self.to_glib_none().0,type_.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_insert_page(&self, child: &Widget, tab_label: &Widget, menu_label: &Widget, position: i32) -> i32{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.insert_page | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,tab_label.to_glib_none().0,menu_label.to_glib_none().0,position) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_focus_out(&self, direction: DirectionType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.move_focus_out | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_page_added(&self, child: &Widget, page_num: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.page_added | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,page_num) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_page_removed(&self, child: &Widget, page_num: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.page_removed | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,page_num) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_page_reordered(&self, child: &Widget, page_num: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.page_reordered | |
.map(|f|{ f(self.to_glib_none().0,child.to_glib_none().0,page_num) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_reorder_tab(&self, direction: DirectionType, move_to_last: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.reorder_tab | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib(),move_to_last.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_page(&self, move_focus: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.select_page | |
.map(|f|{ f(self.to_glib_none().0,move_focus.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_switch_page(&self, page: &Widget, page_num: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkNotebookClass; | |
(*parent_klass) | |
.switch_page | |
.map(|f|{ f(self.to_glib_none().0,page.to_glib_none().0,page_num) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait NotebookClassExt<T: NotebookBase> | |
where | |
T::ImplType: NotebookImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkNotebookClass); | |
klass.change_current_page = Some(notebook_change_current_page::<T>); | |
klass.create_window = Some(notebook_create_window::<T>); | |
klass.focus_tab = Some(notebook_focus_tab::<T>); | |
klass.insert_page = Some(notebook_insert_page::<T>); | |
klass.move_focus_out = Some(notebook_move_focus_out::<T>); | |
klass.page_added = Some(notebook_page_added::<T>); | |
klass.page_removed = Some(notebook_page_removed::<T>); | |
klass.page_reordered = Some(notebook_page_reordered::<T>); | |
klass.reorder_tab = Some(notebook_reorder_tab::<T>); | |
klass.select_page = Some(notebook_select_page::<T>); | |
klass.switch_page = Some(notebook_switch_page::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Notebook(Object<InstanceStruct<Notebook>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Notebook>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> NotebookBase for T {} | |
pub type NotebookClass = ClassStruct<Notebook>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Notebook> for NotebookClass {} | |
unsafe impl WidgetClassExt<Notebook> for NotebookClass {} | |
unsafe impl InitiallyUnownedClassExt<Notebook> for NotebookClass {} | |
unsafe impl ImplementorIfaceClassExt<Notebook> for NotebookClass {} | |
unsafe impl BuildableClassExt<Notebook> for NotebookClass {} | |
#[macro_export] | |
macro_rules! box_notebook_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::notebook::NotebookBase> $crate::notebook::NotebookImpl<T> for Box<$name<T>>{ | |
fn change_current_page(&self, notebook: &T, offset: i32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.change_current_page(offset) | |
} | |
fn create_window(&self, notebook: &T, page: &Widget, x: i32, y: i32) -> Option<Notebook>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.create_window(page, x, y) | |
} | |
fn focus_tab(&self, notebook: &T, type_: NotebookTab) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.focus_tab(type_) | |
} | |
fn insert_page(&self, notebook: &T, child: &Widget, tab_label: &Widget, menu_label: &Widget, position: i32) -> i32{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.insert_page(child, tab_label, menu_label, position) | |
} | |
fn move_focus_out(&self, notebook: &T, direction: DirectionType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_focus_out(direction) | |
} | |
fn page_added(&self, notebook: &T, child: &Widget, page_num: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.page_added(child, page_num) | |
} | |
fn page_removed(&self, notebook: &T, child: &Widget, page_num: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.page_removed(child, page_num) | |
} | |
fn page_reordered(&self, notebook: &T, child: &Widget, page_num: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.page_reordered(child, page_num) | |
} | |
fn reorder_tab(&self, notebook: &T, direction: DirectionType, move_to_last: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.reorder_tab(direction, move_to_last) | |
} | |
fn select_page(&self, notebook: &T, move_focus: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_page(move_focus) | |
} | |
fn switch_page(&self, notebook: &T, page: &Widget, page_num: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.switch_page(page, page_num) | |
} | |
} | |
} | |
); | |
impl ObjectType for Notebook{ | |
const NAME: &'static str = "RsGtk.Notebook"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<NotebookImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut NotebookClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn notebook_change_current_page<T: NotebookBase> | |
(ptr: *mut GtkNotebook, offset: c_int) -> gboolean | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.change_current_page() | |
} | |
unsafe extern "C" fn notebook_create_window<T: NotebookBase> | |
(ptr: *mut GtkNotebook, page: *mut GtkWidget, x: c_int, y: c_int) -> *mut GtkNotebook | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.create_window() | |
} | |
unsafe extern "C" fn notebook_focus_tab<T: NotebookBase> | |
(ptr: *mut GtkNotebook, type_: GtkNotebookTab) -> gboolean | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.focus_tab() | |
} | |
unsafe extern "C" fn notebook_insert_page<T: NotebookBase> | |
(ptr: *mut GtkNotebook, child: *mut GtkWidget, tab_label: *mut GtkWidget, menu_label: *mut GtkWidget, position: c_int) -> c_int | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.insert_page() | |
} | |
unsafe extern "C" fn notebook_move_focus_out<T: NotebookBase> | |
(ptr: *mut GtkNotebook, direction: GtkDirectionType) | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.move_focus_out() | |
} | |
unsafe extern "C" fn notebook_page_added<T: NotebookBase> | |
(ptr: *mut GtkNotebook, child: *mut GtkWidget, page_num: c_uint) | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.page_added() | |
} | |
unsafe extern "C" fn notebook_page_removed<T: NotebookBase> | |
(ptr: *mut GtkNotebook, child: *mut GtkWidget, page_num: c_uint) | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.page_removed() | |
} | |
unsafe extern "C" fn notebook_page_reordered<T: NotebookBase> | |
(ptr: *mut GtkNotebook, child: *mut GtkWidget, page_num: c_uint) | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.page_reordered() | |
} | |
unsafe extern "C" fn notebook_reorder_tab<T: NotebookBase> | |
(ptr: *mut GtkNotebook, direction: GtkDirectionType, move_to_last: gboolean) -> gboolean | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.reorder_tab() | |
} | |
unsafe extern "C" fn notebook_select_page<T: NotebookBase> | |
(ptr: *mut GtkNotebook, move_focus: gboolean) -> gboolean | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.select_page() | |
} | |
unsafe extern "C" fn notebook_switch_page<T: NotebookBase> | |
(ptr: *mut GtkNotebook, page: *mut GtkWidget, page_num: c_uint) | |
where | |
T::ImplType: NotebookImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let notebook = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = notebook.get_impl(); | |
imp.switch_page() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Orientation; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType >> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType { | |
} | |
pub unsafe trait OrientableIfaceExt<T: > | |
where | |
T::ImplType: <T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkOrientableIface); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Orientable(Object<InstanceStruct<Orientable>>) ; | |
match fn { | |
get_type => || get_type::<Orientable>(), | |
} | |
} | |
unsafe impl<T: ObjectType > for T {} | |
pub type OrientableClass = ClassStruct<Orientable>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_orientable_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::orientable::> $crate::orientable::<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Orientable{ | |
const NAME: &'static str = "RsGtk.Orientable"; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut OrientableClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Allocation; | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait OverlayImpl<T: OverlayBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn get_child_position(&self, overlay: &T, widget: &Widget, allocation: &mut Allocation) -> bool{ | |
overlay.parent_get_child_position(widget, allocation) | |
} | |
} | |
pub trait OverlayImplExt<T> {} | |
} | |
impl<S: OverlayImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> OverlayImplExt<T> for S {} | |
any_impl!(OverlayBase, OverlayImpl); | |
pub unsafe trait OverlayBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_get_child_position(&self, widget: &Widget, allocation: &mut Allocation) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkOverlayClass; | |
(*parent_klass) | |
.get_child_position | |
.map(|f|{ f(self.to_glib_none().0,widget.to_glib_none().0,allocation.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait OverlayClassExt<T: OverlayBase> | |
where | |
T::ImplType: OverlayImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkOverlayClass); | |
klass.get_child_position = Some(overlay_get_child_position::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Overlay(Object<InstanceStruct<Overlay>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Overlay>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> OverlayBase for T {} | |
pub type OverlayClass = ClassStruct<Overlay>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Overlay> for OverlayClass {} | |
unsafe impl ContainerClassExt<Overlay> for OverlayClass {} | |
unsafe impl WidgetClassExt<Overlay> for OverlayClass {} | |
unsafe impl InitiallyUnownedClassExt<Overlay> for OverlayClass {} | |
unsafe impl ImplementorIfaceClassExt<Overlay> for OverlayClass {} | |
unsafe impl BuildableClassExt<Overlay> for OverlayClass {} | |
#[macro_export] | |
macro_rules! box_overlay_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::overlay::OverlayBase> $crate::overlay::OverlayImpl<T> for Box<$name<T>>{ | |
fn get_child_position(&self, overlay: &T, widget: &Widget, allocation: &mut Allocation) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_child_position(widget, allocation) | |
} | |
} | |
} | |
); | |
impl ObjectType for Overlay{ | |
const NAME: &'static str = "RsGtk.Overlay"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<OverlayImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut OverlayClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn overlay_get_child_position<T: OverlayBase> | |
(ptr: *mut GtkOverlay, widget: *mut GtkWidget, allocation: *mut GtkAllocation) -> gboolean | |
where | |
T::ImplType: OverlayImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let overlay = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = overlay.get_impl(); | |
imp.get_child_position() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use PageOrientation; | |
use PaperSize; | |
use Unit; | |
use ffi; | |
#[cfg(any(feature = "v3_22", feature = "dox"))] | |
use glib; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait PageSetupImpl<T: PageSetupBase>: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait PageSetupImplExt<T> {} | |
} | |
impl<S: PageSetupImpl<T>, T: ObjectType >> PageSetupImplExt<T> for S {} | |
any_impl!(PageSetupBase, PageSetupImpl); | |
pub unsafe trait PageSetupBase: ObjectType { | |
} | |
glib_wrapper! { | |
pub struct PageSetup(Object<InstanceStruct<PageSetup>>) ; | |
match fn { | |
get_type => || get_type::<PageSetup>(), | |
} | |
} | |
unsafe impl<T: ObjectType > PageSetupBase for T {} | |
pub type PageSetupClass = ClassStruct<PageSetup>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_pagesetup_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::page_setup::PageSetupBase> $crate::page_setup::PageSetupImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for PageSetup{ | |
const NAME: &'static str = "RsGtk.PageSetup"; | |
type ImplType = Box<PageSetupImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut PageSetupClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use Orientable; | |
use Orientation; | |
use ScrollType; | |
use Widget; | |
use ffi; | |
use gdk; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait PanedImpl<T: PanedBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn accept_position(&self, paned: &T) -> bool{ | |
paned.parent_accept_position() | |
} | |
fn cancel_position(&self, paned: &T) -> bool{ | |
paned.parent_cancel_position() | |
} | |
fn cycle_child_focus(&self, paned: &T, reverse: bool) -> bool{ | |
paned.parent_cycle_child_focus(reverse) | |
} | |
fn cycle_handle_focus(&self, paned: &T, reverse: bool) -> bool{ | |
paned.parent_cycle_handle_focus(reverse) | |
} | |
fn move_handle(&self, paned: &T, scroll: ScrollType) -> bool{ | |
paned.parent_move_handle(scroll) | |
} | |
fn toggle_handle_focus(&self, paned: &T) -> bool{ | |
paned.parent_toggle_handle_focus() | |
} | |
} | |
pub trait PanedImplExt<T> {} | |
} | |
impl<S: PanedImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> PanedImplExt<T> for S {} | |
any_impl!(PanedBase, PanedImpl); | |
pub unsafe trait PanedBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_accept_position(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.accept_position | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_cancel_position(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.cancel_position | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_cycle_child_focus(&self, reverse: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.cycle_child_focus | |
.map(|f|{ f(self.to_glib_none().0,reverse.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_cycle_handle_focus(&self, reverse: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.cycle_handle_focus | |
.map(|f|{ f(self.to_glib_none().0,reverse.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_handle(&self, scroll: ScrollType) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.move_handle | |
.map(|f|{ f(self.to_glib_none().0,scroll.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_toggle_handle_focus(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPanedClass; | |
(*parent_klass) | |
.toggle_handle_focus | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait PanedClassExt<T: PanedBase> | |
where | |
T::ImplType: PanedImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkPanedClass); | |
klass.accept_position = Some(paned_accept_position::<T>); | |
klass.cancel_position = Some(paned_cancel_position::<T>); | |
klass.cycle_child_focus = Some(paned_cycle_child_focus::<T>); | |
klass.cycle_handle_focus = Some(paned_cycle_handle_focus::<T>); | |
klass.move_handle = Some(paned_move_handle::<T>); | |
klass.toggle_handle_focus = Some(paned_toggle_handle_focus::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Paned(Object<InstanceStruct<Paned>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Paned>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> PanedBase for T {} | |
pub type PanedClass = ClassStruct<Paned>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Paned> for PanedClass {} | |
unsafe impl WidgetClassExt<Paned> for PanedClass {} | |
unsafe impl InitiallyUnownedClassExt<Paned> for PanedClass {} | |
unsafe impl ImplementorIfaceClassExt<Paned> for PanedClass {} | |
unsafe impl BuildableClassExt<Paned> for PanedClass {} | |
unsafe impl OrientableClassExt<Paned> for PanedClass {} | |
#[macro_export] | |
macro_rules! box_paned_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::paned::PanedBase> $crate::paned::PanedImpl<T> for Box<$name<T>>{ | |
fn accept_position(&self, paned: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.accept_position() | |
} | |
fn cancel_position(&self, paned: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.cancel_position() | |
} | |
fn cycle_child_focus(&self, paned: &T, reverse: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.cycle_child_focus(reverse) | |
} | |
fn cycle_handle_focus(&self, paned: &T, reverse: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.cycle_handle_focus(reverse) | |
} | |
fn move_handle(&self, paned: &T, scroll: ScrollType) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_handle(scroll) | |
} | |
fn toggle_handle_focus(&self, paned: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.toggle_handle_focus() | |
} | |
} | |
} | |
); | |
impl ObjectType for Paned{ | |
const NAME: &'static str = "RsGtk.Paned"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<PanedImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut PanedClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn paned_accept_position<T: PanedBase> | |
(ptr: *mut GtkPaned) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.accept_position() | |
} | |
unsafe extern "C" fn paned_cancel_position<T: PanedBase> | |
(ptr: *mut GtkPaned) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.cancel_position() | |
} | |
unsafe extern "C" fn paned_cycle_child_focus<T: PanedBase> | |
(ptr: *mut GtkPaned, reverse: gboolean) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.cycle_child_focus() | |
} | |
unsafe extern "C" fn paned_cycle_handle_focus<T: PanedBase> | |
(ptr: *mut GtkPaned, reverse: gboolean) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.cycle_handle_focus() | |
} | |
unsafe extern "C" fn paned_move_handle<T: PanedBase> | |
(ptr: *mut GtkPaned, scroll: GtkScrollType) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.move_handle() | |
} | |
unsafe extern "C" fn paned_toggle_handle_focus<T: PanedBase> | |
(ptr: *mut GtkPaned) -> gboolean | |
where | |
T::ImplType: PanedImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let paned = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = paned.get_impl(); | |
imp.toggle_handle_focus() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
#[cfg(any(feature = "v3_12", feature = "dox"))] | |
use PositionType; | |
use Widget; | |
use ffi; | |
#[cfg(any(feature = "v3_12", feature = "dox"))] | |
use gdk; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait PopoverImpl<T: PopoverBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn closed(&self, popover: &T){ | |
popover.parent_closed() | |
} | |
} | |
pub trait PopoverImplExt<T> {} | |
} | |
impl<S: PopoverImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> PopoverImplExt<T> for S {} | |
any_impl!(PopoverBase, PopoverImpl); | |
pub unsafe trait PopoverBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_closed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkPopoverClass; | |
(*parent_klass) | |
.closed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait PopoverClassExt<T: PopoverBase> | |
where | |
T::ImplType: PopoverImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkPopoverClass); | |
klass.closed = Some(popover_closed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Popover(Object<InstanceStruct<Popover>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Popover>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> PopoverBase for T {} | |
pub type PopoverClass = ClassStruct<Popover>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Popover> for PopoverClass {} | |
unsafe impl ContainerClassExt<Popover> for PopoverClass {} | |
unsafe impl WidgetClassExt<Popover> for PopoverClass {} | |
unsafe impl InitiallyUnownedClassExt<Popover> for PopoverClass {} | |
unsafe impl ImplementorIfaceClassExt<Popover> for PopoverClass {} | |
unsafe impl BuildableClassExt<Popover> for PopoverClass {} | |
#[macro_export] | |
macro_rules! box_popover_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::popover::PopoverBase> $crate::popover::PopoverImpl<T> for Box<$name<T>>{ | |
fn closed(&self, popover: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.closed() | |
} | |
} | |
} | |
); | |
impl ObjectType for Popover{ | |
const NAME: &'static str = "RsGtk.Popover"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<PopoverImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut PopoverClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn popover_closed<T: PopoverBase> | |
(ptr: *mut GtkPopover) | |
where | |
T::ImplType: PopoverImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let popover = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = popover.get_impl(); | |
imp.closed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use NumberUpLayout; | |
use PageOrientation; | |
use PageSet; | |
use PaperSize; | |
use PrintDuplex; | |
use PrintPages; | |
use PrintQuality; | |
use Unit; | |
use ffi; | |
#[cfg(any(feature = "v3_22", feature = "dox"))] | |
use glib; | |
use glib::object::IsA; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait PrintSettingsImpl<T: PrintSettingsBase>: ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait PrintSettingsImplExt<T> {} | |
} | |
impl<S: PrintSettingsImpl<T>, T: ObjectType >> PrintSettingsImplExt<T> for S {} | |
any_impl!(PrintSettingsBase, PrintSettingsImpl); | |
pub unsafe trait PrintSettingsBase: ObjectType { | |
} | |
glib_wrapper! { | |
pub struct PrintSettings(Object<InstanceStruct<PrintSettings>>) ; | |
match fn { | |
get_type => || get_type::<PrintSettings>(), | |
} | |
} | |
unsafe impl<T: ObjectType > PrintSettingsBase for T {} | |
pub type PrintSettingsClass = ClassStruct<PrintSettings>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_printsettings_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::print_settings::PrintSettingsBase> $crate::print_settings::PrintSettingsImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for PrintSettings{ | |
const NAME: &'static str = "RsGtk.PrintSettings"; | |
type ImplType = Box<PrintSettingsImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut PrintSettingsClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ProgressBarImpl<T: ProgressBarBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ProgressBarImplExt<T> {} | |
} | |
impl<S: ProgressBarImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> ProgressBarImplExt<T> for S {} | |
any_impl!(ProgressBarBase, ProgressBarImpl); | |
pub unsafe trait ProgressBarBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
} | |
pub unsafe trait ProgressBarClassExt<T: ProgressBarBase> | |
where | |
T::ImplType: ProgressBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkProgressBarClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ProgressBar(Object<InstanceStruct<ProgressBar>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<ProgressBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> ProgressBarBase for T {} | |
pub type ProgressBarClass = ClassStruct<ProgressBar>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<ProgressBar> for ProgressBarClass {} | |
unsafe impl InitiallyUnownedClassExt<ProgressBar> for ProgressBarClass {} | |
unsafe impl ImplementorIfaceClassExt<ProgressBar> for ProgressBarClass {} | |
unsafe impl BuildableClassExt<ProgressBar> for ProgressBarClass {} | |
unsafe impl OrientableClassExt<ProgressBar> for ProgressBarClass {} | |
#[macro_export] | |
macro_rules! box_progressbar_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::progress_bar::ProgressBarBase> $crate::progress_bar::ProgressBarImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ProgressBar{ | |
const NAME: &'static str = "RsGtk.ProgressBar"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<ProgressBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ProgressBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Orientable; | |
use Orientation; | |
use ScrollType; | |
use SensitivityType; | |
use Widget; | |
use ffi; | |
use gdk; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait RangeImpl<T: RangeBase>: gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn adjust_bounds(&self, range: &T, new_value: f64){ | |
range.parent_adjust_bounds(new_value) | |
} | |
fn change_value(&self, range: &T, scroll: ScrollType, new_value: f64) -> bool{ | |
range.parent_change_value(scroll, new_value) | |
} | |
fn get_range_border(&self, range: &T, border_: /*Ignored*/&mut Border){ | |
range.parent_get_range_border(border_) | |
} | |
fn get_range_size_request(&self, range: &T, orientation: Orientation, minimum: i32, natural: i32){ | |
range.parent_get_range_size_request(orientation, minimum, natural) | |
} | |
fn move_slider(&self, range: &T, scroll: ScrollType){ | |
range.parent_move_slider(scroll) | |
} | |
fn value_changed(&self, range: &T){ | |
range.parent_value_changed() | |
} | |
} | |
pub trait RangeImplExt<T> {} | |
} | |
impl<S: RangeImpl<T>, T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> RangeImplExt<T> for S {} | |
any_impl!(RangeBase, RangeImpl); | |
pub unsafe trait RangeBase: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_adjust_bounds(&self, new_value: f64){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.adjust_bounds | |
.map(|f|{ f(self.to_glib_none().0,new_value) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_change_value(&self, scroll: ScrollType, new_value: f64) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.change_value | |
.map(|f|{ f(self.to_glib_none().0,scroll.to_glib(),new_value) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_range_border(&self, border_: /*Ignored*/&mut Border){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.get_range_border | |
.map(|f|{ f(self.to_glib_none().0,border_.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_range_size_request(&self, orientation: Orientation, minimum: i32, natural: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.get_range_size_request | |
.map(|f|{ f(self.to_glib_none().0,orientation.to_glib(),minimum,natural) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_slider(&self, scroll: ScrollType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.move_slider | |
.map(|f|{ f(self.to_glib_none().0,scroll.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_value_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRangeClass; | |
(*parent_klass) | |
.value_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait RangeClassExt<T: RangeBase> | |
where | |
T::ImplType: RangeImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkRangeClass); | |
klass.adjust_bounds = Some(range_adjust_bounds::<T>); | |
klass.change_value = Some(range_change_value::<T>); | |
klass.get_range_border = Some(range_get_range_border::<T>); | |
klass.get_range_size_request = Some(range_get_range_size_request::<T>); | |
klass.move_slider = Some(range_move_slider::<T>); | |
klass.value_changed = Some(range_value_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Range(Object<InstanceStruct<Range>>):[ | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Range>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> RangeBase for T {} | |
pub type RangeClass = ClassStruct<Range>; | |
// FIXME: Boilerplate | |
unsafe impl WidgetClassExt<Range> for RangeClass {} | |
unsafe impl InitiallyUnownedClassExt<Range> for RangeClass {} | |
unsafe impl ImplementorIfaceClassExt<Range> for RangeClass {} | |
unsafe impl BuildableClassExt<Range> for RangeClass {} | |
unsafe impl OrientableClassExt<Range> for RangeClass {} | |
#[macro_export] | |
macro_rules! box_range_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::range::RangeBase> $crate::range::RangeImpl<T> for Box<$name<T>>{ | |
fn adjust_bounds(&self, range: &T, new_value: f64){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.adjust_bounds(new_value) | |
} | |
fn change_value(&self, range: &T, scroll: ScrollType, new_value: f64) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.change_value(scroll, new_value) | |
} | |
fn get_range_border(&self, range: &T, border_: /*Ignored*/&mut Border){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_range_border(border_) | |
} | |
fn get_range_size_request(&self, range: &T, orientation: Orientation, minimum: i32, natural: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_range_size_request(orientation, minimum, natural) | |
} | |
fn move_slider(&self, range: &T, scroll: ScrollType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_slider(scroll) | |
} | |
fn value_changed(&self, range: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.value_changed() | |
} | |
} | |
} | |
); | |
impl ObjectType for Range{ | |
const NAME: &'static str = "RsGtk.Range"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<RangeImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut RangeClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn range_adjust_bounds<T: RangeBase> | |
(ptr: *mut GtkRange, new_value: c_double) | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.adjust_bounds() | |
} | |
unsafe extern "C" fn range_change_value<T: RangeBase> | |
(ptr: *mut GtkRange, scroll: GtkScrollType, new_value: c_double) -> gboolean | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.change_value() | |
} | |
unsafe extern "C" fn range_get_range_border<T: RangeBase> | |
(ptr: *mut GtkRange, border_: *mut GtkBorder) | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.get_range_border() | |
} | |
unsafe extern "C" fn range_get_range_size_request<T: RangeBase> | |
(ptr: *mut GtkRange, orientation: GtkOrientation, minimum: *mut c_int, natural: *mut c_int) | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.get_range_size_request() | |
} | |
unsafe extern "C" fn range_move_slider<T: RangeBase> | |
(ptr: *mut GtkRange, scroll: GtkScrollType) | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.move_slider() | |
} | |
unsafe extern "C" fn range_value_changed<T: RangeBase> | |
(ptr: *mut GtkRange) | |
where | |
T::ImplType: RangeImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let range = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = range.get_impl(); | |
imp.value_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use Orientable; | |
use RecentManager; | |
use Widget; | |
use ffi; | |
use glib::object::Downcast; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::mem; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait RecentChooserWidgetImpl<T: RecentChooserWidgetBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::RecentChooserImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait RecentChooserWidgetImplExt<T> {} | |
} | |
impl<S: RecentChooserWidgetImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::RecentChooser>>> RecentChooserWidgetImplExt<T> for S {} | |
any_impl!(RecentChooserWidgetBase, RecentChooserWidgetImpl); | |
pub unsafe trait RecentChooserWidgetBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::RecentChooser>{ | |
} | |
pub unsafe trait RecentChooserWidgetClassExt<T: RecentChooserWidgetBase> | |
where | |
T::ImplType: RecentChooserWidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkRecentChooserWidgetClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct RecentChooserWidget(Object<InstanceStruct<RecentChooserWidget>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::RecentChooser => gtk_ffi::GtkRecentChooser] ; | |
match fn { | |
get_type => || get_type::<RecentChooserWidget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::RecentChooser>> RecentChooserWidgetBase for T {} | |
pub type RecentChooserWidgetClass = ClassStruct<RecentChooserWidget>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl ContainerClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl WidgetClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl InitiallyUnownedClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl BuildableClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl OrientableClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
unsafe impl RecentChooserClassExt<RecentChooserWidget> for RecentChooserWidgetClass {} | |
#[macro_export] | |
macro_rules! box_recentchooserwidget_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::recent_chooser_widget::RecentChooserWidgetBase> $crate::recent_chooser_widget::RecentChooserWidgetImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for RecentChooserWidget{ | |
const NAME: &'static str = "RsGtk.RecentChooserWidget"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<RecentChooserWidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut RecentChooserWidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
RecentChooserClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Error; | |
use RecentData; | |
use RecentInfo; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait RecentManagerImpl<T: RecentManagerBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn changed(&self, manager: &T){ | |
manager.parent_changed() | |
} | |
} | |
pub trait RecentManagerImplExt<T> {} | |
} | |
impl<S: RecentManagerImpl<T>, T: ObjectType >> RecentManagerImplExt<T> for S {} | |
any_impl!(RecentManagerBase, RecentManagerImpl); | |
pub unsafe trait RecentManagerBase: ObjectType { | |
fn parent_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkRecentManagerClass; | |
(*parent_klass) | |
.changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait RecentManagerClassExt<T: RecentManagerBase> | |
where | |
T::ImplType: RecentManagerImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkRecentManagerClass); | |
klass.changed = Some(recentmanager_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct RecentManager(Object<InstanceStruct<RecentManager>>) ; | |
match fn { | |
get_type => || get_type::<RecentManager>(), | |
} | |
} | |
unsafe impl<T: ObjectType > RecentManagerBase for T {} | |
pub type RecentManagerClass = ClassStruct<RecentManager>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_recentmanager_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::recent_manager::RecentManagerBase> $crate::recent_manager::RecentManagerImpl<T> for Box<$name<T>>{ | |
fn changed(&self, manager: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.changed() | |
} | |
} | |
} | |
); | |
impl ObjectType for RecentManager{ | |
const NAME: &'static str = "RsGtk.RecentManager"; | |
type ImplType = Box<RecentManagerImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut RecentManagerClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn recentmanager_changed<T: RecentManagerBase> | |
(ptr: *mut GtkRecentManager) | |
where | |
T::ImplType: RecentManagerImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let recentmanager = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = recentmanager.get_impl(); | |
imp.changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use RevealerTransitionType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait RevealerImpl<T: RevealerBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait RevealerImplExt<T> {} | |
} | |
impl<S: RevealerImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> RevealerImplExt<T> for S {} | |
any_impl!(RevealerBase, RevealerImpl); | |
pub unsafe trait RevealerBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait RevealerClassExt<T: RevealerBase> | |
where | |
T::ImplType: RevealerImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkRevealerClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Revealer(Object<InstanceStruct<Revealer>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Revealer>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> RevealerBase for T {} | |
pub type RevealerClass = ClassStruct<Revealer>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Revealer> for RevealerClass {} | |
unsafe impl ContainerClassExt<Revealer> for RevealerClass {} | |
unsafe impl WidgetClassExt<Revealer> for RevealerClass {} | |
unsafe impl InitiallyUnownedClassExt<Revealer> for RevealerClass {} | |
unsafe impl ImplementorIfaceClassExt<Revealer> for RevealerClass {} | |
unsafe impl BuildableClassExt<Revealer> for RevealerClass {} | |
#[macro_export] | |
macro_rules! box_revealer_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::revealer::RevealerBase> $crate::revealer::RevealerImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Revealer{ | |
const NAME: &'static str = "RsGtk.Revealer"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<RevealerImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut RevealerClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Orientable; | |
use Orientation; | |
use PositionType; | |
use Range; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ScaleImpl<T: ScaleBase>: gtk_subclass::RangeImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn draw_value(&self, scale: &T){ | |
scale.parent_draw_value() | |
} | |
fn format_value(&self, scale: &T, value: f64) -> Option<String>{ | |
scale.parent_format_value(value) | |
} | |
fn get_layout_offsets(&self, scale: &T) -> (i32, i32){ | |
scale.parent_get_layout_offsets() | |
} | |
} | |
pub trait ScaleImplExt<T> {} | |
} | |
impl<S: ScaleImpl<T>, T: ObjectType + glib::IsA<gtk::Range> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> ScaleImplExt<T> for S {} | |
any_impl!(ScaleBase, ScaleImpl); | |
pub unsafe trait ScaleBase: ObjectType + glib::IsA<gtk::Range> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_draw_value(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkScaleClass; | |
(*parent_klass) | |
.draw_value | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_format_value(&self, value: f64) -> Option<String>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkScaleClass; | |
(*parent_klass) | |
.format_value | |
.map(|f|{ f(self.to_glib_none().0,value) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_layout_offsets(&self) -> (i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkScaleClass; | |
(*parent_klass) | |
.get_layout_offsets | |
.map(|f|{ f(self.to_glib_none().0,x,y) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ScaleClassExt<T: ScaleBase> | |
where | |
T::ImplType: ScaleImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkScaleClass); | |
klass.draw_value = Some(scale_draw_value::<T>); | |
klass.format_value = Some(scale_format_value::<T>); | |
klass.get_layout_offsets = Some(scale_get_layout_offsets::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Scale(Object<InstanceStruct<Scale>>):[ | |
gtk::Range => gtk_ffi::GtkRange | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Scale>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Range> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> ScaleBase for T {} | |
pub type ScaleClass = ClassStruct<Scale>; | |
// FIXME: Boilerplate | |
unsafe impl RangeClassExt<Scale> for ScaleClass {} | |
unsafe impl WidgetClassExt<Scale> for ScaleClass {} | |
unsafe impl InitiallyUnownedClassExt<Scale> for ScaleClass {} | |
unsafe impl ImplementorIfaceClassExt<Scale> for ScaleClass {} | |
unsafe impl BuildableClassExt<Scale> for ScaleClass {} | |
unsafe impl OrientableClassExt<Scale> for ScaleClass {} | |
#[macro_export] | |
macro_rules! box_scale_impl( | |
($name:ident) => { | |
box_range_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::scale::ScaleBase> $crate::scale::ScaleImpl<T> for Box<$name<T>>{ | |
fn draw_value(&self, scale: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.draw_value() | |
} | |
fn format_value(&self, scale: &T, value: f64) -> Option<String>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.format_value(value) | |
} | |
fn get_layout_offsets(&self, scale: &T) -> (i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_layout_offsets() | |
} | |
} | |
} | |
); | |
impl ObjectType for Scale{ | |
const NAME: &'static str = "RsGtk.Scale"; | |
type ParentType = gtk::Range; | |
type ImplType = Box<ScaleImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ScaleClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
RangeClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn scale_draw_value<T: ScaleBase> | |
(ptr: *mut GtkScale) | |
where | |
T::ImplType: ScaleImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let scale = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = scale.get_impl(); | |
imp.draw_value() | |
} | |
unsafe extern "C" fn scale_format_value<T: ScaleBase> | |
(ptr: *mut GtkScale, value: c_double) -> *mut c_char | |
where | |
T::ImplType: ScaleImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let scale = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = scale.get_impl(); | |
imp.format_value() | |
} | |
unsafe extern "C" fn scale_get_layout_offsets<T: ScaleBase> | |
(ptr: *mut GtkScale, x: *mut c_int, y: *mut c_int) | |
where | |
T::ImplType: ScaleImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let scale = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = scale.get_impl(); | |
imp.get_layout_offsets() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Bin; | |
use Container; | |
use CornerType; | |
use DirectionType; | |
use PolicyType; | |
#[cfg(any(feature = "v3_16", feature = "dox"))] | |
use PositionType; | |
use ScrollType; | |
use ShadowType; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ScrolledWindowImpl<T: ScrolledWindowBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn move_focus_out(&self, scrolled_window: &T, direction: DirectionType){ | |
scrolled_window.parent_move_focus_out(direction) | |
} | |
fn scroll_child(&self, scrolled_window: &T, scroll: ScrollType, horizontal: bool) -> bool{ | |
scrolled_window.parent_scroll_child(scroll, horizontal) | |
} | |
} | |
pub trait ScrolledWindowImplExt<T> {} | |
} | |
impl<S: ScrolledWindowImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> ScrolledWindowImplExt<T> for S {} | |
any_impl!(ScrolledWindowBase, ScrolledWindowImpl); | |
pub unsafe trait ScrolledWindowBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_move_focus_out(&self, direction: DirectionType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkScrolledWindowClass; | |
(*parent_klass) | |
.move_focus_out | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkScrolledWindowClass; | |
(*parent_klass) | |
.scroll_child | |
.map(|f|{ f(self.to_glib_none().0,scroll.to_glib(),horizontal.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ScrolledWindowClassExt<T: ScrolledWindowBase> | |
where | |
T::ImplType: ScrolledWindowImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkScrolledWindowClass); | |
klass.move_focus_out = Some(scrolledwindow_move_focus_out::<T>); | |
klass.scroll_child = Some(scrolledwindow_scroll_child::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ScrolledWindow(Object<InstanceStruct<ScrolledWindow>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<ScrolledWindow>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> ScrolledWindowBase for T {} | |
pub type ScrolledWindowClass = ClassStruct<ScrolledWindow>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
unsafe impl ContainerClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
unsafe impl WidgetClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
unsafe impl InitiallyUnownedClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
unsafe impl ImplementorIfaceClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
unsafe impl BuildableClassExt<ScrolledWindow> for ScrolledWindowClass {} | |
#[macro_export] | |
macro_rules! box_scrolledwindow_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::scrolled_window::ScrolledWindowBase> $crate::scrolled_window::ScrolledWindowImpl<T> for Box<$name<T>>{ | |
fn move_focus_out(&self, scrolled_window: &T, direction: DirectionType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_focus_out(direction) | |
} | |
fn scroll_child(&self, scrolled_window: &T, scroll: ScrollType, horizontal: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.scroll_child(scroll, horizontal) | |
} | |
} | |
} | |
); | |
impl ObjectType for ScrolledWindow{ | |
const NAME: &'static str = "RsGtk.ScrolledWindow"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ScrolledWindowImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ScrolledWindowClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn scrolledwindow_move_focus_out<T: ScrolledWindowBase> | |
(ptr: *mut GtkScrolledWindow, direction: GtkDirectionType) | |
where | |
T::ImplType: ScrolledWindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let scrolledwindow = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = scrolledwindow.get_impl(); | |
imp.move_focus_out() | |
} | |
unsafe extern "C" fn scrolledwindow_scroll_child<T: ScrolledWindowBase> | |
(ptr: *mut GtkScrolledWindow, scroll: GtkScrollType, horizontal: gboolean) -> gboolean | |
where | |
T::ImplType: ScrolledWindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let scrolledwindow = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = scrolledwindow.get_impl(); | |
imp.scroll_child() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait SearchBarImpl<T: SearchBarBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait SearchBarImplExt<T> {} | |
} | |
impl<S: SearchBarImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> SearchBarImplExt<T> for S {} | |
any_impl!(SearchBarBase, SearchBarImpl); | |
pub unsafe trait SearchBarBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait SearchBarClassExt<T: SearchBarBase> | |
where | |
T::ImplType: SearchBarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkSearchBarClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct SearchBar(Object<InstanceStruct<SearchBar>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<SearchBar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> SearchBarBase for T {} | |
pub type SearchBarClass = ClassStruct<SearchBar>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<SearchBar> for SearchBarClass {} | |
unsafe impl ContainerClassExt<SearchBar> for SearchBarClass {} | |
unsafe impl WidgetClassExt<SearchBar> for SearchBarClass {} | |
unsafe impl InitiallyUnownedClassExt<SearchBar> for SearchBarClass {} | |
unsafe impl ImplementorIfaceClassExt<SearchBar> for SearchBarClass {} | |
unsafe impl BuildableClassExt<SearchBar> for SearchBarClass {} | |
#[macro_export] | |
macro_rules! box_searchbar_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::search_bar::SearchBarBase> $crate::search_bar::SearchBarImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for SearchBar{ | |
const NAME: &'static str = "RsGtk.SearchBar"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<SearchBarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut SearchBarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use glib::signal::SignalHandlerId; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use std::boxed::Box as Box_; | |
use std::mem; | |
#[cfg(any(feature = "v3_10", feature = "dox"))] | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait SearchEntryImpl<T: SearchEntryBase>: gtk_subclass::EntryImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::CellEditableImpl<T> + gtk_subclass::EditableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn next_match(&self, entry: &T){ | |
entry.parent_next_match() | |
} | |
fn previous_match(&self, entry: &T){ | |
entry.parent_previous_match() | |
} | |
fn search_changed(&self, entry: &T){ | |
entry.parent_search_changed() | |
} | |
fn stop_search(&self, entry: &T){ | |
entry.parent_stop_search() | |
} | |
} | |
pub trait SearchEntryImplExt<T> {} | |
} | |
impl<S: SearchEntryImpl<T>, T: ObjectType + glib::IsA<gtk::Entry> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::Editable>>> SearchEntryImplExt<T> for S {} | |
any_impl!(SearchEntryBase, SearchEntryImpl); | |
pub unsafe trait SearchEntryBase: ObjectType + glib::IsA<gtk::Entry> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::Editable>{ | |
fn parent_next_match(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkSearchEntryClass; | |
(*parent_klass) | |
.next_match | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_previous_match(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkSearchEntryClass; | |
(*parent_klass) | |
.previous_match | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_search_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkSearchEntryClass; | |
(*parent_klass) | |
.search_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_stop_search(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkSearchEntryClass; | |
(*parent_klass) | |
.stop_search | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait SearchEntryClassExt<T: SearchEntryBase> | |
where | |
T::ImplType: SearchEntryImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkSearchEntryClass); | |
klass.next_match = Some(searchentry_next_match::<T>); | |
klass.previous_match = Some(searchentry_previous_match::<T>); | |
klass.search_changed = Some(searchentry_search_changed::<T>); | |
klass.stop_search = Some(searchentry_stop_search::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct SearchEntry(Object<InstanceStruct<SearchEntry>>):[ | |
gtk::Entry => gtk_ffi::GtkEntry | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::CellEditable => gtk_ffi::GtkCellEditable | |
gtk::Editable => gtk_ffi::GtkEditable] ; | |
match fn { | |
get_type => || get_type::<SearchEntry>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Entry> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::CellEditable> + glib::IsA<gtk::Editable>> SearchEntryBase for T {} | |
pub type SearchEntryClass = ClassStruct<SearchEntry>; | |
// FIXME: Boilerplate | |
unsafe impl EntryClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl WidgetClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl InitiallyUnownedClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl ImplementorIfaceClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl BuildableClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl CellEditableClassExt<SearchEntry> for SearchEntryClass {} | |
unsafe impl EditableClassExt<SearchEntry> for SearchEntryClass {} | |
#[macro_export] | |
macro_rules! box_searchentry_impl( | |
($name:ident) => { | |
box_widget_impl!($name); | |
impl<T: $crate::search_entry::SearchEntryBase> $crate::search_entry::SearchEntryImpl<T> for Box<$name<T>>{ | |
fn next_match(&self, entry: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.next_match() | |
} | |
fn previous_match(&self, entry: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.previous_match() | |
} | |
fn search_changed(&self, entry: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.search_changed() | |
} | |
fn stop_search(&self, entry: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.stop_search() | |
} | |
} | |
} | |
); | |
impl ObjectType for SearchEntry{ | |
const NAME: &'static str = "RsGtk.SearchEntry"; | |
type ParentType = gtk::Widget; | |
type ImplType = Box<SearchEntryImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut SearchEntryClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
EntryClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
CellEditableClassExt::override_vfuncs(klass, token); | |
EditableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn searchentry_next_match<T: SearchEntryBase> | |
(ptr: *mut GtkSearchEntry) | |
where | |
T::ImplType: SearchEntryImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let searchentry = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = searchentry.get_impl(); | |
imp.next_match() | |
} | |
unsafe extern "C" fn searchentry_previous_match<T: SearchEntryBase> | |
(ptr: *mut GtkSearchEntry) | |
where | |
T::ImplType: SearchEntryImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let searchentry = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = searchentry.get_impl(); | |
imp.previous_match() | |
} | |
unsafe extern "C" fn searchentry_search_changed<T: SearchEntryBase> | |
(ptr: *mut GtkSearchEntry) | |
where | |
T::ImplType: SearchEntryImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let searchentry = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = searchentry.get_impl(); | |
imp.search_changed() | |
} | |
unsafe extern "C" fn searchentry_stop_search<T: SearchEntryBase> | |
(ptr: *mut GtkSearchEntry) | |
where | |
T::ImplType: SearchEntryImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let searchentry = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = searchentry.get_impl(); | |
imp.stop_search() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use ToolItem; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait SeparatorToolItemImpl<T: SeparatorToolItemBase>: gtk_subclass::ToolItemImpl<T> + gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ActivatableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait SeparatorToolItemImplExt<T> {} | |
} | |
impl<S: SeparatorToolItemImpl<T>, T: ObjectType + glib::IsA<gtk::ToolItem> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>>> SeparatorToolItemImplExt<T> for S {} | |
any_impl!(SeparatorToolItemBase, SeparatorToolItemImpl); | |
pub unsafe trait SeparatorToolItemBase: ObjectType + glib::IsA<gtk::ToolItem> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>{ | |
} | |
pub unsafe trait SeparatorToolItemClassExt<T: SeparatorToolItemBase> | |
where | |
T::ImplType: SeparatorToolItemImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkSeparatorToolItemClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct SeparatorToolItem(Object<InstanceStruct<SeparatorToolItem>>):[ | |
gtk::ToolItem => gtk_ffi::GtkToolItem | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Activatable => gtk_ffi::GtkActivatable] ; | |
match fn { | |
get_type => || get_type::<SeparatorToolItem>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::ToolItem> + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>> SeparatorToolItemBase for T {} | |
pub type SeparatorToolItemClass = ClassStruct<SeparatorToolItem>; | |
// FIXME: Boilerplate | |
unsafe impl ToolItemClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl BinClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl ContainerClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl WidgetClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl InitiallyUnownedClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl ImplementorIfaceClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl BuildableClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
unsafe impl ActivatableClassExt<SeparatorToolItem> for SeparatorToolItemClass {} | |
#[macro_export] | |
macro_rules! box_separatortoolitem_impl( | |
($name:ident) => { | |
box_toolitem_impl!($name); | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::separator_tool_item::SeparatorToolItemBase> $crate::separator_tool_item::SeparatorToolItemImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for SeparatorToolItem{ | |
const NAME: &'static str = "RsGtk.SeparatorToolItem"; | |
type ParentType = gtk::ToolItem; | |
type ImplType = Box<SeparatorToolItemImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut SeparatorToolItemClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ToolItemClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ActivatableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use SizeGroupMode; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait SizeGroupImpl<T: SizeGroupBase>: gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait SizeGroupImplExt<T> {} | |
} | |
impl<S: SizeGroupImpl<T>, T: ObjectType + glib::IsA<gtk::Buildable>>> SizeGroupImplExt<T> for S {} | |
any_impl!(SizeGroupBase, SizeGroupImpl); | |
pub unsafe trait SizeGroupBase: ObjectType + glib::IsA<gtk::Buildable>{ | |
} | |
pub unsafe trait SizeGroupClassExt<T: SizeGroupBase> | |
where | |
T::ImplType: SizeGroupImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkSizeGroupClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct SizeGroup(Object<InstanceStruct<SizeGroup>>):[ | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<SizeGroup>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Buildable>> SizeGroupBase for T {} | |
pub type SizeGroupClass = ClassStruct<SizeGroup>; | |
// FIXME: Boilerplate | |
unsafe impl BuildableClassExt<SizeGroup> for SizeGroupClass {} | |
#[macro_export] | |
macro_rules! box_sizegroup_impl( | |
($name:ident) => { | |
impl<T: $crate::size_group::SizeGroupBase> $crate::size_group::SizeGroupImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for SizeGroup{ | |
const NAME: &'static str = "RsGtk.SizeGroup"; | |
type ImplType = Box<SizeGroupImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut SizeGroupClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use ImageType; | |
use Menu; | |
use Orientation; | |
use ffi; | |
use gdk; | |
use gdk_pixbuf; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait StatusIconImpl<T: StatusIconBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn activate(&self, status_icon: &T){ | |
status_icon.parent_activate() | |
} | |
fn button_press_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
status_icon.parent_button_press_event(event) | |
} | |
fn button_release_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
status_icon.parent_button_release_event(event) | |
} | |
fn popup_menu(&self, status_icon: &T, button: u32, activate_time: u32){ | |
status_icon.parent_popup_menu(button, activate_time) | |
} | |
fn query_tooltip(&self, status_icon: &T, x: i32, y: i32, keyboard_mode: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
status_icon.parent_query_tooltip(x, y, keyboard_mode, tooltip) | |
} | |
fn scroll_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
status_icon.parent_scroll_event(event) | |
} | |
fn size_changed(&self, status_icon: &T, size: i32) -> bool{ | |
status_icon.parent_size_changed(size) | |
} | |
} | |
pub trait StatusIconImplExt<T> {} | |
} | |
impl<S: StatusIconImpl<T>, T: ObjectType >> StatusIconImplExt<T> for S {} | |
any_impl!(StatusIconBase, StatusIconImpl); | |
pub unsafe trait StatusIconBase: ObjectType { | |
fn parent_activate(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.activate | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_button_press_event(&self, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.button_press_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_button_release_event(&self, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.button_release_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_popup_menu(&self, button: u32, activate_time: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.popup_menu | |
.map(|f|{ f(self.to_glib_none().0,button,activate_time) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_query_tooltip(&self, x: i32, y: i32, keyboard_mode: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.query_tooltip | |
.map(|f|{ f(self.to_glib_none().0,x,y,keyboard_mode.to_glib(),tooltip.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_scroll_event(&self, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.scroll_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_size_changed(&self, size: i32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusIconClass; | |
(*parent_klass) | |
.size_changed | |
.map(|f|{ f(self.to_glib_none().0,size) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait StatusIconClassExt<T: StatusIconBase> | |
where | |
T::ImplType: StatusIconImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkStatusIconClass); | |
klass.activate = Some(statusicon_activate::<T>); | |
klass.button_press_event = Some(statusicon_button_press_event::<T>); | |
klass.button_release_event = Some(statusicon_button_release_event::<T>); | |
klass.popup_menu = Some(statusicon_popup_menu::<T>); | |
klass.query_tooltip = Some(statusicon_query_tooltip::<T>); | |
klass.scroll_event = Some(statusicon_scroll_event::<T>); | |
klass.size_changed = Some(statusicon_size_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct StatusIcon(Object<InstanceStruct<StatusIcon>>) ; | |
match fn { | |
get_type => || get_type::<StatusIcon>(), | |
} | |
} | |
unsafe impl<T: ObjectType > StatusIconBase for T {} | |
pub type StatusIconClass = ClassStruct<StatusIcon>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_statusicon_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::status_icon::StatusIconBase> $crate::status_icon::StatusIconImpl<T> for Box<$name<T>>{ | |
fn activate(&self, status_icon: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate() | |
} | |
fn button_press_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.button_press_event(event) | |
} | |
fn button_release_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.button_release_event(event) | |
} | |
fn popup_menu(&self, status_icon: &T, button: u32, activate_time: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.popup_menu(button, activate_time) | |
} | |
fn query_tooltip(&self, status_icon: &T, x: i32, y: i32, keyboard_mode: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.query_tooltip(x, y, keyboard_mode, tooltip) | |
} | |
fn scroll_event(&self, status_icon: &T, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.scroll_event(event) | |
} | |
fn size_changed(&self, status_icon: &T, size: i32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.size_changed(size) | |
} | |
} | |
} | |
); | |
impl ObjectType for StatusIcon{ | |
const NAME: &'static str = "RsGtk.StatusIcon"; | |
type ImplType = Box<StatusIconImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut StatusIconClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn statusicon_activate<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon) | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.activate() | |
} | |
unsafe extern "C" fn statusicon_button_press_event<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, event: *mut gdk::GdkEventButton) -> gboolean | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.button_press_event() | |
} | |
unsafe extern "C" fn statusicon_button_release_event<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, event: *mut gdk::GdkEventButton) -> gboolean | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.button_release_event() | |
} | |
unsafe extern "C" fn statusicon_popup_menu<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, button: c_uint, activate_time: u32) | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.popup_menu() | |
} | |
unsafe extern "C" fn statusicon_query_tooltip<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, x: c_int, y: c_int, keyboard_mode: gboolean, tooltip: *mut GtkTooltip) -> gboolean | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.query_tooltip() | |
} | |
unsafe extern "C" fn statusicon_scroll_event<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, event: *mut gdk::GdkEventScroll) -> gboolean | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.scroll_event() | |
} | |
unsafe extern "C" fn statusicon_size_changed<T: StatusIconBase> | |
(ptr: *mut GtkStatusIcon, size: c_int) -> gboolean | |
where | |
T::ImplType: StatusIconImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusicon = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusicon.get_impl(); | |
imp.size_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Box; | |
use Container; | |
use Orientable; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait StatusbarImpl<T: StatusbarBase>: gtk_subclass::BoxImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn text_popped(&self, statusbar: &T, context_id: u32, text: &str){ | |
statusbar.parent_text_popped(context_id, text) | |
} | |
fn text_pushed(&self, statusbar: &T, context_id: u32, text: &str){ | |
statusbar.parent_text_pushed(context_id, text) | |
} | |
} | |
pub trait StatusbarImplExt<T> {} | |
} | |
impl<S: StatusbarImpl<T>, T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>>> StatusbarImplExt<T> for S {} | |
any_impl!(StatusbarBase, StatusbarImpl); | |
pub unsafe trait StatusbarBase: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>{ | |
fn parent_text_popped(&self, context_id: u32, text: &str){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusbarClass; | |
(*parent_klass) | |
.text_popped | |
.map(|f|{ f(self.to_glib_none().0,context_id,text.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_text_pushed(&self, context_id: u32, text: &str){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkStatusbarClass; | |
(*parent_klass) | |
.text_pushed | |
.map(|f|{ f(self.to_glib_none().0,context_id,text.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait StatusbarClassExt<T: StatusbarBase> | |
where | |
T::ImplType: StatusbarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkStatusbarClass); | |
klass.text_popped = Some(statusbar_text_popped::<T>); | |
klass.text_pushed = Some(statusbar_text_pushed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Statusbar(Object<InstanceStruct<Statusbar>>):[ | |
gtk::Box => gtk_ffi::GtkBox | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable] ; | |
match fn { | |
get_type => || get_type::<Statusbar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Box> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable>> StatusbarBase for T {} | |
pub type StatusbarClass = ClassStruct<Statusbar>; | |
// FIXME: Boilerplate | |
unsafe impl BoxClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl ContainerClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl WidgetClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl InitiallyUnownedClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl ImplementorIfaceClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl BuildableClassExt<Statusbar> for StatusbarClass {} | |
unsafe impl OrientableClassExt<Statusbar> for StatusbarClass {} | |
#[macro_export] | |
macro_rules! box_statusbar_impl( | |
($name:ident) => { | |
box_box_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::statusbar::StatusbarBase> $crate::statusbar::StatusbarImpl<T> for Box<$name<T>>{ | |
fn text_popped(&self, statusbar: &T, context_id: u32, text: &str){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.text_popped(context_id, text) | |
} | |
fn text_pushed(&self, statusbar: &T, context_id: u32, text: &str){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.text_pushed(context_id, text) | |
} | |
} | |
} | |
); | |
impl ObjectType for Statusbar{ | |
const NAME: &'static str = "RsGtk.Statusbar"; | |
type ParentType = gtk::Box; | |
type ImplType = Box<StatusbarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut StatusbarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BoxClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn statusbar_text_popped<T: StatusbarBase> | |
(ptr: *mut GtkStatusbar, context_id: c_uint, text: *const c_char) | |
where | |
T::ImplType: StatusbarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusbar.get_impl(); | |
imp.text_popped() | |
} | |
unsafe extern "C" fn statusbar_text_pushed<T: StatusbarBase> | |
(ptr: *mut GtkStatusbar, context_id: c_uint, text: *const c_char) | |
where | |
T::ImplType: StatusbarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let statusbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = statusbar.get_impl(); | |
imp.text_pushed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Clipboard; | |
use TextIter; | |
use ffi; | |
use gdk_pixbuf; | |
use gdk_pixbuf_ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait TextBufferImpl<T: TextBufferBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn apply_tag(&self, buffer: &T, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
buffer.parent_apply_tag(tag, start, end) | |
} | |
fn begin_user_action(&self, buffer: &T){ | |
buffer.parent_begin_user_action() | |
} | |
fn changed(&self, buffer: &T){ | |
buffer.parent_changed() | |
} | |
fn delete_range(&self, buffer: &T, start: &mut TextIter, end: &mut TextIter){ | |
buffer.parent_delete_range(start, end) | |
} | |
fn end_user_action(&self, buffer: &T){ | |
buffer.parent_end_user_action() | |
} | |
fn insert_child_anchor(&self, buffer: &T, iter: &mut TextIter, anchor: /*Ignored*/&TextChildAnchor){ | |
buffer.parent_insert_child_anchor(iter, anchor) | |
} | |
fn insert_pixbuf(&self, buffer: &T, iter: &mut TextIter, pixbuf: &gdk_pixbuf::Pixbuf){ | |
buffer.parent_insert_pixbuf(iter, pixbuf) | |
} | |
fn insert_text(&self, buffer: &T, pos: &mut TextIter, new_text: &str){ | |
buffer.parent_insert_text(pos, new_text) | |
} | |
fn mark_deleted(&self, buffer: &T, mark: /*Ignored*/&TextMark){ | |
buffer.parent_mark_deleted(mark) | |
} | |
fn mark_set(&self, buffer: &T, location: &TextIter, mark: /*Ignored*/&TextMark){ | |
buffer.parent_mark_set(location, mark) | |
} | |
fn modified_changed(&self, buffer: &T){ | |
buffer.parent_modified_changed() | |
} | |
fn paste_done(&self, buffer: &T, clipboard: &Clipboard){ | |
buffer.parent_paste_done(clipboard) | |
} | |
fn remove_tag(&self, buffer: &T, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
buffer.parent_remove_tag(tag, start, end) | |
} | |
} | |
pub trait TextBufferImplExt<T> {} | |
} | |
impl<S: TextBufferImpl<T>, T: ObjectType >> TextBufferImplExt<T> for S {} | |
any_impl!(TextBufferBase, TextBufferImpl); | |
pub unsafe trait TextBufferBase: ObjectType { | |
fn parent_apply_tag(&self, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.apply_tag | |
.map(|f|{ f(self.to_glib_none().0,tag.to_glib_none().0,start.to_glib_none().0,end.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_begin_user_action(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.begin_user_action | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_delete_range(&self, start: &mut TextIter, end: &mut TextIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.delete_range | |
.map(|f|{ f(self.to_glib_none().0,start.to_glib_none_mut().0,end.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_end_user_action(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.end_user_action | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_insert_child_anchor(&self, iter: &mut TextIter, anchor: /*Ignored*/&TextChildAnchor){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.insert_child_anchor | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,anchor.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_insert_pixbuf(&self, iter: &mut TextIter, pixbuf: &gdk_pixbuf::Pixbuf){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.insert_pixbuf | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,pixbuf.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_insert_text(&self, pos: &mut TextIter, new_text: &str){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.insert_text | |
.map(|f|{ f(self.to_glib_none().0,pos.to_glib_none_mut().0,new_text.to_glib_none().0,new_text_length) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_mark_deleted(&self, mark: /*Ignored*/&TextMark){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.mark_deleted | |
.map(|f|{ f(self.to_glib_none().0,mark.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_mark_set(&self, location: &TextIter, mark: /*Ignored*/&TextMark){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.mark_set | |
.map(|f|{ f(self.to_glib_none().0,location.to_glib_none().0,mark.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_modified_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.modified_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_paste_done(&self, clipboard: &Clipboard){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.paste_done | |
.map(|f|{ f(self.to_glib_none().0,clipboard.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_remove_tag(&self, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTextBufferClass; | |
(*parent_klass) | |
.remove_tag | |
.map(|f|{ f(self.to_glib_none().0,tag.to_glib_none().0,start.to_glib_none().0,end.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait TextBufferClassExt<T: TextBufferBase> | |
where | |
T::ImplType: TextBufferImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkTextBufferClass); | |
klass.apply_tag = Some(textbuffer_apply_tag::<T>); | |
klass.begin_user_action = Some(textbuffer_begin_user_action::<T>); | |
klass.changed = Some(textbuffer_changed::<T>); | |
klass.delete_range = Some(textbuffer_delete_range::<T>); | |
klass.end_user_action = Some(textbuffer_end_user_action::<T>); | |
klass.insert_child_anchor = Some(textbuffer_insert_child_anchor::<T>); | |
klass.insert_pixbuf = Some(textbuffer_insert_pixbuf::<T>); | |
klass.insert_text = Some(textbuffer_insert_text::<T>); | |
klass.mark_deleted = Some(textbuffer_mark_deleted::<T>); | |
klass.mark_set = Some(textbuffer_mark_set::<T>); | |
klass.modified_changed = Some(textbuffer_modified_changed::<T>); | |
klass.paste_done = Some(textbuffer_paste_done::<T>); | |
klass.remove_tag = Some(textbuffer_remove_tag::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct TextBuffer(Object<InstanceStruct<TextBuffer>>) ; | |
match fn { | |
get_type => || get_type::<TextBuffer>(), | |
} | |
} | |
unsafe impl<T: ObjectType > TextBufferBase for T {} | |
pub type TextBufferClass = ClassStruct<TextBuffer>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_textbuffer_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::text_buffer::TextBufferBase> $crate::text_buffer::TextBufferImpl<T> for Box<$name<T>>{ | |
fn apply_tag(&self, buffer: &T, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.apply_tag(tag, start, end) | |
} | |
fn begin_user_action(&self, buffer: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.begin_user_action() | |
} | |
fn changed(&self, buffer: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.changed() | |
} | |
fn delete_range(&self, buffer: &T, start: &mut TextIter, end: &mut TextIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.delete_range(start, end) | |
} | |
fn end_user_action(&self, buffer: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.end_user_action() | |
} | |
fn insert_child_anchor(&self, buffer: &T, iter: &mut TextIter, anchor: /*Ignored*/&TextChildAnchor){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.insert_child_anchor(iter, anchor) | |
} | |
fn insert_pixbuf(&self, buffer: &T, iter: &mut TextIter, pixbuf: &gdk_pixbuf::Pixbuf){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.insert_pixbuf(iter, pixbuf) | |
} | |
fn insert_text(&self, buffer: &T, pos: &mut TextIter, new_text: &str){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.insert_text(pos, new_text) | |
} | |
fn mark_deleted(&self, buffer: &T, mark: /*Ignored*/&TextMark){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.mark_deleted(mark) | |
} | |
fn mark_set(&self, buffer: &T, location: &TextIter, mark: /*Ignored*/&TextMark){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.mark_set(location, mark) | |
} | |
fn modified_changed(&self, buffer: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.modified_changed() | |
} | |
fn paste_done(&self, buffer: &T, clipboard: &Clipboard){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.paste_done(clipboard) | |
} | |
fn remove_tag(&self, buffer: &T, tag: /*Ignored*/&TextTag, start: &TextIter, end: &TextIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.remove_tag(tag, start, end) | |
} | |
} | |
} | |
); | |
impl ObjectType for TextBuffer{ | |
const NAME: &'static str = "RsGtk.TextBuffer"; | |
type ImplType = Box<TextBufferImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut TextBufferClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn textbuffer_apply_tag<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, tag: *mut GtkTextTag, start: *const GtkTextIter, end: *const GtkTextIter) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.apply_tag() | |
} | |
unsafe extern "C" fn textbuffer_begin_user_action<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.begin_user_action() | |
} | |
unsafe extern "C" fn textbuffer_changed<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.changed() | |
} | |
unsafe extern "C" fn textbuffer_delete_range<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, start: *mut GtkTextIter, end: *mut GtkTextIter) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.delete_range() | |
} | |
unsafe extern "C" fn textbuffer_end_user_action<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.end_user_action() | |
} | |
unsafe extern "C" fn textbuffer_insert_child_anchor<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, iter: *mut GtkTextIter, anchor: *mut GtkTextChildAnchor) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.insert_child_anchor() | |
} | |
unsafe extern "C" fn textbuffer_insert_pixbuf<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, iter: *mut GtkTextIter, pixbuf: *mut gdk_pixbuf::GdkPixbuf) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.insert_pixbuf() | |
} | |
unsafe extern "C" fn textbuffer_insert_text<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, pos: *mut GtkTextIter, new_text: *const c_char, new_text_length: c_int) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.insert_text() | |
} | |
unsafe extern "C" fn textbuffer_mark_deleted<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, mark: *mut GtkTextMark) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.mark_deleted() | |
} | |
unsafe extern "C" fn textbuffer_mark_set<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, location: *const GtkTextIter, mark: *mut GtkTextMark) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.mark_set() | |
} | |
unsafe extern "C" fn textbuffer_modified_changed<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.modified_changed() | |
} | |
unsafe extern "C" fn textbuffer_paste_done<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, clipboard: *mut GtkClipboard) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.paste_done() | |
} | |
unsafe extern "C" fn textbuffer_remove_tag<T: TextBufferBase> | |
(ptr: *mut GtkTextBuffer, tag: *mut GtkTextTag, start: *const GtkTextIter, end: *const GtkTextIter) | |
where | |
T::ImplType: TextBufferImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let textbuffer = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = textbuffer.get_impl(); | |
imp.remove_tag() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Bin; | |
use Container; | |
use Orientation; | |
use ReliefStyle; | |
use SizeGroup; | |
use ToolbarStyle; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ToolItemImpl<T: ToolItemBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ActivatableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn create_menu_proxy(&self, tool_item: &T) -> bool{ | |
tool_item.parent_create_menu_proxy() | |
} | |
fn toolbar_reconfigured(&self, tool_item: &T){ | |
tool_item.parent_toolbar_reconfigured() | |
} | |
} | |
pub trait ToolItemImplExt<T> {} | |
} | |
impl<S: ToolItemImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>>> ToolItemImplExt<T> for S {} | |
any_impl!(ToolItemBase, ToolItemImpl); | |
pub unsafe trait ToolItemBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>{ | |
fn parent_create_menu_proxy(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkToolItemClass; | |
(*parent_klass) | |
.create_menu_proxy | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_toolbar_reconfigured(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkToolItemClass; | |
(*parent_klass) | |
.toolbar_reconfigured | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ToolItemClassExt<T: ToolItemBase> | |
where | |
T::ImplType: ToolItemImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkToolItemClass); | |
klass.create_menu_proxy = Some(toolitem_create_menu_proxy::<T>); | |
klass.toolbar_reconfigured = Some(toolitem_toolbar_reconfigured::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ToolItem(Object<InstanceStruct<ToolItem>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Activatable => gtk_ffi::GtkActivatable] ; | |
match fn { | |
get_type => || get_type::<ToolItem>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Activatable>> ToolItemBase for T {} | |
pub type ToolItemClass = ClassStruct<ToolItem>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl ContainerClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl WidgetClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl InitiallyUnownedClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl ImplementorIfaceClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl BuildableClassExt<ToolItem> for ToolItemClass {} | |
unsafe impl ActivatableClassExt<ToolItem> for ToolItemClass {} | |
#[macro_export] | |
macro_rules! box_toolitem_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::tool_item::ToolItemBase> $crate::tool_item::ToolItemImpl<T> for Box<$name<T>>{ | |
fn create_menu_proxy(&self, tool_item: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.create_menu_proxy() | |
} | |
fn toolbar_reconfigured(&self, tool_item: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.toolbar_reconfigured() | |
} | |
} | |
} | |
); | |
impl ObjectType for ToolItem{ | |
const NAME: &'static str = "RsGtk.ToolItem"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ToolItemImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ToolItemClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ActivatableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn toolitem_create_menu_proxy<T: ToolItemBase> | |
(ptr: *mut GtkToolItem) -> gboolean | |
where | |
T::ImplType: ToolItemImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let toolitem = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = toolitem.get_impl(); | |
imp.create_menu_proxy() | |
} | |
unsafe extern "C" fn toolitem_toolbar_reconfigured<T: ToolItemBase> | |
(ptr: *mut GtkToolItem) | |
where | |
T::ImplType: ToolItemImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let toolitem = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = toolitem.get_impl(); | |
imp.toolbar_reconfigured() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use ReliefStyle; | |
use ToolItem; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ToolItemGroupImpl<T: ToolItemGroupBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ToolShellImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ToolItemGroupImplExt<T> {} | |
} | |
impl<S: ToolItemGroupImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::ToolShell>>> ToolItemGroupImplExt<T> for S {} | |
any_impl!(ToolItemGroupBase, ToolItemGroupImpl); | |
pub unsafe trait ToolItemGroupBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::ToolShell>{ | |
} | |
pub unsafe trait ToolItemGroupClassExt<T: ToolItemGroupBase> | |
where | |
T::ImplType: ToolItemGroupImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkToolItemGroupClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ToolItemGroup(Object<InstanceStruct<ToolItemGroup>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::ToolShell => gtk_ffi::GtkToolShell] ; | |
match fn { | |
get_type => || get_type::<ToolItemGroup>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::ToolShell>> ToolItemGroupBase for T {} | |
pub type ToolItemGroupClass = ClassStruct<ToolItemGroup>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
unsafe impl WidgetClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
unsafe impl InitiallyUnownedClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
unsafe impl ImplementorIfaceClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
unsafe impl BuildableClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
unsafe impl ToolShellClassExt<ToolItemGroup> for ToolItemGroupClass {} | |
#[macro_export] | |
macro_rules! box_toolitemgroup_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::tool_item_group::ToolItemGroupBase> $crate::tool_item_group::ToolItemGroupImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ToolItemGroup{ | |
const NAME: &'static str = "RsGtk.ToolItemGroup"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<ToolItemGroupImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ToolItemGroupClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ToolShellClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Container; | |
use Orientable; | |
use ToolItem; | |
use ToolItemGroup; | |
use ToolPaletteDragTargets; | |
use ToolbarStyle; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ToolPaletteImpl<T: ToolPaletteBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::ScrollableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ToolPaletteImplExt<T> {} | |
} | |
impl<S: ToolPaletteImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::Scrollable>>> ToolPaletteImplExt<T> for S {} | |
any_impl!(ToolPaletteBase, ToolPaletteImpl); | |
pub unsafe trait ToolPaletteBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::Scrollable>{ | |
} | |
pub unsafe trait ToolPaletteClassExt<T: ToolPaletteBase> | |
where | |
T::ImplType: ToolPaletteImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkToolPaletteClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct ToolPalette(Object<InstanceStruct<ToolPalette>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::Scrollable => gtk_ffi::GtkScrollable] ; | |
match fn { | |
get_type => || get_type::<ToolPalette>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::Scrollable>> ToolPaletteBase for T {} | |
pub type ToolPaletteClass = ClassStruct<ToolPalette>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl WidgetClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl InitiallyUnownedClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl ImplementorIfaceClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl BuildableClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl OrientableClassExt<ToolPalette> for ToolPaletteClass {} | |
unsafe impl ScrollableClassExt<ToolPalette> for ToolPaletteClass {} | |
#[macro_export] | |
macro_rules! box_toolpalette_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::tool_palette::ToolPaletteBase> $crate::tool_palette::ToolPaletteImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for ToolPalette{ | |
const NAME: &'static str = "RsGtk.ToolPalette"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<ToolPaletteImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ToolPaletteClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
ScrollableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Container; | |
use IconSize; | |
use Orientable; | |
use Orientation; | |
use ReliefStyle; | |
use ToolItem; | |
use ToolbarStyle; | |
use Widget; | |
use ffi; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ToolbarImpl<T: ToolbarBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::OrientableImpl<T> + gtk_subclass::ToolShellImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn orientation_changed(&self, toolbar: &T, orientation: Orientation){ | |
toolbar.parent_orientation_changed(orientation) | |
} | |
fn popup_context_menu(&self, toolbar: &T, x: i32, y: i32, button_number: i32) -> bool{ | |
toolbar.parent_popup_context_menu(x, y, button_number) | |
} | |
fn style_changed(&self, toolbar: &T, style: ToolbarStyle){ | |
toolbar.parent_style_changed(style) | |
} | |
} | |
pub trait ToolbarImplExt<T> {} | |
} | |
impl<S: ToolbarImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ToolShell>>> ToolbarImplExt<T> for S {} | |
any_impl!(ToolbarBase, ToolbarImpl); | |
pub unsafe trait ToolbarBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ToolShell>{ | |
fn parent_orientation_changed(&self, orientation: Orientation){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkToolbarClass; | |
(*parent_klass) | |
.orientation_changed | |
.map(|f|{ f(self.to_glib_none().0,orientation.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_popup_context_menu(&self, x: i32, y: i32, button_number: i32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkToolbarClass; | |
(*parent_klass) | |
.popup_context_menu | |
.map(|f|{ f(self.to_glib_none().0,x,y,button_number) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_style_changed(&self, style: ToolbarStyle){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkToolbarClass; | |
(*parent_klass) | |
.style_changed | |
.map(|f|{ f(self.to_glib_none().0,style.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait ToolbarClassExt<T: ToolbarBase> | |
where | |
T::ImplType: ToolbarImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkToolbarClass); | |
klass.orientation_changed = Some(toolbar_orientation_changed::<T>); | |
klass.popup_context_menu = Some(toolbar_popup_context_menu::<T>); | |
klass.style_changed = Some(toolbar_style_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Toolbar(Object<InstanceStruct<Toolbar>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Orientable => gtk_ffi::GtkOrientable | |
gtk::ToolShell => gtk_ffi::GtkToolShell] ; | |
match fn { | |
get_type => || get_type::<Toolbar>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Orientable> + glib::IsA<gtk::ToolShell>> ToolbarBase for T {} | |
pub type ToolbarClass = ClassStruct<Toolbar>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl WidgetClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl InitiallyUnownedClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl ImplementorIfaceClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl BuildableClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl OrientableClassExt<Toolbar> for ToolbarClass {} | |
unsafe impl ToolShellClassExt<Toolbar> for ToolbarClass {} | |
#[macro_export] | |
macro_rules! box_toolbar_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
box_orientable_impl!($name); | |
impl<T: $crate::toolbar::ToolbarBase> $crate::toolbar::ToolbarImpl<T> for Box<$name<T>>{ | |
fn orientation_changed(&self, toolbar: &T, orientation: Orientation){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.orientation_changed(orientation) | |
} | |
fn popup_context_menu(&self, toolbar: &T, x: i32, y: i32, button_number: i32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.popup_context_menu(x, y, button_number) | |
} | |
fn style_changed(&self, toolbar: &T, style: ToolbarStyle){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.style_changed(style) | |
} | |
} | |
} | |
); | |
impl ObjectType for Toolbar{ | |
const NAME: &'static str = "RsGtk.Toolbar"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<ToolbarImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ToolbarClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
OrientableClassExt::override_vfuncs(klass, token); | |
ToolShellClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn toolbar_orientation_changed<T: ToolbarBase> | |
(ptr: *mut GtkToolbar, orientation: GtkOrientation) | |
where | |
T::ImplType: ToolbarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let toolbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = toolbar.get_impl(); | |
imp.orientation_changed() | |
} | |
unsafe extern "C" fn toolbar_popup_context_menu<T: ToolbarBase> | |
(ptr: *mut GtkToolbar, x: c_int, y: c_int, button_number: c_int) -> gboolean | |
where | |
T::ImplType: ToolbarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let toolbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = toolbar.get_impl(); | |
imp.popup_context_menu() | |
} | |
unsafe extern "C" fn toolbar_style_changed<T: ToolbarBase> | |
(ptr: *mut GtkToolbar, style: GtkToolbarStyle) | |
where | |
T::ImplType: ToolbarImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let toolbar = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = toolbar.get_impl(); | |
imp.style_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use TreeIter; | |
use TreeModelFlags; | |
use TreePath; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: ObjectImpl<T> + AnyImpl + 'static { | |
fn get_column_type(&self, tree_model: &T, index_: i32) -> glib::types::Type{ | |
tree_model.parent_get_column_type(index_) | |
} | |
fn get_flags(&self, tree_model: &T) -> TreeModelFlags{ | |
tree_model.parent_get_flags() | |
} | |
fn get_iter(&self, tree_model: &T, path: &mut TreePath) -> Option<TreeIter>{ | |
tree_model.parent_get_iter(path) | |
} | |
fn get_n_columns(&self, tree_model: &T) -> i32{ | |
tree_model.parent_get_n_columns() | |
} | |
fn get_path(&self, tree_model: &T, iter: &mut TreeIter) -> Option<TreePath>{ | |
tree_model.parent_get_path(iter) | |
} | |
fn get_value(&self, tree_model: &T, iter: &mut TreeIter, column: i32) -> glib::Value{ | |
tree_model.parent_get_value(iter, column) | |
} | |
fn iter_children(&self, tree_model: &T, parent: Option<&mut TreeIter>) -> Option<TreeIter>{ | |
tree_model.parent_iter_children(parent) | |
} | |
fn iter_has_child(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
tree_model.parent_iter_has_child(iter) | |
} | |
fn iter_n_children(&self, tree_model: &T, iter: Option<&mut TreeIter>) -> i32{ | |
tree_model.parent_iter_n_children(iter) | |
} | |
fn iter_next(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
tree_model.parent_iter_next(iter) | |
} | |
fn iter_nth_child(&self, tree_model: &T, parent: Option<&mut TreeIter>, n: i32) -> Option<TreeIter>{ | |
tree_model.parent_iter_nth_child(parent, n) | |
} | |
fn iter_parent(&self, tree_model: &T, child: &mut TreeIter) -> Option<TreeIter>{ | |
tree_model.parent_iter_parent(child) | |
} | |
fn iter_previous(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
tree_model.parent_iter_previous(iter) | |
} | |
fn ref_node(&self, tree_model: &T, iter: &mut TreeIter){ | |
tree_model.parent_ref_node(iter) | |
} | |
fn row_changed(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
tree_model.parent_row_changed(path, iter) | |
} | |
fn row_deleted(&self, tree_model: &T, path: &mut TreePath){ | |
tree_model.parent_row_deleted(path) | |
} | |
fn row_has_child_toggled(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
tree_model.parent_row_has_child_toggled(path, iter) | |
} | |
fn row_inserted(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
tree_model.parent_row_inserted(path, iter) | |
} | |
fn rows_reordered(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter, new_order: i32){ | |
tree_model.parent_rows_reordered(path, iter, new_order) | |
} | |
fn unref_node(&self, tree_model: &T, iter: &mut TreeIter){ | |
tree_model.parent_unref_node(iter) | |
} | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType >> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType { | |
fn parent_get_column_type(&self, index_: i32) -> glib::types::Type{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_column_type | |
.map(|f|{ f(self.to_glib_none().0,index_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_flags(&self) -> TreeModelFlags{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_flags | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_iter(&self, path: &mut TreePath) -> Option<TreeIter>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_iter | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_n_columns(&self) -> i32{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_n_columns | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_path(&self, iter: &mut TreeIter) -> Option<TreePath>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_path | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_value(&self, iter: &mut TreeIter, column: i32) -> glib::Value{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.get_value | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,column,value.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_children(&self, parent: Option<&mut TreeIter>) -> Option<TreeIter>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_children | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,parent.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_has_child(&self, iter: &mut TreeIter) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_has_child | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_n_children(&self, iter: Option<&mut TreeIter>) -> i32{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_n_children | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_next(&self, iter: &mut TreeIter) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_next | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_nth_child(&self, parent: Option<&mut TreeIter>, n: i32) -> Option<TreeIter>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_nth_child | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,parent.to_glib_none_mut().0,n) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_parent(&self, child: &mut TreeIter) -> Option<TreeIter>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_parent | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,child.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_iter_previous(&self, iter: &mut TreeIter) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.iter_previous | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_ref_node(&self, iter: &mut TreeIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.ref_node | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_changed(&self, path: &mut TreePath, iter: &mut TreeIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.row_changed | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_deleted(&self, path: &mut TreePath){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.row_deleted | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_has_child_toggled(&self, path: &mut TreePath, iter: &mut TreeIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.row_has_child_toggled | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_inserted(&self, path: &mut TreePath, iter: &mut TreeIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.row_inserted | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_rows_reordered(&self, path: &mut TreePath, iter: &mut TreeIter, new_order: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.rows_reordered | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0,iter.to_glib_none_mut().0,new_order) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unref_node(&self, iter: &mut TreeIter){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeModelIface; | |
(*parent_klass) | |
.unref_node | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait TreeModelIfaceExt<T: > | |
where | |
T::ImplType: <T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkTreeModelIface); | |
klass.get_column_type = Some(treemodel_get_column_type::<T>); | |
klass.get_flags = Some(treemodel_get_flags::<T>); | |
klass.get_iter = Some(treemodel_get_iter::<T>); | |
klass.get_n_columns = Some(treemodel_get_n_columns::<T>); | |
klass.get_path = Some(treemodel_get_path::<T>); | |
klass.get_value = Some(treemodel_get_value::<T>); | |
klass.iter_children = Some(treemodel_iter_children::<T>); | |
klass.iter_has_child = Some(treemodel_iter_has_child::<T>); | |
klass.iter_n_children = Some(treemodel_iter_n_children::<T>); | |
klass.iter_next = Some(treemodel_iter_next::<T>); | |
klass.iter_nth_child = Some(treemodel_iter_nth_child::<T>); | |
klass.iter_parent = Some(treemodel_iter_parent::<T>); | |
klass.iter_previous = Some(treemodel_iter_previous::<T>); | |
klass.ref_node = Some(treemodel_ref_node::<T>); | |
klass.row_changed = Some(treemodel_row_changed::<T>); | |
klass.row_deleted = Some(treemodel_row_deleted::<T>); | |
klass.row_has_child_toggled = Some(treemodel_row_has_child_toggled::<T>); | |
klass.row_inserted = Some(treemodel_row_inserted::<T>); | |
klass.rows_reordered = Some(treemodel_rows_reordered::<T>); | |
klass.unref_node = Some(treemodel_unref_node::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct TreeModel(Object<InstanceStruct<TreeModel>>) ; | |
match fn { | |
get_type => || get_type::<TreeModel>(), | |
} | |
} | |
unsafe impl<T: ObjectType > for T {} | |
pub type TreeModelClass = ClassStruct<TreeModel>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_treemodel_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::tree_model::> $crate::tree_model::<T> for Box<$name<T>>{ | |
fn get_column_type(&self, tree_model: &T, index_: i32) -> glib::types::Type{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_column_type(index_) | |
} | |
fn get_flags(&self, tree_model: &T) -> TreeModelFlags{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_flags() | |
} | |
fn get_iter(&self, tree_model: &T, path: &mut TreePath) -> Option<TreeIter>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_iter(path) | |
} | |
fn get_n_columns(&self, tree_model: &T) -> i32{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_n_columns() | |
} | |
fn get_path(&self, tree_model: &T, iter: &mut TreeIter) -> Option<TreePath>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_path(iter) | |
} | |
fn get_value(&self, tree_model: &T, iter: &mut TreeIter, column: i32) -> glib::Value{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_value(iter, column) | |
} | |
fn iter_children(&self, tree_model: &T, parent: Option<&mut TreeIter>) -> Option<TreeIter>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_children(parent) | |
} | |
fn iter_has_child(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_has_child(iter) | |
} | |
fn iter_n_children(&self, tree_model: &T, iter: Option<&mut TreeIter>) -> i32{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_n_children(iter) | |
} | |
fn iter_next(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_next(iter) | |
} | |
fn iter_nth_child(&self, tree_model: &T, parent: Option<&mut TreeIter>, n: i32) -> Option<TreeIter>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_nth_child(parent, n) | |
} | |
fn iter_parent(&self, tree_model: &T, child: &mut TreeIter) -> Option<TreeIter>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_parent(child) | |
} | |
fn iter_previous(&self, tree_model: &T, iter: &mut TreeIter) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.iter_previous(iter) | |
} | |
fn ref_node(&self, tree_model: &T, iter: &mut TreeIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.ref_node(iter) | |
} | |
fn row_changed(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_changed(path, iter) | |
} | |
fn row_deleted(&self, tree_model: &T, path: &mut TreePath){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_deleted(path) | |
} | |
fn row_has_child_toggled(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_has_child_toggled(path, iter) | |
} | |
fn row_inserted(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_inserted(path, iter) | |
} | |
fn rows_reordered(&self, tree_model: &T, path: &mut TreePath, iter: &mut TreeIter, new_order: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.rows_reordered(path, iter, new_order) | |
} | |
fn unref_node(&self, tree_model: &T, iter: &mut TreeIter){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unref_node(iter) | |
} | |
} | |
} | |
); | |
impl ObjectType for TreeModel{ | |
const NAME: &'static str = "RsGtk.TreeModel"; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut TreeModelClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn treemodel_get_column_type<T: > | |
(ptr: *mut GtkTreeModel, index_: c_int) -> GType | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_column_type() | |
} | |
unsafe extern "C" fn treemodel_get_flags<T: > | |
(ptr: *mut GtkTreeModel) -> GtkTreeModelFlags | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_flags() | |
} | |
unsafe extern "C" fn treemodel_get_iter<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter, path: *mut GtkTreePath) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_iter() | |
} | |
unsafe extern "C" fn treemodel_get_n_columns<T: > | |
(ptr: *mut GtkTreeModel) -> c_int | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_n_columns() | |
} | |
unsafe extern "C" fn treemodel_get_path<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) -> *mut GtkTreePath | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_path() | |
} | |
unsafe extern "C" fn treemodel_get_value<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter, column: c_int, value: *mut gobject::GValue) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.get_value() | |
} | |
unsafe extern "C" fn treemodel_iter_children<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter, parent: *mut GtkTreeIter) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_children() | |
} | |
unsafe extern "C" fn treemodel_iter_has_child<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_has_child() | |
} | |
unsafe extern "C" fn treemodel_iter_n_children<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) -> c_int | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_n_children() | |
} | |
unsafe extern "C" fn treemodel_iter_next<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_next() | |
} | |
unsafe extern "C" fn treemodel_iter_nth_child<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter, parent: *mut GtkTreeIter, n: c_int) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_nth_child() | |
} | |
unsafe extern "C" fn treemodel_iter_parent<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter, child: *mut GtkTreeIter) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_parent() | |
} | |
unsafe extern "C" fn treemodel_iter_previous<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.iter_previous() | |
} | |
unsafe extern "C" fn treemodel_ref_node<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.ref_node() | |
} | |
unsafe extern "C" fn treemodel_row_changed<T: > | |
(ptr: *mut GtkTreeModel, path: *mut GtkTreePath, iter: *mut GtkTreeIter) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.row_changed() | |
} | |
unsafe extern "C" fn treemodel_row_deleted<T: > | |
(ptr: *mut GtkTreeModel, path: *mut GtkTreePath) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.row_deleted() | |
} | |
unsafe extern "C" fn treemodel_row_has_child_toggled<T: > | |
(ptr: *mut GtkTreeModel, path: *mut GtkTreePath, iter: *mut GtkTreeIter) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.row_has_child_toggled() | |
} | |
unsafe extern "C" fn treemodel_row_inserted<T: > | |
(ptr: *mut GtkTreeModel, path: *mut GtkTreePath, iter: *mut GtkTreeIter) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.row_inserted() | |
} | |
unsafe extern "C" fn treemodel_rows_reordered<T: > | |
(ptr: *mut GtkTreeModel, path: *mut GtkTreePath, iter: *mut GtkTreeIter, new_order: *mut c_int) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.rows_reordered() | |
} | |
unsafe extern "C" fn treemodel_unref_node<T: > | |
(ptr: *mut GtkTreeModel, iter: *mut GtkTreeIter) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treemodel = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treemodel.get_impl(); | |
imp.unref_node() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use SelectionMode; | |
use TreeIter; | |
use TreeModel; | |
use TreePath; | |
use TreeView; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait TreeSelectionImpl<T: TreeSelectionBase>: ObjectImpl<T> + AnyImpl + 'static { | |
fn changed(&self, selection: &T){ | |
selection.parent_changed() | |
} | |
} | |
pub trait TreeSelectionImplExt<T> {} | |
} | |
impl<S: TreeSelectionImpl<T>, T: ObjectType >> TreeSelectionImplExt<T> for S {} | |
any_impl!(TreeSelectionBase, TreeSelectionImpl); | |
pub unsafe trait TreeSelectionBase: ObjectType { | |
fn parent_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSelectionClass; | |
(*parent_klass) | |
.changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait TreeSelectionClassExt<T: TreeSelectionBase> | |
where | |
T::ImplType: TreeSelectionImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkTreeSelectionClass); | |
klass.changed = Some(treeselection_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct TreeSelection(Object<InstanceStruct<TreeSelection>>) ; | |
match fn { | |
get_type => || get_type::<TreeSelection>(), | |
} | |
} | |
unsafe impl<T: ObjectType > TreeSelectionBase for T {} | |
pub type TreeSelectionClass = ClassStruct<TreeSelection>; | |
// FIXME: Boilerplate | |
#[macro_export] | |
macro_rules! box_treeselection_impl( | |
($name:ident) => { | |
box_object_impl!($name); | |
impl<T: $crate::tree_selection::TreeSelectionBase> $crate::tree_selection::TreeSelectionImpl<T> for Box<$name<T>>{ | |
fn changed(&self, selection: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.changed() | |
} | |
} | |
} | |
); | |
impl ObjectType for TreeSelection{ | |
const NAME: &'static str = "RsGtk.TreeSelection"; | |
type ImplType = Box<TreeSelectionImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut TreeSelectionClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn treeselection_changed<T: TreeSelectionBase> | |
(ptr: *mut GtkTreeSelection) | |
where | |
T::ImplType: TreeSelectionImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeselection = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeselection.get_impl(); | |
imp.changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use SortType; | |
use TreeModel; | |
use ffi; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait <T: >: gtk_subclass::TreeModelImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn get_sort_column_id(&self, sortable: &T) -> Option<(i32, SortType)>{ | |
sortable.parent_get_sort_column_id() | |
} | |
fn has_default_sort_func(&self, sortable: &T) -> bool{ | |
sortable.parent_has_default_sort_func() | |
} | |
fn set_default_sort_func(&self, sortable: &T, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
sortable.parent_set_default_sort_func(sort_func, destroy) | |
} | |
fn set_sort_column_id(&self, sortable: &T, sort_column_id: i32, order: SortType){ | |
sortable.parent_set_sort_column_id(sort_column_id, order) | |
} | |
fn set_sort_func(&self, sortable: &T, sort_column_id: i32, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
sortable.parent_set_sort_func(sort_column_id, sort_func, destroy) | |
} | |
fn sort_column_changed(&self, sortable: &T){ | |
sortable.parent_sort_column_changed() | |
} | |
} | |
pub trait Ext<T> {} | |
} | |
impl<S: <T>, T: ObjectType + glib::IsA<gtk::TreeModel>>> Ext<T> for S {} | |
any_impl!(, ); | |
pub unsafe trait : ObjectType + glib::IsA<gtk::TreeModel>{ | |
fn parent_get_sort_column_id(&self) -> Option<(i32, SortType)>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.get_sort_column_id | |
.map(|f|{ f(self.to_glib_none().0,sort_column_id,order.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_has_default_sort_func(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.has_default_sort_func | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_default_sort_func(&self, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.set_default_sort_func | |
.map(|f|{ f(self.to_glib_none().0,/*Unknown conversion*/sort_func,Box::into_raw(user_data) as *mut _,/*Unknown conversion*/destroy) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_sort_column_id(&self, sort_column_id: i32, order: SortType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.set_sort_column_id | |
.map(|f|{ f(self.to_glib_none().0,sort_column_id,order.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_sort_func(&self, sort_column_id: i32, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.set_sort_func | |
.map(|f|{ f(self.to_glib_none().0,sort_column_id,/*Unknown conversion*/sort_func,Box::into_raw(user_data) as *mut _,/*Unknown conversion*/destroy) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_sort_column_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeSortableIface; | |
(*parent_klass) | |
.sort_column_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait TreeSortableIfaceExt<T: > | |
where | |
T::ImplType: <T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkTreeSortableIface); | |
klass.get_sort_column_id = Some(treesortable_get_sort_column_id::<T>); | |
klass.has_default_sort_func = Some(treesortable_has_default_sort_func::<T>); | |
klass.set_default_sort_func = Some(treesortable_set_default_sort_func::<T>); | |
klass.set_sort_column_id = Some(treesortable_set_sort_column_id::<T>); | |
klass.set_sort_func = Some(treesortable_set_sort_func::<T>); | |
klass.sort_column_changed = Some(treesortable_sort_column_changed::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct TreeSortable(Object<InstanceStruct<TreeSortable>>):[ | |
gtk::TreeModel => gtk_ffi::GtkTreeModel] ; | |
match fn { | |
get_type => || get_type::<TreeSortable>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::TreeModel>> for T {} | |
pub type TreeSortableClass = ClassStruct<TreeSortable>; | |
// FIXME: Boilerplate | |
unsafe impl TreeModelClassExt<TreeSortable> for TreeSortableClass {} | |
#[macro_export] | |
macro_rules! box_treesortable_impl( | |
($name:ident) => { | |
box_treemodel_impl!($name); | |
impl<T: $crate::tree_sortable::> $crate::tree_sortable::<T> for Box<$name<T>>{ | |
fn get_sort_column_id(&self, sortable: &T) -> Option<(i32, SortType)>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_sort_column_id() | |
} | |
fn has_default_sort_func(&self, sortable: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.has_default_sort_func() | |
} | |
fn set_default_sort_func(&self, sortable: &T, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_default_sort_func(sort_func, destroy) | |
} | |
fn set_sort_column_id(&self, sortable: &T, sort_column_id: i32, order: SortType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_sort_column_id(sort_column_id, order) | |
} | |
fn set_sort_func(&self, sortable: &T, sort_column_id: i32, sort_func: /*Unknown conversion*//*Unimplemented*/TreeIterCompareFunc, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_sort_func(sort_column_id, sort_func, destroy) | |
} | |
fn sort_column_changed(&self, sortable: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.sort_column_changed() | |
} | |
} | |
} | |
); | |
impl ObjectType for TreeSortable{ | |
const NAME: &'static str = "RsGtk.TreeSortable"; | |
type ImplType = Box<<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut TreeSortableClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
TreeModelClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn treesortable_get_sort_column_id<T: > | |
(ptr: *mut GtkTreeSortable, sort_column_id: *mut c_int, order: *mut GtkSortType) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.get_sort_column_id() | |
} | |
unsafe extern "C" fn treesortable_has_default_sort_func<T: > | |
(ptr: *mut GtkTreeSortable) -> gboolean | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.has_default_sort_func() | |
} | |
unsafe extern "C" fn treesortable_set_default_sort_func<T: > | |
(ptr: *mut GtkTreeSortable, sort_func: GtkTreeIterCompareFunc, user_data: gpointer, destroy: glib::GDestroyNotify) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.set_default_sort_func() | |
} | |
unsafe extern "C" fn treesortable_set_sort_column_id<T: > | |
(ptr: *mut GtkTreeSortable, sort_column_id: c_int, order: GtkSortType) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.set_sort_column_id() | |
} | |
unsafe extern "C" fn treesortable_set_sort_func<T: > | |
(ptr: *mut GtkTreeSortable, sort_column_id: c_int, sort_func: GtkTreeIterCompareFunc, user_data: gpointer, destroy: glib::GDestroyNotify) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.set_sort_func() | |
} | |
unsafe extern "C" fn treesortable_sort_column_changed<T: > | |
(ptr: *mut GtkTreeSortable) | |
where | |
T::ImplType: <T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treesortable = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treesortable.get_impl(); | |
imp.sort_column_changed() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Container; | |
use MovementStep; | |
use TreeIter; | |
use TreeModel; | |
use TreePath; | |
use TreeSelection; | |
use TreeViewDropPosition; | |
use TreeViewGridLines; | |
use Widget; | |
use ffi; | |
use gdk; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait TreeViewImpl<T: TreeViewBase>: gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ScrollableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn columns_changed(&self, tree_view: &T){ | |
tree_view.parent_columns_changed() | |
} | |
fn cursor_changed(&self, tree_view: &T){ | |
tree_view.parent_cursor_changed() | |
} | |
fn expand_collapse_cursor_row(&self, tree_view: &T, logical: bool, expand: bool, open_all: bool) -> bool{ | |
tree_view.parent_expand_collapse_cursor_row(logical, expand, open_all) | |
} | |
fn move_cursor(&self, tree_view: &T, step: MovementStep, count: i32) -> bool{ | |
tree_view.parent_move_cursor(step, count) | |
} | |
fn row_activated(&self, tree_view: &T, path: &mut TreePath, column: /*Ignored*/&TreeViewColumn){ | |
tree_view.parent_row_activated(path, column) | |
} | |
fn row_collapsed(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath){ | |
tree_view.parent_row_collapsed(iter, path) | |
} | |
fn row_expanded(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath){ | |
tree_view.parent_row_expanded(iter, path) | |
} | |
fn select_all(&self, tree_view: &T) -> bool{ | |
tree_view.parent_select_all() | |
} | |
fn select_cursor_parent(&self, tree_view: &T) -> bool{ | |
tree_view.parent_select_cursor_parent() | |
} | |
fn select_cursor_row(&self, tree_view: &T, start_editing: bool) -> bool{ | |
tree_view.parent_select_cursor_row(start_editing) | |
} | |
fn start_interactive_search(&self, tree_view: &T) -> bool{ | |
tree_view.parent_start_interactive_search() | |
} | |
fn test_collapse_row(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
tree_view.parent_test_collapse_row(iter, path) | |
} | |
fn test_expand_row(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
tree_view.parent_test_expand_row(iter, path) | |
} | |
fn toggle_cursor_row(&self, tree_view: &T) -> bool{ | |
tree_view.parent_toggle_cursor_row() | |
} | |
fn unselect_all(&self, tree_view: &T) -> bool{ | |
tree_view.parent_unselect_all() | |
} | |
} | |
pub trait TreeViewImplExt<T> {} | |
} | |
impl<S: TreeViewImpl<T>, T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>>> TreeViewImplExt<T> for S {} | |
any_impl!(TreeViewBase, TreeViewImpl); | |
pub unsafe trait TreeViewBase: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>{ | |
fn parent_columns_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.columns_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_cursor_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.cursor_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_expand_collapse_cursor_row(&self, logical: bool, expand: bool, open_all: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.expand_collapse_cursor_row | |
.map(|f|{ f(self.to_glib_none().0,logical.to_glib(),expand.to_glib(),open_all.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_cursor(&self, step: MovementStep, count: i32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.move_cursor | |
.map(|f|{ f(self.to_glib_none().0,step.to_glib(),count) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_activated(&self, path: &mut TreePath, column: /*Ignored*/&TreeViewColumn){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.row_activated | |
.map(|f|{ f(self.to_glib_none().0,path.to_glib_none_mut().0,column.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_collapsed(&self, iter: &mut TreeIter, path: &mut TreePath){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.row_collapsed | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_row_expanded(&self, iter: &mut TreeIter, path: &mut TreePath){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.row_expanded | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_all(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.select_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_cursor_parent(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.select_cursor_parent | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_select_cursor_row(&self, start_editing: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.select_cursor_row | |
.map(|f|{ f(self.to_glib_none().0,start_editing.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_start_interactive_search(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.start_interactive_search | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_test_collapse_row(&self, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.test_collapse_row | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_test_expand_row(&self, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.test_expand_row | |
.map(|f|{ f(self.to_glib_none().0,iter.to_glib_none_mut().0,path.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_toggle_cursor_row(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.toggle_cursor_row | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unselect_all(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkTreeViewClass; | |
(*parent_klass) | |
.unselect_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait TreeViewClassExt<T: TreeViewBase> | |
where | |
T::ImplType: TreeViewImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkTreeViewClass); | |
klass.columns_changed = Some(treeview_columns_changed::<T>); | |
klass.cursor_changed = Some(treeview_cursor_changed::<T>); | |
klass.expand_collapse_cursor_row = Some(treeview_expand_collapse_cursor_row::<T>); | |
klass.move_cursor = Some(treeview_move_cursor::<T>); | |
klass.row_activated = Some(treeview_row_activated::<T>); | |
klass.row_collapsed = Some(treeview_row_collapsed::<T>); | |
klass.row_expanded = Some(treeview_row_expanded::<T>); | |
klass.select_all = Some(treeview_select_all::<T>); | |
klass.select_cursor_parent = Some(treeview_select_cursor_parent::<T>); | |
klass.select_cursor_row = Some(treeview_select_cursor_row::<T>); | |
klass.start_interactive_search = Some(treeview_start_interactive_search::<T>); | |
klass.test_collapse_row = Some(treeview_test_collapse_row::<T>); | |
klass.test_expand_row = Some(treeview_test_expand_row::<T>); | |
klass.toggle_cursor_row = Some(treeview_toggle_cursor_row::<T>); | |
klass.unselect_all = Some(treeview_unselect_all::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct TreeView(Object<InstanceStruct<TreeView>>):[ | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Scrollable => gtk_ffi::GtkScrollable] ; | |
match fn { | |
get_type => || get_type::<TreeView>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>> TreeViewBase for T {} | |
pub type TreeViewClass = ClassStruct<TreeView>; | |
// FIXME: Boilerplate | |
unsafe impl ContainerClassExt<TreeView> for TreeViewClass {} | |
unsafe impl WidgetClassExt<TreeView> for TreeViewClass {} | |
unsafe impl InitiallyUnownedClassExt<TreeView> for TreeViewClass {} | |
unsafe impl ImplementorIfaceClassExt<TreeView> for TreeViewClass {} | |
unsafe impl BuildableClassExt<TreeView> for TreeViewClass {} | |
unsafe impl ScrollableClassExt<TreeView> for TreeViewClass {} | |
#[macro_export] | |
macro_rules! box_treeview_impl( | |
($name:ident) => { | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::tree_view::TreeViewBase> $crate::tree_view::TreeViewImpl<T> for Box<$name<T>>{ | |
fn columns_changed(&self, tree_view: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.columns_changed() | |
} | |
fn cursor_changed(&self, tree_view: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.cursor_changed() | |
} | |
fn expand_collapse_cursor_row(&self, tree_view: &T, logical: bool, expand: bool, open_all: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.expand_collapse_cursor_row(logical, expand, open_all) | |
} | |
fn move_cursor(&self, tree_view: &T, step: MovementStep, count: i32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_cursor(step, count) | |
} | |
fn row_activated(&self, tree_view: &T, path: &mut TreePath, column: /*Ignored*/&TreeViewColumn){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_activated(path, column) | |
} | |
fn row_collapsed(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_collapsed(iter, path) | |
} | |
fn row_expanded(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.row_expanded(iter, path) | |
} | |
fn select_all(&self, tree_view: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_all() | |
} | |
fn select_cursor_parent(&self, tree_view: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_cursor_parent() | |
} | |
fn select_cursor_row(&self, tree_view: &T, start_editing: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.select_cursor_row(start_editing) | |
} | |
fn start_interactive_search(&self, tree_view: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.start_interactive_search() | |
} | |
fn test_collapse_row(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.test_collapse_row(iter, path) | |
} | |
fn test_expand_row(&self, tree_view: &T, iter: &mut TreeIter, path: &mut TreePath) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.test_expand_row(iter, path) | |
} | |
fn toggle_cursor_row(&self, tree_view: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.toggle_cursor_row() | |
} | |
fn unselect_all(&self, tree_view: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unselect_all() | |
} | |
} | |
} | |
); | |
impl ObjectType for TreeView{ | |
const NAME: &'static str = "RsGtk.TreeView"; | |
type ParentType = gtk::Container; | |
type ImplType = Box<TreeViewImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut TreeViewClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ScrollableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn treeview_columns_changed<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.columns_changed() | |
} | |
unsafe extern "C" fn treeview_cursor_changed<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.cursor_changed() | |
} | |
unsafe extern "C" fn treeview_expand_collapse_cursor_row<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, logical: gboolean, expand: gboolean, open_all: gboolean) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.expand_collapse_cursor_row() | |
} | |
unsafe extern "C" fn treeview_move_cursor<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, step: GtkMovementStep, count: c_int) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.move_cursor() | |
} | |
unsafe extern "C" fn treeview_row_activated<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, path: *mut GtkTreePath, column: *mut GtkTreeViewColumn) | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.row_activated() | |
} | |
unsafe extern "C" fn treeview_row_collapsed<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, iter: *mut GtkTreeIter, path: *mut GtkTreePath) | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.row_collapsed() | |
} | |
unsafe extern "C" fn treeview_row_expanded<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, iter: *mut GtkTreeIter, path: *mut GtkTreePath) | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.row_expanded() | |
} | |
unsafe extern "C" fn treeview_select_all<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.select_all() | |
} | |
unsafe extern "C" fn treeview_select_cursor_parent<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.select_cursor_parent() | |
} | |
unsafe extern "C" fn treeview_select_cursor_row<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, start_editing: gboolean) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.select_cursor_row() | |
} | |
unsafe extern "C" fn treeview_start_interactive_search<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.start_interactive_search() | |
} | |
unsafe extern "C" fn treeview_test_collapse_row<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, iter: *mut GtkTreeIter, path: *mut GtkTreePath) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.test_collapse_row() | |
} | |
unsafe extern "C" fn treeview_test_expand_row<T: TreeViewBase> | |
(ptr: *mut GtkTreeView, iter: *mut GtkTreeIter, path: *mut GtkTreePath) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.test_expand_row() | |
} | |
unsafe extern "C" fn treeview_toggle_cursor_row<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.toggle_cursor_row() | |
} | |
unsafe extern "C" fn treeview_unselect_all<T: TreeViewBase> | |
(ptr: *mut GtkTreeView) -> gboolean | |
where | |
T::ImplType: TreeViewImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let treeview = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = treeview.get_impl(); | |
imp.unselect_all() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use Adjustment; | |
use Bin; | |
use Container; | |
use ShadowType; | |
use Widget; | |
use ffi; | |
use gdk; | |
use glib; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait ViewportImpl<T: ViewportBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + gtk_subclass::ScrollableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
} | |
pub trait ViewportImplExt<T> {} | |
} | |
impl<S: ViewportImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>>> ViewportImplExt<T> for S {} | |
any_impl!(ViewportBase, ViewportImpl); | |
pub unsafe trait ViewportBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>{ | |
} | |
pub unsafe trait ViewportClassExt<T: ViewportBase> | |
where | |
T::ImplType: ViewportImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkViewportClass); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Viewport(Object<InstanceStruct<Viewport>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable | |
gtk::Scrollable => gtk_ffi::GtkScrollable] ; | |
match fn { | |
get_type => || get_type::<Viewport>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable> + glib::IsA<gtk::Scrollable>> ViewportBase for T {} | |
pub type ViewportClass = ClassStruct<Viewport>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Viewport> for ViewportClass {} | |
unsafe impl ContainerClassExt<Viewport> for ViewportClass {} | |
unsafe impl WidgetClassExt<Viewport> for ViewportClass {} | |
unsafe impl InitiallyUnownedClassExt<Viewport> for ViewportClass {} | |
unsafe impl ImplementorIfaceClassExt<Viewport> for ViewportClass {} | |
unsafe impl BuildableClassExt<Viewport> for ViewportClass {} | |
unsafe impl ScrollableClassExt<Viewport> for ViewportClass {} | |
#[macro_export] | |
macro_rules! box_viewport_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::viewport::ViewportBase> $crate::viewport::ViewportImpl<T> for Box<$name<T>>{ | |
} | |
} | |
); | |
impl ObjectType for Viewport{ | |
const NAME: &'static str = "RsGtk.Viewport"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<ViewportImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut ViewportClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
ScrollableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use AccelGroup; | |
use Align; | |
use Allocation; | |
use DirectionType; | |
use Orientation; | |
use SizeRequestMode; | |
use StateFlags; | |
use StateType; | |
use TextDirection; | |
use WidgetHelpType; | |
use WidgetPath; | |
use Window; | |
use ffi; | |
use gdk; | |
use gdk_ffi; | |
use gdk_pixbuf; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use libc; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait WidgetImpl<T: WidgetBase>: gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn adjust_baseline_allocation(&self, widget: &T, baseline: i32){ | |
widget.parent_adjust_baseline_allocation(baseline) | |
} | |
fn adjust_baseline_request(&self, widget: &T, minimum_baseline: i32, natural_baseline: i32){ | |
widget.parent_adjust_baseline_request(minimum_baseline, natural_baseline) | |
} | |
fn adjust_size_allocation(&self, widget: &T, orientation: Orientation, minimum_size: i32, natural_size: i32, allocated_pos: i32, allocated_size: i32){ | |
widget.parent_adjust_size_allocation(orientation, minimum_size, natural_size, allocated_pos, allocated_size) | |
} | |
fn adjust_size_request(&self, widget: &T, orientation: Orientation, minimum_size: i32, natural_size: i32){ | |
widget.parent_adjust_size_request(orientation, minimum_size, natural_size) | |
} | |
fn button_press_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
widget.parent_button_press_event(event) | |
} | |
fn button_release_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
widget.parent_button_release_event(event) | |
} | |
fn can_activate_accel(&self, widget: &T, signal_id: u32) -> bool{ | |
widget.parent_can_activate_accel(signal_id) | |
} | |
fn child_notify(&self, widget: &T, child_property: /*Ignored*/&glib::ParamSpec){ | |
widget.parent_child_notify(child_property) | |
} | |
fn composited_changed(&self, widget: &T){ | |
widget.parent_composited_changed() | |
} | |
fn compute_expand(&self, widget: &T, hexpand_p: bool, vexpand_p: bool){ | |
widget.parent_compute_expand(hexpand_p, vexpand_p) | |
} | |
fn configure_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventConfigure) -> bool{ | |
widget.parent_configure_event(event) | |
} | |
fn damage_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventExpose) -> bool{ | |
widget.parent_damage_event(event) | |
} | |
fn delete_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
widget.parent_delete_event(event) | |
} | |
fn destroy(&self, widget: &T){ | |
widget.parent_destroy() | |
} | |
fn destroy_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
widget.parent_destroy_event(event) | |
} | |
fn direction_changed(&self, widget: &T, previous_direction: TextDirection){ | |
widget.parent_direction_changed(previous_direction) | |
} | |
fn dispatch_child_properties_changed(&self, widget: &T, n_pspecs: u32, pspecs: /*Ignored*/&glib::ParamSpec){ | |
widget.parent_dispatch_child_properties_changed(n_pspecs, pspecs) | |
} | |
fn drag_begin(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
widget.parent_drag_begin(context) | |
} | |
fn drag_data_delete(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
widget.parent_drag_data_delete(context) | |
} | |
fn drag_data_get(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
widget.parent_drag_data_get(context, selection_data, info, time_) | |
} | |
fn drag_data_received(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
widget.parent_drag_data_received(context, x, y, selection_data, info, time_) | |
} | |
fn drag_drop(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
widget.parent_drag_drop(context, x, y, time_) | |
} | |
fn drag_end(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
widget.parent_drag_end(context) | |
} | |
fn drag_failed(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, result: /*Ignored*/DragResult) -> bool{ | |
widget.parent_drag_failed(context, result) | |
} | |
fn drag_leave(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, time_: u32){ | |
widget.parent_drag_leave(context, time_) | |
} | |
fn drag_motion(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
widget.parent_drag_motion(context, x, y, time_) | |
} | |
fn draw(&self, widget: &T, cr: /*Ignored*/&mut cairo::Context) -> bool{ | |
widget.parent_draw(cr) | |
} | |
fn enter_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
widget.parent_enter_notify_event(event) | |
} | |
fn event(&self, widget: &T, event: /*Ignored*/&mut gdk::Event) -> bool{ | |
widget.parent_event(event) | |
} | |
fn focus(&self, widget: &T, direction: DirectionType) -> bool{ | |
widget.parent_focus(direction) | |
} | |
fn focus_in_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
widget.parent_focus_in_event(event) | |
} | |
fn focus_out_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
widget.parent_focus_out_event(event) | |
} | |
fn get_accessible(&self, widget: &T) -> /*Ignored*/Option<atk::Object>{ | |
widget.parent_get_accessible() | |
} | |
fn get_preferred_height(&self, widget: &T) -> (i32, i32){ | |
widget.parent_get_preferred_height() | |
} | |
fn get_preferred_height_and_baseline_for_width(&self, widget: &T, width: i32) -> (i32, i32, i32, i32){ | |
widget.parent_get_preferred_height_and_baseline_for_width(width) | |
} | |
fn get_preferred_height_for_width(&self, widget: &T, width: i32) -> (i32, i32){ | |
widget.parent_get_preferred_height_for_width(width) | |
} | |
fn get_preferred_width(&self, widget: &T) -> (i32, i32){ | |
widget.parent_get_preferred_width() | |
} | |
fn get_preferred_width_for_height(&self, widget: &T, height: i32) -> (i32, i32){ | |
widget.parent_get_preferred_width_for_height(height) | |
} | |
fn get_request_mode(&self, widget: &T) -> SizeRequestMode{ | |
widget.parent_get_request_mode() | |
} | |
fn grab_broken_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventGrabBroken) -> bool{ | |
widget.parent_grab_broken_event(event) | |
} | |
fn grab_focus(&self, widget: &T){ | |
widget.parent_grab_focus() | |
} | |
fn grab_notify(&self, widget: &T, was_grabbed: bool){ | |
widget.parent_grab_notify(was_grabbed) | |
} | |
fn hide(&self, widget: &T){ | |
widget.parent_hide() | |
} | |
fn hierarchy_changed(&self, widget: &T, previous_toplevel: &Widget){ | |
widget.parent_hierarchy_changed(previous_toplevel) | |
} | |
fn key_press_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
widget.parent_key_press_event(event) | |
} | |
fn key_release_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
widget.parent_key_release_event(event) | |
} | |
fn keynav_failed(&self, widget: &T, direction: DirectionType) -> bool{ | |
widget.parent_keynav_failed(direction) | |
} | |
fn leave_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
widget.parent_leave_notify_event(event) | |
} | |
fn map(&self, widget: &T){ | |
widget.parent_map() | |
} | |
fn map_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
widget.parent_map_event(event) | |
} | |
fn mnemonic_activate(&self, widget: &T, group_cycling: bool) -> bool{ | |
widget.parent_mnemonic_activate(group_cycling) | |
} | |
fn motion_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventMotion) -> bool{ | |
widget.parent_motion_notify_event(event) | |
} | |
fn move_focus(&self, widget: &T, direction: DirectionType){ | |
widget.parent_move_focus(direction) | |
} | |
fn parent_set(&self, widget: &T, previous_parent: &Widget){ | |
widget.parent_parent_set(previous_parent) | |
} | |
fn popup_menu(&self, widget: &T) -> bool{ | |
widget.parent_popup_menu() | |
} | |
fn property_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProperty) -> bool{ | |
widget.parent_property_notify_event(event) | |
} | |
fn proximity_in_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
widget.parent_proximity_in_event(event) | |
} | |
fn proximity_out_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
widget.parent_proximity_out_event(event) | |
} | |
fn query_tooltip(&self, widget: &T, x: i32, y: i32, keyboard_tooltip: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
widget.parent_query_tooltip(x, y, keyboard_tooltip, tooltip) | |
} | |
fn queue_draw_region(&self, widget: &T, region: /*Ignored*/&cairo::Region){ | |
widget.parent_queue_draw_region(region) | |
} | |
fn realize(&self, widget: &T){ | |
widget.parent_realize() | |
} | |
fn screen_changed(&self, widget: &T, previous_screen: &gdk::Screen){ | |
widget.parent_screen_changed(previous_screen) | |
} | |
fn scroll_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
widget.parent_scroll_event(event) | |
} | |
fn selection_clear_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
widget.parent_selection_clear_event(event) | |
} | |
fn selection_get(&self, widget: &T, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
widget.parent_selection_get(selection_data, info, time_) | |
} | |
fn selection_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
widget.parent_selection_notify_event(event) | |
} | |
fn selection_received(&self, widget: &T, selection_data: /*Ignored*/&mut SelectionData, time_: u32){ | |
widget.parent_selection_received(selection_data, time_) | |
} | |
fn selection_request_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
widget.parent_selection_request_event(event) | |
} | |
fn show(&self, widget: &T){ | |
widget.parent_show() | |
} | |
fn show_all(&self, widget: &T){ | |
widget.parent_show_all() | |
} | |
fn show_help(&self, widget: &T, help_type: WidgetHelpType) -> bool{ | |
widget.parent_show_help(help_type) | |
} | |
fn size_allocate(&self, widget: &T, allocation: &mut Allocation){ | |
widget.parent_size_allocate(allocation) | |
} | |
fn state_changed(&self, widget: &T, previous_state: StateType){ | |
widget.parent_state_changed(previous_state) | |
} | |
fn state_flags_changed(&self, widget: &T, previous_state_flags: StateFlags){ | |
widget.parent_state_flags_changed(previous_state_flags) | |
} | |
fn style_set(&self, widget: &T, previous_style: /*Ignored*/&Style){ | |
widget.parent_style_set(previous_style) | |
} | |
fn style_updated(&self, widget: &T){ | |
widget.parent_style_updated() | |
} | |
fn touch_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventTouch) -> bool{ | |
widget.parent_touch_event(event) | |
} | |
fn unmap(&self, widget: &T){ | |
widget.parent_unmap() | |
} | |
fn unmap_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
widget.parent_unmap_event(event) | |
} | |
fn unrealize(&self, widget: &T){ | |
widget.parent_unrealize() | |
} | |
fn visibility_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventVisibility) -> bool{ | |
widget.parent_visibility_notify_event(event) | |
} | |
fn window_state_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventWindowState) -> bool{ | |
widget.parent_window_state_event(event) | |
} | |
} | |
pub trait WidgetImplExt<T> {} | |
} | |
impl<S: WidgetImpl<T>, T: ObjectType + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> WidgetImplExt<T> for S {} | |
any_impl!(WidgetBase, WidgetImpl); | |
pub unsafe trait WidgetBase: ObjectType + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_adjust_baseline_allocation(&self, baseline: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.adjust_baseline_allocation | |
.map(|f|{ f(self.to_glib_none().0,baseline) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_adjust_baseline_request(&self, minimum_baseline: i32, natural_baseline: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.adjust_baseline_request | |
.map(|f|{ f(self.to_glib_none().0,minimum_baseline,natural_baseline) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_adjust_size_allocation(&self, orientation: Orientation, minimum_size: i32, natural_size: i32, allocated_pos: i32, allocated_size: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.adjust_size_allocation | |
.map(|f|{ f(self.to_glib_none().0,orientation.to_glib(),minimum_size,natural_size,allocated_pos,allocated_size) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_adjust_size_request(&self, orientation: Orientation, minimum_size: i32, natural_size: i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.adjust_size_request | |
.map(|f|{ f(self.to_glib_none().0,orientation.to_glib(),minimum_size,natural_size) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_button_press_event(&self, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.button_press_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_button_release_event(&self, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.button_release_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_can_activate_accel(&self, signal_id: u32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.can_activate_accel | |
.map(|f|{ f(self.to_glib_none().0,signal_id) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_child_notify(&self, child_property: /*Ignored*/&glib::ParamSpec){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.child_notify | |
.map(|f|{ f(self.to_glib_none().0,child_property.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_composited_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.composited_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_compute_expand(&self, hexpand_p: bool, vexpand_p: bool){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.compute_expand | |
.map(|f|{ f(self.to_glib_none().0,hexpand_p.to_glib(),vexpand_p.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_configure_event(&self, event: /*Ignored*/&mut gdk::EventConfigure) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.configure_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_damage_event(&self, event: /*Ignored*/&mut gdk::EventExpose) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.damage_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_delete_event(&self, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.delete_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_destroy(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.destroy | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_destroy_event(&self, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.destroy_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_direction_changed(&self, previous_direction: TextDirection){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.direction_changed | |
.map(|f|{ f(self.to_glib_none().0,previous_direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_dispatch_child_properties_changed(&self, n_pspecs: u32, pspecs: /*Ignored*/&glib::ParamSpec){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.dispatch_child_properties_changed | |
.map(|f|{ f(self.to_glib_none().0,n_pspecs,pspecs.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_begin(&self, context: /*Ignored*/&gdk::DragContext){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_begin | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_data_delete(&self, context: /*Ignored*/&gdk::DragContext){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_data_delete | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_data_get(&self, context: /*Ignored*/&gdk::DragContext, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_data_get | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,selection_data.to_glib_none_mut().0,info,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_data_received(&self, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_data_received | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,x,y,selection_data.to_glib_none_mut().0,info,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_drop(&self, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_drop | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,x,y,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_end(&self, context: /*Ignored*/&gdk::DragContext){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_end | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_failed(&self, context: /*Ignored*/&gdk::DragContext, result: /*Ignored*/DragResult) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_failed | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,result.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_leave(&self, context: /*Ignored*/&gdk::DragContext, time_: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_leave | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_drag_motion(&self, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.drag_motion | |
.map(|f|{ f(self.to_glib_none().0,context.to_glib_none().0,x,y,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_draw(&self, cr: /*Ignored*/&mut cairo::Context) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.draw | |
.map(|f|{ f(self.to_glib_none().0,cr.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_enter_notify_event(&self, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.enter_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_event(&self, event: /*Ignored*/&mut gdk::Event) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_focus(&self, direction: DirectionType) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.focus | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_focus_in_event(&self, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.focus_in_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_focus_out_event(&self, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.focus_out_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_accessible(&self) -> /*Ignored*/Option<atk::Object>{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_accessible | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_preferred_height(&self) -> (i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_preferred_height | |
.map(|f|{ f(self.to_glib_none().0,minimum_height,natural_height) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_preferred_height_and_baseline_for_width | |
.map(|f|{ f(self.to_glib_none().0,width,minimum_height,natural_height,minimum_baseline,natural_baseline) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_preferred_height_for_width(&self, width: i32) -> (i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_preferred_height_for_width | |
.map(|f|{ f(self.to_glib_none().0,width,minimum_height,natural_height) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_preferred_width(&self) -> (i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_preferred_width | |
.map(|f|{ f(self.to_glib_none().0,minimum_width,natural_width) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_preferred_width_for_height(&self, height: i32) -> (i32, i32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_preferred_width_for_height | |
.map(|f|{ f(self.to_glib_none().0,height,minimum_width,natural_width) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_get_request_mode(&self) -> SizeRequestMode{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.get_request_mode | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_grab_broken_event(&self, event: /*Ignored*/&mut gdk::EventGrabBroken) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.grab_broken_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_grab_focus(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.grab_focus | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_grab_notify(&self, was_grabbed: bool){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.grab_notify | |
.map(|f|{ f(self.to_glib_none().0,was_grabbed.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_hide(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.hide | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_hierarchy_changed(&self, previous_toplevel: &Widget){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.hierarchy_changed | |
.map(|f|{ f(self.to_glib_none().0,previous_toplevel.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_key_press_event(&self, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.key_press_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_key_release_event(&self, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.key_release_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_keynav_failed(&self, direction: DirectionType) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.keynav_failed | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_leave_notify_event(&self, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.leave_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_map(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.map | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_map_event(&self, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.map_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_mnemonic_activate(&self, group_cycling: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.mnemonic_activate | |
.map(|f|{ f(self.to_glib_none().0,group_cycling.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_motion_notify_event(&self, event: /*Ignored*/&mut gdk::EventMotion) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.motion_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_move_focus(&self, direction: DirectionType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.move_focus | |
.map(|f|{ f(self.to_glib_none().0,direction.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_parent_set(&self, previous_parent: &Widget){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.parent_set | |
.map(|f|{ f(self.to_glib_none().0,previous_parent.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_popup_menu(&self) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.popup_menu | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_property_notify_event(&self, event: /*Ignored*/&mut gdk::EventProperty) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.property_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_proximity_in_event(&self, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.proximity_in_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_proximity_out_event(&self, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.proximity_out_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_query_tooltip(&self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.query_tooltip | |
.map(|f|{ f(self.to_glib_none().0,x,y,keyboard_tooltip.to_glib(),tooltip.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_queue_draw_region(&self, region: /*Ignored*/&cairo::Region){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.queue_draw_region | |
.map(|f|{ f(self.to_glib_none().0,region.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_realize(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.realize | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_screen_changed(&self, previous_screen: &gdk::Screen){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.screen_changed | |
.map(|f|{ f(self.to_glib_none().0,previous_screen.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_scroll_event(&self, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.scroll_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selection_clear_event(&self, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.selection_clear_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selection_get(&self, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.selection_get | |
.map(|f|{ f(self.to_glib_none().0,selection_data.to_glib_none_mut().0,info,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selection_notify_event(&self, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.selection_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selection_received(&self, selection_data: /*Ignored*/&mut SelectionData, time_: u32){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.selection_received | |
.map(|f|{ f(self.to_glib_none().0,selection_data.to_glib_none_mut().0,time_) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_selection_request_event(&self, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.selection_request_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_show(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.show | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_show_all(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.show_all | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_show_help(&self, help_type: WidgetHelpType) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.show_help | |
.map(|f|{ f(self.to_glib_none().0,help_type.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_size_allocate(&self, allocation: &mut Allocation){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.size_allocate | |
.map(|f|{ f(self.to_glib_none().0,allocation.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_state_changed(&self, previous_state: StateType){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.state_changed | |
.map(|f|{ f(self.to_glib_none().0,previous_state.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_state_flags_changed(&self, previous_state_flags: StateFlags){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.state_flags_changed | |
.map(|f|{ f(self.to_glib_none().0,previous_state_flags.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_style_set(&self, previous_style: /*Ignored*/&Style){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.style_set | |
.map(|f|{ f(self.to_glib_none().0,previous_style.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_style_updated(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.style_updated | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_touch_event(&self, event: /*Ignored*/&mut gdk::EventTouch) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.touch_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unmap(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.unmap | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unmap_event(&self, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.unmap_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_unrealize(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.unrealize | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_visibility_notify_event(&self, event: /*Ignored*/&mut gdk::EventVisibility) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.visibility_notify_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_window_state_event(&self, event: /*Ignored*/&mut gdk::EventWindowState) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWidgetClass; | |
(*parent_klass) | |
.window_state_event | |
.map(|f|{ f(self.to_glib_none().0,event.to_glib_none_mut().0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait WidgetClassExt<T: WidgetBase> | |
where | |
T::ImplType: WidgetImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkWidgetClass); | |
klass.adjust_baseline_allocation = Some(widget_adjust_baseline_allocation::<T>); | |
klass.adjust_baseline_request = Some(widget_adjust_baseline_request::<T>); | |
klass.adjust_size_allocation = Some(widget_adjust_size_allocation::<T>); | |
klass.adjust_size_request = Some(widget_adjust_size_request::<T>); | |
klass.button_press_event = Some(widget_button_press_event::<T>); | |
klass.button_release_event = Some(widget_button_release_event::<T>); | |
klass.can_activate_accel = Some(widget_can_activate_accel::<T>); | |
klass.child_notify = Some(widget_child_notify::<T>); | |
klass.composited_changed = Some(widget_composited_changed::<T>); | |
klass.compute_expand = Some(widget_compute_expand::<T>); | |
klass.configure_event = Some(widget_configure_event::<T>); | |
klass.damage_event = Some(widget_damage_event::<T>); | |
klass.delete_event = Some(widget_delete_event::<T>); | |
klass.destroy = Some(widget_destroy::<T>); | |
klass.destroy_event = Some(widget_destroy_event::<T>); | |
klass.direction_changed = Some(widget_direction_changed::<T>); | |
klass.dispatch_child_properties_changed = Some(widget_dispatch_child_properties_changed::<T>); | |
klass.drag_begin = Some(widget_drag_begin::<T>); | |
klass.drag_data_delete = Some(widget_drag_data_delete::<T>); | |
klass.drag_data_get = Some(widget_drag_data_get::<T>); | |
klass.drag_data_received = Some(widget_drag_data_received::<T>); | |
klass.drag_drop = Some(widget_drag_drop::<T>); | |
klass.drag_end = Some(widget_drag_end::<T>); | |
klass.drag_failed = Some(widget_drag_failed::<T>); | |
klass.drag_leave = Some(widget_drag_leave::<T>); | |
klass.drag_motion = Some(widget_drag_motion::<T>); | |
klass.draw = Some(widget_draw::<T>); | |
klass.enter_notify_event = Some(widget_enter_notify_event::<T>); | |
klass.event = Some(widget_event::<T>); | |
klass.focus = Some(widget_focus::<T>); | |
klass.focus_in_event = Some(widget_focus_in_event::<T>); | |
klass.focus_out_event = Some(widget_focus_out_event::<T>); | |
klass.get_accessible = Some(widget_get_accessible::<T>); | |
klass.get_preferred_height = Some(widget_get_preferred_height::<T>); | |
klass.get_preferred_height_and_baseline_for_width = Some(widget_get_preferred_height_and_baseline_for_width::<T>); | |
klass.get_preferred_height_for_width = Some(widget_get_preferred_height_for_width::<T>); | |
klass.get_preferred_width = Some(widget_get_preferred_width::<T>); | |
klass.get_preferred_width_for_height = Some(widget_get_preferred_width_for_height::<T>); | |
klass.get_request_mode = Some(widget_get_request_mode::<T>); | |
klass.grab_broken_event = Some(widget_grab_broken_event::<T>); | |
klass.grab_focus = Some(widget_grab_focus::<T>); | |
klass.grab_notify = Some(widget_grab_notify::<T>); | |
klass.hide = Some(widget_hide::<T>); | |
klass.hierarchy_changed = Some(widget_hierarchy_changed::<T>); | |
klass.key_press_event = Some(widget_key_press_event::<T>); | |
klass.key_release_event = Some(widget_key_release_event::<T>); | |
klass.keynav_failed = Some(widget_keynav_failed::<T>); | |
klass.leave_notify_event = Some(widget_leave_notify_event::<T>); | |
klass.map = Some(widget_map::<T>); | |
klass.map_event = Some(widget_map_event::<T>); | |
klass.mnemonic_activate = Some(widget_mnemonic_activate::<T>); | |
klass.motion_notify_event = Some(widget_motion_notify_event::<T>); | |
klass.move_focus = Some(widget_move_focus::<T>); | |
klass.parent_set = Some(widget_parent_set::<T>); | |
klass.popup_menu = Some(widget_popup_menu::<T>); | |
klass.property_notify_event = Some(widget_property_notify_event::<T>); | |
klass.proximity_in_event = Some(widget_proximity_in_event::<T>); | |
klass.proximity_out_event = Some(widget_proximity_out_event::<T>); | |
klass.query_tooltip = Some(widget_query_tooltip::<T>); | |
klass.queue_draw_region = Some(widget_queue_draw_region::<T>); | |
klass.realize = Some(widget_realize::<T>); | |
klass.screen_changed = Some(widget_screen_changed::<T>); | |
klass.scroll_event = Some(widget_scroll_event::<T>); | |
klass.selection_clear_event = Some(widget_selection_clear_event::<T>); | |
klass.selection_get = Some(widget_selection_get::<T>); | |
klass.selection_notify_event = Some(widget_selection_notify_event::<T>); | |
klass.selection_received = Some(widget_selection_received::<T>); | |
klass.selection_request_event = Some(widget_selection_request_event::<T>); | |
klass.show = Some(widget_show::<T>); | |
klass.show_all = Some(widget_show_all::<T>); | |
klass.show_help = Some(widget_show_help::<T>); | |
klass.size_allocate = Some(widget_size_allocate::<T>); | |
klass.state_changed = Some(widget_state_changed::<T>); | |
klass.state_flags_changed = Some(widget_state_flags_changed::<T>); | |
klass.style_set = Some(widget_style_set::<T>); | |
klass.style_updated = Some(widget_style_updated::<T>); | |
klass.touch_event = Some(widget_touch_event::<T>); | |
klass.unmap = Some(widget_unmap::<T>); | |
klass.unmap_event = Some(widget_unmap_event::<T>); | |
klass.unrealize = Some(widget_unrealize::<T>); | |
klass.visibility_notify_event = Some(widget_visibility_notify_event::<T>); | |
klass.window_state_event = Some(widget_window_state_event::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Widget(Object<InstanceStruct<Widget>>):[ | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Widget>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> WidgetBase for T {} | |
pub type WidgetClass = ClassStruct<Widget>; | |
// FIXME: Boilerplate | |
unsafe impl InitiallyUnownedClassExt<Widget> for WidgetClass {} | |
unsafe impl ImplementorIfaceClassExt<Widget> for WidgetClass {} | |
unsafe impl BuildableClassExt<Widget> for WidgetClass {} | |
#[macro_export] | |
macro_rules! box_widget_impl( | |
($name:ident) => { | |
impl<T: $crate::widget::WidgetBase> $crate::widget::WidgetImpl<T> for Box<$name<T>>{ | |
fn adjust_baseline_allocation(&self, widget: &T, baseline: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.adjust_baseline_allocation(baseline) | |
} | |
fn adjust_baseline_request(&self, widget: &T, minimum_baseline: i32, natural_baseline: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.adjust_baseline_request(minimum_baseline, natural_baseline) | |
} | |
fn adjust_size_allocation(&self, widget: &T, orientation: Orientation, minimum_size: i32, natural_size: i32, allocated_pos: i32, allocated_size: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.adjust_size_allocation(orientation, minimum_size, natural_size, allocated_pos, allocated_size) | |
} | |
fn adjust_size_request(&self, widget: &T, orientation: Orientation, minimum_size: i32, natural_size: i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.adjust_size_request(orientation, minimum_size, natural_size) | |
} | |
fn button_press_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.button_press_event(event) | |
} | |
fn button_release_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventButton) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.button_release_event(event) | |
} | |
fn can_activate_accel(&self, widget: &T, signal_id: u32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.can_activate_accel(signal_id) | |
} | |
fn child_notify(&self, widget: &T, child_property: /*Ignored*/&glib::ParamSpec){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.child_notify(child_property) | |
} | |
fn composited_changed(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.composited_changed() | |
} | |
fn compute_expand(&self, widget: &T, hexpand_p: bool, vexpand_p: bool){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.compute_expand(hexpand_p, vexpand_p) | |
} | |
fn configure_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventConfigure) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.configure_event(event) | |
} | |
fn damage_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventExpose) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.damage_event(event) | |
} | |
fn delete_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.delete_event(event) | |
} | |
fn destroy(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.destroy() | |
} | |
fn destroy_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.destroy_event(event) | |
} | |
fn direction_changed(&self, widget: &T, previous_direction: TextDirection){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.direction_changed(previous_direction) | |
} | |
fn dispatch_child_properties_changed(&self, widget: &T, n_pspecs: u32, pspecs: /*Ignored*/&glib::ParamSpec){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.dispatch_child_properties_changed(n_pspecs, pspecs) | |
} | |
fn drag_begin(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_begin(context) | |
} | |
fn drag_data_delete(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_data_delete(context) | |
} | |
fn drag_data_get(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_data_get(context, selection_data, info, time_) | |
} | |
fn drag_data_received(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_data_received(context, x, y, selection_data, info, time_) | |
} | |
fn drag_drop(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_drop(context, x, y, time_) | |
} | |
fn drag_end(&self, widget: &T, context: /*Ignored*/&gdk::DragContext){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_end(context) | |
} | |
fn drag_failed(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, result: /*Ignored*/DragResult) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_failed(context, result) | |
} | |
fn drag_leave(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, time_: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_leave(context, time_) | |
} | |
fn drag_motion(&self, widget: &T, context: /*Ignored*/&gdk::DragContext, x: i32, y: i32, time_: u32) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.drag_motion(context, x, y, time_) | |
} | |
fn draw(&self, widget: &T, cr: /*Ignored*/&mut cairo::Context) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.draw(cr) | |
} | |
fn enter_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.enter_notify_event(event) | |
} | |
fn event(&self, widget: &T, event: /*Ignored*/&mut gdk::Event) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.event(event) | |
} | |
fn focus(&self, widget: &T, direction: DirectionType) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.focus(direction) | |
} | |
fn focus_in_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.focus_in_event(event) | |
} | |
fn focus_out_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventFocus) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.focus_out_event(event) | |
} | |
fn get_accessible(&self, widget: &T) -> /*Ignored*/Option<atk::Object>{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_accessible() | |
} | |
fn get_preferred_height(&self, widget: &T) -> (i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_preferred_height() | |
} | |
fn get_preferred_height_and_baseline_for_width(&self, widget: &T, width: i32) -> (i32, i32, i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_preferred_height_and_baseline_for_width(width) | |
} | |
fn get_preferred_height_for_width(&self, widget: &T, width: i32) -> (i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_preferred_height_for_width(width) | |
} | |
fn get_preferred_width(&self, widget: &T) -> (i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_preferred_width() | |
} | |
fn get_preferred_width_for_height(&self, widget: &T, height: i32) -> (i32, i32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_preferred_width_for_height(height) | |
} | |
fn get_request_mode(&self, widget: &T) -> SizeRequestMode{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.get_request_mode() | |
} | |
fn grab_broken_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventGrabBroken) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.grab_broken_event(event) | |
} | |
fn grab_focus(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.grab_focus() | |
} | |
fn grab_notify(&self, widget: &T, was_grabbed: bool){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.grab_notify(was_grabbed) | |
} | |
fn hide(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.hide() | |
} | |
fn hierarchy_changed(&self, widget: &T, previous_toplevel: &Widget){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.hierarchy_changed(previous_toplevel) | |
} | |
fn key_press_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.key_press_event(event) | |
} | |
fn key_release_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventKey) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.key_release_event(event) | |
} | |
fn keynav_failed(&self, widget: &T, direction: DirectionType) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.keynav_failed(direction) | |
} | |
fn leave_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventCrossing) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.leave_notify_event(event) | |
} | |
fn map(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.map() | |
} | |
fn map_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.map_event(event) | |
} | |
fn mnemonic_activate(&self, widget: &T, group_cycling: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.mnemonic_activate(group_cycling) | |
} | |
fn motion_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventMotion) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.motion_notify_event(event) | |
} | |
fn move_focus(&self, widget: &T, direction: DirectionType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.move_focus(direction) | |
} | |
fn parent_set(&self, widget: &T, previous_parent: &Widget){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.parent_set(previous_parent) | |
} | |
fn popup_menu(&self, widget: &T) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.popup_menu() | |
} | |
fn property_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProperty) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.property_notify_event(event) | |
} | |
fn proximity_in_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.proximity_in_event(event) | |
} | |
fn proximity_out_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventProximity) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.proximity_out_event(event) | |
} | |
fn query_tooltip(&self, widget: &T, x: i32, y: i32, keyboard_tooltip: bool, tooltip: /*Ignored*/&Tooltip) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.query_tooltip(x, y, keyboard_tooltip, tooltip) | |
} | |
fn queue_draw_region(&self, widget: &T, region: /*Ignored*/&cairo::Region){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.queue_draw_region(region) | |
} | |
fn realize(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.realize() | |
} | |
fn screen_changed(&self, widget: &T, previous_screen: &gdk::Screen){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.screen_changed(previous_screen) | |
} | |
fn scroll_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventScroll) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.scroll_event(event) | |
} | |
fn selection_clear_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selection_clear_event(event) | |
} | |
fn selection_get(&self, widget: &T, selection_data: /*Ignored*/&mut SelectionData, info: u32, time_: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selection_get(selection_data, info, time_) | |
} | |
fn selection_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selection_notify_event(event) | |
} | |
fn selection_received(&self, widget: &T, selection_data: /*Ignored*/&mut SelectionData, time_: u32){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selection_received(selection_data, time_) | |
} | |
fn selection_request_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventSelection) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.selection_request_event(event) | |
} | |
fn show(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.show() | |
} | |
fn show_all(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.show_all() | |
} | |
fn show_help(&self, widget: &T, help_type: WidgetHelpType) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.show_help(help_type) | |
} | |
fn size_allocate(&self, widget: &T, allocation: &mut Allocation){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.size_allocate(allocation) | |
} | |
fn state_changed(&self, widget: &T, previous_state: StateType){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.state_changed(previous_state) | |
} | |
fn state_flags_changed(&self, widget: &T, previous_state_flags: StateFlags){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.state_flags_changed(previous_state_flags) | |
} | |
fn style_set(&self, widget: &T, previous_style: /*Ignored*/&Style){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.style_set(previous_style) | |
} | |
fn style_updated(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.style_updated() | |
} | |
fn touch_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventTouch) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.touch_event(event) | |
} | |
fn unmap(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unmap() | |
} | |
fn unmap_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventAny) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unmap_event(event) | |
} | |
fn unrealize(&self, widget: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.unrealize() | |
} | |
fn visibility_notify_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventVisibility) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.visibility_notify_event(event) | |
} | |
fn window_state_event(&self, widget: &T, event: /*Ignored*/&mut gdk::EventWindowState) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.window_state_event(event) | |
} | |
} | |
} | |
); | |
impl ObjectType for Widget{ | |
const NAME: &'static str = "RsGtk.Widget"; | |
type ImplType = Box<WidgetImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut WidgetClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn widget_adjust_baseline_allocation<T: WidgetBase> | |
(ptr: *mut GtkWidget, baseline: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.adjust_baseline_allocation() | |
} | |
unsafe extern "C" fn widget_adjust_baseline_request<T: WidgetBase> | |
(ptr: *mut GtkWidget, minimum_baseline: *mut c_int, natural_baseline: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.adjust_baseline_request() | |
} | |
unsafe extern "C" fn widget_adjust_size_allocation<T: WidgetBase> | |
(ptr: *mut GtkWidget, orientation: GtkOrientation, minimum_size: *mut c_int, natural_size: *mut c_int, allocated_pos: *mut c_int, allocated_size: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.adjust_size_allocation() | |
} | |
unsafe extern "C" fn widget_adjust_size_request<T: WidgetBase> | |
(ptr: *mut GtkWidget, orientation: GtkOrientation, minimum_size: *mut c_int, natural_size: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.adjust_size_request() | |
} | |
unsafe extern "C" fn widget_button_press_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventButton) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.button_press_event() | |
} | |
unsafe extern "C" fn widget_button_release_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventButton) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.button_release_event() | |
} | |
unsafe extern "C" fn widget_can_activate_accel<T: WidgetBase> | |
(ptr: *mut GtkWidget, signal_id: c_uint) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.can_activate_accel() | |
} | |
unsafe extern "C" fn widget_child_notify<T: WidgetBase> | |
(ptr: *mut GtkWidget, child_property: *mut gobject::GParamSpec) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.child_notify() | |
} | |
unsafe extern "C" fn widget_composited_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.composited_changed() | |
} | |
unsafe extern "C" fn widget_compute_expand<T: WidgetBase> | |
(ptr: *mut GtkWidget, hexpand_p: *mut gboolean, vexpand_p: *mut gboolean) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.compute_expand() | |
} | |
unsafe extern "C" fn widget_configure_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventConfigure) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.configure_event() | |
} | |
unsafe extern "C" fn widget_damage_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventExpose) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.damage_event() | |
} | |
unsafe extern "C" fn widget_delete_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventAny) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.delete_event() | |
} | |
unsafe extern "C" fn widget_destroy<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.destroy() | |
} | |
unsafe extern "C" fn widget_destroy_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventAny) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.destroy_event() | |
} | |
unsafe extern "C" fn widget_direction_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_direction: GtkTextDirection) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.direction_changed() | |
} | |
unsafe extern "C" fn widget_dispatch_child_properties_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, n_pspecs: c_uint, pspecs: *mut *mut gobject::GParamSpec) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.dispatch_child_properties_changed() | |
} | |
unsafe extern "C" fn widget_drag_begin<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_begin() | |
} | |
unsafe extern "C" fn widget_drag_data_delete<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_data_delete() | |
} | |
unsafe extern "C" fn widget_drag_data_get<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, selection_data: *mut GtkSelectionData, info: c_uint, time_: c_uint) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_data_get() | |
} | |
unsafe extern "C" fn widget_drag_data_received<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, x: c_int, y: c_int, selection_data: *mut GtkSelectionData, info: c_uint, time_: c_uint) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_data_received() | |
} | |
unsafe extern "C" fn widget_drag_drop<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, x: c_int, y: c_int, time_: c_uint) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_drop() | |
} | |
unsafe extern "C" fn widget_drag_end<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_end() | |
} | |
unsafe extern "C" fn widget_drag_failed<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, result: GtkDragResult) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_failed() | |
} | |
unsafe extern "C" fn widget_drag_leave<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, time_: c_uint) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_leave() | |
} | |
unsafe extern "C" fn widget_drag_motion<T: WidgetBase> | |
(ptr: *mut GtkWidget, context: *mut gdk::GdkDragContext, x: c_int, y: c_int, time_: c_uint) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.drag_motion() | |
} | |
unsafe extern "C" fn widget_draw<T: WidgetBase> | |
(ptr: *mut GtkWidget, cr: *mut cairo::cairo_t) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.draw() | |
} | |
unsafe extern "C" fn widget_enter_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventCrossing) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.enter_notify_event() | |
} | |
unsafe extern "C" fn widget_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEvent) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.event() | |
} | |
unsafe extern "C" fn widget_focus<T: WidgetBase> | |
(ptr: *mut GtkWidget, direction: GtkDirectionType) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.focus() | |
} | |
unsafe extern "C" fn widget_focus_in_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventFocus) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.focus_in_event() | |
} | |
unsafe extern "C" fn widget_focus_out_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventFocus) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.focus_out_event() | |
} | |
unsafe extern "C" fn widget_get_accessible<T: WidgetBase> | |
(ptr: *mut GtkWidget) -> *mut atk::AtkObject | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_accessible() | |
} | |
unsafe extern "C" fn widget_get_preferred_height<T: WidgetBase> | |
(ptr: *mut GtkWidget, minimum_height: *mut c_int, natural_height: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_preferred_height() | |
} | |
unsafe extern "C" fn widget_get_preferred_height_and_baseline_for_width<T: WidgetBase> | |
(ptr: *mut GtkWidget, width: c_int, minimum_height: *mut c_int, natural_height: *mut c_int, minimum_baseline: *mut c_int, natural_baseline: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_preferred_height_and_baseline_for_width() | |
} | |
unsafe extern "C" fn widget_get_preferred_height_for_width<T: WidgetBase> | |
(ptr: *mut GtkWidget, width: c_int, minimum_height: *mut c_int, natural_height: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_preferred_height_for_width() | |
} | |
unsafe extern "C" fn widget_get_preferred_width<T: WidgetBase> | |
(ptr: *mut GtkWidget, minimum_width: *mut c_int, natural_width: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_preferred_width() | |
} | |
unsafe extern "C" fn widget_get_preferred_width_for_height<T: WidgetBase> | |
(ptr: *mut GtkWidget, height: c_int, minimum_width: *mut c_int, natural_width: *mut c_int) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_preferred_width_for_height() | |
} | |
unsafe extern "C" fn widget_get_request_mode<T: WidgetBase> | |
(ptr: *mut GtkWidget) -> GtkSizeRequestMode | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.get_request_mode() | |
} | |
unsafe extern "C" fn widget_grab_broken_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventGrabBroken) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.grab_broken_event() | |
} | |
unsafe extern "C" fn widget_grab_focus<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.grab_focus() | |
} | |
unsafe extern "C" fn widget_grab_notify<T: WidgetBase> | |
(ptr: *mut GtkWidget, was_grabbed: gboolean) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.grab_notify() | |
} | |
unsafe extern "C" fn widget_hide<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.hide() | |
} | |
unsafe extern "C" fn widget_hierarchy_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_toplevel: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.hierarchy_changed() | |
} | |
unsafe extern "C" fn widget_key_press_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventKey) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.key_press_event() | |
} | |
unsafe extern "C" fn widget_key_release_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventKey) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.key_release_event() | |
} | |
unsafe extern "C" fn widget_keynav_failed<T: WidgetBase> | |
(ptr: *mut GtkWidget, direction: GtkDirectionType) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.keynav_failed() | |
} | |
unsafe extern "C" fn widget_leave_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventCrossing) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.leave_notify_event() | |
} | |
unsafe extern "C" fn widget_map<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.map() | |
} | |
unsafe extern "C" fn widget_map_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventAny) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.map_event() | |
} | |
unsafe extern "C" fn widget_mnemonic_activate<T: WidgetBase> | |
(ptr: *mut GtkWidget, group_cycling: gboolean) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.mnemonic_activate() | |
} | |
unsafe extern "C" fn widget_motion_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventMotion) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.motion_notify_event() | |
} | |
unsafe extern "C" fn widget_move_focus<T: WidgetBase> | |
(ptr: *mut GtkWidget, direction: GtkDirectionType) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.move_focus() | |
} | |
unsafe extern "C" fn widget_parent_set<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_parent: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.parent_set() | |
} | |
unsafe extern "C" fn widget_popup_menu<T: WidgetBase> | |
(ptr: *mut GtkWidget) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.popup_menu() | |
} | |
unsafe extern "C" fn widget_property_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventProperty) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.property_notify_event() | |
} | |
unsafe extern "C" fn widget_proximity_in_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventProximity) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.proximity_in_event() | |
} | |
unsafe extern "C" fn widget_proximity_out_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventProximity) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.proximity_out_event() | |
} | |
unsafe extern "C" fn widget_query_tooltip<T: WidgetBase> | |
(ptr: *mut GtkWidget, x: c_int, y: c_int, keyboard_tooltip: gboolean, tooltip: *mut GtkTooltip) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.query_tooltip() | |
} | |
unsafe extern "C" fn widget_queue_draw_region<T: WidgetBase> | |
(ptr: *mut GtkWidget, region: *const cairo::cairo_region_t) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.queue_draw_region() | |
} | |
unsafe extern "C" fn widget_realize<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.realize() | |
} | |
unsafe extern "C" fn widget_screen_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_screen: *mut gdk::GdkScreen) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.screen_changed() | |
} | |
unsafe extern "C" fn widget_scroll_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventScroll) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.scroll_event() | |
} | |
unsafe extern "C" fn widget_selection_clear_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventSelection) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.selection_clear_event() | |
} | |
unsafe extern "C" fn widget_selection_get<T: WidgetBase> | |
(ptr: *mut GtkWidget, selection_data: *mut GtkSelectionData, info: c_uint, time_: c_uint) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.selection_get() | |
} | |
unsafe extern "C" fn widget_selection_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventSelection) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.selection_notify_event() | |
} | |
unsafe extern "C" fn widget_selection_received<T: WidgetBase> | |
(ptr: *mut GtkWidget, selection_data: *mut GtkSelectionData, time_: c_uint) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.selection_received() | |
} | |
unsafe extern "C" fn widget_selection_request_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventSelection) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.selection_request_event() | |
} | |
unsafe extern "C" fn widget_show<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.show() | |
} | |
unsafe extern "C" fn widget_show_all<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.show_all() | |
} | |
unsafe extern "C" fn widget_show_help<T: WidgetBase> | |
(ptr: *mut GtkWidget, help_type: GtkWidgetHelpType) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.show_help() | |
} | |
unsafe extern "C" fn widget_size_allocate<T: WidgetBase> | |
(ptr: *mut GtkWidget, allocation: *mut GtkAllocation) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.size_allocate() | |
} | |
unsafe extern "C" fn widget_state_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_state: GtkStateType) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.state_changed() | |
} | |
unsafe extern "C" fn widget_state_flags_changed<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_state_flags: GtkStateFlags) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.state_flags_changed() | |
} | |
unsafe extern "C" fn widget_style_set<T: WidgetBase> | |
(ptr: *mut GtkWidget, previous_style: *mut GtkStyle) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.style_set() | |
} | |
unsafe extern "C" fn widget_style_updated<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.style_updated() | |
} | |
unsafe extern "C" fn widget_touch_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventTouch) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.touch_event() | |
} | |
unsafe extern "C" fn widget_unmap<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.unmap() | |
} | |
unsafe extern "C" fn widget_unmap_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventAny) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.unmap_event() | |
} | |
unsafe extern "C" fn widget_unrealize<T: WidgetBase> | |
(ptr: *mut GtkWidget) | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.unrealize() | |
} | |
unsafe extern "C" fn widget_visibility_notify_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventVisibility) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.visibility_notify_event() | |
} | |
unsafe extern "C" fn widget_window_state_event<T: WidgetBase> | |
(ptr: *mut GtkWidget, event: *mut gdk::GdkEventWindowState) -> gboolean | |
where | |
T::ImplType: WidgetImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let widget = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = widget.get_impl(); | |
imp.window_state_event() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+) | |
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+) | |
// DO NOT EDIT | |
use AccelGroup; | |
use Application; | |
use Bin; | |
use Container; | |
use Error; | |
use Widget; | |
use WindowPosition; | |
use WindowType; | |
use ffi; | |
use gdk; | |
use gdk_pixbuf; | |
use glib; | |
use glib::StaticType; | |
use glib::Value; | |
use glib::object::Downcast; | |
use glib::object::IsA; | |
use glib::signal::SignalHandlerId; | |
use glib::signal::connect; | |
use glib::translate::*; | |
use glib_ffi; | |
use gobject_ffi; | |
use std; | |
use std::boxed::Box as Box_; | |
use std::mem; | |
use std::mem::transmute; | |
use std::ptr; | |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] | |
extern crate libc; | |
extern crate glib_sys as glib; | |
extern crate gdk_sys as gdk; | |
extern crate pango_sys as pango; | |
#[allow(unused_imports)] | |
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, | |
c_short, c_ushort, c_long, c_ulong, | |
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; | |
#[allow(unused_imports)] | |
use glib::{gboolean, gconstpointer, gpointer, GType}; | |
pub trait WindowImpl<T: WindowBase>: gtk_subclass::BinImpl<T> + gtk_subclass::ContainerImpl<T> + gtk_subclass::WidgetImpl<T> + gobject_subclass::InitiallyUnownedImpl<T> + atk_subclass::ImplementorIfaceImpl<T> + gtk_subclass::BuildableImpl<T> + ObjectImpl<T> + AnyImpl + 'static { | |
fn activate_default(&self, window: &T){ | |
window.parent_activate_default() | |
} | |
fn activate_focus(&self, window: &T){ | |
window.parent_activate_focus() | |
} | |
fn enable_debugging(&self, window: &T, toggle: bool) -> bool{ | |
window.parent_enable_debugging(toggle) | |
} | |
fn keys_changed(&self, window: &T){ | |
window.parent_keys_changed() | |
} | |
fn set_focus(&self, window: &T, focus: Option<&Widget>){ | |
window.parent_set_focus(focus) | |
} | |
} | |
pub trait WindowImplExt<T> {} | |
} | |
impl<S: WindowImpl<T>, T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>>> WindowImplExt<T> for S {} | |
any_impl!(WindowBase, WindowImpl); | |
pub unsafe trait WindowBase: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>{ | |
fn parent_activate_default(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWindowClass; | |
(*parent_klass) | |
.activate_default | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_activate_focus(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWindowClass; | |
(*parent_klass) | |
.activate_focus | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_enable_debugging(&self, toggle: bool) -> bool{ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWindowClass; | |
(*parent_klass) | |
.enable_debugging | |
.map(|f|{ f(self.to_glib_none().0,toggle.to_glib()) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_keys_changed(&self){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWindowClass; | |
(*parent_klass) | |
.keys_changed | |
.map(|f|{ f(self.to_glib_none().0) }) | |
.unwrap_or(()) | |
} | |
} | |
fn parent_set_focus(&self, focus: Option<&Widget>){ | |
unsafe { | |
let klass = self.get_class(); | |
let parent_klass = (*klass).get_parent_class() as *const ffi::GtkWindowClass; | |
(*parent_klass) | |
.set_focus | |
.map(|f|{ f(self.to_glib_none().0,focus.0) }) | |
.unwrap_or(()) | |
} | |
} | |
} | |
pub unsafe trait WindowClassExt<T: WindowBase> | |
where | |
T::ImplType: WindowImpl<T>{ | |
fn override_vfuncs(&mut self, _: &ClassInitToken){ | |
unsafe { | |
let klass = &mut *(self as *const Self as *mut ffi::GtkWindowClass); | |
klass.activate_default = Some(window_activate_default::<T>); | |
klass.activate_focus = Some(window_activate_focus::<T>); | |
klass.enable_debugging = Some(window_enable_debugging::<T>); | |
klass.keys_changed = Some(window_keys_changed::<T>); | |
klass.set_focus = Some(window_set_focus::<T>); | |
} | |
} | |
} | |
glib_wrapper! { | |
pub struct Window(Object<InstanceStruct<Window>>):[ | |
gtk::Bin => gtk_ffi::GtkBin | |
gtk::Container => gtk_ffi::GtkContainer | |
gtk::Widget => gtk_ffi::GtkWidget | |
gobject::InitiallyUnowned => gobject_ffi::GInitiallyUnowned | |
atk::ImplementorIface => atk_ffi::AtkImplementorIface | |
gtk::Buildable => gtk_ffi::GtkBuildable] ; | |
match fn { | |
get_type => || get_type::<Window>(), | |
} | |
} | |
unsafe impl<T: ObjectType + glib::IsA<gtk::Bin> + glib::IsA<gtk::Container> + glib::IsA<gtk::Widget> + glib::IsA<gobject::InitiallyUnowned> + glib::IsA<atk::ImplementorIface> + glib::IsA<gtk::Buildable>> WindowBase for T {} | |
pub type WindowClass = ClassStruct<Window>; | |
// FIXME: Boilerplate | |
unsafe impl BinClassExt<Window> for WindowClass {} | |
unsafe impl ContainerClassExt<Window> for WindowClass {} | |
unsafe impl WidgetClassExt<Window> for WindowClass {} | |
unsafe impl InitiallyUnownedClassExt<Window> for WindowClass {} | |
unsafe impl ImplementorIfaceClassExt<Window> for WindowClass {} | |
unsafe impl BuildableClassExt<Window> for WindowClass {} | |
#[macro_export] | |
macro_rules! box_window_impl( | |
($name:ident) => { | |
box_bin_impl!($name); | |
box_container_impl!($name); | |
box_widget_impl!($name); | |
impl<T: $crate::window::WindowBase> $crate::window::WindowImpl<T> for Box<$name<T>>{ | |
fn activate_default(&self, window: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate_default() | |
} | |
fn activate_focus(&self, window: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.activate_focus() | |
} | |
fn enable_debugging(&self, window: &T, toggle: bool) -> bool{ | |
let imp: &$name<T> = self.as_ref(); | |
imp.enable_debugging(toggle) | |
} | |
fn keys_changed(&self, window: &T){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.keys_changed() | |
} | |
fn set_focus(&self, window: &T, focus: Option<&Widget>){ | |
let imp: &$name<T> = self.as_ref(); | |
imp.set_focus(focus) | |
} | |
} | |
} | |
); | |
impl ObjectType for Window{ | |
const NAME: &'static str = "RsGtk.Window"; | |
type ParentType = gtk::Bin; | |
type ImplType = Box<WindowImpl<Self>>; | |
type InstanceStructType = InstanceStruct<Self>; | |
fn class_init(token: &ClassInitToken, klass: &mut WindowClass) { | |
ObjectClassExt::override_vfuncs(klass, token); | |
BinClassExt::override_vfuncs(klass, token); | |
ContainerClassExt::override_vfuncs(klass, token); | |
WidgetClassExt::override_vfuncs(klass, token); | |
InitiallyUnownedClassExt::override_vfuncs(klass, token); | |
ImplementorIfaceClassExt::override_vfuncs(klass, token); | |
BuildableClassExt::override_vfuncs(klass, token); | |
} | |
object_type_fns!(); | |
} | |
unsafe extern "C" fn window_activate_default<T: WindowBase> | |
(ptr: *mut GtkWindow) | |
where | |
T::ImplType: WindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let window = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = window.get_impl(); | |
imp.activate_default() | |
} | |
unsafe extern "C" fn window_activate_focus<T: WindowBase> | |
(ptr: *mut GtkWindow) | |
where | |
T::ImplType: WindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let window = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = window.get_impl(); | |
imp.activate_focus() | |
} | |
unsafe extern "C" fn window_enable_debugging<T: WindowBase> | |
(ptr: *mut GtkWindow, toggle: gboolean) -> gboolean | |
where | |
T::ImplType: WindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let window = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = window.get_impl(); | |
imp.enable_debugging() | |
} | |
unsafe extern "C" fn window_keys_changed<T: WindowBase> | |
(ptr: *mut GtkWindow) | |
where | |
T::ImplType: WindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let window = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = window.get_impl(); | |
imp.keys_changed() | |
} | |
unsafe extern "C" fn window_set_focus<T: WindowBase> | |
(ptr: *mut GtkWindow, focus: *mut GtkWidget) | |
where | |
T::ImplType: WindowImpl<T> | |
{ | |
callback_guard!(); | |
floating_reference_guard!(ptr); | |
let window = &*(ptr as *mut T::InstanceStructType); | |
let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); | |
let imp = window.get_impl(); | |
imp.set_focus() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment