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 crate::{translate::*, MainContext}; |
6 | |
7 | crate::wrapper! { |
8 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
9 | pub struct Source(Shared<ffi::GSource>); |
10 | |
11 | match fn { |
12 | ref => |ptr| ffi::g_source_ref(ptr), |
13 | unref => |ptr| ffi::g_source_unref(ptr), |
14 | type_ => || ffi::g_source_get_type(), |
15 | } |
16 | } |
17 | |
18 | impl Source { |
19 | //#[doc(alias = "g_source_new")] |
20 | //pub fn new(source_funcs: /*Ignored*/&mut SourceFuncs, struct_size: u32) -> Source { |
21 | // unsafe { TODO: call ffi:g_source_new() } |
22 | //} |
23 | |
24 | #[doc (alias = "g_source_add_child_source" )] |
25 | pub fn add_child_source(&self, child_source: &Source) { |
26 | unsafe { |
27 | ffi::g_source_add_child_source(self.to_glib_none().0, child_source.to_glib_none().0); |
28 | } |
29 | } |
30 | |
31 | //#[doc(alias = "g_source_add_poll")] |
32 | //pub fn add_poll(&self, fd: /*Ignored*/&mut PollFD) { |
33 | // unsafe { TODO: call ffi:g_source_add_poll() } |
34 | //} |
35 | |
36 | //#[doc(alias = "g_source_add_unix_fd")] |
37 | //pub fn add_unix_fd(&self, fd: i32, events: IOCondition) -> /*Unimplemented*/Basic: Pointer { |
38 | // unsafe { TODO: call ffi:g_source_add_unix_fd() } |
39 | //} |
40 | |
41 | #[doc (alias = "g_source_destroy" )] |
42 | pub fn destroy(&self) { |
43 | unsafe { |
44 | ffi::g_source_destroy(self.to_glib_none().0); |
45 | } |
46 | } |
47 | |
48 | #[doc (alias = "g_source_get_can_recurse" )] |
49 | #[doc (alias = "get_can_recurse" )] |
50 | pub fn can_recurse(&self) -> bool { |
51 | unsafe { from_glib(ffi::g_source_get_can_recurse(self.to_glib_none().0)) } |
52 | } |
53 | |
54 | #[doc (alias = "g_source_get_context" )] |
55 | #[doc (alias = "get_context" )] |
56 | pub fn context(&self) -> Option<MainContext> { |
57 | unsafe { from_glib_none(ffi::g_source_get_context(self.to_glib_none().0)) } |
58 | } |
59 | |
60 | #[doc (alias = "g_source_get_name" )] |
61 | #[doc (alias = "get_name" )] |
62 | pub fn name(&self) -> Option<crate::GString> { |
63 | unsafe { from_glib_none(ffi::g_source_get_name(self.to_glib_none().0)) } |
64 | } |
65 | |
66 | #[doc (alias = "g_source_get_priority" )] |
67 | #[doc (alias = "get_priority" )] |
68 | pub fn priority(&self) -> i32 { |
69 | unsafe { ffi::g_source_get_priority(self.to_glib_none().0) } |
70 | } |
71 | |
72 | #[doc (alias = "g_source_get_ready_time" )] |
73 | #[doc (alias = "get_ready_time" )] |
74 | pub fn ready_time(&self) -> i64 { |
75 | unsafe { ffi::g_source_get_ready_time(self.to_glib_none().0) } |
76 | } |
77 | |
78 | #[doc (alias = "g_source_get_time" )] |
79 | #[doc (alias = "get_time" )] |
80 | pub fn time(&self) -> i64 { |
81 | unsafe { ffi::g_source_get_time(self.to_glib_none().0) } |
82 | } |
83 | |
84 | #[doc (alias = "g_source_is_destroyed" )] |
85 | pub fn is_destroyed(&self) -> bool { |
86 | unsafe { from_glib(ffi::g_source_is_destroyed(self.to_glib_none().0)) } |
87 | } |
88 | |
89 | //#[doc(alias = "g_source_modify_unix_fd")] |
90 | //pub fn modify_unix_fd(&self, tag: /*Unimplemented*/Basic: Pointer, new_events: IOCondition) { |
91 | // unsafe { TODO: call ffi:g_source_modify_unix_fd() } |
92 | //} |
93 | |
94 | //#[doc(alias = "g_source_query_unix_fd")] |
95 | //pub fn query_unix_fd(&self, tag: /*Unimplemented*/Basic: Pointer) -> IOCondition { |
96 | // unsafe { TODO: call ffi:g_source_query_unix_fd() } |
97 | //} |
98 | |
99 | #[doc (alias = "g_source_remove_child_source" )] |
100 | pub fn remove_child_source(&self, child_source: &Source) { |
101 | unsafe { |
102 | ffi::g_source_remove_child_source(self.to_glib_none().0, child_source.to_glib_none().0); |
103 | } |
104 | } |
105 | |
106 | //#[doc(alias = "g_source_remove_poll")] |
107 | //pub fn remove_poll(&self, fd: /*Ignored*/&mut PollFD) { |
108 | // unsafe { TODO: call ffi:g_source_remove_poll() } |
109 | //} |
110 | |
111 | //#[doc(alias = "g_source_remove_unix_fd")] |
112 | //pub fn remove_unix_fd(&self, tag: /*Unimplemented*/Basic: Pointer) { |
113 | // unsafe { TODO: call ffi:g_source_remove_unix_fd() } |
114 | //} |
115 | |
116 | //#[doc(alias = "g_source_remove_by_funcs_user_data")] |
117 | //pub fn remove_by_funcs_user_data(funcs: /*Ignored*/&mut SourceFuncs, user_data: /*Unimplemented*/Option<Basic: Pointer>) -> bool { |
118 | // unsafe { TODO: call ffi:g_source_remove_by_funcs_user_data() } |
119 | //} |
120 | |
121 | //#[doc(alias = "g_source_remove_by_user_data")] |
122 | //pub fn remove_by_user_data(user_data: /*Unimplemented*/Option<Basic: Pointer>) -> bool { |
123 | // unsafe { TODO: call ffi:g_source_remove_by_user_data() } |
124 | //} |
125 | } |
126 | |
127 | unsafe impl Send for Source {} |
128 | unsafe impl Sync for Source {} |
129 | |