diff --git a/src/Color.vala b/src/Color.vala index a784283..cc5fea2 100644 --- a/src/Color.vala +++ b/src/Color.vala @@ -35,7 +35,8 @@ namespace CairoChart { public Color (double red = 0.0, double green = 0.0, double blue = 0.0, - double alpha = 1.0) { + double alpha = 1.0 + ) { this.red = red; this.green = green; this.blue = blue; diff --git a/src/Font.vala b/src/Font.vala index 229c387..58e8009 100644 --- a/src/Font.vala +++ b/src/Font.vala @@ -63,7 +63,8 @@ namespace CairoChart { Cairo.FontSlant slant = Cairo.FontSlant.NORMAL, Cairo.FontWeight weight = Cairo.FontWeight.NORMAL, double size = 10, - Font.Orientation orientation = Font.Orientation.HORIZONTAL) { + Font.Orientation orientation = Font.Orientation.HORIZONTAL + ) { this.family = family; this.slant = slant; this.weight = weight; diff --git a/src/Line.vala b/src/Line.vala index 06ed962..74e56df 100644 --- a/src/Line.vala +++ b/src/Line.vala @@ -1,22 +1,60 @@ namespace CairoChart { + /** + * ``Chart`` line. + */ public class Line { + /** + * Line Style. + */ public struct Style { - double width; - Cairo.LineJoin join; - Cairo.LineCap cap; - double[]? dashes; - double dash_offset; + /** + * Line color. + */ Color color; + /** + * A line width. + */ + double width; + + /** + * An array specifying alternate lengths of on and off stroke portions. + */ + double[]? dashes; + + /** + * An offset into the dash pattern at which the stroke should start. + */ + double dash_offset; + /** + * A line join style. + */ + Cairo.LineJoin join; + + /** + * A line cap style. + */ + Cairo.LineCap cap; + + /** + * Constructs a new ``Style``. + * @param color line color. + * @param width a line width. + * @param dashes an array specifying alternate lengths of on and off stroke portions. + * @param dash_offset an offset into the dash pattern at which the stroke should start. + * @param join a line join style. + * @param cap a line cap style. + */ public Style (Color color = Color(), - double width = 1, - double[]? dashes = null, double dash_offset = 0, - Cairo.LineJoin join = Cairo.LineJoin.MITER, - Cairo.LineCap cap = Cairo.LineCap.ROUND - ) { + double width = 1, + double[]? dashes = null, + double dash_offset = 0, + Cairo.LineJoin join = Cairo.LineJoin.MITER, + Cairo.LineCap cap = Cairo.LineCap.ROUND + ) { this.width = width; this.join = join; this.cap = cap; @@ -25,6 +63,9 @@ namespace CairoChart { this.color = color; } + /** + * Applies current style to the {@link Chart} ``Context``. + */ public void apply (Chart chart) { chart.color = color; chart.ctx.set_line_join(join); @@ -33,5 +74,7 @@ namespace CairoChart { chart.ctx.set_dash(dashes, dash_offset); } } + + private Line () { } } } diff --git a/src/Marker.vala b/src/Marker.vala index 04c0955..9f0cf63 100644 --- a/src/Marker.vala +++ b/src/Marker.vala @@ -15,7 +15,9 @@ namespace CairoChart { public Type type = Type.NONE; public double size = 8.0; - public Marker (Type type = Type.NONE, double size = 8.0) { + public Marker (Type type = Type.NONE, + double size = 8.0 + ) { this.type = type; this.size = size; } diff --git a/src/Place.vala b/src/Place.vala index b6345dd..6b45820 100644 --- a/src/Place.vala +++ b/src/Place.vala @@ -38,7 +38,8 @@ namespace CairoChart { return place; } - public Place (double x_min = 0, double x_max = 1, double y_min = 0, double y_max = 1) { + public Place (double x_min = 0, + double x_max = 1, double y_min = 0, double y_max = 1) { this.x_min = x_min; this.x_max = x_max; this.y_min = y_min;