Synopsis

#include <adg-1/adg.h>

AdgDash *           adg_dash_dup                        (const AdgDash *dash);
AdgDash *           adg_dash_new                        (void);
AdgDash *           adg_dash_new_with_dashes            (gint num_dashes,
                                                         ...);
void                adg_dash_append_dash                (AdgDash *dash,
                                                         gdouble length);
void                adg_dash_append_dashes              (AdgDash *dash,
                                                         gint num_dashes,
                                                         ...);
void                adg_dash_append_dashes_valist       (AdgDash *dash,
                                                         gint num_dashes,
                                                         va_list var_args);
void                adg_dash_append_dashes_array        (AdgDash *dash,
                                                         gint num_dashes,
                                                         const gdouble *dashes);
gint                adg_dash_get_num_dashes             (const AdgDash *dash);
const gdouble *     adg_dash_get_dashes                 (const AdgDash *dash);
void                adg_dash_clear_dashes               (AdgDash *dash);
void                adg_dash_set_offset                 (AdgDash *dash,
                                                         gdouble offset);
gdouble             adg_dash_get_offset                 (const AdgDash *dash);
void                adg_dash_destroy                    (AdgDash *dash);
                    AdgDash;

Object Hierarchy

  GBoxed
   +----AdgDash

Description

The AdgDash boxed type wraps the values needed by cairo to univoquely identify a dash pattern, an array of positive values. Each value provides the length of alternate "on" and "off" portions of the stroke. The offset specifies an offset into the pattern at which the stroke begins.

Each "on" segment will have caps applied as if the segment were a separate sub-path. In particular, it is valid to use an "on" length of 0 with CAIRO_LINE_CAP_ROUND or CAIRO_LINE_CAP_SQUARE in order to distribute dots or squares along a path.

Check the cairo_set_dash() documentation for further details: http://www.cairographics.org/manual/cairo-cairo-t.htmlcairo-set-dash

Details

adg_dash_dup ()

AdgDash *           adg_dash_dup                        (const AdgDash *dash);

Duplicates dash.

dash :

an AdgDash instance

Returns :

the duplicate of dash: must be freed with adg_dash_destroy() when no longer needed. [transfer full]

Since 1.0


adg_dash_new ()

AdgDash *           adg_dash_new                        (void);

Creates a new empty dash pattern.

Returns :

the newly created dash pattern. [transfer full]

Since 1.0


adg_dash_new_with_dashes ()

AdgDash *           adg_dash_new_with_dashes            (gint num_dashes,
                                                         ...);

Creates a new dash pattern, presetting some dashes on it.

num_dashes :

the number of dashes to set

... :

lengths (a list of double values) of each dash

Returns :

the newly created dash pattern. [transfer full]

Since 1.0


adg_dash_append_dash ()

void                adg_dash_append_dash                (AdgDash *dash,
                                                         gdouble length);

Appends to the dash pattern a new dash of the specified length value.

dash :

an AdgDash instance

length :

the length value

Since 1.0


adg_dash_append_dashes ()

void                adg_dash_append_dashes              (AdgDash *dash,
                                                         gint num_dashes,
                                                         ...);

Appends to the current dash pattern num_dashes number of dashes. The length of each dash must be specified as gdouble in the arguments.

dash :

an AdgDash instance

num_dashes :

number of dashes to append

... :

a num_dashes list of gdouble

Since 1.0


adg_dash_append_dashes_valist ()

void                adg_dash_append_dashes_valist       (AdgDash *dash,
                                                         gint num_dashes,
                                                         va_list var_args);

Variadic version of adg_dash_append_dashes().

dash :

an AdgDash instance

num_dashes :

number of dashes to append

var_args :

a va_list containing num_dashes list of gdouble

Since 1.0


adg_dash_append_dashes_array ()

void                adg_dash_append_dashes_array        (AdgDash *dash,
                                                         gint num_dashes,
                                                         const gdouble *dashes);

Array version of adg_dash_append_dashes().

Rename to: adg_dash_append_dashes

dash :

an AdgDash instance

num_dashes :

number of dashes to append

dashes :

array of num_dashes gdoubles. [array length=num_dashes]

Since 1.0


adg_dash_get_num_dashes ()

gint                adg_dash_get_num_dashes             (const AdgDash *dash);

Gets the number of dashes stored inside this dash pattern.

dash :

an AdgDash instance

Returns :

the number of dashes or -1 if dash is invalid.

Since 1.0


adg_dash_get_dashes ()

const gdouble *     adg_dash_get_dashes                 (const AdgDash *dash);

Gets the array of gdoubles containing the length of each dash of the pattern of dash.

dash :

an AdgDash instance

Returns :

the array of lengths or NULL on invalid dash. The array is owned by dash and must not be modified or freed.

Since 1.0


adg_dash_clear_dashes ()

void                adg_dash_clear_dashes               (AdgDash *dash);

Resets the dashes of dash, effectively clearing the pattern.

dash :

an AdgDash instance

Since 1.0


adg_dash_set_offset ()

void                adg_dash_set_offset                 (AdgDash *dash,
                                                         gdouble offset);

Sets the pattern offset of dash to offset.

dash :

an AdgDash instance

offset :

the new offset value

Since 1.0


adg_dash_get_offset ()

gdouble             adg_dash_get_offset                 (const AdgDash *dash);

Gets the offset of the pattern in dash.

dash :

an AdgDash instance

Returns :

the offset of dash or 0 on invalid dash.

Since 1.0


adg_dash_destroy ()

void                adg_dash_destroy                    (AdgDash *dash);

Destroys dash, freeing every resource owned by it. After the destruction dash cannot be used anymore.

dash :

an AdgDash instance

Since 1.0


AdgDash

typedef struct _AdgDash AdgDash;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0