Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-animations.h File Reference

Data Structures

struct  _CairoDockTransition
 Transitions are an easy way to set an animation on an Icon to make it change from a state to another. More...
 
struct  _CairoDockHidingEffect
 Definition of a Hiding Effect backend (used to provide an animation when the docks hides/shows itself). More...
 

Macros

#define cairo_dock_container_is_animating(pContainer)
 
#define cairo_dock_animation_will_be_visible(pDock)
 
#define gldi_icon_stop_animation(pIcon)
 
#define cairo_dock_get_animation_delta_t(pContainer)
 
#define cairo_dock_get_slow_animation_delta_t(pContainer)
 
#define cairo_dock_has_transition(pIcon)
 
#define cairo_dock_get_transition_count(pIcon)
 
#define cairo_dock_get_transition_elapsed_time(pIcon)
 
#define cairo_dock_get_transition_fraction(pIcon)
 

Typedefs

typedef gboolean(* CairoDockTransitionRenderFunc )(Icon *pIcon, gpointer pUserData)
 callback to render the icon with libcairo at each step of the Transition.
 
typedef gboolean(* CairoDockTransitionGLRenderFunc )(Icon *pIcon, gpointer pUserData)
 callback to render the icon with OpenGL at each step of the Transition.
 

Functions

void cairo_dock_pop_up (CairoDock *pDock)
 
void cairo_dock_pop_down (CairoDock *pDock)
 
void cairo_dock_launch_animation (GldiContainer *pContainer)
 
void gldi_icon_start_animation (Icon *icon)
 
void gldi_icon_request_animation (Icon *pIcon, const gchar *cAnimation, int iNbRounds)
 
void gldi_icon_request_attention (Icon *pIcon, const gchar *cAnimation, int iNbRounds)
 
void gldi_icon_stop_attention (Icon *pIcon)
 
void cairo_dock_trigger_icon_removal_from_dock (Icon *pIcon)
 
void cairo_dock_set_transition_on_icon (Icon *pIcon, GldiContainer *pContainer, CairoDockTransitionRenderFunc render_step_cairo, CairoDockTransitionGLRenderFunc render_step_opengl, gboolean bFastPace, gint iDuration, gboolean bRemoveWhenFinished, gpointer pUserData, GFreeFunc pFreeUserDataFunc)
 
void cairo_dock_remove_transition_on_icon (Icon *pIcon)
 

Detailed Description

This class handles the icons and containers animations. Each container has a rendering loop. An iteration of this loop is separated in 2 phases : the update of each element of the container and of the container itself, and the redraw of each element and of the container itself. The loop has 2 possible frequencies : fast (~33Hz) and slow (~10Hz), to optimize the CPU load according to the needs of the animation. To be called on each iteration of the loop, you register to the CAIRO_DOCK_UPDATE_X or CAIRO_DOCK_UPDATE_X_SLOW, where X is either ICON, DOCK, DESKLET, DIALOG or FLYING_CONTAINER. If you need to draw things directly on the container, you register to CAIRO_DOCK_RENDER_X, where X is either ICON, DOCK, DESKLET, DIALOG or FLYING_CONTAINER.

Macro Definition Documentation

#define cairo_dock_container_is_animating (   pContainer)

Say if a container is currently animated.

Parameters
pContainera Container
#define cairo_dock_animation_will_be_visible (   pDock)

Say if it's usefull to launch an animation on a Dock (indeed, it's useless to launch it if it will be invisible).

Parameters
pDockthe Dock to animate.
#define gldi_icon_stop_animation (   pIcon)

Stop any animation on an Icon, except the disappearance/appearance animation.

Parameters
pIconthe icon
#define cairo_dock_get_animation_delta_t (   pContainer)

Get the interval of time between 2 iterations of the fast loop (in ms).

Parameters
pContainerthe container.
#define cairo_dock_get_slow_animation_delta_t (   pContainer)

Get the interval of time between 2 iterations of the slow loop (in ms).

Parameters
pContainerthe container.
#define cairo_dock_has_transition (   pIcon)

Say if an Icon has a Transition.

Parameters
pIconthe icon.
Returns
TRUE if the icon has a Transition.
#define cairo_dock_get_transition_count (   pIcon)

Get the the elpased number of steps since the beginning of the transition.

Parameters
pIconthe icon.
Returns
the elpased number of steps.
#define cairo_dock_get_transition_elapsed_time (   pIcon)

Get the elapsed time (in ms) since the beginning of the transition.

Parameters
pIconthe icon.
Returns
the elapsed time.
#define cairo_dock_get_transition_fraction (   pIcon)

Get the percentage of the elapsed time (between 0 and 1) since the beginning of the transition, if the transition has a fixed duration (otherwise 0).

Parameters
pIconthe icon.
Returns
the elapsed time in [0,1].

Function Documentation

void cairo_dock_pop_up ( CairoDock pDock)

Pop up a Dock above other windows, if it is in mode "keep below other windows"; otherwise do nothing.

Parameters
pDockthe dock.
void cairo_dock_pop_down ( CairoDock pDock)

Pop down a Dock below other windows, if it is in mode "keep below other windows"; otherwise do nothing.

Parameters
pDockthe dock.
void cairo_dock_launch_animation ( GldiContainer pContainer)

Launch the animation of a Container.

Parameters
pContainerthe container to animate.
void gldi_icon_start_animation ( Icon icon)

Start the animation of an Icon. Do nothing if the icon is at rest or if the animation won't be visible.

Parameters
iconthe icon to animate.
void gldi_icon_request_animation ( Icon pIcon,
const gchar *  cAnimation,
int  iNbRounds 
)

Launch a given animation on an Icon. Do nothing if the icon will not be animated or if the animation doesn't exist.

Parameters
pIconthe icon to animate.
cAnimationname of the animation.
iNbRoundsnumber of rounds the animation will be played.
void gldi_icon_request_attention ( Icon pIcon,
const gchar *  cAnimation,
int  iNbRounds 
)

Launch an animation that will draw the user's attention (ie, the icon will be visible even if the dock is hidden or even if it's in a sub-dock).

Parameters
pIconthe icon
cAnimationan animation name, or NULL or "default" to use the default attention animation
iNbRoundsnumber of rounds, or <= 0 for an endles animation
void gldi_icon_stop_attention ( Icon pIcon)

Stop the icon from drawing the attention. If the icon is not drawing the attention, do nothing.

Parameters
pIconthe icon
void cairo_dock_trigger_icon_removal_from_dock ( Icon pIcon)

Trigger the removal of an Icon from its Dock. The icon will effectively be removed at the end of the animation. If the icon is not inside a dock, nothing happens.

Parameters
pIconthe icon to remove
void cairo_dock_set_transition_on_icon ( Icon pIcon,
GldiContainer pContainer,
CairoDockTransitionRenderFunc  render_step_cairo,
CairoDockTransitionGLRenderFunc  render_step_opengl,
gboolean  bFastPace,
gint  iDuration,
gboolean  bRemoveWhenFinished,
gpointer  pUserData,
GFreeFunc  pFreeUserDataFunc 
)

Set a Transition on an Icon.

Parameters
pIconthe icon.
pContainerthe Container of the Icon. It will be shared with the transition.
render_step_cairothe cairo rendering function.
render_step_openglthe openGL rendering function (can be NULL, in which case the texture mapping from the cairo drawing is done automatically).
bFastPaceTRUE for a high frequency refresh (this uses of course more CPU).
iDurationduration if the transition, in ms. Can be 0 for an endless transition, in which case you can stop the transition with cairo_dock_remove_transition_on_icon.
bRemoveWhenFinishedTRUE to destroy and remove the transition when it is finished.
pUserDatadata passed to the rendering functions.
pFreeUserDataFuncfunction called to free the user data when the transition is destroyed (optionnal).
void cairo_dock_remove_transition_on_icon ( Icon pIcon)

Stop and remove the Transition of an Icon.

Parameters
pIconthe icon.