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

Data Structures

struct  _CairoDockImageBuffer
 Definition of an Image Buffer. It provides an unified interface for a cairo/opengl image buffer. More...

Defines

#define cairo_dock_strings_differ(s1, s2)
#define cairo_dock_colors_rvb_differ(c1, c2)
#define cairo_dock_colors_differ(c1, c2)
#define cairo_dock_load_image_buffer(pImage, cImageFile, iWidth, iHeight, iLoadModifier)

Functions

gchar * cairo_dock_search_image_s_path (const gchar *cImageFile)
void cairo_dock_load_image_buffer_full (CairoDockImageBuffer *pImage, const gchar *cImageFile, int iWidth, int iHeight, CairoDockLoadImageModifier iLoadModifier, double fAlpha)
void cairo_dock_load_image_buffer_from_surface (CairoDockImageBuffer *pImage, cairo_surface_t *pSurface, int iWidth, int iHeight)
CairoDockImageBuffercairo_dock_create_image_buffer (const gchar *cImageFile, int iWidth, int iHeight, CairoDockLoadImageModifier iLoadModifier)
void cairo_dock_unload_image_buffer (CairoDockImageBuffer *pImage)
void cairo_dock_free_image_buffer (CairoDockImageBuffer *pImage)

Detailed Description

This class defines a simple image loader interface. It also handles the main image buffers of the dock. Use cairo_dock_create_image_buffer to create an image buffer from a file, or cairo_dock_load_image_buffer to load an image into an existing immage buffer. Use cairo_dock_free_image_buffer to destroy it or cairo_dock_unload_image_buffer to unload and reset it to 0. If you just want to load an image into a mere cairo_surface, use the functions of the surface-factory.


Define Documentation

#define cairo_dock_strings_differ (   s1,
  s2 
)

Say if 2 strings differ, taking into account NULL strings.

#define cairo_dock_colors_rvb_differ (   c1,
  c2 
)

Say if 2 RGBA colors differ.

#define cairo_dock_colors_differ (   c1,
  c2 
)

Say if 2 RGB colors differ.

#define cairo_dock_load_image_buffer (   pImage,
  cImageFile,
  iWidth,
  iHeight,
  iLoadModifier 
)

Load an image into an ImageBuffer. If the image is given by its sole name, it is taken in the root folder of the current theme.

Parameters:
pImagean ImageBuffer.
cImageFilename of a file
iWidthwidth it should be loaded. The resulting width can be different depending on the modifier.
iHeightheight it should be loaded. The resulting width can be different depending on the modifier.
iLoadModifiermodifier

Function Documentation

gchar* cairo_dock_search_image_s_path ( const gchar *  cImageFile)

Find the path of an image. '~' is handled, as well as the 'images' folder of the current theme. Use cairo_dock_search_icon_s_path to search theme icons.

Parameters:
cImageFilea file name or path. If it's already a path, it will just be duplicated.
Returns:
the path of the file, or NULL if it has not been found.
void cairo_dock_load_image_buffer_full ( CairoDockImageBuffer pImage,
const gchar *  cImageFile,
int  iWidth,
int  iHeight,
CairoDockLoadImageModifier  iLoadModifier,
double  fAlpha 
)

Load an image into an ImageBuffer with a given transparency. If the image is given by its sole name, it is taken in the root folder of the current theme.

Parameters:
pImagean ImageBuffer.
cImageFilename of a file
iWidthwidth it should be loaded.
iHeightheight it should be loaded.
iLoadModifiermodifier
fAlphatransparency (1:fully opaque)
void cairo_dock_load_image_buffer_from_surface ( CairoDockImageBuffer pImage,
cairo_surface_t *  pSurface,
int  iWidth,
int  iHeight 
)

Load a surface into an ImageBuffer.

Parameters:
pImagean ImageBuffer.
pSurfacea cairo surface
iWidthwidth of the surface
iHeightheight of the surface
CairoDockImageBuffer* cairo_dock_create_image_buffer ( const gchar *  cImageFile,
int  iWidth,
int  iHeight,
CairoDockLoadImageModifier  iLoadModifier 
)

Create and load an image into an ImageBuffer. If the image is given by its sole name, it is taken in the root folder of the current theme.

Parameters:
cImageFilename of a file
iWidthwidth it should be loaded.
iHeightheight it should be loaded.
iLoadModifiermodifier
Returns:
a newly allocated ImageBuffer.
void cairo_dock_unload_image_buffer ( CairoDockImageBuffer pImage)

Reset an ImageBuffer's ressources. It can be used to load another image then.

Parameters:
pImagean ImageBuffer.
void cairo_dock_free_image_buffer ( CairoDockImageBuffer pImage)

Reset and free an ImageBuffer.

Parameters:
pImagean ImageBuffer.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines