Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgLineStyle

Properties

  "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

Description

Contains parameters on how to draw lines such as width, cap mode, join mode and dash composition, if used.

Details

struct AdgLineStyle

struct AdgLineStyle;

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

Since 1.0


struct AdgLineStyleClass

struct AdgLineStyleClass {
};

adg_line_style_new ()

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


adg_line_style_set_color_dress ()

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.

line_style :

an AdgLineStyle

dress :

the new color dress to use

Since 1.0


adg_line_style_get_color_dress ()

AdgDress            adg_line_style_get_color_dress      (AdgLineStyle *line_style);

Gets the color dress used by line_style.

line_style :

an AdgLineStyle

Returns :

the current color dress. [transfer none]

Since 1.0


adg_line_style_set_width ()

void                adg_line_style_set_width            (AdgLineStyle *line_style,
                                                         gdouble width);

Sets a new line thickness value.

line_style :

an AdgLineStyle object

width :

the new width

Since 1.0


adg_line_style_get_width ()

gdouble             adg_line_style_get_width            (AdgLineStyle *line_style);

Gets the line thickness value (in global space).

line_style :

an AdgLineStyle object

Returns :

the requested width.

Since 1.0


adg_line_style_set_cap ()

void                adg_line_style_set_cap              (AdgLineStyle *line_style,
                                                         cairo_line_cap_t cap);

Sets a new line cap mode.

line_style :

an AdgLineStyle object

cap :

the new cap mode. [type gint]

Since 1.0


adg_line_style_get_cap ()

cairo_line_cap_t    adg_line_style_get_cap              (AdgLineStyle *line_style);

Gets the line cap mode.

line_style :

an AdgLineStyle object

Returns :

the requested line cap mode. [type gint][transfer none]

Since 1.0


adg_line_style_set_join ()

void                adg_line_style_set_join             (AdgLineStyle *line_style,
                                                         cairo_line_join_t join);

Sets a new line join mode.

line_style :

an AdgLineStyle object

join :

the new join mode. [type gint]

Since 1.0


adg_line_style_get_join ()

cairo_line_join_t   adg_line_style_get_join             (AdgLineStyle *line_style);

Gets the line join mode.

line_style :

an AdgLineStyle object

Returns :

the requested line join mode. [type gint][transfer none]

Since 1.0


adg_line_style_set_miter_limit ()

void                adg_line_style_set_miter_limit      (AdgLineStyle *line_style,
                                                         gdouble miter_limit);

Sets a new miter limit value.

line_style :

an AdgLineStyle object

miter_limit :

the new miter limit

Since 1.0


adg_line_style_get_miter_limit ()

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.

line_style :

an AdgLineStyle object

Returns :

the requested miter limit

Since 1.0


adg_line_style_set_antialias ()

void                adg_line_style_set_antialias        (AdgLineStyle *line_style,
                                                         cairo_antialias_t antialias);

Sets a new antialias mode.

line_style :

an AdgLineStyle object

antialias :

the new antialias mode. [type gint]

Since 1.0


adg_line_style_get_antialias ()

cairo_antialias_t   adg_line_style_get_antialias        (AdgLineStyle *line_style);

Gets the antialias mode used.

line_style :

an AdgLineStyle object

Returns :

the requested antialias mode. [type gint][transfer none]

Since 1.0


adg_line_style_set_dash ()

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.

line_style :

an AdgLineStyle object

dash :

the new AdgDash pattern

Since 1.0


adg_line_style_get_dash ()

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);

Note

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);

line_style :

an AdgLineStyle object

Returns :

the current dash pattern or NULL on errors.

Since 1.0

Property Details

The "antialias" property

  "antialias"                gint                  : Read / Write

Type of antialiasing to do when rendering lines.

Default value: 0


The "cap" property

  "cap"                      gint                  : Read / Write

The line cap mode.

Default value: 1


The "color-dress" property

  "color-dress"              AdgDress              : Read / Write

The color dress to bind to this line style.


The "dash" property

  "dash"                     AdgDash*              : Read / Write

The dash pattern to be used while stroking a path.


The "join" property

  "join"                     gint                  : Read / Write

The line join mode.

Default value: 0


The "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


The "width" property

  "width"                    gdouble               : Read / Write

The line thickness in device unit.

Allowed values: >= 0

Default value: 2