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

Data Structures

struct  _CairoEmblem
 Definition of an Emblem. You shouldn't access any of its fields directly. More...

Defines

#define cairo_dock_set_emblem_position(pEmblem, pos)

Enumerations

enum  CairoEmblemPosition
 Available position of the emblem on the icon.

Functions

CairoEmblemcairo_dock_make_emblem (const gchar *cImageFile, Icon *pIcon)
CairoEmblemcairo_dock_make_emblem_from_surface (cairo_surface_t *pSurface, int iSurfaceWidth, int iSurfaceHeight, Icon *pIcon)
CairoEmblemcairo_dock_make_emblem_from_texture (GLuint iTexture, Icon *pIcon)
void cairo_dock_free_emblem (CairoEmblem *pEmblem)
void cairo_dock_draw_emblem_on_icon (CairoEmblem *pEmblem, Icon *pIcon, CairoContainer *pContainer)

Detailed Description

This class defines Emblems, that are small images superimposed on the icon at a given place.

The emblem is drawn directly on the icon, so it modifies its surface/texture itself. Thus, to remove an emblem, you have to set the original image on the icon.

Emblems can be placed in the corners of the icon, or in the middle of it.

Usage : create an Emblem with cairo_dock_make_emblem set its position with cairo_dock_set_emblem_position you can then render the emblem on the icon with cairo_dock_draw_emblem_on_icon. free the emblem when you're done with cairo_dock_free_emblem

An emblem can be used as many times as you want on any icon. The only limitation is that an emblem uses either Cairo or OpenGL, this is decided at the creation time; so the icons you draw the emblem on must be drawn with the same rendering.


Define Documentation

#define cairo_dock_set_emblem_position (   pEmblem,
  pos 
)

Set the position of an emblem.

Parameters:
pEmblemthe emblem
posthe position (a CairoEmblemPosition)

Function Documentation

CairoEmblem* cairo_dock_make_emblem ( const gchar *  cImageFile,
Icon pIcon 
)

Create an emblem from an image, that suits the given icon and container. If the image is given by its sole name, it is searched inside the current theme root folder.

Parameters:
cImageFilean image.
pIconan icon.
Returns:
the newly allocated emblem.
CairoEmblem* cairo_dock_make_emblem_from_surface ( cairo_surface_t *  pSurface,
int  iSurfaceWidth,
int  iSurfaceHeight,
Icon pIcon 
)

Create an emblem from an existing surface. The surface is appropriated by the emblem, so if you free it with cairo_dock_free_emblem, it will also free the surface. Use g_free to destroy the emblem if you don't want the surface to be destroyed with.

Parameters:
pSurfacea surface.
iSurfaceWidthwidth of the surface, 0 means it has the same width as the icon.
iSurfaceHeightheight of the surface, 0 means it has the same height as the icon.
pIconan icon.
Returns:
the newly allocated emblem.
CairoEmblem* cairo_dock_make_emblem_from_texture ( GLuint  iTexture,
Icon pIcon 
)

Create an emblem from an existing texture. The texture is appropriated by the emblem, so if you free it with cairo_dock_free_emblem, it will also free the texture. Use g_free to destroy the emblem if you don't want the texture to be destroyed with.

Parameters:
iTexturea texture.
pIconan icon.
Returns:
the newly allocated emblem.
void cairo_dock_free_emblem ( CairoEmblem pEmblem)

Destroy an emblem and all its allocated ressources.

Parameters:
pEmblemthe emblem
void cairo_dock_draw_emblem_on_icon ( CairoEmblem pEmblem,
Icon pIcon,
CairoContainer pContainer 
)

Permanently draw an emblem on an icon.

Parameters:
pEmblemthe emblem
pIconan icon
pContainerits container, or NULL if the icon is not yet inside a container
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines