Cairo-Dock 2.4.0~1
cairo-dock-icon-facility.h File Reference

Defines

#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)
#define cairo_dock_set_icon_always_visible(icon, bAlwaysVisible)
#define cairo_dock_remove_quick_info(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)
Iconcairo_dock_get_icon_with_module (GList *pIconList, CairoDockModule *pModule)
void cairo_dock_get_icon_extent (Icon *pIcon, int *iWidth, int *iHeight)
void cairo_dock_get_current_icon_size (Icon *pIcon, CairoContainer *pContainer, double *fSizeX, double *fSizeY)
void cairo_dock_compute_icon_area (Icon *icon, CairoContainer *pContainer, GdkRectangle *pArea)
Iconcairo_dock_foreach_icons_of_type (GList *pIconList, CairoDockIconGroup iGroup, CairoDockForeachIconFunc pFuntion, gpointer data)
void cairo_dock_update_icon_s_container_name (Icon *icon, const gchar *cNewParentDockName)
void cairo_dock_set_icon_name (const gchar *cIconName, Icon *pIcon, CairoContainer *pContainer)
void cairo_dock_set_icon_name_printf (Icon *pIcon, CairoContainer *pContainer, const gchar *cIconNameFormat,...) G_GNUC_PRINTF(3
void void cairo_dock_set_quick_info (Icon *pIcon, CairoContainer *pContainer, const gchar *cQuickInfo)
void cairo_dock_set_quick_info_printf (Icon *pIcon, CairoContainer *pContainer, const gchar *cQuickInfoFormat,...) G_GNUC_PRINTF(3

Detailed Description

This class provides utility functions on Icons.


Define 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)

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

Parameters:
iconan icon.
#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 cairo_dock_remove_quick_info (   pIcon)

Clear the quick-info of an icon.

Parameters:
pIconthe icon.

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.
Icon* cairo_dock_get_icon_with_module ( GList *  pIconList,
CairoDockModule pModule 
)

Search the icon of a given module in a list of icons.

Parameters:
pIconLista list of icons.
pModulethe module.
Returns:
the first icon which has an instance of the given module, 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,
CairoContainer 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,
CairoContainer 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.
Icon* cairo_dock_foreach_icons_of_type ( GList *  pIconList,
CairoDockIconGroup  iGroup,
CairoDockForeachIconFunc  pFuntion,
gpointer  data 
)

Run an action on all the icons of a given group. The action can even destroy or remove the icon from the list.

Parameters:
pIconLista list of icons.
iGroupthe group.
pFuntionthe callback.
datadata passed as a parameter of the callback.
Returns:
the first automatic separator with another group, or NULL if there is none.
void cairo_dock_update_icon_s_container_name ( Icon icon,
const gchar *  cNewParentDockName 
)

Update the container's name of an icon with the name of a dock. In the case of a launcher or an applet, the conf file is updated too.

Parameters:
iconan icon.
cNewParentDockNamethe name of its new dock.
void cairo_dock_set_icon_name ( const gchar *  cIconName,
Icon pIcon,
CairoContainer pContainer 
)

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:
cIconNamethe new label of the icon. You can even pass pIcon->cName.
pIconthe icon.
pContainerthe container of the icon.
void cairo_dock_set_icon_name_printf ( Icon pIcon,
CairoContainer pContainer,
const gchar *  cIconNameFormat,
  ... 
)

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

Parameters:
pIconthe icon.
pContainerthe container of the icon.
cIconNameFormatthe new label of the icon, in a 'printf' way.
...data to be inserted into the string.
void void cairo_dock_set_quick_info ( Icon pIcon,
CairoContainer pContainer,
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.
pContainerthe container of the icon.
cQuickInfothe text of the quick-info.
void cairo_dock_set_quick_info_printf ( Icon pIcon,
CairoContainer pContainer,
const gchar *  cQuickInfoFormat,
  ... 
)

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

Parameters:
pIconthe icon.
pContainerthe container of the icon.
cQuickInfoFormatthe text of the quick-info, in a 'printf' way.
...data to be inserted into the string.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines