44
55use crate :: { ffi, GLContext , MemoryFormat , Texture } ;
66use glib:: translate:: * ;
7+ #[ cfg( feature = "v4_16" ) ]
8+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_16" ) ) ) ]
9+ use glib:: {
10+ prelude:: * ,
11+ signal:: { connect_raw, SignalHandlerId } ,
12+ } ;
13+ #[ cfg( feature = "v4_16" ) ]
14+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_16" ) ) ) ]
15+ use std:: boxed:: Box as Box_ ;
716
817glib:: wrapper! {
918 #[ doc( alias = "GdkGLTextureBuilder" ) ]
@@ -21,6 +30,15 @@ impl GLTextureBuilder {
2130 unsafe { from_glib_full ( ffi:: gdk_gl_texture_builder_new ( ) ) }
2231 }
2332
33+ //#[cfg(feature = "v4_16")]
34+ //#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
35+ //#[doc(alias = "gdk_gl_texture_builder_get_color_state")]
36+ //#[doc(alias = "get_color_state")]
37+ //#[doc(alias = "color-state")]
38+ //pub fn color_state(&self) -> /*Ignored*/ColorState {
39+ // unsafe { TODO: call ffi:gdk_gl_texture_builder_get_color_state() }
40+ //}
41+
2442 #[ doc( alias = "gdk_gl_texture_builder_get_context" ) ]
2543 #[ doc( alias = "get_context" ) ]
2644 pub fn context ( & self ) -> Option < GLContext > {
@@ -91,6 +109,44 @@ impl GLTextureBuilder {
91109 pub fn width ( & self ) -> i32 {
92110 unsafe { ffi:: gdk_gl_texture_builder_get_width ( self . to_glib_none ( ) . 0 ) }
93111 }
112+
113+ //#[cfg(feature = "v4_16")]
114+ //#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
115+ //#[doc(alias = "gdk_gl_texture_builder_set_color_state")]
116+ //#[doc(alias = "color-state")]
117+ //pub fn set_color_state(&self, color_state: /*Ignored*/&ColorState) {
118+ // unsafe { TODO: call ffi:gdk_gl_texture_builder_set_color_state() }
119+ //}
120+
121+ #[ cfg( feature = "v4_16" ) ]
122+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_16" ) ) ) ]
123+ #[ doc( alias = "color-state" ) ]
124+ pub fn connect_color_state_notify < F : Fn ( & Self ) + Send + Sync + ' static > (
125+ & self ,
126+ f : F ,
127+ ) -> SignalHandlerId {
128+ unsafe extern "C" fn notify_color_state_trampoline <
129+ F : Fn ( & GLTextureBuilder ) + Send + Sync + ' static ,
130+ > (
131+ this : * mut ffi:: GdkGLTextureBuilder ,
132+ _param_spec : glib:: ffi:: gpointer ,
133+ f : glib:: ffi:: gpointer ,
134+ ) {
135+ let f: & F = & * ( f as * const F ) ;
136+ f ( & from_glib_borrow ( this) )
137+ }
138+ unsafe {
139+ let f: Box_ < F > = Box_ :: new ( f) ;
140+ connect_raw (
141+ self . as_ptr ( ) as * mut _ ,
142+ b"notify::color-state\0 " . as_ptr ( ) as * const _ ,
143+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
144+ notify_color_state_trampoline :: < F > as * const ( ) ,
145+ ) ) ,
146+ Box_ :: into_raw ( f) ,
147+ )
148+ }
149+ }
94150}
95151
96152#[ cfg( feature = "v4_12" ) ]
0 commit comments