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

Data Structures

struct  _IconInterface
 Icon's interface. More...
 
struct  _Icon
 Definition of an Icon. More...
 
struct  _CairoIconContainerRenderer
 Definition of an Icon container (= an icon holding a sub-dock) renderer. More...
 

Macros

#define CAIRO_DOCK_IS_ICON(obj)
 
#define CAIRO_DOCK_IS_APPLI(icon)
 
#define CAIRO_DOCK_IS_APPLET(icon)
 
#define CAIRO_DOCK_IS_MULTI_APPLI(icon)
 
#define CAIRO_DOCK_IS_AUTOMATIC_SEPARATOR(icon)
 
#define CAIRO_DOCK_IS_USER_SEPARATOR(icon)
 
#define CAIRO_DOCK_IS_NORMAL_APPLI(icon)
 
#define CAIRO_DOCK_IS_DETACHABLE_APPLET(icon)
 

Enumerations

enum  CairoDockIconGroup
 Available groups of icons.
 
enum  CairoDockAnimationState
 Animation state of an icon, sorted by priority.
 

Functions

Icongldi_icon_new (void)
 
Iconcairo_dock_create_dummy_launcher (gchar *cName, gchar *cFileName, gchar *cCommand, gchar *cQuickInfo, double fOrder)
 
void cairo_dock_load_icon_image (Icon *icon, GldiContainer *pContainer)
 
void cairo_dock_load_icon_text (Icon *icon)
 
void cairo_dock_load_icon_quickinfo (Icon *icon)
 
void cairo_dock_load_icon_buffers (Icon *pIcon, GldiContainer *pContainer)
 

Detailed Description

This class defines the items contained in containers : Icons. An icon can either be:

  • a launcher (it has a command, a class, and possible an X window ID)
  • an appli (it has a X window ID and a class, no command)
  • an applet (it has a module instance and no command, possibly a class)
  • a container (it has a sub-dock and no class nor command)
  • a class icon (it has a bsub-dock and a class, but no command nor X ID)
  • a separator (it has nothing)

The class defines the methods used to create a generic Icon and to load its various buffers. Specialized Icons are created by the corresponding factory.

Macro Definition Documentation

#define CAIRO_DOCK_IS_ICON (   obj)

Say if an object is an Icon.

Parameters
objthe object.
Returns
TRUE if the object is an icon.
#define CAIRO_DOCK_IS_APPLI (   icon)

TRUE if the icon holds a window.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_APPLET (   icon)

TRUE if the icon holds an instance of a module.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_MULTI_APPLI (   icon)

TRUE if the icon is an icon pointing on the sub-dock of a class.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_AUTOMATIC_SEPARATOR (   icon)

TRUE if the icon is an automatic separator.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_USER_SEPARATOR (   icon)

TRUE if the icon is a separator added by the user.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_NORMAL_APPLI (   icon)

TRUE if the icon is an icon d'appli only.

Parameters
iconan icon.
#define CAIRO_DOCK_IS_DETACHABLE_APPLET (   icon)

TRUE if the icon is an icon d'applet detachable en desklet.

Parameters
iconan icon.

Function Documentation

Icon* gldi_icon_new ( void  )

Create an empty icon.

Returns
the newly allocated icon object.
Icon* cairo_dock_create_dummy_launcher ( gchar *  cName,
gchar *  cFileName,
gchar *  cCommand,
gchar *  cQuickInfo,
double  fOrder 
)

Create an Icon that will behave like a launcher. It's especially useful for applets that want to fill a sub-dock or a desklet (the icon is not loaded by the function). Be careful that the strings are not duplicated. Therefore, you must use g_strdup() if you want to set a constant string; and must not free the strings after calling this function.

Parameters
cNamelabel of the icon
cFileNamename of an image
cCommanda command, or NULL
cQuickInfoa quick-info, or NULL
fOrderorder of the icon in its container.
Returns
the newly created icon.
void cairo_dock_load_icon_image ( Icon icon,
GldiContainer pContainer 
)

Fill the image buffer (surface & texture) of a given icon, according to its type. Set its size if necessary, and fills the reflection buffer for cairo.

Parameters
iconthe icon.
pContainerits container.
void cairo_dock_load_icon_text ( Icon icon)

Fill the label buffer (surface & texture) of a given icon, according to a text description.

Parameters
iconthe icon.
void cairo_dock_load_icon_quickinfo ( Icon icon)

Fill the quick-info buffer (surface & texture) of a given icon, according to a text description.

Parameters
iconthe icon.
void cairo_dock_load_icon_buffers ( Icon pIcon,
GldiContainer pContainer 
)

Fill all the buffers (surfaces & textures) of a given icon, according to its type. Set its size accordingly, and fills the reflection buffer for cairo. Label and quick-info are loaded with the current global text description.

Parameters
pIconthe icon.
pContainerits container.