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

Macros

#define cairo_dock_icon_is_being_inserted(icon)
 
#define cairo_dock_icon_is_being_removed(icon)
 
#define cairo_dock_get_icon_order(icon)
 
#define cairo_dock_get_next_element(ic, list)
 
#define cairo_dock_get_previous_element(ic, list)
 
#define cairo_dock_set_icon_static(icon, _bStatic)
 
#define cairo_dock_set_icon_always_visible(icon, _bAlwaysVisible)
 
#define gldi_icon_mark_as_launching(pIcon)
 
#define gldi_icon_is_launching(pIcon)
 

Functions

CairoDockIconGroup cairo_dock_get_icon_type (Icon *icon)
 
int cairo_dock_compare_icons_order (Icon *icon1, Icon *icon2)
 
int cairo_dock_compare_icons_name (Icon *icon1, Icon *icon2)
 
int cairo_dock_compare_icons_extension (Icon *icon1, Icon *icon2)
 
GList * cairo_dock_sort_icons_by_order (GList *pIconList)
 
GList * cairo_dock_sort_icons_by_name (GList *pIconList)
 
Iconcairo_dock_get_first_icon (GList *pIconList)
 
Iconcairo_dock_get_last_icon (GList *pIconList)
 
Iconcairo_dock_get_first_icon_of_group (GList *pIconList, CairoDockIconGroup iGroup)
 
Iconcairo_dock_get_last_icon_of_group (GList *pIconList, CairoDockIconGroup iGroup)
 
Iconcairo_dock_get_first_icon_of_order (GList *pIconList, CairoDockIconGroup iGroup)
 
Iconcairo_dock_get_last_icon_of_order (GList *pIconList, CairoDockIconGroup iGroup)
 
Iconcairo_dock_get_pointed_icon (GList *pIconList)
 
Iconcairo_dock_get_next_icon (GList *pIconList, Icon *pIcon)
 
Iconcairo_dock_get_previous_icon (GList *pIconList, Icon *pIcon)
 
Iconcairo_dock_get_icon_with_command (GList *pIconList, const gchar *cCommand)
 
Iconcairo_dock_get_icon_with_base_uri (GList *pIconList, const gchar *cBaseURI)
 
Iconcairo_dock_get_icon_with_name (GList *pIconList, const gchar *cName)
 
Iconcairo_dock_get_icon_with_subdock (GList *pIconList, CairoDock *pSubDock)
 
void cairo_dock_get_icon_extent (Icon *pIcon, int *iWidth, int *iHeight)
 
void cairo_dock_get_current_icon_size (Icon *pIcon, GldiContainer *pContainer, double *fSizeX, double *fSizeY)
 
void cairo_dock_compute_icon_area (Icon *icon, GldiContainer *pContainer, GdkRectangle *pArea)
 
void gldi_icon_set_name (Icon *pIcon, const gchar *cIconName)
 
void gldi_icon_set_name_printf (Icon *pIcon, const gchar *cIconNameFormat,...) G_GNUC_PRINTF(2
 
void void gldi_icon_set_quick_info (Icon *pIcon, const gchar *cQuickInfo)
 
void gldi_icon_set_quick_info_printf (Icon *pIcon, const gchar *cQuickInfoFormat,...) G_GNUC_PRINTF(2
 
gboolean cairo_dock_begin_draw_icon (Icon *pIcon, gint iRenderingMode)
 
void cairo_dock_end_draw_icon (Icon *pIcon)
 

Detailed Description

This class provides utility functions on Icons.

Macro Definition Documentation

#define cairo_dock_icon_is_being_inserted (   icon)

Say whether an icon is currently being inserted.

#define cairo_dock_icon_is_being_removed (   icon)

Say whether an icon is currently being removed.

#define cairo_dock_get_icon_order (   icon)

Get the group order of an icon. 3 groups are available by default : launchers, applis, and applets, and each group has an order.

#define cairo_dock_get_next_element (   ic,
  list 
)

Get the next element in a list, looping if necessary..

Parameters
icthe current element.
lista list.
Returns
the next element, or the first element of the list if 'ic' is the last one.
#define cairo_dock_get_previous_element (   ic,
  list 
)

Get the previous element in a list, looping if necessary..

Parameters
icthe current element.
lista list.
Returns
the previous element, or the last element of the list if 'ic' is the first one.
#define cairo_dock_set_icon_static (   icon,
  _bStatic 
)

Make an icon static or not. Static icons are not animated when mouse hovers them.

Parameters
iconan icon.
_bStaticstatic or not.
#define cairo_dock_set_icon_always_visible (   icon,
  _bAlwaysVisible 
)

Make an icon always visible, even when the dock is hidden.

Parameters
iconan icon.
_bAlwaysVisiblewhether the icon is always visible or not.
#define gldi_icon_mark_as_launching (   pIcon)

Mark an Icon as 'launching'. This states lasts until the corresponding window appears (with a timeout of 15 seconds). Typically used to prevent the program from being started 2 times in a row, or to keep the animation running until the program is started.

#define gldi_icon_is_launching (   pIcon)

Tell if an Icon is being launched.

Function Documentation

CairoDockIconGroup cairo_dock_get_icon_type ( Icon icon)

Get the type of an icon according to its content (launcher, appli, applet). This can be different from its group.

Parameters
iconthe icon.
Returns
the type of the icon.
int cairo_dock_compare_icons_order ( Icon icon1,
Icon icon2 
)

Compare 2 icons with the order relation on (group order, icon order).

Parameters
icon1an icon.
icon2another icon.
Returns
-1 if icon1 < icon2, 1 if icon1 > icon2, 0 if icon1 = icon2.
int cairo_dock_compare_icons_name ( Icon icon1,
Icon icon2 
)

Compare 2 icons with the order relation on the name (case unsensitive alphabetical order).

Parameters
icon1an icon.
icon2another icon.
Returns
-1 if icon1 < icon2, 1 if icon1 > icon2, 0 if icon1 = icon2.
int cairo_dock_compare_icons_extension ( Icon icon1,
Icon icon2 
)

Compare 2 icons with the order relation on the extension of their URIs (case unsensitive alphabetical order).

Parameters
icon1an icon.
icon2another icon.
Returns
-1 if icon1 < icon2, 1 if icon1 > icon2, 0 if icon1 = icon2.
GList* cairo_dock_sort_icons_by_order ( GList *  pIconList)

Sort a list with the order relation on (group order, icon order).

Parameters
pIconLista list of icons.
Returns
the sorted list. Elements are the same as the initial list, only their order has changed.
GList* cairo_dock_sort_icons_by_name ( GList *  pIconList)

Sort a list with the alphabetical order on the icons' name.

Parameters
pIconLista list of icons.
Returns
the sorted list. Elements are the same as the initial list, only their order has changed. Icon's orders are updated to reflect the new order.
Icon* cairo_dock_get_first_icon ( GList *  pIconList)

Get the first icon of a list of icons.

Parameters
pIconLista list of icons.
Returns
the first icon, or NULL if the list is empty.
Icon* cairo_dock_get_last_icon ( GList *  pIconList)

Get the last icon of a list of icons.

Parameters
pIconLista list of icons.
Returns
the last icon, or NULL if the list is empty.
Icon* cairo_dock_get_first_icon_of_group ( GList *  pIconList,
CairoDockIconGroup  iGroup 
)

Get the first icon of a given group.

Parameters
pIconLista list of icons.
iGroupthe group of icon.
Returns
the first found icon with this group, or NULL if none matches.
Icon* cairo_dock_get_last_icon_of_group ( GList *  pIconList,
CairoDockIconGroup  iGroup 
)

Get the last icon of a given group.

Parameters
pIconLista list of icons.
iGroupthe group of icon.
Returns
the last found icon with this group, or NULL if none matches.
Icon* cairo_dock_get_first_icon_of_order ( GList *  pIconList,
CairoDockIconGroup  iGroup 
)

Get the first icon whose group has the same order as a given one.

Parameters
pIconLista list of icons.
iGroupa group of icon.
Returns
the first found icon, or NULL if none matches.
Icon* cairo_dock_get_last_icon_of_order ( GList *  pIconList,
CairoDockIconGroup  iGroup 
)

Get the last icon whose group has the same order as a given one.

Parameters
pIconLista list of icons.
iGroupa group of icon.
Returns
the last found icon, or NULL if none matches.
Icon* cairo_dock_get_pointed_icon ( GList *  pIconList)

Get the currently pointed icon in a list of icons.

Parameters
pIconLista list of icons.
Returns
the icon whose field 'bPointed' is TRUE, or NULL if none is pointed.
Icon* cairo_dock_get_next_icon ( GList *  pIconList,
Icon pIcon 
)

Get the icon next to a given one. The cost is O(n).

Parameters
pIconLista list of icons.
pIconan icon in the list.
Returns
the icon whose left neighboor is pIcon, or NULL if the list is empty or if pIcon is the last icon.
Icon* cairo_dock_get_previous_icon ( GList *  pIconList,
Icon pIcon 
)

Get the icon previous to a given one. The cost is O(n).

Parameters
pIconLista list of icons.
pIconan icon in the list.
Returns
the icon whose right neighboor is pIcon, or NULL if the list is empty or if pIcon is the first icon.
Icon* cairo_dock_get_icon_with_command ( GList *  pIconList,
const gchar *  cCommand 
)

Search an icon with a given command in a list of icons.

Parameters
pIconLista list of icons.
cCommandthe command.
Returns
the first icon whose field 'cCommand' is identical to the given command, or NULL if no icon matches.
Icon* cairo_dock_get_icon_with_base_uri ( GList *  pIconList,
const gchar *  cBaseURI 
)

Search an icon with a given URI in a list of icons.

Parameters
pIconLista list of icons.
cBaseURIthe URI.
Returns
the first icon whose field 'cURI' is identical to the given URI, or NULL if no icon matches.
Icon* cairo_dock_get_icon_with_name ( GList *  pIconList,
const gchar *  cName 
)

Search an icon with a given name in a list of icons.

Parameters
pIconLista list of icons.
cNamethe name.
Returns
the first icon whose field 'cName' is identical to the given name, or NULL if no icon matches.
Icon* cairo_dock_get_icon_with_subdock ( GList *  pIconList,
CairoDock pSubDock 
)

Search the icon pointing on a given sub-dock in a list of icons.

Parameters
pIconLista list of icons.
pSubDocka sub-dock.
Returns
the first icon whose field 'pSubDock' is equal to the given sub-dock, or NULL if no icon matches.
void cairo_dock_get_icon_extent ( Icon pIcon,
int *  iWidth,
int *  iHeight 
)

Get the dimension allocated to the surface/texture of an icon.

Parameters
pIconthe icon.
iWidthpointer to the width.
iHeightpointer to the height.
void cairo_dock_get_current_icon_size ( Icon pIcon,
GldiContainer pContainer,
double *  fSizeX,
double *  fSizeY 
)

Get the current size of an icon as it is seen on the screen (taking into account the zoom and the ratio).

Parameters
pIconthe icon
pContainerits container
fSizeXpointer to the X size (horizontal)
fSizeYpointer to the Y size (vertical)
void cairo_dock_compute_icon_area ( Icon icon,
GldiContainer pContainer,
GdkRectangle *  pArea 
)

Get the total zone used by an icon on its container (taking into account reflect, gap to reflect, zoom and stretching).

Parameters
iconthe icon
pContainerits container
pAreaa rectangle filled with the zone used by the icon on its container.
void gldi_icon_set_name ( Icon pIcon,
const gchar *  cIconName 
)

Set the label of an icon. If it has a sub-dock, it is renamed (the name is possibly altered to stay unique). The label buffer is updated too.

Parameters
pIconthe icon.
cIconNamethe new label of the icon. You can even pass pIcon->cName.
void gldi_icon_set_name_printf ( Icon pIcon,
const gchar *  cIconNameFormat,
  ... 
)

Same as above, but takes a printf-like format string.

Parameters
pIconthe icon.
cIconNameFormatthe new label of the icon, in a 'printf' way.
...data to be inserted into the string.
void void gldi_icon_set_quick_info ( Icon pIcon,
const gchar *  cQuickInfo 
)

Set the quick-info of an icon. This is a small text (a few characters) that is superimposed on the icon.

Parameters
pIconthe icon.
cQuickInfothe text of the quick-info. If NULL, will just remove the current the quick-info.
void gldi_icon_set_quick_info_printf ( Icon pIcon,
const gchar *  cQuickInfoFormat,
  ... 
)

Same as above, but takes a printf-like format string.

Parameters
pIconthe icon.
cQuickInfoFormatthe text of the quick-info, in a 'printf' way.
...data to be inserted into the string.
gboolean cairo_dock_begin_draw_icon ( Icon pIcon,
gint  iRenderingMode 
)

Initiate an OpenGL drawing session on an icon's texture.

Parameters
pIconthe icon on which to draw.
iRenderingModerendering mode. 0:normal, 1:don't clear the current texture, so that the drawing will be superimposed on it, 2:keep the current icon texture unchanged for all the drawing (the drawing is made on another texture).
Returns
TRUE if you can proceed to the drawing, FALSE if an error occured.
void cairo_dock_end_draw_icon ( Icon pIcon)

Finish an OpenGL drawing session on an icon.

Parameters
pIconthe icon on which to draw.
Returns
TRUE if you can proceed to the drawing, FALSE if an error occured.