|
Cairo-Dock 2.4.0~1
|
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 | |
| CairoEmblem * | cairo_dock_make_emblem (const gchar *cImageFile, Icon *pIcon) |
| CairoEmblem * | cairo_dock_make_emblem_from_surface (cairo_surface_t *pSurface, int iSurfaceWidth, int iSurfaceHeight, Icon *pIcon) |
| CairoEmblem * | cairo_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) |
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 cairo_dock_set_emblem_position | ( | pEmblem, | |
| pos | |||
| ) |
Set the position of an emblem.
| pEmblem | the emblem |
| pos | the position (a CairoEmblemPosition) |
| 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.
| cImageFile | an image. |
| pIcon | an icon. |
| 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.
| pSurface | a surface. |
| iSurfaceWidth | width of the surface, 0 means it has the same width as the icon. |
| iSurfaceHeight | height of the surface, 0 means it has the same height as the icon. |
| pIcon | an icon. |
| 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.
| iTexture | a texture. |
| pIcon | an icon. |
| void cairo_dock_free_emblem | ( | CairoEmblem * | pEmblem | ) |
Destroy an emblem and all its allocated ressources.
| pEmblem | the emblem |
| void cairo_dock_draw_emblem_on_icon | ( | CairoEmblem * | pEmblem, |
| Icon * | pIcon, | ||
| CairoContainer * | pContainer | ||
| ) |
Permanently draw an emblem on an icon.
| pEmblem | the emblem |
| pIcon | an icon |
| pContainer | its container, or NULL if the icon is not yet inside a container |