Cairo-Dock
3.4.0
|
Macros | |
#define | CAIRO_DOCK_ORIENTATION_MASK |
mask to get the orientation from a CairoDockLoadImageModifier. | |
#define | cairo_dock_create_surface_for_square_icon(cImagePath, fImageSize) |
#define | cairo_dock_create_surface_from_text(cText, pLabelDescription, iTextWidthPtr, iTextHeightPtr) |
Functions | |
cairo_surface_t * | cairo_dock_create_surface_from_xicon_buffer (gulong *pXIconBuffer, int iBufferNbElements, int iWidth, int iHeight) |
cairo_surface_t * | cairo_dock_create_surface_from_pixbuf (GdkPixbuf *pixbuf, double fMaxScale, int iWidthConstraint, int iHeightConstraint, CairoDockLoadImageModifier iLoadingModifier, double *fImageWidth, double *fImageHeight, double *fZoomX, double *fZoomY) |
cairo_surface_t * | cairo_dock_create_blank_surface (int iWidth, int iHeight) |
cairo_surface_t * | cairo_dock_create_surface_from_image (const gchar *cImagePath, double fMaxScale, int iWidthConstraint, int iHeightConstraint, CairoDockLoadImageModifier iLoadingModifier, double *fImageWidth, double *fImageHeight, double *fZoomX, double *fZoomY) |
cairo_surface_t * | cairo_dock_create_surface_from_image_simple (const gchar *cImageFile, double fImageWidth, double fImageHeight) |
cairo_surface_t * | cairo_dock_create_surface_from_icon (const gchar *cImagePath, double fImageWidth, double fImageHeight) |
cairo_surface_t * | cairo_dock_create_surface_from_pattern (const gchar *cImageFile, double fImageWidth, double fImageHeight, double fAlpha) |
cairo_surface_t * | cairo_dock_rotate_surface (cairo_surface_t *pSurface, double fImageWidth, double fImageHeight, double fRotationAngle) |
cairo_surface_t * | cairo_dock_create_surface_from_text_full (const gchar *cText, GldiTextDescription *pLabelDescription, double fMaxScale, int iMaxWidth, int *iTextWidth, int *iTextHeight) |
cairo_surface_t * | cairo_dock_duplicate_surface (cairo_surface_t *pSurface, double fWidth, double fHeight, double fDesiredWidth, double fDesiredHeight) |
This class contains functions to load any image/X buffer/GdkPixbuf/text into a cairo-surface. The loading of an image can be modified by a mask, to take into account the ratio, zoom, orientation, etc.
The general way to load an image is by using cairo_dock_create_surface_from_image.
If you just want to load an image at a given size, use cairo_dock_create_surface_from_image_simple, or cairo_dock_create_surface_from_icon.
To load a text into a surface, describe your text look with a _GldiTextDescription, and pass it to cairo_dock_create_surface_from_text.
Note: if you also need to load the image into a texture, it's easier to use the higher level ImageBuffer API (see cairo_dock_create_image_buffer).
#define cairo_dock_create_surface_for_square_icon | ( | cImagePath, | |
fImageSize | |||
) |
Create a square surface from any image, at a given size. If the image is given by its sole name, it is searched inside the icons themes known by Cairo-Dock.
cImagePath | path or name of an image. |
fImageSize | the desired surface size. |
#define cairo_dock_create_surface_from_text | ( | cText, | |
pLabelDescription, | |||
iTextWidthPtr, | |||
iTextHeightPtr | |||
) |
Create a surface representing a text, according to a given text description.
cText | the text. |
pLabelDescription | description of the text rendering. |
iTextWidthPtr | will be filled the width of the resulting surface. |
iTextHeightPtr | will be filled the height of the resulting surface. |
Types of image loading modifiers.
cairo_surface_t* cairo_dock_create_surface_from_xicon_buffer | ( | gulong * | pXIconBuffer, |
int | iBufferNbElements, | ||
int | iWidth, | ||
int | iHeight | ||
) |
Create a surface from raw data of an X icon. The biggest icon possible is taken. The ratio is kept, and the surface will fill the space with transparency if necessary.
pXIconBuffer | raw data of the icon. |
iBufferNbElements | number of elements in the buffer. |
iWidth | will be filled with the resulting width of the surface. |
iHeight | will be filled with the resulting height of the surface. |
cairo_surface_t* cairo_dock_create_surface_from_pixbuf | ( | GdkPixbuf * | pixbuf, |
double | fMaxScale, | ||
int | iWidthConstraint, | ||
int | iHeightConstraint, | ||
CairoDockLoadImageModifier | iLoadingModifier, | ||
double * | fImageWidth, | ||
double * | fImageHeight, | ||
double * | fZoomX, | ||
double * | fZoomY | ||
) |
Create a surface from a GdkPixbuf.
pixbuf | the pixbuf. |
fMaxScale | maximum zoom of the icon. |
iWidthConstraint | constraint on the width, or 0 to not constraint it. |
iHeightConstraint | constraint on the height, or 0 to not constraint it. |
iLoadingModifier | a mask of different loading modifiers. |
fImageWidth | will be filled with the resulting width of the surface (hors zoom). |
fImageHeight | will be filled with the resulting height of the surface (hors zoom). |
fZoomX | if non NULL, will be filled with the zoom that has been applied on width. |
fZoomY | if non NULL, will be filled with the zoom that has been applied on width. |
cairo_surface_t* cairo_dock_create_blank_surface | ( | int | iWidth, |
int | iHeight | ||
) |
Create an empty surface (transparent) of a given size. In OpenGL mode, this surface can act as a buffer to generate a texture.
iWidth | width of the surface. |
iHeight | height of the surface. |
cairo_surface_t* cairo_dock_create_surface_from_image | ( | const gchar * | cImagePath, |
double | fMaxScale, | ||
int | iWidthConstraint, | ||
int | iHeightConstraint, | ||
CairoDockLoadImageModifier | iLoadingModifier, | ||
double * | fImageWidth, | ||
double * | fImageHeight, | ||
double * | fZoomX, | ||
double * | fZoomY | ||
) |
Create a surface from any image.
cImagePath | complete path to the image. |
fMaxScale | maximum zoom of the icon. |
iWidthConstraint | constraint on the width, or 0 to not constraint it. |
iHeightConstraint | constraint on the height, or 0 to not constraint it. |
iLoadingModifier | a mask of different loading modifiers. |
fImageWidth | will be filled with the resulting width of the surface (hors zoom). |
fImageHeight | will be filled with the resulting height of the surface (hors zoom). |
fZoomX | if non NULL, will be filled with the zoom that has been applied on width. |
fZoomY | if non NULL, will be filled with the zoom that has been applied on width. |
cairo_surface_t* cairo_dock_create_surface_from_image_simple | ( | const gchar * | cImageFile, |
double | fImageWidth, | ||
double | fImageHeight | ||
) |
Create a surface from any image, at a given size. If the image is given by its sole name, it is searched inside the current theme root folder.
cImageFile | path or name of an image. |
fImageWidth | the desired surface width. |
fImageHeight | the desired surface height. |
cairo_surface_t* cairo_dock_create_surface_from_icon | ( | const gchar * | cImagePath, |
double | fImageWidth, | ||
double | fImageHeight | ||
) |
Create a surface from any image, at a given size. If the image is given by its sole name, it is searched inside the icons themes known by Cairo-Dock.
cImagePath | path or name of an image. |
fImageWidth | the desired surface width. |
fImageHeight | the desired surface height. |
cairo_surface_t* cairo_dock_create_surface_from_pattern | ( | const gchar * | cImageFile, |
double | fImageWidth, | ||
double | fImageHeight, | ||
double | fAlpha | ||
) |
Create a surface at a given size, and fill it with a pattern. If the pattern image is given by its sole name, it is searched inside the current theme root folder.
cImageFile | path or name of an image that will be repeated to fill the surface. |
fImageWidth | the desired surface width. |
fImageHeight | the desired surface height. |
fAlpha | transparency of the pattern (1 means opaque). |
cairo_surface_t* cairo_dock_rotate_surface | ( | cairo_surface_t * | pSurface, |
double | fImageWidth, | ||
double | fImageHeight, | ||
double | fRotationAngle | ||
) |
Create a surface by rotating another. Only works for 1/4 of rounds.
pSurface | surface to rotate. |
fImageWidth | the width of the surface. |
fImageHeight | the height of the surface. |
fRotationAngle | rotation angle to apply, in radians. |
cairo_surface_t* cairo_dock_create_surface_from_text_full | ( | const gchar * | cText, |
GldiTextDescription * | pLabelDescription, | ||
double | fMaxScale, | ||
int | iMaxWidth, | ||
int * | iTextWidth, | ||
int * | iTextHeight | ||
) |
Create a surface representing a text, according to a given text description.
cText | the text. |
pLabelDescription | description of the text rendering. |
fMaxScale | maximum zoom of the text. |
iMaxWidth | maximum authorized width for the surface; it will be zoomed in to fits this limit. 0 for no limit. |
iTextWidth | will be filled the width of the resulting surface. |
iTextHeight | will be filled the height of the resulting surface. |
cairo_surface_t* cairo_dock_duplicate_surface | ( | cairo_surface_t * | pSurface, |
double | fWidth, | ||
double | fHeight, | ||
double | fDesiredWidth, | ||
double | fDesiredHeight | ||
) |
Create a surface identical to another, possibly resizing it.
pSurface | surface to duplicate. |
fWidth | the width of the surface. |
fHeight | the height of the surface. |
fDesiredWidth | desired width of the copy (0 to keep the same size). |
fDesiredHeight | desired height of the copy (0 to keep the same size). |