File tree Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,9 @@ generate_builder = false
494
494
[[object .function .parameter ]]
495
495
name = " region"
496
496
const = true
497
+ [[object .function ]]
498
+ name = " build"
499
+ manual = true
497
500
498
501
[[object ]]
499
502
name = " Gdk.KeyEvent"
Original file line number Diff line number Diff line change @@ -26,11 +26,6 @@ impl GLTextureBuilder {
26
26
unsafe { from_glib_full ( ffi:: gdk_gl_texture_builder_new ( ) ) }
27
27
}
28
28
29
- //#[doc(alias = "gdk_gl_texture_builder_build")]
30
- //pub fn build(&self, data: /*Unimplemented*/Option<Basic: Pointer>) -> Texture {
31
- // unsafe { TODO: call ffi:gdk_gl_texture_builder_build() }
32
- //}
33
-
34
29
#[ doc( alias = "gdk_gl_texture_builder_get_context" ) ]
35
30
#[ doc( alias = "get_context" ) ]
36
31
pub fn context ( & self ) -> Option < GLContext > {
Original file line number Diff line number Diff line change
1
+ // Take a look at the license at the top of the repository in the LICENSE file.
2
+
3
+ use crate :: { GLTextureBuilder , Texture } ;
4
+ use glib:: translate:: * ;
5
+
6
+ impl GLTextureBuilder {
7
+ #[ doc( alias = "gdk_gl_texture_builder_build" ) ]
8
+ pub unsafe fn build ( & self ) -> Texture {
9
+ from_glib_full ( ffi:: gdk_gl_texture_builder_build (
10
+ self . to_glib_none ( ) . 0 ,
11
+ None ,
12
+ std:: ptr:: null_mut ( ) ,
13
+ ) )
14
+ }
15
+
16
+ #[ doc( alias = "gdk_gl_texture_builder_build" ) ]
17
+ pub unsafe fn build_with_release_func < F : FnOnce ( ) + ' static > (
18
+ & self ,
19
+ release_func : F ,
20
+ ) -> Texture {
21
+ unsafe extern "C" fn destroy_closure < F : FnOnce ( ) + ' static > ( func : glib:: ffi:: gpointer ) {
22
+ let released_func = Box :: < F > :: from_raw ( func as * mut _ ) ;
23
+ released_func ( ) ;
24
+ }
25
+ let released_func = Box :: new ( release_func) ;
26
+ from_glib_full ( ffi:: gdk_gl_texture_builder_build (
27
+ self . to_glib_none ( ) . 0 ,
28
+ Some ( destroy_closure :: < F > ) ,
29
+ Box :: into_raw ( released_func) as glib:: ffi:: gpointer ,
30
+ ) )
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ mod drop;
81
81
mod focus_event;
82
82
mod functions;
83
83
mod gl_texture;
84
+ #[ cfg( any( feature = "v4_12" , docsrs) ) ]
85
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
86
+ mod gl_texture_builder;
84
87
mod grab_broken_event;
85
88
mod key_event;
86
89
mod keymap_key;
You can’t perform that action at this time.
0 commit comments