1use gio;
6use glib::translate::*;
7use gtk_sys;
8use CssSectionType;
9
10glib_wrapper! {
11 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
12 pub struct CssSection(Shared<gtk_sys::GtkCssSection>);
13
14 match fn {
15 ref => |ptr| gtk_sys::gtk_css_section_ref(ptr),
16 unref => |ptr| gtk_sys::gtk_css_section_unref(ptr),
17 get_type => || gtk_sys::gtk_css_section_get_type(),
18 }
19}
20
21impl CssSection {
22 pub fn get_end_line(&self) -> u32 {
23 unsafe { gtk_sys::gtk_css_section_get_end_line(self.to_glib_none().0) }
24 }
25
26 pub fn get_end_position(&self) -> u32 {
27 unsafe { gtk_sys::gtk_css_section_get_end_position(self.to_glib_none().0) }
28 }
29
30 pub fn get_file(&self) -> Option<gio::File> {
31 unsafe { from_glib_none(gtk_sys::gtk_css_section_get_file(self.to_glib_none().0)) }
32 }
33
34 pub fn get_parent(&self) -> Option<CssSection> {
35 unsafe { from_glib_none(gtk_sys::gtk_css_section_get_parent(self.to_glib_none().0)) }
36 }
37
38 pub fn get_section_type(&self) -> CssSectionType {
39 unsafe {
40 from_glib(gtk_sys::gtk_css_section_get_section_type(
41 self.to_glib_none().0,
42 ))
43 }
44 }
45
46 pub fn get_start_line(&self) -> u32 {
47 unsafe { gtk_sys::gtk_css_section_get_start_line(self.to_glib_none().0) }
48 }
49
50 pub fn get_start_position(&self) -> u32 {
51 unsafe { gtk_sys::gtk_css_section_get_start_position(self.to_glib_none().0) }
52 }
53}