1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// 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

use gio;
use glib::translate::*;
use gtk_sys;
use CssSectionType;

glib_wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct CssSection(Shared<gtk_sys::GtkCssSection>);

    match fn {
        ref => |ptr| gtk_sys::gtk_css_section_ref(ptr),
        unref => |ptr| gtk_sys::gtk_css_section_unref(ptr),
        get_type => || gtk_sys::gtk_css_section_get_type(),
    }
}

impl CssSection {
    pub fn get_end_line(&self) -> u32 {
        unsafe { gtk_sys::gtk_css_section_get_end_line(self.to_glib_none().0) }
    }

    pub fn get_end_position(&self) -> u32 {
        unsafe { gtk_sys::gtk_css_section_get_end_position(self.to_glib_none().0) }
    }

    pub fn get_file(&self) -> Option<gio::File> {
        unsafe { from_glib_none(gtk_sys::gtk_css_section_get_file(self.to_glib_none().0)) }
    }

    pub fn get_parent(&self) -> Option<CssSection> {
        unsafe { from_glib_none(gtk_sys::gtk_css_section_get_parent(self.to_glib_none().0)) }
    }

    pub fn get_section_type(&self) -> CssSectionType {
        unsafe {
            from_glib(gtk_sys::gtk_css_section_get_section_type(
                self.to_glib_none().0,
            ))
        }
    }

    pub fn get_start_line(&self) -> u32 {
        unsafe { gtk_sys::gtk_css_section_get_start_line(self.to_glib_none().0) }
    }

    pub fn get_start_position(&self) -> u32 {
        unsafe { gtk_sys::gtk_css_section_get_start_position(self.to_glib_none().0) }
    }
}