Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-draw.h File Reference

Macros

#define cairo_dock_erase_cairo_context(pCairoContext)
 

Functions

cairo_t * cairo_dock_create_drawing_context_generic (GldiContainer *pContainer)
 CONTEXT ///. More...
 
cairo_t * cairo_dock_create_drawing_context_on_container (GldiContainer *pContainer)
 
cairo_t * cairo_dock_create_drawing_context_on_area (GldiContainer *pContainer, GdkRectangle *pArea, double *fBgColor)
 
void cairo_dock_draw_rounded_rectangle (cairo_t *pCairoContext, double fRadius, double fLineWidth, double fFrameWidth, double fFrameHeight)
 
void cairo_dock_draw_icon_cairo (Icon *icon, CairoDock *pDock, cairo_t *pCairoContext)
 
void cairo_dock_render_one_icon (Icon *icon, CairoDock *pDock, cairo_t *pCairoContext, double fDockMagnitude, gboolean bUseText)
 
void cairo_dock_draw_string (cairo_t *pCairoContext, CairoDock *pDock, double fStringLineWidth, gboolean bIsLoop, gboolean bForceConstantSeparator)
 

Detailed Description

This class provides some useful functions to draw with libcairo.

Macro Definition Documentation

#define cairo_dock_erase_cairo_context (   pCairoContext)

Erase a drawing context, making it fully transparent. You don't need to erase a newly created context.

Parameters
pCairoContexta drawing context.

Function Documentation

cairo_t* cairo_dock_create_drawing_context_generic ( GldiContainer pContainer)

CONTEXT ///.

Create a generic drawing context, to be used as a source context (for instance, for creating a surface).

Parameters
pContainera container.
Returns
the context on which to draw. Is never NULL, test it with cairo_status() before use it, and destroy it with cairo_destroy() when you're done with it.
cairo_t* cairo_dock_create_drawing_context_on_container ( GldiContainer pContainer)

Create a drawing context to draw on a container. It handles fake transparency.

Parameters
pContainerthe container on which you want to draw.
Returns
the newly allocated context, to be destroyed with 'cairo_destroy'.
cairo_t* cairo_dock_create_drawing_context_on_area ( GldiContainer pContainer,
GdkRectangle *  pArea,
double *  fBgColor 
)

Create a drawing context to draw on a part of a container. It handles fake transparency.

Parameters
pContainerthe container on which you want to draw
pAreapart of the container to draw.
fBgColorbackground color (rgba) to fill the area with, or NULL to let it transparent.
Returns
the newly allocated context, with a clip corresponding to the area, to be destroyed with 'cairo_destroy'.
void cairo_dock_draw_rounded_rectangle ( cairo_t *  pCairoContext,
double  fRadius,
double  fLineWidth,
double  fFrameWidth,
double  fFrameHeight 
)

Compute the path of a rectangle with rounded corners. It doesn't stroke it, use cairo_stroke or cairo_fill to draw the line or the inside.

Parameters
pCairoContexta drawing context; the current matrix is not altered, but the current path is.
fRadiusradius if the corners.
fLineWidthwidth of the line.
fFrameWidthwidth of the rectangle, without the corners.
fFrameHeightheight of the rectangle, including the corners.
void cairo_dock_draw_icon_cairo ( Icon icon,
CairoDock pDock,
cairo_t *  pCairoContext 
)

Draw an icon and its reflect on a dock. Only draw the icon's image and reflect, and nothing else.

Parameters
iconthe icon to draw.
pDockthe dock containing the icon.
pCairoContexta context on the dock, not altered by the function.
void cairo_dock_render_one_icon ( Icon icon,
CairoDock pDock,
cairo_t *  pCairoContext,
double  fDockMagnitude,
gboolean  bUseText 
)

Draw an icon, according to its current parameters : position, transparency, reflect, rotation, stretching. Also draws its indicators, label, and quick-info. It generates a CAIRO_DOCK_RENDER_ICON notification.

Parameters
iconthe icon to draw.
pDockthe dock containing the icon.
pCairoContexta context on the dock, it is altered by the function.
fDockMagnitudecurrent magnitude of the dock.
bUseTextTRUE to draw the labels.
void cairo_dock_draw_string ( cairo_t *  pCairoContext,
CairoDock pDock,
double  fStringLineWidth,
gboolean  bIsLoop,
gboolean  bForceConstantSeparator 
)

Draw a string linking the center of all the icons of a dock.

Parameters
pCairoContexta context on the dock, not altered by the function.
pDockthe dock.
fStringLineWidthwidth of the line.
bIsLoopTRUE to loop (link the last icon to the first one).
bForceConstantSeparatorTRUE to consider separators having a constant size.