@@ -62,11 +62,13 @@ impl GLAreaBuilder {
62
62
}
63
63
}
64
64
65
- // #[cfg(feature = "v4_12")]
65
+ #[ cfg( feature = "v4_12" ) ]
66
66
#[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
67
- //pub fn allowed_apis(self, allowed_apis: /*Ignored*/gdk::GLAPI) -> Self {
68
- // Self { builder: self.builder.property("allowed-apis", allowed_apis), }
69
- //}
67
+ pub fn allowed_apis ( self , allowed_apis : gdk:: GLAPI ) -> Self {
68
+ Self {
69
+ builder : self . builder . property ( "allowed-apis" , allowed_apis) ,
70
+ }
71
+ }
70
72
71
73
pub fn auto_render ( self , auto_render : bool ) -> Self {
72
74
Self {
@@ -291,17 +293,17 @@ pub trait GLAreaExt: 'static {
291
293
#[ doc( alias = "gtk_gl_area_attach_buffers" ) ]
292
294
fn attach_buffers ( & self ) ;
293
295
294
- // #[cfg(feature = "v4_12")]
295
- // #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
296
- // #[doc(alias = "gtk_gl_area_get_allowed_apis")]
297
- // #[doc(alias = "get_allowed_apis")]
298
- // fn allowed_apis(&self) -> /*Ignored*/ gdk::GLAPI;
296
+ #[ cfg( feature = "v4_12" ) ]
297
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
298
+ #[ doc( alias = "gtk_gl_area_get_allowed_apis" ) ]
299
+ #[ doc( alias = "get_allowed_apis" ) ]
300
+ fn allowed_apis ( & self ) -> gdk:: GLAPI ;
299
301
300
- // #[cfg(feature = "v4_12")]
301
- // #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
302
- // #[doc(alias = "gtk_gl_area_get_api")]
303
- // #[doc(alias = "get_api")]
304
- // fn api(&self) -> /*Ignored*/ gdk::GLAPI;
302
+ #[ cfg( feature = "v4_12" ) ]
303
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
304
+ #[ doc( alias = "gtk_gl_area_get_api" ) ]
305
+ #[ doc( alias = "get_api" ) ]
306
+ fn api ( & self ) -> gdk:: GLAPI ;
305
307
306
308
#[ doc( alias = "gtk_gl_area_get_auto_render" ) ]
307
309
#[ doc( alias = "get_auto_render" ) ]
@@ -339,10 +341,10 @@ pub trait GLAreaExt: 'static {
339
341
#[ doc( alias = "gtk_gl_area_queue_render" ) ]
340
342
fn queue_render ( & self ) ;
341
343
342
- // #[cfg(feature = "v4_12")]
343
- // #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
344
- // #[doc(alias = "gtk_gl_area_set_allowed_apis")]
345
- // fn set_allowed_apis(&self, apis: /*Ignored*/ gdk::GLAPI);
344
+ #[ cfg( feature = "v4_12" ) ]
345
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
346
+ #[ doc( alias = "gtk_gl_area_set_allowed_apis" ) ]
347
+ fn set_allowed_apis ( & self , apis : gdk:: GLAPI ) ;
346
348
347
349
#[ doc( alias = "gtk_gl_area_set_auto_render" ) ]
348
350
fn set_auto_render ( & self , auto_render : bool ) ;
@@ -413,17 +415,21 @@ impl<O: IsA<GLArea>> GLAreaExt for O {
413
415
}
414
416
}
415
417
416
- //#[cfg(feature = "v4_12")]
417
- //#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
418
- //fn allowed_apis(&self) -> /*Ignored*/gdk::GLAPI {
419
- // unsafe { TODO: call ffi:gtk_gl_area_get_allowed_apis() }
420
- //}
418
+ #[ cfg( feature = "v4_12" ) ]
419
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
420
+ fn allowed_apis ( & self ) -> gdk:: GLAPI {
421
+ unsafe {
422
+ from_glib ( ffi:: gtk_gl_area_get_allowed_apis (
423
+ self . as_ref ( ) . to_glib_none ( ) . 0 ,
424
+ ) )
425
+ }
426
+ }
421
427
422
- // #[cfg(feature = "v4_12")]
423
- // #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
424
- // fn api(&self) -> /*Ignored*/ gdk::GLAPI {
425
- // unsafe { TODO: call ffi:gtk_gl_area_get_api() }
426
- // }
428
+ #[ cfg( feature = "v4_12" ) ]
429
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
430
+ fn api ( & self ) -> gdk:: GLAPI {
431
+ unsafe { from_glib ( ffi:: gtk_gl_area_get_api ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
432
+ }
427
433
428
434
fn is_auto_render ( & self ) -> bool {
429
435
unsafe {
@@ -487,11 +493,13 @@ impl<O: IsA<GLArea>> GLAreaExt for O {
487
493
}
488
494
}
489
495
490
- //#[cfg(feature = "v4_12")]
491
- //#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
492
- //fn set_allowed_apis(&self, apis: /*Ignored*/gdk::GLAPI) {
493
- // unsafe { TODO: call ffi:gtk_gl_area_set_allowed_apis() }
494
- //}
496
+ #[ cfg( feature = "v4_12" ) ]
497
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v4_12" ) ) ) ]
498
+ fn set_allowed_apis ( & self , apis : gdk:: GLAPI ) {
499
+ unsafe {
500
+ ffi:: gtk_gl_area_set_allowed_apis ( self . as_ref ( ) . to_glib_none ( ) . 0 , apis. into_glib ( ) ) ;
501
+ }
502
+ }
495
503
496
504
fn set_auto_render ( & self , auto_render : bool ) {
497
505
unsafe {
0 commit comments