1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use gio_sys;
6 use glib::object::IsA;
7 use glib::translate::*;
8 use std::fmt;
9 
10 glib_wrapper! {
11     pub struct SettingsBackend(Object<gio_sys::GSettingsBackend, gio_sys::GSettingsBackendClass, SettingsBackendClass>);
12 
13     match fn {
14         get_type => || gio_sys::g_settings_backend_get_type(),
15     }
16 }
17 
18 impl SettingsBackend {
19     //pub fn flatten_tree(tree: /*Ignored*/&glib::Tree) -> (GString, Vec<GString>, Vec<glib::Variant>) {
20     //    unsafe { TODO: call gio_sys:g_settings_backend_flatten_tree() }
21     //}
22 
get_default() -> Option<SettingsBackend>23     pub fn get_default() -> Option<SettingsBackend> {
24         unsafe { from_glib_full(gio_sys::g_settings_backend_get_default()) }
25     }
26 }
27 
28 pub const NONE_SETTINGS_BACKEND: Option<&SettingsBackend> = None;
29 
30 pub trait SettingsBackendExt: 'static {
31     //fn changed(&self, key: &str, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
32 
33     //fn changed_tree(&self, tree: /*Ignored*/&glib::Tree, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
34 
35     //fn keys_changed(&self, path: &str, items: &[&str], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
36 
37     //fn path_changed(&self, path: &str, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
38 
path_writable_changed(&self, path: &str)39     fn path_writable_changed(&self, path: &str);
40 
writable_changed(&self, key: &str)41     fn writable_changed(&self, key: &str);
42 }
43 
44 impl<O: IsA<SettingsBackend>> SettingsBackendExt for O {
45     //fn changed(&self, key: &str, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
46     //    unsafe { TODO: call gio_sys:g_settings_backend_changed() }
47     //}
48 
49     //fn changed_tree(&self, tree: /*Ignored*/&glib::Tree, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
50     //    unsafe { TODO: call gio_sys:g_settings_backend_changed_tree() }
51     //}
52 
53     //fn keys_changed(&self, path: &str, items: &[&str], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
54     //    unsafe { TODO: call gio_sys:g_settings_backend_keys_changed() }
55     //}
56 
57     //fn path_changed(&self, path: &str, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
58     //    unsafe { TODO: call gio_sys:g_settings_backend_path_changed() }
59     //}
60 
path_writable_changed(&self, path: &str)61     fn path_writable_changed(&self, path: &str) {
62         unsafe {
63             gio_sys::g_settings_backend_path_writable_changed(
64                 self.as_ref().to_glib_none().0,
65                 path.to_glib_none().0,
66             );
67         }
68     }
69 
writable_changed(&self, key: &str)70     fn writable_changed(&self, key: &str) {
71         unsafe {
72             gio_sys::g_settings_backend_writable_changed(
73                 self.as_ref().to_glib_none().0,
74                 key.to_glib_none().0,
75             );
76         }
77     }
78 }
79 
80 impl fmt::Display for SettingsBackend {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result81     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
82         write!(f, "SettingsBackend")
83     }
84 }
85