animate/legacy/
blur_effect.rs

1use crate::{ActorMeta, Effect, OffscreenEffect};
2use glib::{object as gobject, object::Cast, translate::*};
3use std::fmt;
4
5glib_wrapper! {
6    pub struct BlurEffect(Object<ffi::ClutterBlurEffect, ffi::ClutterBlurEffectClass, BlurEffectClass>) @extends OffscreenEffect, Effect, ActorMeta, gobject::InitiallyUnowned;
7
8    match fn {
9        get_type => || ffi::clutter_blur_effect_get_type(),
10    }
11}
12
13impl BlurEffect {
14    /// Creates a new `BlurEffect` to be used with
15    /// `ActorExt::add_effect`
16    ///
17    /// # Returns
18    ///
19    /// the newly created `BlurEffect` or `None`
20    pub fn new() -> BlurEffect {
21        unsafe { Effect::from_glib_none(ffi::clutter_blur_effect_new()).unsafe_cast() }
22    }
23}
24
25impl Default for BlurEffect {
26    fn default() -> Self {
27        Self::new()
28    }
29}
30
31impl fmt::Display for BlurEffect {
32    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
33        write!(f, "BlurEffect")
34    }
35}