Clone in a terminal:
Commit b1a91b1
Johan Mattsson - 2016-06-18T23:14:41+00:00
b1a91b1fd26528339f259eeed3baeb8778b609a8johan.mattsson.m@gmail.com

Base class for gradients

Changed files (1)

Diff

diff --git a/libsvgbird/Gradient.vala b/libsvgbird/Gradient.valanew file mode 100644index 0000000..879e5ae--- /dev/null+++ b/libsvgbird/Gradient.vala@@ -0,0 +1,58 @@+/*+	Copyright (C) 2015 2016 Johan Mattsson++	This library is free software; you can redistribute it and/or modify +	it under the terms of the GNU Lesser General Public License as +	published by the Free Software Foundation; either version 3 of the +	License, or (at your option) any later version.++	This library is distributed in the hope that it will be useful, but +	WITHOUT ANY WARRANTY; without even the implied warranty of +	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +	Lesser General Public License for more details.+*/++using Cairo;+using Math;++namespace SvgBird {++public abstract class Gradient : GLib.Object {+	public Gee.ArrayList<Stop> stops;+	+	public string id = "";+	public string? href = null;+	public SvgTransforms transforms;++	public Gradient () {+		stops = new Gee.ArrayList<Stop> ();+		transforms = new SvgTransforms ();+	}+	+	public void copy_stops (Gradient g) {+		foreach (Stop stop in g.stops) {+			stops.add (stop.copy ());+		}+	}++	public Matrix get_matrix () {+		return transforms.get_matrix ();+	}+	+	public void copy_gradient (Gradient from, Gradient to) {+		foreach (Stop s in from.stops) {+			to.stops.add (s.copy ());+		}+	+		to.id = from.id;+		to.href = from.href;	+		to.transforms = from.transforms.copy ();+	+	}++	public abstract Gradient copy ();+	public abstract string to_string ();++}++}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112