/* mini-graph.c generated by valac 0.20.0.2-fd7ed, the Vala compiler
 * generated from mini-graph.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <cairo.h>
#include <gdk/gdk.h>


#define BOXES_TYPE_MINI_GRAPH (boxes_mini_graph_get_type ())
#define BOXES_MINI_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MINI_GRAPH, BoxesMiniGraph))
#define BOXES_MINI_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MINI_GRAPH, BoxesMiniGraphClass))
#define BOXES_IS_MINI_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MINI_GRAPH))
#define BOXES_IS_MINI_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MINI_GRAPH))
#define BOXES_MINI_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MINI_GRAPH, BoxesMiniGraphClass))

typedef struct _BoxesMiniGraph BoxesMiniGraph;
typedef struct _BoxesMiniGraphClass BoxesMiniGraphClass;
typedef struct _BoxesMiniGraphPrivate BoxesMiniGraphPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BoxesMiniGraph {
	GtkDrawingArea parent_instance;
	BoxesMiniGraphPrivate * priv;
};

struct _BoxesMiniGraphClass {
	GtkDrawingAreaClass parent_class;
};

struct _BoxesMiniGraphPrivate {
	gdouble* _points;
	gint _points_length1;
	gint __points_size_;
	gint _npoints;
	gdouble _ymax;
	gboolean ymax_set;
};


static gpointer boxes_mini_graph_parent_class = NULL;

GType boxes_mini_graph_get_type (void) G_GNUC_CONST;
#define BOXES_MINI_GRAPH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_MINI_GRAPH, BoxesMiniGraphPrivate))
enum  {
	BOXES_MINI_GRAPH_DUMMY_PROPERTY,
	BOXES_MINI_GRAPH_NPOINTS
};
BoxesMiniGraph* boxes_mini_graph_new (gdouble* points, int points_length1, gint npoints);
BoxesMiniGraph* boxes_mini_graph_construct (GType object_type, gdouble* points, int points_length1, gint npoints);
void boxes_mini_graph_set_points (BoxesMiniGraph* self, gdouble* value, int value_length1);
void boxes_mini_graph_set_npoints (BoxesMiniGraph* self, gint value);
BoxesMiniGraph* boxes_mini_graph_new_with_ymax (gdouble* points, int points_length1, gdouble ymax, gint npoints);
BoxesMiniGraph* boxes_mini_graph_construct_with_ymax (GType object_type, gdouble* points, int points_length1, gdouble ymax, gint npoints);
static void boxes_mini_graph_set_ymax (BoxesMiniGraph* self, gdouble value);
static gdouble boxes_mini_graph_max (BoxesMiniGraph* self);
gdouble* boxes_mini_graph_get_points (BoxesMiniGraph* self, int* result_length1);
static gboolean boxes_mini_graph_real_draw (GtkWidget* base, cairo_t* cr);
gint boxes_mini_graph_get_npoints (BoxesMiniGraph* self);
static gdouble boxes_mini_graph_get_ymax (BoxesMiniGraph* self);
static gdouble* _vala_array_dup2 (gdouble* self, int length);
static void boxes_mini_graph_finalize (GObject* obj);
static void _vala_boxes_mini_graph_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_mini_graph_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


BoxesMiniGraph* boxes_mini_graph_construct (GType object_type, gdouble* points, int points_length1, gint npoints) {
	BoxesMiniGraph * self = NULL;
	gdouble* _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_;
#line 22 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self = (BoxesMiniGraph*) g_object_new (object_type, NULL);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = points;
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0__length1 = points_length1;
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_set_points (self, _tmp0_, _tmp0__length1);
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = npoints;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_set_npoints (self, _tmp1_);
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_widget_set_size_request ((GtkWidget*) self, 32, -1);
#line 22 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return self;
#line 94 "mini-graph.c"
}


BoxesMiniGraph* boxes_mini_graph_new (gdouble* points, int points_length1, gint npoints) {
#line 22 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return boxes_mini_graph_construct (BOXES_TYPE_MINI_GRAPH, points, points_length1, npoints);
#line 101 "mini-graph.c"
}


BoxesMiniGraph* boxes_mini_graph_construct_with_ymax (GType object_type, gdouble* points, int points_length1, gdouble ymax, gint npoints) {
	BoxesMiniGraph * self = NULL;
	gdouble* _tmp0_;
	gint _tmp0__length1;
	gdouble _tmp1_;
	gint _tmp2_;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self = (BoxesMiniGraph*) g_object_new (object_type, NULL);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = points;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0__length1 = points_length1;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_set_points (self, _tmp0_, _tmp0__length1);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = ymax;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_set_ymax (self, _tmp1_);
#line 31 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp2_ = npoints;
#line 31 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_set_npoints (self, _tmp2_);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_widget_set_size_request ((GtkWidget*) self, 32, -1);
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return self;
#line 131 "mini-graph.c"
}


BoxesMiniGraph* boxes_mini_graph_new_with_ymax (gdouble* points, int points_length1, gdouble ymax, gint npoints) {
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return boxes_mini_graph_construct_with_ymax (BOXES_TYPE_MINI_GRAPH, points, points_length1, ymax, npoints);
#line 138 "mini-graph.c"
}


static gdouble boxes_mini_graph_max (BoxesMiniGraph* self) {
	gdouble result = 0.0;
	gdouble* _tmp0_;
	gint _tmp0__length1;
	gdouble* _tmp1_;
	gint _tmp1__length1;
	gdouble* _tmp2_;
	gint _tmp2__length1;
	gdouble* _tmp3_;
	gint _tmp3__length1;
	gdouble _tmp4_;
	gdouble max;
	gdouble* _tmp5_;
	gint _tmp5__length1;
	gdouble* _tmp6_;
	gint _tmp6__length1;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_val_if_fail (self != NULL, 0.0);
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = boxes_mini_graph_get_points (self, &_tmp0__length1);
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = _tmp0_;
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1__length1 = _tmp0__length1;
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (_tmp1__length1 == 0) {
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		result = 1.0;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		return result;
#line 172 "mini-graph.c"
	}
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp2_ = boxes_mini_graph_get_points (self, &_tmp2__length1);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp3_ = _tmp2_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp3__length1 = _tmp2__length1;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp4_ = _tmp3_[0];
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	max = _tmp4_;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp5_ = boxes_mini_graph_get_points (self, &_tmp5__length1);
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp6_ = _tmp5_;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp6__length1 = _tmp5__length1;
#line 190 "mini-graph.c"
	{
		gdouble* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection = _tmp6_;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection_length1 = _tmp6__length1;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		for (p_it = 0; p_it < _tmp6__length1; p_it = p_it + 1) {
#line 202 "mini-graph.c"
			gdouble p = 0.0;
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
			p = p_collection[p_it];
#line 206 "mini-graph.c"
			{
				gdouble _tmp7_;
				gdouble _tmp8_;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp7_ = p;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp8_ = max;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				if (_tmp7_ > _tmp8_) {
#line 216 "mini-graph.c"
					gdouble _tmp9_;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp9_ = p;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					max = _tmp9_;
#line 222 "mini-graph.c"
				}
			}
		}
	}
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	result = max;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return result;
#line 231 "mini-graph.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return self ? g_object_ref (self) : NULL;
#line 238 "mini-graph.c"
}


static gboolean boxes_mini_graph_real_draw (GtkWidget* base, cairo_t* cr) {
	BoxesMiniGraph * self;
	gboolean result = FALSE;
	gint _tmp0_ = 0;
	gint width;
	gint _tmp1_ = 0;
	gint height;
	GtkStyleContext* _tmp2_ = NULL;
	GtkStyleContext* _tmp3_;
	GtkStyleContext* style;
	cairo_t* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkStateFlags _tmp6_ = 0;
	GdkRGBA _tmp7_ = {0};
	cairo_t* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	cairo_t* _tmp11_;
	gint _tmp12_ = 0;
	gint _tmp13_;
	gint _tmp17_;
	gint nstep;
	gdouble _tmp18_ = 0.0;
	gboolean _tmp19_;
	gdouble _tmp23_;
	gdouble ymax;
	gdouble dy;
	gdouble dx;
	gint _tmp24_;
	gdouble _tmp27_;
	cairo_t* _tmp30_;
	GtkStyleContext* _tmp31_;
	GdkRGBA _tmp32_ = {0};
	gdouble x;
	gdouble* _tmp33_;
	gint _tmp33__length1;
	gdouble* _tmp34_;
	gint _tmp34__length1;
	cairo_t* _tmp47_;
	gdouble _tmp48_;
	gdouble _tmp49_;
	gint _tmp50_;
	cairo_t* _tmp51_;
	gint _tmp52_;
	cairo_t* _tmp53_;
	cairo_t* _tmp54_;
	GtkStyleContext* _tmp55_;
	GtkStateFlags _tmp56_ = 0;
	GdkRGBA _tmp57_ = {0};
	cairo_t* _tmp58_;
	gdouble* _tmp59_;
	gint _tmp59__length1;
	gdouble* _tmp60_;
	gint _tmp60__length1;
	cairo_t* _tmp73_;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self = (BoxesMiniGraph*) base;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_val_if_fail (cr != NULL, FALSE);
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	width = _tmp0_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = gtk_widget_get_allocated_height ((GtkWidget*) self);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	height = _tmp1_;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) self);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	style = _tmp3_;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp4_ = cr;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp5_ = style;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp6_ = gtk_widget_get_state_flags ((GtkWidget*) self);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_style_context_get_background_color (_tmp5_, _tmp6_, &_tmp7_);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gdk_cairo_set_source_rgba (_tmp4_, &_tmp7_);
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp8_ = cr;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp9_ = width;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp10_ = height;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_rectangle (_tmp8_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp9_, (gdouble) _tmp10_);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp11_ = cr;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_fill (_tmp11_);
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp13_ = self->priv->_npoints;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (_tmp13_ == (-1)) {
#line 341 "mini-graph.c"
		gdouble* _tmp14_;
		gint _tmp14__length1;
		gdouble* _tmp15_;
		gint _tmp15__length1;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp14_ = boxes_mini_graph_get_points (self, &_tmp14__length1);
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp15_ = _tmp14_;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp15__length1 = _tmp14__length1;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp12_ = _tmp15__length1;
#line 354 "mini-graph.c"
	} else {
		gint _tmp16_;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp16_ = self->priv->_npoints;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp12_ = _tmp16_;
#line 361 "mini-graph.c"
	}
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp17_ = _tmp12_;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	nstep = _tmp17_ - 1;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp19_ = self->priv->ymax_set;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (_tmp19_) {
#line 371 "mini-graph.c"
		gdouble _tmp20_;
		gdouble _tmp21_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp20_ = boxes_mini_graph_get_ymax (self);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp21_ = _tmp20_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp18_ = _tmp21_;
#line 380 "mini-graph.c"
	} else {
		gdouble _tmp22_ = 0.0;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp22_ = boxes_mini_graph_max (self);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp18_ = _tmp22_;
#line 387 "mini-graph.c"
	}
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp23_ = _tmp18_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	ymax = _tmp23_;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	dy = 0.0;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	dx = 0.0;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp24_ = nstep;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (_tmp24_ != 0) {
#line 401 "mini-graph.c"
		gint _tmp25_;
		gint _tmp26_;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp25_ = width;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp26_ = nstep;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		dx = ((gdouble) _tmp25_) / _tmp26_;
#line 410 "mini-graph.c"
	}
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp27_ = ymax;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (_tmp27_ != ((gdouble) 0)) {
#line 416 "mini-graph.c"
		gint _tmp28_;
		gdouble _tmp29_;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp28_ = height;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		_tmp29_ = ymax;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		dy = ((gdouble) _tmp28_) / _tmp29_;
#line 425 "mini-graph.c"
	}
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp30_ = cr;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp31_ = style;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_style_context_get_color (_tmp31_, GTK_STATE_FLAG_NORMAL, &_tmp32_);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gdk_cairo_set_source_rgba (_tmp30_, &_tmp32_);
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	x = 0.0;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp33_ = boxes_mini_graph_get_points (self, &_tmp33__length1);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp34_ = _tmp33_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp34__length1 = _tmp33__length1;
#line 443 "mini-graph.c"
	{
		gdouble* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection = _tmp34_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection_length1 = _tmp34__length1;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		for (p_it = 0; p_it < _tmp34__length1; p_it = p_it + 1) {
#line 455 "mini-graph.c"
			gdouble p = 0.0;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
			p = p_collection[p_it];
#line 459 "mini-graph.c"
			{
				gint _tmp35_;
				gdouble _tmp36_;
				gdouble _tmp37_;
				gdouble y;
				gdouble _tmp38_;
				gdouble _tmp45_;
				gdouble _tmp46_;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp35_ = height;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp36_ = p;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp37_ = dy;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				y = _tmp35_ - (_tmp36_ * _tmp37_);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp38_ = x;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				if (_tmp38_ == 0.0) {
#line 480 "mini-graph.c"
					cairo_t* _tmp39_;
					gdouble _tmp40_;
					gdouble _tmp41_;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp39_ = cr;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp40_ = x;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp41_ = y;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					cairo_move_to (_tmp39_, _tmp40_, _tmp41_);
#line 492 "mini-graph.c"
				} else {
					cairo_t* _tmp42_;
					gdouble _tmp43_;
					gdouble _tmp44_;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp42_ = cr;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp43_ = x;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp44_ = y;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					cairo_line_to (_tmp42_, _tmp43_, _tmp44_);
#line 505 "mini-graph.c"
				}
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp45_ = x;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp46_ = dx;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				x = _tmp45_ + _tmp46_;
#line 513 "mini-graph.c"
			}
		}
	}
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp47_ = cr;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp48_ = x;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp49_ = dx;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp50_ = height;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_line_to (_tmp47_, _tmp48_ - _tmp49_, (gdouble) _tmp50_);
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp51_ = cr;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp52_ = height;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_line_to (_tmp51_, (gdouble) 0, (gdouble) _tmp52_);
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp53_ = cr;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_fill (_tmp53_);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp54_ = cr;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp55_ = style;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp56_ = gtk_widget_get_state_flags ((GtkWidget*) self);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_style_context_get_border_color (_tmp55_, _tmp56_, &_tmp57_);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gdk_cairo_set_source_rgba (_tmp54_, &_tmp57_);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp58_ = cr;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_set_line_width (_tmp58_, 1.0);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	x = 0.0;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp59_ = boxes_mini_graph_get_points (self, &_tmp59__length1);
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp60_ = _tmp59_;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp60__length1 = _tmp59__length1;
#line 559 "mini-graph.c"
	{
		gdouble* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection = _tmp60_;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		p_collection_length1 = _tmp60__length1;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		for (p_it = 0; p_it < _tmp60__length1; p_it = p_it + 1) {
#line 571 "mini-graph.c"
			gdouble p = 0.0;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
			p = p_collection[p_it];
#line 575 "mini-graph.c"
			{
				gint _tmp61_;
				gdouble _tmp62_;
				gdouble _tmp63_;
				gdouble y;
				gdouble _tmp64_;
				gdouble _tmp71_;
				gdouble _tmp72_;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp61_ = height;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp62_ = p;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp63_ = dy;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				y = _tmp61_ - (_tmp62_ * _tmp63_);
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp64_ = x;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				if (_tmp64_ == 0.0) {
#line 596 "mini-graph.c"
					cairo_t* _tmp65_;
					gdouble _tmp66_;
					gdouble _tmp67_;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp65_ = cr;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp66_ = x;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp67_ = y;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					cairo_move_to (_tmp65_, _tmp66_, _tmp67_);
#line 608 "mini-graph.c"
				} else {
					cairo_t* _tmp68_;
					gdouble _tmp69_;
					gdouble _tmp70_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp68_ = cr;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp69_ = x;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					_tmp70_ = y;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
					cairo_line_to (_tmp68_, _tmp69_, _tmp70_);
#line 621 "mini-graph.c"
				}
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp71_ = x;
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				_tmp72_ = dx;
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
				x = _tmp71_ + _tmp72_;
#line 629 "mini-graph.c"
			}
		}
	}
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp73_ = cr;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	cairo_stroke (_tmp73_);
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	result = TRUE;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_g_object_unref0 (style);
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return result;
#line 643 "mini-graph.c"
}


gdouble* boxes_mini_graph_get_points (BoxesMiniGraph* self, int* result_length1) {
	gdouble* result;
	gdouble* _tmp0_;
	gint _tmp0__length1;
	gdouble* _tmp1_;
	gint _tmp1__length1;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = self->priv->_points;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0__length1 = self->priv->_points_length1;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = _tmp0_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1__length1 = _tmp0__length1;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	if (result_length1) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		*result_length1 = _tmp1__length1;
#line 667 "mini-graph.c"
	}
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	result = _tmp1_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return result;
#line 673 "mini-graph.c"
}


static gdouble* _vala_array_dup2 (gdouble* self, int length) {
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return g_memdup (self, length * sizeof (gdouble));
#line 680 "mini-graph.c"
}


void boxes_mini_graph_set_points (BoxesMiniGraph* self, gdouble* value, int value_length1) {
	gdouble* _tmp0_;
	gint _tmp0__length1;
	gdouble* _tmp1_;
	gint _tmp1__length1;
#line 6 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_if_fail (self != NULL);
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = value;
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0__length1 = value_length1;
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup2 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp1__length1 = _tmp0__length1;
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_points = (g_free (self->priv->_points), NULL);
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_points = _tmp1_;
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_points_length1 = _tmp1__length1;
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->__points_size_ = self->priv->_points_length1;
#line 8 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	gtk_widget_queue_draw ((GtkWidget*) self);
#line 709 "mini-graph.c"
}


gint boxes_mini_graph_get_npoints (BoxesMiniGraph* self) {
	gint result;
	gint _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = self->priv->_npoints;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	result = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return result;
#line 724 "mini-graph.c"
}


void boxes_mini_graph_set_npoints (BoxesMiniGraph* self, gint value) {
	gint _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_if_fail (self != NULL);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = value;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_npoints = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_object_notify ((GObject *) self, "npoints");
#line 738 "mini-graph.c"
}


static gdouble boxes_mini_graph_get_ymax (BoxesMiniGraph* self) {
	gdouble result;
	gdouble _tmp0_;
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_val_if_fail (self != NULL, 0.0);
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = self->priv->_ymax;
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	result = _tmp0_;
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	return result;
#line 753 "mini-graph.c"
}


static void boxes_mini_graph_set_ymax (BoxesMiniGraph* self, gdouble value) {
	gdouble _tmp0_;
#line 15 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_return_if_fail (self != NULL);
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	_tmp0_ = value;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_ymax = _tmp0_;
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->ymax_set = TRUE;
#line 767 "mini-graph.c"
}


static void boxes_mini_graph_class_init (BoxesMiniGraphClass * klass) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	boxes_mini_graph_parent_class = g_type_class_peek_parent (klass);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_type_class_add_private (klass, sizeof (BoxesMiniGraphPrivate));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	GTK_WIDGET_CLASS (klass)->draw = boxes_mini_graph_real_draw;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_mini_graph_get_property;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_mini_graph_set_property;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_mini_graph_finalize;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MINI_GRAPH_NPOINTS, g_param_spec_int ("npoints", "npoints", "npoints", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 786 "mini-graph.c"
}


static void boxes_mini_graph_instance_init (BoxesMiniGraph * self) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv = BOXES_MINI_GRAPH_GET_PRIVATE (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_npoints = -1;
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->ymax_set = FALSE;
#line 797 "mini-graph.c"
}


static void boxes_mini_graph_finalize (GObject* obj) {
	BoxesMiniGraph * self;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_MINI_GRAPH, BoxesMiniGraph);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	self->priv->_points = (g_free (self->priv->_points), NULL);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	G_OBJECT_CLASS (boxes_mini_graph_parent_class)->finalize (obj);
#line 809 "mini-graph.c"
}


GType boxes_mini_graph_get_type (void) {
	static volatile gsize boxes_mini_graph_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_mini_graph_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesMiniGraphClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_mini_graph_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesMiniGraph), 0, (GInstanceInitFunc) boxes_mini_graph_instance_init, NULL };
		GType boxes_mini_graph_type_id;
		boxes_mini_graph_type_id = g_type_register_static (GTK_TYPE_DRAWING_AREA, "BoxesMiniGraph", &g_define_type_info, 0);
		g_once_init_leave (&boxes_mini_graph_type_id__volatile, boxes_mini_graph_type_id);
	}
	return boxes_mini_graph_type_id__volatile;
}


static void _vala_boxes_mini_graph_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesMiniGraph * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_MINI_GRAPH, BoxesMiniGraph);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	switch (property_id) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		case BOXES_MINI_GRAPH_NPOINTS:
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		g_value_set_int (value, boxes_mini_graph_get_npoints (self));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		break;
#line 836 "mini-graph.c"
		default:
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		break;
#line 842 "mini-graph.c"
	}
}


static void _vala_boxes_mini_graph_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesMiniGraph * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_MINI_GRAPH, BoxesMiniGraph);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
	switch (property_id) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		case BOXES_MINI_GRAPH_NPOINTS:
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		boxes_mini_graph_set_npoints (self, g_value_get_int (value));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		break;
#line 858 "mini-graph.c"
		default:
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/mini-graph.vala"
		break;
#line 864 "mini-graph.c"
	}
}



