gtk/auto/
text_child_anchor.rs1use glib::object::IsA;
6use glib::translate::*;
7use gtk_sys;
8use std::fmt;
9use Widget;
10
11glib_wrapper! {
12 pub struct TextChildAnchor(Object<gtk_sys::GtkTextChildAnchor, gtk_sys::GtkTextChildAnchorClass, TextChildAnchorClass>);
13
14 match fn {
15 get_type => || gtk_sys::gtk_text_child_anchor_get_type(),
16 }
17}
18
19impl TextChildAnchor {
20 pub fn new() -> TextChildAnchor {
21 assert_initialized_main_thread!();
22 unsafe { from_glib_full(gtk_sys::gtk_text_child_anchor_new()) }
23 }
24}
25
26impl Default for TextChildAnchor {
27 fn default() -> Self {
28 Self::new()
29 }
30}
31
32pub const NONE_TEXT_CHILD_ANCHOR: Option<&TextChildAnchor> = None;
33
34pub trait TextChildAnchorExt: 'static {
35 fn get_deleted(&self) -> bool;
36
37 fn get_widgets(&self) -> Vec<Widget>;
38}
39
40impl<O: IsA<TextChildAnchor>> TextChildAnchorExt for O {
41 fn get_deleted(&self) -> bool {
42 unsafe {
43 from_glib(gtk_sys::gtk_text_child_anchor_get_deleted(
44 self.as_ref().to_glib_none().0,
45 ))
46 }
47 }
48
49 fn get_widgets(&self) -> Vec<Widget> {
50 unsafe {
51 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_text_child_anchor_get_widgets(
52 self.as_ref().to_glib_none().0,
53 ))
54 }
55 }
56}
57
58impl fmt::Display for TextChildAnchor {
59 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
60 write!(f, "TextChildAnchor")
61 }
62}