@@ -258,6 +258,140 @@ impl From<Layer> for glib::Value {
258
258
}
259
259
}
260
260
261
+ #[ cfg( feature = "v2_50" ) ]
262
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
263
+ #[ derive( Debug , Eq , PartialEq , Ord , PartialOrd , Hash , Clone , Copy ) ]
264
+ #[ non_exhaustive]
265
+ #[ doc( alias = "AtkLive" ) ]
266
+ pub enum Live {
267
+ #[ doc( alias = "ATK_LIVE_NONE" ) ]
268
+ None ,
269
+ #[ doc( alias = "ATK_LIVE_POLITE" ) ]
270
+ Polite ,
271
+ #[ doc( alias = "ATK_LIVE_ASSERTIVE" ) ]
272
+ Assertive ,
273
+ #[ doc( hidden) ]
274
+ __Unknown( i32 ) ,
275
+ }
276
+
277
+ #[ cfg( feature = "v2_50" ) ]
278
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
279
+ impl fmt:: Display for Live {
280
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
281
+ write ! (
282
+ f,
283
+ "Live::{}" ,
284
+ match * self {
285
+ Self :: None => "None" ,
286
+ Self :: Polite => "Polite" ,
287
+ Self :: Assertive => "Assertive" ,
288
+ _ => "Unknown" ,
289
+ }
290
+ )
291
+ }
292
+ }
293
+
294
+ #[ cfg( feature = "v2_50" ) ]
295
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
296
+ #[ doc( hidden) ]
297
+ impl IntoGlib for Live {
298
+ type GlibType = ffi:: AtkLive ;
299
+
300
+ #[ inline]
301
+ fn into_glib ( self ) -> ffi:: AtkLive {
302
+ match self {
303
+ Self :: None => ffi:: ATK_LIVE_NONE ,
304
+ Self :: Polite => ffi:: ATK_LIVE_POLITE ,
305
+ Self :: Assertive => ffi:: ATK_LIVE_ASSERTIVE ,
306
+ Self :: __Unknown( value) => value,
307
+ }
308
+ }
309
+ }
310
+
311
+ #[ cfg( feature = "v2_50" ) ]
312
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
313
+ #[ doc( hidden) ]
314
+ impl FromGlib < ffi:: AtkLive > for Live {
315
+ #[ inline]
316
+ unsafe fn from_glib ( value : ffi:: AtkLive ) -> Self {
317
+ skip_assert_initialized ! ( ) ;
318
+
319
+ match value {
320
+ ffi:: ATK_LIVE_NONE => Self :: None ,
321
+ ffi:: ATK_LIVE_POLITE => Self :: Polite ,
322
+ ffi:: ATK_LIVE_ASSERTIVE => Self :: Assertive ,
323
+ value => Self :: __Unknown ( value) ,
324
+ }
325
+ }
326
+ }
327
+
328
+ #[ cfg( feature = "v2_50" ) ]
329
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
330
+ impl StaticType for Live {
331
+ #[ inline]
332
+ fn static_type ( ) -> glib:: Type {
333
+ unsafe { from_glib ( ffi:: atk_live_get_type ( ) ) }
334
+ }
335
+ }
336
+
337
+ #[ cfg( feature = "v2_50" ) ]
338
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
339
+ impl glib:: HasParamSpec for Live {
340
+ type ParamSpec = glib:: ParamSpecEnum ;
341
+ type SetValue = Self ;
342
+ type BuilderFn = fn ( & str , Self ) -> glib:: ParamSpecEnumBuilder < Self > ;
343
+
344
+ fn param_spec_builder ( ) -> Self :: BuilderFn {
345
+ |name, default_value| Self :: ParamSpec :: builder_with_default ( name, default_value)
346
+ }
347
+ }
348
+
349
+ #[ cfg( feature = "v2_50" ) ]
350
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
351
+ impl glib:: value:: ValueType for Live {
352
+ type Type = Self ;
353
+ }
354
+
355
+ #[ cfg( feature = "v2_50" ) ]
356
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
357
+ unsafe impl < ' a > glib:: value:: FromValue < ' a > for Live {
358
+ type Checker = glib:: value:: GenericValueTypeChecker < Self > ;
359
+
360
+ #[ inline]
361
+ unsafe fn from_value ( value : & ' a glib:: Value ) -> Self {
362
+ skip_assert_initialized ! ( ) ;
363
+ from_glib ( glib:: gobject_ffi:: g_value_get_enum ( value. to_glib_none ( ) . 0 ) )
364
+ }
365
+ }
366
+
367
+ #[ cfg( feature = "v2_50" ) ]
368
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
369
+ impl ToValue for Live {
370
+ #[ inline]
371
+ fn to_value ( & self ) -> glib:: Value {
372
+ let mut value = glib:: Value :: for_value_type :: < Self > ( ) ;
373
+ unsafe {
374
+ glib:: gobject_ffi:: g_value_set_enum ( value. to_glib_none_mut ( ) . 0 , self . into_glib ( ) ) ;
375
+ }
376
+ value
377
+ }
378
+
379
+ #[ inline]
380
+ fn value_type ( & self ) -> glib:: Type {
381
+ Self :: static_type ( )
382
+ }
383
+ }
384
+
385
+ #[ cfg( feature = "v2_50" ) ]
386
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_50" ) ) ) ]
387
+ impl From < Live > for glib:: Value {
388
+ #[ inline]
389
+ fn from ( v : Live ) -> Self {
390
+ skip_assert_initialized ! ( ) ;
391
+ ToValue :: to_value ( & v)
392
+ }
393
+ }
394
+
261
395
#[ derive( Debug , Eq , PartialEq , Ord , PartialOrd , Hash , Clone , Copy ) ]
262
396
#[ non_exhaustive]
263
397
#[ doc( alias = "AtkRelationType" ) ]
0 commit comments