awn-effects

## awn-effects awn-effects |

## Synopsis

    enum                AwnEffect;
                        AwnEffects;
    AwnEffects*         awn_effects_new                     ();
    AwnEffects*         awn_effects_new_for_widget          (GtkWidget *widget);
    void                awn_effects_free                    (AwnEffects *fx);
    void                awn_effects_finalize                (AwnEffects *fx);
    void                awn_effects_register                (AwnEffects *fx,
                                                             GtkWidget *obj);
    void                awn_effects_unregister              (AwnEffects *fx);
    void                awn_effects_start                   (AwnEffects *fx,
                                                             const AwnEffect effect);
    void                awn_effects_stop                    (AwnEffects *fx,
                                                             const AwnEffect effect);
    void                awn_effects_set_title               (AwnEffects *fx,
                                                             AwnTitle *title,
                                                             AwnTitleCallback title_func);
    void                awn_effects_start_ex                (AwnEffects *fx,
                                                             const AwnEffect effect,
                                                             AwnEventNotify start,
                                                             AwnEventNotify stop,
                                                             gint max_loops);
    void                awn_effects_draw_background         (AwnEffects *,
                                                             cairo_t *);
    void                awn_effects_draw_icons              (AwnEffects *,
                                                             cairo_t *,
                                                             GdkPixbuf *,
                                                             GdkPixbuf *);
    void                awn_effects_draw_icons_cairo        (AwnEffects *fx,
                                                             cairo_t *cr,
                                                             cairo_t *,
                                                             cairo_t *);
    void                awn_effects_draw_foreground         (AwnEffects *,
                                                             cairo_t *);
    void                awn_effects_draw_set_window_size    (AwnEffects *,
                                                             const gint ,
                                                             const gint );
    void                awn_effects_draw_set_icon_size      (AwnEffects *,
                                                             const gint ,
                                                             const gint );
    void                awn_effects_reflection_off          (AwnEffects *fx);
    void                awn_effects_reflection_on           (AwnEffects *fx);
    void                awn_effects_set_offset_cut          (AwnEffects *fx,
                                                             gboolean cut);

## Description

## Details

### enum AwnEffect

    typedef enum
    {
      AWN_EFFECT_NONE,
      AWN_EFFECT_OPENING,
      AWN_EFFECT_LAUNCHING,
      AWN_EFFECT_HOVER,
      AWN_EFFECT_ATTENTION,
      AWN_EFFECT_CLOSING,
      AWN_EFFECT_DESATURATE
    } AwnEffect;

### AwnEffects

    typedef struct {
      GtkWidget *self;
      GtkWidget *focus_window;
      AwnSettings *settings;
      AwnTitle *title;
      AwnTitleCallback get_title;
      GList *effect_queue;

      gint icon_width, icon_height;
      gint window_width, window_height;

      /* EFFECT VARIABLES */
      gboolean effect_lock;
      AwnEffect current_effect;
      AwnEffectSequence direction;
      gint count;

      gdouble x_offset;
      gdouble y_offset;
      gdouble curve_offset;

      gint delta_width;
      gint delta_height;

      GtkAllocation clip_region;

      gdouble rotate_degrees;
      gfloat alpha;
      gfloat spotlight_alpha;
      gfloat saturation;
      gfloat glow_amount;

      gint icon_depth;
      gint icon_depth_direction;

      /* State variables */
      gboolean hover;
      gboolean clip;
      gboolean flip;
      gboolean spotlight;
      gboolean do_reflections;
      gboolean do_offset_cut;

      guint enter_notify;
      guint leave_notify;
      guint timer_id;

      cairo_t * icon_ctx;
      cairo_t * reflect_ctx;

      AwnEffectsOp  * op_list;

      /* padding so we dont break ABI compability every time */
      void *pad1;
      void *pad2;
      void *pad3;
      void *pad4;
    } AwnEffects;

Structure containing all necessary variables for effects state for particular widget.

### awn_effects_new ()

    AwnEffects*         awn_effects_new                     ();

Creates and initializes new AwnEffects structure. After using this constructor it is necessary to set 'self' member to be able to use effects properly.

Returns : | Newly created AwnEffects instance.

### awn_effects_new_for_widget ()

    AwnEffects*         awn_effects_new_for_widget          (GtkWidget *widget);

Creates and initializes new AwnEffects structure.

`widget` : | Object which will be passed to all callback functions, this object is also passed to `gtk_widget_queue_draw()` during the animation.
Returns : | Newly created AwnEffects instance.

### awn_effects_free ()

    void                awn_effects_free                    (AwnEffects *fx);

Cleans up (by calling awn_effects_finalize) and frees AwnEffects structure.

`fx` : | Pointer to AwnEffects structure.

### awn_effects_finalize ()

    void                awn_effects_finalize                (AwnEffects *fx);

Finalizes AwnEffects usage and frees internally allocated memory.

`fx` : | Pointer to AwnEffects structure.

### awn_effects_register ()

    void                awn_effects_register                (AwnEffects *fx,
                                                             GtkWidget *obj);

Registers "enter-notify-event" and "leave-notify-event" signals for the managed window.

`fx` : | Pointer to AwnEffects structure.
`obj` : | GtkWidget derived class providing enter-notify-event and leave-notify-event signals.

### awn_effects_unregister ()

    void                awn_effects_unregister              (AwnEffects *fx);

Unregisters events for managed window.

`fx` : | Pointer to AwnEffects structure.

### awn_effects_start ()

    void                awn_effects_start                   (AwnEffects *fx,
                                                             const AwnEffect effect);

Start a single effect. The effect will loop until `awn_effect_stop()` is called.

`fx` : | Pointer to AwnEffects structure.
`effect` : | AwnEffect to schedule.

### awn_effects_stop ()

    void                awn_effects_stop                    (AwnEffects *fx,
                                                             const AwnEffect effect);

Stop a single effect.

`fx` : | Pointer to AwnEffects structure.
`effect` : | AwnEffect to stop.

### awn_effects_set_title ()

    void                awn_effects_set_title               (AwnEffects *fx,
                                                             AwnTitle *title,
                                                             AwnTitleCallback title_func);

Makes AwnTitle appear on "enter-notify-event".

`fx` : | Pointer to AwnEffects structure.
`title` : | Pointer to AwnTitle instance.
`title_func` : | Pointer to function which returns desired title text.

### awn_effects_start_ex ()

    void                awn_effects_start_ex                (AwnEffects *fx,
                                                             const AwnEffect effect,
                                                             AwnEventNotify start,
                                                             AwnEventNotify stop,
                                                             gint max_loops);

Extended effect start, which provides callbacks for animation start, end and possibility to specify maximum number of loops.

`fx` : | Pointer to AwnEffects structure.
`effect` : | Effect to schedule.
`start` : | Function which will be called when animation starts.
`stop` : | Function which will be called when animation finishes.
`max_loops` : | Number of maximum animation loops (0 for unlimited).

### awn_effects_draw_background ()

    void                awn_effects_draw_background         (AwnEffects *,
                                                             cairo_t *);

`Param1` : |
`Param2` : |

### awn_effects_draw_icons ()

    void                awn_effects_draw_icons              (AwnEffects *,
                                                             cairo_t *,
                                                             GdkPixbuf *,
                                                             GdkPixbuf *);

`Param1` : |
`Param2` : |
`Param3` : |
`Param4` : |

### awn_effects_draw_icons_cairo ()

    void                awn_effects_draw_icons_cairo        (AwnEffects *fx,
                                                             cairo_t *cr,
                                                             cairo_t *,
                                                             cairo_t *);

`fx` : |
`cr` : |
`Param3` : |
`Param4` : |

### awn_effects_draw_foreground ()

    void                awn_effects_draw_foreground         (AwnEffects *,
                                                             cairo_t *);

`Param1` : |
`Param2` : |

### awn_effects_draw_set_window_size ()

    void                awn_effects_draw_set_window_size    (AwnEffects *,
                                                             const gint ,
                                                             const gint );

`Param1` : |
`Param2` : |
`Param3` : |

### awn_effects_draw_set_icon_size ()

    void                awn_effects_draw_set_icon_size      (AwnEffects *,
                                                             const gint ,
                                                             const gint );

`Param1` : |
`Param2` : |
`Param3` : |

### awn_effects_reflection_off ()

    void                awn_effects_reflection_off          (AwnEffects *fx);

`fx` : |

### awn_effects_reflection_on ()

    void                awn_effects_reflection_on           (AwnEffects *fx);

`fx` : |

### awn_effects_set_offset_cut ()

    void                awn_effects_set_offset_cut          (AwnEffects *fx,
                                                             gboolean cut);

`fx` : |
`cut` : |