![]() |
![]() |
![]() |
adg-1 reference manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <adg-1/adg.h> struct AdgLineStyle; struct AdgLineStyleClass; AdgLineStyle * adg_line_style_new (void
); void adg_line_style_set_color_dress (AdgLineStyle *line_style
,AdgDress dress
); AdgDress adg_line_style_get_color_dress (AdgLineStyle *line_style
); void adg_line_style_set_width (AdgLineStyle *line_style
,gdouble width
); gdouble adg_line_style_get_width (AdgLineStyle *line_style
); void adg_line_style_set_cap (AdgLineStyle *line_style
,cairo_line_cap_t cap
); cairo_line_cap_t adg_line_style_get_cap (AdgLineStyle *line_style
); void adg_line_style_set_join (AdgLineStyle *line_style
,cairo_line_join_t join
); cairo_line_join_t adg_line_style_get_join (AdgLineStyle *line_style
); void adg_line_style_set_miter_limit (AdgLineStyle *line_style
,gdouble miter_limit
); gdouble adg_line_style_get_miter_limit (AdgLineStyle *line_style
); void adg_line_style_set_antialias (AdgLineStyle *line_style
,cairo_antialias_t antialias
); cairo_antialias_t adg_line_style_get_antialias (AdgLineStyle *line_style
); void adg_line_style_set_dash (AdgLineStyle *line_style
,const AdgDash *dash
); const AdgDash * adg_line_style_get_dash (AdgLineStyle *line_style
);
"antialias" gint : Read / Write "cap" gint : Read / Write "color-dress" AdgDress : Read / Write "dash" AdgDash* : Read / Write "join" gint : Read / Write "miter-limit" gdouble : Read / Write "width" gdouble : Read / Write
Contains parameters on how to draw lines such as width, cap mode, join mode and dash composition, if used.
struct AdgLineStyle;
All fields are private and should not be used directly. Use its public methods instead.
Since 1.0
AdgLineStyle * adg_line_style_new (void
);
Constructs a new line style initialized with default params.
Returns : |
a new line style. [transfer full] |
Since 1.0
void adg_line_style_set_color_dress (AdgLineStyle *line_style
,AdgDress dress
);
Sets a new color dress on line_style
. The new dress
should be related to the original dress: you cannot
set a dress used for line styles to a dress managing
fonts.
The validation of the new dress is done by calling
adg_dress_are_related()
with dress
and the previous
dress as arguments: check out its documentation for
details on what is a related dress.
|
an AdgLineStyle |
|
the new color dress to use |
Since 1.0
AdgDress adg_line_style_get_color_dress (AdgLineStyle *line_style
);
Gets the color dress used by line_style
.
|
an AdgLineStyle |
Returns : |
the current color dress. [transfer none] |
Since 1.0
void adg_line_style_set_width (AdgLineStyle *line_style
,gdouble width
);
Sets a new line thickness value.
|
an AdgLineStyle object |
|
the new width |
Since 1.0
gdouble adg_line_style_get_width (AdgLineStyle *line_style
);
Gets the line thickness value (in global space).
|
an AdgLineStyle object |
Returns : |
the requested width. |
Since 1.0
void adg_line_style_set_cap (AdgLineStyle *line_style
,cairo_line_cap_t cap
);
Sets a new line cap mode.
|
an AdgLineStyle object |
|
the new cap mode. [type gint] |
Since 1.0
cairo_line_cap_t adg_line_style_get_cap (AdgLineStyle *line_style
);
Gets the line cap mode.
|
an AdgLineStyle object |
Returns : |
the requested line cap mode. [type gint][transfer none] |
Since 1.0
void adg_line_style_set_join (AdgLineStyle *line_style
,cairo_line_join_t join
);
Sets a new line join mode.
|
an AdgLineStyle object |
|
the new join mode. [type gint] |
Since 1.0
cairo_line_join_t adg_line_style_get_join (AdgLineStyle *line_style
);
Gets the line join mode.
|
an AdgLineStyle object |
Returns : |
the requested line join mode. [type gint][transfer none] |
Since 1.0
void adg_line_style_set_miter_limit (AdgLineStyle *line_style
,gdouble miter_limit
);
Sets a new miter limit value.
|
an AdgLineStyle object |
|
the new miter limit |
Since 1.0
gdouble adg_line_style_get_miter_limit (AdgLineStyle *line_style
);
Gets the line miter limit value. The miter limit is used to determine whether the lines should be joined with a bevel instead of a miter.
|
an AdgLineStyle object |
Returns : |
the requested miter limit |
Since 1.0
void adg_line_style_set_antialias (AdgLineStyle *line_style
,cairo_antialias_t antialias
);
Sets a new antialias mode.
|
an AdgLineStyle object |
|
the new antialias mode. [type gint] |
Since 1.0
cairo_antialias_t adg_line_style_get_antialias (AdgLineStyle *line_style
);
Gets the antialias mode used.
|
an AdgLineStyle object |
Returns : |
the requested antialias mode. [type gint][transfer none] |
Since 1.0
void adg_line_style_set_dash (AdgLineStyle *line_style
,const AdgDash *dash
);
Sets the dash pattern of line_style
to dash
: all future rendering with
this line style will use this pattern.
The line_style
will embed a copy of dash
: this means that, after this
call, dash
can be freed (with adg_dash_destroy()
) if no more needed.
|
an AdgLineStyle object |
|
the new AdgDash pattern |
Since 1.0
const AdgDash * adg_line_style_get_dash (AdgLineStyle *line_style
);
Gets the dash pattern currently active on line_style
. A NULL
value is
returned when no dash pattern is active.
The returned pattern is owned by line_style
: you are not allowed to modify
or free it. If something needs to be changed, work on a duplicate and reset
the new pattern, such as:
1 2 3 4 5 6 7 8 9 10 11 12 |
AdgDash *dash, *new_dash; dash = adg_line_style_get_dash(line_style); if (dash == NULL) new_dash = adg_dash_new(); else new_dash = adg_dash_dup(dash); // ...modify new_dash as needed... adg_line_style_set_dash(line_style, new_dash); adg_dash_destroy(new_dash); |
Getting "dash" via the GObject property mechanism returns a duplicate instead, so you must free it when done.
1 2 3 |
g_object_get(line_style, "dash", &dash, NULL); // Here dash is a duplicate: modifying it will not affect line_style adg_dash_destroy(dash); |
|
an AdgLineStyle object |
Returns : |
the current dash pattern or NULL on errors. |
Since 1.0
"antialias"
property "antialias" gint : Read / Write
Type of antialiasing to do when rendering lines.
Default value: 0
"color-dress"
property"color-dress" AdgDress : Read / Write
The color dress to bind to this line style.
"dash"
property"dash" AdgDash* : Read / Write
The dash pattern to be used while stroking a path.
"miter-limit"
property "miter-limit" gdouble : Read / Write
Whether the lines should be joined with a bevel instead of a miter.
Allowed values: >= 0
Default value: 10