AwnEffects

AwnEffects

Functions

Properties

gboolean active Read / Write / Construct
DesktopAgnosticColor * active-rect-color Read / Write
DesktopAgnosticColor * active-rect-outline Read / Write
gchar * arrow-png Read / Write / Construct
gint arrows-count Read / Write / Construct
gint border-clip Read / Write / Construct
gchar * custom-active-png Read / Write / Construct
gboolean depressed Read / Write / Construct
DesktopAgnosticColor * dot-color Read / Write
gint effects Read / Write / Construct
gfloat icon-alpha Read / Write / Construct
gint icon-offset Read / Write / Construct
gboolean indirect-paint Read / Write / Construct
gboolean make-shadow Read / Write / Construct
gboolean no-clear Read / Write / Construct
GtkPositionType position Read / Write / Construct
gfloat progress Read / Write / Construct
gfloat reflection-alpha Read / Write / Construct
gint reflection-offset Read / Write / Construct
gboolean reflection-visible Read / Write / Construct
gchar * spotlight-png Read / Write / Construct
GtkWidget * widget Read / Write

Signals

void animation-end Run First
void animation-start Run First

Types and Values

Object Hierarchy

    GObject
    ╰── AwnEffects

Description

Functions

awn_effects_new_for_widget ()

AwnEffects *
awn_effects_new_for_widget (GtkWidget *widget);

Creates new AwnEffects instance.

Parameters

widget

Managed widget, computing window width and height is based on it and it is also passed to gtk_widget_queue_draw() during the animations.

 

Returns


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.

Parameters

fx

Pointer to AwnEffects instance.

 

effect

AwnEffect to schedule.

 

awn_effects_stop ()

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

Stop a single effect.

Parameters

fx

Pointer to AwnEffects instance.

 

effect

AwnEffect to stop.

 

awn_effects_start_ex ()

void
awn_effects_start_ex (AwnEffects *fx,
                      const AwnEffect effect,
                      gint max_loops,
                      gboolean signal_start,
                      gboolean signal_end);

Extended effect start, which provides a way to specify maximum number of loops and possibility to emit signals for animation start & end.

Parameters

fx

Pointer to AwnEffects instance.

 

effect

Effect to schedule.

 

max_loops

Number of maximum animation loops (0 for unlimited).

 

signal_start

Determines whether the animation should emit "animation-start" signal when it starts.

 

signal_end

Determines whether the animation should emit "animation-end" signal when it finishes.

 

awn_effects_set_icon_size ()

void
awn_effects_set_icon_size (AwnEffects *fx,
                           gint width,
                           gint height,
                           gboolean requestSize);

Sets up correct offsets in managed window based on dimensions of drawn icon.

Parameters

fx

Pointer to AwnEffects instance.

 

width

Width of drawn icon.

 

height

Height of drawn icon.

 

requestSize

Set to true to call gtk_widget_set_size_request for the managed widget.

 

awn_effects_cairo_create ()

cairo_t *
awn_effects_cairo_create (AwnEffects *fx);
Make sure you call awn_effects_cairo_destroy() on the cairo context returned by this call.

Parameters

fx

Pointer to AwnEffects instance.

 

Returns

cairo context where an icon can be drawn. (the icon should have dimensions specified by a previous call to awn_effects_set_icon_size)


awn_effects_cairo_create_clipped ()

cairo_t *
awn_effects_cairo_create_clipped (AwnEffects *fx,
                                  GdkEventExpose *event);

Creates a Cairo context for drawing to “widget”. The drawing region will be clipped to event 's region member, and translated to its area member, so you can always paint the icon at coordinates [0, 0].

Make sure you call awn_effects_cairo_destroy() on the cairo context returned by this call.

Parameters

fx

Pointer to AwnEffects instance.

 

event

GdkEventExpose received by the widget.

 

Returns

cairo context where an icon can be drawn. (the icon should have dimensions specified by a previous call to awn_effects_set_icon_size)


awn_effects_cairo_destroy ()

void
awn_effects_cairo_destroy (AwnEffects *fx);

Finish drawing of the icon and run all post-ops.

Parameters

fx

Pointer to AwnEffects instance.

 

awn_effects_add_overlay ()

void
awn_effects_add_overlay (AwnEffects *fx,
                         AwnOverlay *overlay);

Adds an overlay to the list of rendered overlays.

Parameters

fx

AwnEffects instance.

 

overlay

AwnOverlay instance which should be added.

 

awn_effects_remove_overlay ()

void
awn_effects_remove_overlay (AwnEffects *fx,
                            AwnOverlay *overlay);

Removes overlay from the list of rendered overlays.

Parameters

fx

AwnEffects instance.

 

overlay

AwnOverlay which was previously added using awn_effects_add_overlay.

 

awn_effects_get_overlays ()

GList *
awn_effects_get_overlays (AwnEffects *fx);

Parameters

fx

AwnEffects instance.

 

Returns

a newly-allocated list of the overlays added to this effects instance.


awn_effects_redraw ()

void
awn_effects_redraw (AwnEffects *fx);

Schedules redraw of the managed widget. Contrary to gtk_widget_queue_draw, this function tries to minimize the area that needs to be redrawn.

Parameters

fx

AwnEffects instance.

 

awn_effects_main_effect_loop ()

void
awn_effects_main_effect_loop (AwnEffects *fx);


awn_effects_emit_anim_start ()

void
awn_effects_emit_anim_start (AwnEffects *fx,
                             AwnEffect effect);


awn_effects_emit_anim_end ()

void
awn_effects_emit_anim_end (AwnEffects *fx,
                           AwnEffect effect);

Types and Values

enum AwnEffect

Members

AWN_EFFECT_NONE

   

AWN_EFFECT_OPENING

   

AWN_EFFECT_CLOSING

   

AWN_EFFECT_HOVER

   

AWN_EFFECT_LAUNCHING

   

AWN_EFFECT_ATTENTION

   

AWN_EFFECT_DESATURATE

   

AwnEffectsPrivate

typedef struct _AwnEffectsPrivate AwnEffectsPrivate;


struct AwnEffects

struct AwnEffects;

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

Property Details

The “active” property

  “active”                   gboolean

Determines whether to draw the active rectangle behind the icon.

Flags: Read / Write / Construct

Default value: FALSE


The “active-rect-color” property

  “active-rect-color”        DesktopAgnosticColor *

Color used for painting active rectangle.

Flags: Read / Write


The “active-rect-outline” property

  “active-rect-outline”      DesktopAgnosticColor *

Color used for painting outline of active rectangle.

Flags: Read / Write


The “arrow-png” property

  “arrow-png”                gchar *

Icon to draw when arrows-count is more than 0.

Flags: Read / Write / Construct

Default value: "__awn_internal_arrow1"


The “arrows-count” property

  “arrows-count”             gint

Determines the number of arrows drawn.

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “border-clip” property

  “border-clip”              gint

Determines amount of clipping of the icon edge. (suitable for offset on the 3D bar)

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “custom-active-png” property

  “custom-active-png”        gchar *

Path to a custom png icon which will be painted when the property “active” is set to TRUE.

Flags: Read / Write / Construct

Default value: NULL


The “depressed” property

  “depressed”                gboolean

Determines whether to draw the icon slightly desaturated.

Flags: Read / Write / Construct

Default value: FALSE


The “dot-color” property

  “dot-color”                DesktopAgnosticColor *

Color used for painting glowing dot.

Flags: Read / Write


The “effects” property

  “effects”                  gint

Set a bitmask to specify which kind of effects are used on the widget.

Flags: Read / Write / Construct

Default value: 0


The “icon-alpha” property

  “icon-alpha”               gfloat

Determines alpha value of the drawn icon.

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1


The “icon-offset” property

  “icon-offset”              gint

Determines offset of the icon from border of the widget's window.

Flags: Read / Write / Construct

Default value: 0


The “indirect-paint” property

  “indirect-paint”           gboolean

Determines whether transformations are applied directly to the widget, or to an offscreen buffer before being painted to target widget. Set to FALSE to improve performance, but will cause artifacts if used on non-transparent window.

Flags: Read / Write / Construct

Default value: TRUE


The “make-shadow” property

  “make-shadow”              gboolean

Determines whether to draw a shadow around the icon.

Flags: Read / Write / Construct

Default value: FALSE


The “no-clear” property

  “no-clear”                 gboolean

Whether the context should be cleared when painting. Set no-clear to FALSE to improve performace if you're using background of proper color on the widget.

Flags: Read / Write / Construct

Default value: TRUE


The “position” property

  “position”                 GtkPositionType

Determines position of the widget.

Flags: Read / Write / Construct

Default value: GTK_POS_BOTTOM


The “progress” property

  “progress”                 gfloat

Extra progress pie painted on the pie and percentage value it represents. Set to 1.0 to hide the progress pie.

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1


The “reflection-alpha” property

  “reflection-alpha”         gfloat

Determines alpha value of the reflected icon.

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 0.25


The “reflection-offset” property

  “reflection-offset”        gint

Determines offset of the reflection from the drawn icon.

Flags: Read / Write / Construct

Default value: 0


The “reflection-visible” property

  “reflection-visible”       gboolean

Determines whether the reflection is visible.

Flags: Read / Write / Construct

Default value: TRUE


The “spotlight-png” property

  “spotlight-png”            gchar *

Path to png icon which will be used for the spotlight effect.

Flags: Read / Write / Construct

Default value: "__awn_internal_spotlight"


The “widget” property

  “widget”                   GtkWidget *

Determines which widget is animated by this instance of AwnEffects.

Flags: Read / Write

Signal Details

The “animation-end” signal

void
user_function (AwnEffects *arg0,
               AwnEffect   arg1,
               gpointer    user_data)

fx : The AwnEffects instance which received the signal. effect : Effect type which just finished.

The ::animation-end signal is emitted when the animation finishes, and as ::animation-start signal is emitted only once for the entire animation (see the note in description for ::animation-start signal). You also have to explicitely ask AwnEffects to emit this signal using awn_effects_start_ex method.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “animation-start” signal

void
user_function (AwnEffects *arg0,
               AwnEffect   arg1,
               gpointer    user_data)

fx : The AwnEffects instance which received the signal. effect : Effect type which was started.

The ::animation-start signal is emitted when the animation starts playing (ie. all other animations queued before it finish playing). You also have to explicitely ask AwnEffects to emit this signal using awn_effects_start_ex method. Note: Signal is emitted only once even if another animation with higher priority interrupts the animation and this animation is started again later (ie. no signal on this second start).

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run First