animate/legacy/
flags.rs

1use glib::{
2    translate::*,
3    value::{FromValue, FromValueOptional, SetValue, Value},
4    StaticType, Type,
5};
6
7bitflags! {
8    pub struct ActorFlags: u32 {
9        const MAPPED = 2;
10        const REALIZED = 4;
11        const REACTIVE = 8;
12        const VISIBLE = 16;
13        const NO_LAYOUT = 32;
14    }
15}
16
17#[doc(hidden)]
18impl ToGlib for ActorFlags {
19    type GlibType = ffi::ClutterActorFlags;
20
21    fn to_glib(&self) -> ffi::ClutterActorFlags {
22        self.bits()
23    }
24}
25
26#[doc(hidden)]
27impl FromGlib<ffi::ClutterActorFlags> for ActorFlags {
28    fn from_glib(value: ffi::ClutterActorFlags) -> ActorFlags {
29        ActorFlags::from_bits_truncate(value)
30    }
31}
32
33impl StaticType for ActorFlags {
34    fn static_type() -> Type {
35        unsafe { from_glib(ffi::clutter_actor_flags_get_type()) }
36    }
37}
38
39impl<'a> FromValueOptional<'a> for ActorFlags {
40    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
41        Some(FromValue::from_value(value))
42    }
43}
44
45impl<'a> FromValue<'a> for ActorFlags {
46    unsafe fn from_value(value: &Value) -> Self {
47        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
48    }
49}
50
51impl SetValue for ActorFlags {
52    unsafe fn set_value(value: &mut Value, this: &Self) {
53        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
54    }
55}
56
57bitflags! {
58    pub struct AllocationFlags: u32 {
59        const ALLOCATION_NONE = 0;
60        const ABSOLUTE_ORIGIN_CHANGED = 2;
61        const DELEGATE_LAYOUT = 4;
62    }
63}
64
65#[doc(hidden)]
66impl ToGlib for AllocationFlags {
67    type GlibType = ffi::ClutterAllocationFlags;
68
69    fn to_glib(&self) -> ffi::ClutterAllocationFlags {
70        self.bits()
71    }
72}
73
74#[doc(hidden)]
75impl FromGlib<ffi::ClutterAllocationFlags> for AllocationFlags {
76    fn from_glib(value: ffi::ClutterAllocationFlags) -> AllocationFlags {
77        AllocationFlags::from_bits_truncate(value)
78    }
79}
80
81impl StaticType for AllocationFlags {
82    fn static_type() -> Type {
83        unsafe { from_glib(ffi::clutter_allocation_flags_get_type()) }
84    }
85}
86
87impl<'a> FromValueOptional<'a> for AllocationFlags {
88    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
89        Some(FromValue::from_value(value))
90    }
91}
92
93impl<'a> FromValue<'a> for AllocationFlags {
94    unsafe fn from_value(value: &Value) -> Self {
95        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
96    }
97}
98
99impl SetValue for AllocationFlags {
100    unsafe fn set_value(value: &mut Value, this: &Self) {
101        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
102    }
103}
104
105bitflags! {
106    pub struct ContentRepeat: u32 {
107        const NONE = 0;
108        const X_AXIS = 1;
109        const Y_AXIS = 2;
110        const BOTH = 3;
111    }
112}
113
114#[doc(hidden)]
115impl ToGlib for ContentRepeat {
116    type GlibType = ffi::ClutterContentRepeat;
117
118    fn to_glib(&self) -> ffi::ClutterContentRepeat {
119        self.bits()
120    }
121}
122
123#[doc(hidden)]
124impl FromGlib<ffi::ClutterContentRepeat> for ContentRepeat {
125    fn from_glib(value: ffi::ClutterContentRepeat) -> ContentRepeat {
126        ContentRepeat::from_bits_truncate(value)
127    }
128}
129
130impl StaticType for ContentRepeat {
131    fn static_type() -> Type {
132        unsafe { from_glib(ffi::clutter_content_repeat_get_type()) }
133    }
134}
135
136impl<'a> FromValueOptional<'a> for ContentRepeat {
137    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
138        Some(FromValue::from_value(value))
139    }
140}
141
142impl<'a> FromValue<'a> for ContentRepeat {
143    unsafe fn from_value(value: &Value) -> Self {
144        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
145    }
146}
147
148impl SetValue for ContentRepeat {
149    unsafe fn set_value(value: &mut Value, this: &Self) {
150        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
151    }
152}
153
154bitflags! {
155    pub struct EffectPaintFlags: u32 {
156        const ACTOR_DIRTY = 1;
157    }
158}
159
160#[doc(hidden)]
161impl ToGlib for EffectPaintFlags {
162    type GlibType = ffi::ClutterEffectPaintFlags;
163
164    fn to_glib(&self) -> ffi::ClutterEffectPaintFlags {
165        self.bits()
166    }
167}
168
169#[doc(hidden)]
170impl FromGlib<ffi::ClutterEffectPaintFlags> for EffectPaintFlags {
171    fn from_glib(value: ffi::ClutterEffectPaintFlags) -> EffectPaintFlags {
172        EffectPaintFlags::from_bits_truncate(value)
173    }
174}
175
176impl StaticType for EffectPaintFlags {
177    fn static_type() -> Type {
178        unsafe { from_glib(ffi::clutter_effect_paint_flags_get_type()) }
179    }
180}
181
182impl<'a> FromValueOptional<'a> for EffectPaintFlags {
183    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
184        Some(FromValue::from_value(value))
185    }
186}
187
188impl<'a> FromValue<'a> for EffectPaintFlags {
189    unsafe fn from_value(value: &Value) -> Self {
190        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
191    }
192}
193
194impl SetValue for EffectPaintFlags {
195    unsafe fn set_value(value: &mut Value, this: &Self) {
196        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
197    }
198}
199
200bitflags! {
201    pub struct EventFlags: u32 {
202        const NONE = 0;
203        const FLAG_SYNTHETIC = 1;
204    }
205}
206
207#[doc(hidden)]
208impl ToGlib for EventFlags {
209    type GlibType = ffi::ClutterEventFlags;
210
211    fn to_glib(&self) -> ffi::ClutterEventFlags {
212        self.bits()
213    }
214}
215
216#[doc(hidden)]
217impl FromGlib<ffi::ClutterEventFlags> for EventFlags {
218    fn from_glib(value: ffi::ClutterEventFlags) -> EventFlags {
219        EventFlags::from_bits_truncate(value)
220    }
221}
222
223impl StaticType for EventFlags {
224    fn static_type() -> Type {
225        unsafe { from_glib(ffi::clutter_event_flags_get_type()) }
226    }
227}
228
229impl<'a> FromValueOptional<'a> for EventFlags {
230    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
231        Some(FromValue::from_value(value))
232    }
233}
234
235impl<'a> FromValue<'a> for EventFlags {
236    unsafe fn from_value(value: &Value) -> Self {
237        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
238    }
239}
240
241impl SetValue for EventFlags {
242    unsafe fn set_value(value: &mut Value, this: &Self) {
243        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
244    }
245}
246
247bitflags! {
248    pub struct FeatureFlags: u32 {
249        const TEXTURE_NPOT = 4;
250        const SYNC_TO_VBLANK = 8;
251        const TEXTURE_YUV = 16;
252        const TEXTURE_READ_PIXELS = 32;
253        const STAGE_STATIC = 64;
254        const STAGE_USER_RESIZE = 128;
255        const STAGE_CURSOR = 256;
256        const SHADERS_GLSL = 512;
257        const OFFSCREEN = 1024;
258        const STAGE_MULTIPLE = 2048;
259        const SWAP_EVENTS = 4096;
260    }
261}
262
263#[doc(hidden)]
264impl ToGlib for FeatureFlags {
265    type GlibType = ffi::ClutterFeatureFlags;
266
267    fn to_glib(&self) -> ffi::ClutterFeatureFlags {
268        self.bits()
269    }
270}
271
272#[doc(hidden)]
273impl FromGlib<ffi::ClutterFeatureFlags> for FeatureFlags {
274    fn from_glib(value: ffi::ClutterFeatureFlags) -> FeatureFlags {
275        FeatureFlags::from_bits_truncate(value)
276    }
277}
278
279impl StaticType for FeatureFlags {
280    fn static_type() -> Type {
281        unsafe { from_glib(ffi::clutter_feature_flags_get_type()) }
282    }
283}
284
285impl<'a> FromValueOptional<'a> for FeatureFlags {
286    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
287        Some(FromValue::from_value(value))
288    }
289}
290
291impl<'a> FromValue<'a> for FeatureFlags {
292    unsafe fn from_value(value: &Value) -> Self {
293        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
294    }
295}
296
297impl SetValue for FeatureFlags {
298    unsafe fn set_value(value: &mut Value, this: &Self) {
299        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
300    }
301}
302
303bitflags! {
304    pub struct ModifierType: u32 {
305        const SHIFT_MASK = 1;
306        const LOCK_MASK = 2;
307        const CONTROL_MASK = 4;
308        const MOD1_MASK = 8;
309        const MOD2_MASK = 16;
310        const MOD3_MASK = 32;
311        const MOD4_MASK = 64;
312        const MOD5_MASK = 128;
313        const BUTTON1_MASK = 256;
314        const BUTTON2_MASK = 512;
315        const BUTTON3_MASK = 1024;
316        const BUTTON4_MASK = 2048;
317        const BUTTON5_MASK = 4096;
318        const MODIFIER_RESERVED_13_MASK = 8192;
319        const MODIFIER_RESERVED_14_MASK = 16384;
320        const MODIFIER_RESERVED_15_MASK = 32768;
321        const MODIFIER_RESERVED_16_MASK = 65536;
322        const MODIFIER_RESERVED_17_MASK = 131072;
323        const MODIFIER_RESERVED_18_MASK = 262144;
324        const MODIFIER_RESERVED_19_MASK = 524288;
325        const MODIFIER_RESERVED_20_MASK = 1048576;
326        const MODIFIER_RESERVED_21_MASK = 2097152;
327        const MODIFIER_RESERVED_22_MASK = 4194304;
328        const MODIFIER_RESERVED_23_MASK = 8388608;
329        const MODIFIER_RESERVED_24_MASK = 16777216;
330        const MODIFIER_RESERVED_25_MASK = 33554432;
331        const SUPER_MASK = 67108864;
332        const HYPER_MASK = 134217728;
333        const META_MASK = 268435456;
334        const MODIFIER_RESERVED_29_MASK = 536870912;
335        const RELEASE_MASK = 1073741824;
336        const MODIFIER_MASK = 1543512063;
337    }
338}
339
340#[doc(hidden)]
341impl ToGlib for ModifierType {
342    type GlibType = ffi::ClutterModifierType;
343
344    fn to_glib(&self) -> ffi::ClutterModifierType {
345        self.bits()
346    }
347}
348
349#[doc(hidden)]
350impl FromGlib<ffi::ClutterModifierType> for ModifierType {
351    fn from_glib(value: ffi::ClutterModifierType) -> ModifierType {
352        ModifierType::from_bits_truncate(value)
353    }
354}
355
356impl StaticType for ModifierType {
357    fn static_type() -> Type {
358        unsafe { from_glib(ffi::clutter_modifier_type_get_type()) }
359    }
360}
361
362impl<'a> FromValueOptional<'a> for ModifierType {
363    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
364        Some(FromValue::from_value(value))
365    }
366}
367
368impl<'a> FromValue<'a> for ModifierType {
369    unsafe fn from_value(value: &Value) -> Self {
370        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
371    }
372}
373
374impl SetValue for ModifierType {
375    unsafe fn set_value(value: &mut Value, this: &Self) {
376        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
377    }
378}
379
380bitflags! {
381    pub struct OffscreenRedirect: u32 {
382        const AUTOMATIC_FOR_OPACITY = 1;
383        const ALWAYS = 2;
384    }
385}
386
387#[doc(hidden)]
388impl ToGlib for OffscreenRedirect {
389    type GlibType = ffi::ClutterOffscreenRedirect;
390
391    fn to_glib(&self) -> ffi::ClutterOffscreenRedirect {
392        self.bits()
393    }
394}
395
396#[doc(hidden)]
397impl FromGlib<ffi::ClutterOffscreenRedirect> for OffscreenRedirect {
398    fn from_glib(value: ffi::ClutterOffscreenRedirect) -> OffscreenRedirect {
399        OffscreenRedirect::from_bits_truncate(value)
400    }
401}
402
403impl StaticType for OffscreenRedirect {
404    fn static_type() -> Type {
405        unsafe { from_glib(ffi::clutter_offscreen_redirect_get_type()) }
406    }
407}
408
409impl<'a> FromValueOptional<'a> for OffscreenRedirect {
410    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
411        Some(FromValue::from_value(value))
412    }
413}
414
415impl<'a> FromValue<'a> for OffscreenRedirect {
416    unsafe fn from_value(value: &Value) -> Self {
417        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
418    }
419}
420
421impl SetValue for OffscreenRedirect {
422    unsafe fn set_value(value: &mut Value, this: &Self) {
423        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
424    }
425}
426
427bitflags! {
428    pub struct RepaintFlags: u32 {
429        const PRE_PAINT = 1;
430        const POST_PAINT = 2;
431        const QUEUE_REDRAW_ON_ADD = 4;
432    }
433}
434
435#[doc(hidden)]
436impl ToGlib for RepaintFlags {
437    type GlibType = ffi::ClutterRepaintFlags;
438
439    fn to_glib(&self) -> ffi::ClutterRepaintFlags {
440        self.bits()
441    }
442}
443
444#[doc(hidden)]
445impl FromGlib<ffi::ClutterRepaintFlags> for RepaintFlags {
446    fn from_glib(value: ffi::ClutterRepaintFlags) -> RepaintFlags {
447        RepaintFlags::from_bits_truncate(value)
448    }
449}
450
451impl StaticType for RepaintFlags {
452    fn static_type() -> Type {
453        unsafe { from_glib(ffi::clutter_repaint_flags_get_type()) }
454    }
455}
456
457impl<'a> FromValueOptional<'a> for RepaintFlags {
458    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
459        Some(FromValue::from_value(value))
460    }
461}
462
463impl<'a> FromValue<'a> for RepaintFlags {
464    unsafe fn from_value(value: &Value) -> Self {
465        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
466    }
467}
468
469impl SetValue for RepaintFlags {
470    unsafe fn set_value(value: &mut Value, this: &Self) {
471        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
472    }
473}
474
475bitflags! {
476    pub struct ScrollFinishFlags: u32 {
477        const NONE = 0;
478        const HORIZONTAL = 1;
479        const VERTICAL = 2;
480    }
481}
482
483#[doc(hidden)]
484impl ToGlib for ScrollFinishFlags {
485    type GlibType = ffi::ClutterScrollFinishFlags;
486
487    fn to_glib(&self) -> ffi::ClutterScrollFinishFlags {
488        self.bits()
489    }
490}
491
492#[doc(hidden)]
493impl FromGlib<ffi::ClutterScrollFinishFlags> for ScrollFinishFlags {
494    fn from_glib(value: ffi::ClutterScrollFinishFlags) -> ScrollFinishFlags {
495        ScrollFinishFlags::from_bits_truncate(value)
496    }
497}
498
499impl StaticType for ScrollFinishFlags {
500    fn static_type() -> Type {
501        unsafe { from_glib(ffi::clutter_scroll_finish_flags_get_type()) }
502    }
503}
504
505impl<'a> FromValueOptional<'a> for ScrollFinishFlags {
506    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
507        Some(FromValue::from_value(value))
508    }
509}
510
511impl<'a> FromValue<'a> for ScrollFinishFlags {
512    unsafe fn from_value(value: &Value) -> Self {
513        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
514    }
515}
516
517impl SetValue for ScrollFinishFlags {
518    unsafe fn set_value(value: &mut Value, this: &Self) {
519        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
520    }
521}
522
523bitflags! {
524    pub struct ScrollMode: u32 {
525        const NONE = 0;
526        const HORIZONTALLY = 1;
527        const VERTICALLY = 2;
528        const BOTH = 3;
529    }
530}
531
532#[doc(hidden)]
533impl ToGlib for ScrollMode {
534    type GlibType = ffi::ClutterScrollMode;
535
536    fn to_glib(&self) -> ffi::ClutterScrollMode {
537        self.bits()
538    }
539}
540
541#[doc(hidden)]
542impl FromGlib<ffi::ClutterScrollMode> for ScrollMode {
543    fn from_glib(value: ffi::ClutterScrollMode) -> ScrollMode {
544        ScrollMode::from_bits_truncate(value)
545    }
546}
547
548impl StaticType for ScrollMode {
549    fn static_type() -> Type {
550        unsafe { from_glib(ffi::clutter_scroll_mode_get_type()) }
551    }
552}
553
554impl<'a> FromValueOptional<'a> for ScrollMode {
555    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
556        Some(FromValue::from_value(value))
557    }
558}
559
560impl<'a> FromValue<'a> for ScrollMode {
561    unsafe fn from_value(value: &Value) -> Self {
562        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
563    }
564}
565
566impl SetValue for ScrollMode {
567    unsafe fn set_value(value: &mut Value, this: &Self) {
568        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
569    }
570}
571
572bitflags! {
573    pub struct StageState: u32 {
574        const FULLSCREEN = 2;
575        const OFFSCREEN = 4;
576        const ACTIVATED = 8;
577    }
578}
579
580#[doc(hidden)]
581impl ToGlib for StageState {
582    type GlibType = ffi::ClutterStageState;
583
584    fn to_glib(&self) -> ffi::ClutterStageState {
585        self.bits()
586    }
587}
588
589#[doc(hidden)]
590impl FromGlib<ffi::ClutterStageState> for StageState {
591    fn from_glib(value: ffi::ClutterStageState) -> StageState {
592        StageState::from_bits_truncate(value)
593    }
594}
595
596impl StaticType for StageState {
597    fn static_type() -> Type {
598        unsafe { from_glib(ffi::clutter_stage_state_get_type()) }
599    }
600}
601
602impl<'a> FromValueOptional<'a> for StageState {
603    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
604        Some(FromValue::from_value(value))
605    }
606}
607
608impl<'a> FromValue<'a> for StageState {
609    unsafe fn from_value(value: &Value) -> Self {
610        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
611    }
612}
613
614impl SetValue for StageState {
615    unsafe fn set_value(value: &mut Value, this: &Self) {
616        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
617    }
618}
619
620bitflags! {
621    pub struct SwipeDirection: u32 {
622        const UP = 1;
623        const DOWN = 2;
624        const LEFT = 4;
625        const RIGHT = 8;
626    }
627}
628
629#[doc(hidden)]
630impl ToGlib for SwipeDirection {
631    type GlibType = ffi::ClutterSwipeDirection;
632
633    fn to_glib(&self) -> ffi::ClutterSwipeDirection {
634        self.bits()
635    }
636}
637
638#[doc(hidden)]
639impl FromGlib<ffi::ClutterSwipeDirection> for SwipeDirection {
640    fn from_glib(value: ffi::ClutterSwipeDirection) -> SwipeDirection {
641        SwipeDirection::from_bits_truncate(value)
642    }
643}
644
645impl StaticType for SwipeDirection {
646    fn static_type() -> Type {
647        unsafe { from_glib(ffi::clutter_swipe_direction_get_type()) }
648    }
649}
650
651impl<'a> FromValueOptional<'a> for SwipeDirection {
652    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
653        Some(FromValue::from_value(value))
654    }
655}
656
657impl<'a> FromValue<'a> for SwipeDirection {
658    unsafe fn from_value(value: &Value) -> Self {
659        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
660    }
661}
662
663impl SetValue for SwipeDirection {
664    unsafe fn set_value(value: &mut Value, this: &Self) {
665        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
666    }
667}