This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,11 @@ concurrency = "send+sync"
239
239
# out parameter not marked as such
240
240
ignore = true
241
241
242
+ [[object .function ]]
243
+ name = " find_source_by_id"
244
+ # source id is a newtype
245
+ ignore = true
246
+
242
247
[[object ]]
243
248
name = " GLib.MainLoop"
244
249
status = " generate"
Original file line number Diff line number Diff line change 1
1
// This file was generated by gir (7504fb6) from gir-files (71d73f0)
2
2
// DO NOT EDIT
3
3
4
- use Source ;
5
4
use ffi;
6
5
use translate:: * ;
7
6
@@ -45,12 +44,6 @@ impl MainContext {
45
44
// unsafe { TODO: call ffi::g_main_context_find_source_by_funcs_user_data() }
46
45
//}
47
46
48
- pub fn find_source_by_id ( & self , source_id : u32 ) -> Option < Source > {
49
- unsafe {
50
- from_glib_none ( ffi:: g_main_context_find_source_by_id ( self . to_glib_none ( ) . 0 , source_id) )
51
- }
52
- }
53
-
54
47
//pub fn find_source_by_user_data<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, user_data: P) -> Option<Source> {
55
48
// unsafe { TODO: call ffi::g_main_context_find_source_by_user_data() }
56
49
//}
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ use ffi::{gpointer, gboolean};
11
11
use std:: cell:: RefCell ;
12
12
13
13
use MainContext ;
14
+ use Source ;
15
+ use SourceId ;
14
16
15
17
use source:: { CallbackGuard , Priority } ;
16
18
@@ -25,6 +27,12 @@ impl MainContext {
25
27
}
26
28
}
27
29
30
+ pub fn find_source_by_id ( & self , source_id : SourceId ) -> Option < Source > {
31
+ unsafe {
32
+ from_glib_none ( ffi:: g_main_context_find_source_by_id ( self . to_glib_none ( ) . 0 , source_id. to_glib ( ) ) )
33
+ }
34
+ }
35
+
28
36
// FIXME: These can actually be FnOnce but require FnBox to
29
37
// stabilize, or Box<FnOnce()> to be callable otherwise
30
38
pub fn invoke < F > ( & self , func : F )
You can’t perform that action at this time.
0 commit comments