|
Cairo-Dock 2.4.0~1
|
Data Structures | |
| struct | _CairoDockLabelDescription |
| Description of the rendering of a text. More... | |
Defines | |
| #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) |
Enumerations | |
| enum | CairoDockLoadImageModifier { CAIRO_DOCK_FILL_SPACE, CAIRO_DOCK_KEEP_RATIO, CAIRO_DOCK_DONT_ZOOM_IN, CAIRO_DOCK_ORIENTATION_HFLIP, CAIRO_DOCK_ORIENTATION_ROT_180, CAIRO_DOCK_ORIENTATION_VFLIP, CAIRO_DOCK_ORIENTATION_ROT_90_HFLIP, CAIRO_DOCK_ORIENTATION_ROT_90, CAIRO_DOCK_ORIENTATION_ROT_90_VFLIP, CAIRO_DOCK_ORIENTATION_ROT_270 } |
| Types of image loading modifiers. More... | |
Functions | |
| void | cairo_dock_calculate_constrainted_size (double *fImageWidth, double *fImageHeight, int iWidthConstraint, int iHeightConstraint, CairoDockLoadImageModifier iLoadingModifier, double *fZoomWidth, double *fZoomHeight) |
| 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_reflection_surface (cairo_surface_t *pSurface, double fImageWidth, double fImageHeight, double fReflectSize, double fAlbedo, gboolean bIsHorizontal, gboolean bDirectionUp) |
| cairo_surface_t * | cairo_dock_create_surface_from_text_full (const gchar *cText, CairoDockLabelDescription *pLabelDescription, double fMaxScale, int iMaxWidth, int *iTextWidth, int *iTextHeight, double *fTextXOffset, double *fTextYOffset) |
| 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 _CairoDockLabelDescription, 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.
| void cairo_dock_calculate_constrainted_size | ( | double * | fImageWidth, |
| double * | fImageHeight, | ||
| int | iWidthConstraint, | ||
| int | iHeightConstraint, | ||
| CairoDockLoadImageModifier | iLoadingModifier, | ||
| double * | fZoomWidth, | ||
| double * | fZoomHeight | ||
| ) |
Calculate the size of an image according to a constraint on width and height, and a loading modifier.
| fImageWidth | pointer to the width of the image. Initially contains the width of the original image, and is updated with the resulting width. |
| fImageHeight | pointer to the height of the image. Initially contains the height of the original image, and is updated with the resulting height. |
| iWidthConstraint | constraint on width (0 <=> no constraint). |
| iHeightConstraint | constraint on height (0 <=> no constraint). |
| iLoadingModifier | a mask of different loading modifiers. |
| fZoomWidth | will be filled with the zoom that has been applied on width. |
| fZoomHeight | will be filled with the zoom that has been applied on height. |
| 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_reflection_surface | ( | cairo_surface_t * | pSurface, |
| double | fImageWidth, | ||
| double | fImageHeight, | ||
| double | fReflectSize, | ||
| double | fAlbedo, | ||
| gboolean | bIsHorizontal, | ||
| gboolean | bDirectionUp | ||
| ) |
Create a surface by reflection of another. Apply a transparency gradation. The size of the reflect is given by the global config,and its position if given by the orientation of the icon; if this changes, the reflect needs to be re-created.
| pSurface | surface to reflect. |
| fImageWidth | the width of the surface. |
| fImageHeight | the height of the surface. |
| fReflectSize | size of the reflection. |
| fAlbedo | power of the reflection (1 : strong, 0 : transparent) |
| bIsHorizontal | TRUE if the surface is in an horizontal container. |
| bDirectionUp | TRUE if the surface is in a container whose direction is towards. |
| cairo_surface_t* cairo_dock_create_surface_from_text_full | ( | const gchar * | cText, |
| CairoDockLabelDescription * | pLabelDescription, | ||
| double | fMaxScale, | ||
| int | iMaxWidth, | ||
| int * | iTextWidth, | ||
| int * | iTextHeight, | ||
| double * | fTextXOffset, | ||
| double * | fTextYOffset | ||
| ) |
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. |
| fTextXOffset | if non NULL, will be filled the horizontal offset to apply to center the text horizontally. |
| fTextYOffset | if non NULL, will be filled the vertical offset to apply to center the text vertically. |
| 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). |