generate missing functions

This commit is contained in:
Bilal Elmoussaoui 2020-06-20 16:05:31 +02:00
parent a4a97fc1c9
commit f4d62f8f64
No known key found for this signature in database
GPG key ID: 1FFF9F28D4E0F10E
5 changed files with 67 additions and 0 deletions

View file

@ -75,6 +75,20 @@ manual = [
"Pango.EllipsizeMode",
]
[[object]]
name = "Handy.*"
status = "generate"
[[object.function]]
name = "init"
# generated manually
ignore = true
[[object.function]]
name = "string_utf8_truncate"
ignore = true
[[object.function]]
name = "string_utf8_len"
ignore = true
[[object]]
name = "Handy.ActionRow"
status = "generate"

View file

@ -0,0 +1,36 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#[cfg(any(feature = "v0_0_11", feature = "dox"))]
use glib::object::IsA;
use glib::translate::*;
#[cfg(any(feature = "v0_0_11", feature = "dox"))]
use gtk;
use handy_sys;
#[cfg(any(feature = "v0_0_11", feature = "dox"))]
pub fn ease_out_cubic(t: f64) -> f64 {
assert_initialized_main_thread!();
unsafe { handy_sys::hdy_ease_out_cubic(t) }
}
//#[cfg(any(feature = "v0_0_6", feature = "dox"))]
//pub fn enum_value_row_name(value: /*Ignored*/&EnumValueObject, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> Option<GString> {
// unsafe { TODO: call handy_sys:hdy_enum_value_row_name() }
//}
#[cfg(any(feature = "v0_0_11", feature = "dox"))]
pub fn get_enable_animations<P: IsA<gtk::Widget>>(widget: &P) -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(handy_sys::hdy_get_enable_animations(
widget.as_ref().to_glib_none().0,
))
}
}
//#[cfg(any(feature = "v0_0_6", feature = "dox"))]
//pub fn list_box_separator_header<P: IsA<gtk::ListBoxRow>, Q: IsA<gtk::ListBoxRow>>(row: &P, before: Option<&Q>, unused_user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call handy_sys:hdy_list_box_separator_header() }
//}

View file

@ -191,6 +191,8 @@ pub use self::enums::PaginatorIndicatorStyle;
pub use self::enums::SqueezerTransitionType;
pub use self::enums::ViewSwitcherPolicy;
pub mod functions;
#[doc(hidden)]
pub mod traits {
pub use super::ActionRowExt;

13
libhandy/src/functions.rs Normal file
View file

@ -0,0 +1,13 @@
use glib::translate::*;
use handy_sys;
use std::ptr;
pub fn init() -> Result<(), glib::BoolError> {
unsafe {
if from_glib(handy_sys::hdy_init(ptr::null_mut(), ptr::null_mut())) {
Ok(())
} else {
Err(glib_bool_error!("Failed to initialize Handy"))
}
}
}

View file

@ -39,6 +39,8 @@ macro_rules! skip_assert_initialized {
}
pub use glib::Error;
mod functions;
pub use functions::*;
pub mod prelude;
pub use prelude::*;
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]