![]() |
![]() |
![]() |
adg-1 reference manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#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;
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
AdgDash * adg_dash_dup (const AdgDash *dash
);
Duplicates 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
AdgDash * adg_dash_new (void
);
Creates a new empty dash pattern.
Returns : |
the newly created dash pattern. [transfer full] |
Since 1.0
AdgDash * adg_dash_new_with_dashes (gint num_dashes
,...
);
Creates a new dash pattern, presetting some dashes on it.
|
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
void adg_dash_append_dash (AdgDash *dash
,gdouble length
);
Appends to the dash
pattern a new dash of the specified length
value.
|
an AdgDash instance |
|
the length value |
Since 1.0
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.
|
an AdgDash instance |
|
number of dashes to append |
|
a num_dashes list of gdouble
|
Since 1.0
void adg_dash_append_dashes_valist (AdgDash *dash
,gint num_dashes
,va_list var_args
);
Variadic version of adg_dash_append_dashes()
.
|
an AdgDash instance |
|
number of dashes to append |
|
a va_list containing num_dashes list of gdouble
|
Since 1.0
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
|
an AdgDash instance |
|
number of dashes to append |
|
array of num_dashes gdoubles. [array length=num_dashes]
|
Since 1.0
gint adg_dash_get_num_dashes (const AdgDash *dash
);
Gets the number of dashes stored inside this dash pattern.
|
an AdgDash instance |
Returns : |
the number of dashes or -1 if dash is invalid. |
Since 1.0
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
.
|
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
void adg_dash_clear_dashes (AdgDash *dash
);
Resets the dashes of dash
, effectively clearing the pattern.
|
an AdgDash instance |
Since 1.0
void adg_dash_set_offset (AdgDash *dash
,gdouble offset
);
Sets the pattern offset of dash
to offset
.
|
an AdgDash instance |
|
the new offset value |
Since 1.0
gdouble adg_dash_get_offset (const AdgDash *dash
);
Gets the offset of the pattern in dash
.
|
an AdgDash instance |
Returns : |
the offset of dash or 0 on invalid dash . |
Since 1.0
void adg_dash_destroy (AdgDash *dash
);
Destroys dash
, freeing every resource owned by it. After the destruction
dash
cannot be used anymore.
|
an AdgDash instance |
Since 1.0