/* resource-graph.c generated by valac 0.32.0.73-ab1d1, the Vala compiler
 * generated from resource-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_RESOURCE_GRAPH (boxes_resource_graph_get_type ())
#define BOXES_RESOURCE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraph))
#define BOXES_RESOURCE_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraphClass))
#define BOXES_IS_RESOURCE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_RESOURCE_GRAPH))
#define BOXES_IS_RESOURCE_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_RESOURCE_GRAPH))
#define BOXES_RESOURCE_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraphClass))

typedef struct _BoxesResourceGraph BoxesResourceGraph;
typedef struct _BoxesResourceGraphClass BoxesResourceGraphClass;
typedef struct _BoxesResourceGraphPrivate BoxesResourceGraphPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BoxesResourceGraph {
	GtkDrawingArea parent_instance;
	BoxesResourceGraphPrivate * priv;
};

struct _BoxesResourceGraphClass {
	GtkDrawingAreaClass parent_class;
};

struct _BoxesResourceGraphPrivate {
	gdouble* _points;
	gint _points_length1;
	gint __points_size_;
	gint _npoints;
	gdouble _ymax;
};


static gpointer boxes_resource_graph_parent_class = NULL;

GType boxes_resource_graph_get_type (void) G_GNUC_CONST;
#define BOXES_RESOURCE_GRAPH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraphPrivate))
enum  {
	BOXES_RESOURCE_GRAPH_DUMMY_PROPERTY,
	BOXES_RESOURCE_GRAPH_NPOINTS,
	BOXES_RESOURCE_GRAPH_YMAX
};
BoxesResourceGraph* boxes_resource_graph_new (gdouble ymax);
BoxesResourceGraph* boxes_resource_graph_construct (GType object_type, gdouble ymax);
void boxes_resource_graph_set_ymax (BoxesResourceGraph* self, gdouble value);
static gboolean boxes_resource_graph_real_draw (GtkWidget* base, cairo_t* cr);
gint boxes_resource_graph_get_npoints (BoxesResourceGraph* self);
gdouble* boxes_resource_graph_get_points (BoxesResourceGraph* self, int* result_length1);
gdouble boxes_resource_graph_get_ymax (BoxesResourceGraph* self);
void boxes_resource_graph_set_points (BoxesResourceGraph* self, gdouble* value, int value_length1);
static gdouble* _vala_array_dup2 (gdouble* self, int length);
void boxes_resource_graph_set_npoints (BoxesResourceGraph* self, gint value);
static void boxes_resource_graph_finalize (GObject* obj);
static void _vala_boxes_resource_graph_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_resource_graph_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


BoxesResourceGraph* boxes_resource_graph_construct (GType object_type, gdouble ymax) {
	BoxesResourceGraph * self = NULL;
	gdouble _tmp0_ = 0.0;
#line 24 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self = (BoxesResourceGraph*) g_object_new (object_type, NULL);
#line 25 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = ymax;
#line 25 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	boxes_resource_graph_set_ymax (self, _tmp0_);
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_set ((GtkWidget*) self, "width-request", 120, NULL);
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_set ((GtkWidget*) self, "height-request", 60, NULL);
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_set ((GtkWidget*) self, "expand", TRUE, NULL);
#line 24 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return self;
#line 87 "resource-graph.c"
}


BoxesResourceGraph* boxes_resource_graph_new (gdouble ymax) {
#line 24 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return boxes_resource_graph_construct (BOXES_TYPE_RESOURCE_GRAPH, ymax);
#line 94 "resource-graph.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return self ? g_object_ref (self) : NULL;
#line 101 "resource-graph.c"
}


static gboolean boxes_resource_graph_real_draw (GtkWidget* base, cairo_t* cr) {
	BoxesResourceGraph * self;
	gboolean result = FALSE;
	gint width = 0;
	gint _tmp0_ = 0;
	gint height = 0;
	gint _tmp1_ = 0;
	GtkStyleContext* style = NULL;
	GtkStyleContext* _tmp2_ = NULL;
	GtkStyleContext* _tmp3_ = NULL;
	GtkStyleContext* _tmp4_ = NULL;
	cairo_t* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	gint nstep = 0;
	gdouble dy = 0.0;
	gdouble dx = 0.0;
	gint _tmp13_ = 0;
	gdouble _tmp16_ = 0.0;
	gdouble _tmp17_ = 0.0;
	GtkStyleContext* _tmp21_ = NULL;
	GtkStyleContext* _tmp22_ = NULL;
	cairo_t* _tmp23_ = NULL;
	GtkStyleContext* _tmp24_ = NULL;
	GtkStateFlags _tmp25_ = 0;
	GdkRGBA _tmp26_ = {0};
	GtkStyleContext* _tmp27_ = NULL;
	gdouble x = 0.0;
	gdouble* _tmp28_ = NULL;
	gint _tmp28__length1 = 0;
	gdouble* _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	cairo_t* _tmp42_ = NULL;
	gdouble _tmp43_ = 0.0;
	gdouble _tmp44_ = 0.0;
	gint _tmp45_ = 0;
	cairo_t* _tmp46_ = NULL;
	gint _tmp47_ = 0;
	cairo_t* _tmp48_ = NULL;
	cairo_t* _tmp49_ = NULL;
	GtkStyleContext* _tmp50_ = NULL;
	GtkStateFlags _tmp51_ = 0;
	GdkRGBA _tmp52_ = {0};
	cairo_t* _tmp53_ = NULL;
	gdouble* _tmp54_ = NULL;
	gint _tmp54__length1 = 0;
	gdouble* _tmp55_ = NULL;
	gint _tmp55__length1 = 0;
	cairo_t* _tmp68_ = NULL;
#line 31 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self = (BoxesResourceGraph*) base;
#line 31 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_val_if_fail (cr != NULL, FALSE);
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	width = _tmp0_;
#line 33 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp1_ = gtk_widget_get_allocated_height ((GtkWidget*) self);
#line 33 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	height = _tmp1_;
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) self);
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	style = _tmp3_;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp4_ = style;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp5_ = cr;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp6_ = width;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp7_ = height;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_render_background (_tmp4_, _tmp5_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp6_, (gdouble) _tmp7_);
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp9_ = self->priv->_npoints;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	if (_tmp9_ == -1) {
#line 188 "resource-graph.c"
		gdouble* _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		gdouble* _tmp11_ = NULL;
		gint _tmp11__length1 = 0;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp10_ = boxes_resource_graph_get_points (self, &_tmp10__length1);
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp11_ = _tmp10_;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp11__length1 = _tmp10__length1;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp8_ = _tmp11__length1;
#line 201 "resource-graph.c"
	} else {
		gint _tmp12_ = 0;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp12_ = self->priv->_npoints;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp8_ = _tmp12_;
#line 208 "resource-graph.c"
	}
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	nstep = _tmp8_ - 1;
#line 39 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	dy = 0.0;
#line 40 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	dx = 0.0;
#line 41 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp13_ = nstep;
#line 41 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	if (_tmp13_ != 0) {
#line 220 "resource-graph.c"
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp14_ = width;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp15_ = nstep;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		dx = ((gdouble) _tmp14_) / _tmp15_;
#line 229 "resource-graph.c"
	}
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp16_ = boxes_resource_graph_get_ymax (self);
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp17_ = _tmp16_;
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	if (_tmp17_ != ((gdouble) 0)) {
#line 237 "resource-graph.c"
		gint _tmp18_ = 0;
		gdouble _tmp19_ = 0.0;
		gdouble _tmp20_ = 0.0;
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp18_ = height;
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp19_ = boxes_resource_graph_get_ymax (self);
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp20_ = _tmp19_;
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		dy = ((gdouble) _tmp18_) / _tmp20_;
#line 249 "resource-graph.c"
	}
#line 46 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp21_ = style;
#line 46 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_style_context_save (_tmp21_);
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp22_ = style;
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_style_context_set_state (_tmp22_, GTK_STATE_FLAG_NORMAL);
#line 48 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp23_ = cr;
#line 48 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp24_ = style;
#line 48 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp25_ = gtk_widget_get_state_flags ((GtkWidget*) self);
#line 48 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_style_context_get_color (_tmp24_, _tmp25_, &_tmp26_);
#line 48 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gdk_cairo_set_source_rgba (_tmp23_, &_tmp26_);
#line 49 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp27_ = style;
#line 49 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_style_context_restore (_tmp27_);
#line 50 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	x = 0.0;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp28_ = boxes_resource_graph_get_points (self, &_tmp28__length1);
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp29_ = _tmp28_;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp29__length1 = _tmp28__length1;
#line 281 "resource-graph.c"
	{
		gdouble* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		p_collection = _tmp29_;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		p_collection_length1 = _tmp29__length1;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		for (p_it = 0; p_it < _tmp29__length1; p_it = p_it + 1) {
#line 293 "resource-graph.c"
			gdouble p = 0.0;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
			p = p_collection[p_it];
#line 297 "resource-graph.c"
			{
				gdouble y = 0.0;
				gint _tmp30_ = 0;
				gdouble _tmp31_ = 0.0;
				gdouble _tmp32_ = 0.0;
				gdouble _tmp33_ = 0.0;
				gdouble _tmp40_ = 0.0;
				gdouble _tmp41_ = 0.0;
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp30_ = height;
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp31_ = p;
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp32_ = dy;
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				y = _tmp30_ - (_tmp31_ * _tmp32_);
#line 53 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp33_ = x;
#line 53 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				if (_tmp33_ == 0.0) {
#line 318 "resource-graph.c"
					cairo_t* _tmp34_ = NULL;
					gdouble _tmp35_ = 0.0;
					gdouble _tmp36_ = 0.0;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp34_ = cr;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp35_ = x;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp36_ = y;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					cairo_move_to (_tmp34_, _tmp35_, _tmp36_);
#line 330 "resource-graph.c"
				} else {
					cairo_t* _tmp37_ = NULL;
					gdouble _tmp38_ = 0.0;
					gdouble _tmp39_ = 0.0;
#line 56 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp37_ = cr;
#line 56 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp38_ = x;
#line 56 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp39_ = y;
#line 56 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					cairo_line_to (_tmp37_, _tmp38_, _tmp39_);
#line 343 "resource-graph.c"
				}
#line 57 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp40_ = x;
#line 57 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp41_ = dx;
#line 57 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				x = _tmp40_ + _tmp41_;
#line 351 "resource-graph.c"
			}
		}
	}
#line 59 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp42_ = cr;
#line 59 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp43_ = x;
#line 59 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp44_ = dx;
#line 59 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp45_ = height;
#line 59 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	cairo_line_to (_tmp42_, _tmp43_ - _tmp44_, (gdouble) _tmp45_);
#line 60 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp46_ = cr;
#line 60 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp47_ = height;
#line 60 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	cairo_line_to (_tmp46_, (gdouble) 0, (gdouble) _tmp47_);
#line 61 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp48_ = cr;
#line 61 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	cairo_fill (_tmp48_);
#line 63 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp49_ = cr;
#line 63 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp50_ = style;
#line 63 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp51_ = gtk_widget_get_state_flags ((GtkWidget*) self);
#line 63 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_style_context_get_border_color (_tmp50_, _tmp51_, &_tmp52_);
#line 63 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gdk_cairo_set_source_rgba (_tmp49_, &_tmp52_);
#line 64 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp53_ = cr;
#line 64 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	cairo_set_line_width (_tmp53_, 1.0);
#line 65 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	x = 0.0;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp54_ = boxes_resource_graph_get_points (self, &_tmp54__length1);
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp55_ = _tmp54_;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp55__length1 = _tmp54__length1;
#line 397 "resource-graph.c"
	{
		gdouble* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		p_collection = _tmp55_;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		p_collection_length1 = _tmp55__length1;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		for (p_it = 0; p_it < _tmp55__length1; p_it = p_it + 1) {
#line 409 "resource-graph.c"
			gdouble p = 0.0;
#line 66 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
			p = p_collection[p_it];
#line 413 "resource-graph.c"
			{
				gdouble y = 0.0;
				gint _tmp56_ = 0;
				gdouble _tmp57_ = 0.0;
				gdouble _tmp58_ = 0.0;
				gdouble _tmp59_ = 0.0;
				gdouble _tmp66_ = 0.0;
				gdouble _tmp67_ = 0.0;
#line 67 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp56_ = height;
#line 67 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp57_ = p;
#line 67 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp58_ = dy;
#line 67 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				y = _tmp56_ - (_tmp57_ * _tmp58_);
#line 69 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp59_ = x;
#line 69 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				if (_tmp59_ == 0.0) {
#line 434 "resource-graph.c"
					cairo_t* _tmp60_ = NULL;
					gdouble _tmp61_ = 0.0;
					gdouble _tmp62_ = 0.0;
#line 70 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp60_ = cr;
#line 70 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp61_ = x;
#line 70 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp62_ = y;
#line 70 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					cairo_move_to (_tmp60_, _tmp61_, _tmp62_);
#line 446 "resource-graph.c"
				} else {
					cairo_t* _tmp63_ = NULL;
					gdouble _tmp64_ = 0.0;
					gdouble _tmp65_ = 0.0;
#line 72 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp63_ = cr;
#line 72 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp64_ = x;
#line 72 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					_tmp65_ = y;
#line 72 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
					cairo_line_to (_tmp63_, _tmp64_, _tmp65_);
#line 459 "resource-graph.c"
				}
#line 73 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp66_ = x;
#line 73 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				_tmp67_ = dx;
#line 73 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
				x = _tmp66_ + _tmp67_;
#line 467 "resource-graph.c"
			}
		}
	}
#line 75 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp68_ = cr;
#line 75 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	cairo_stroke (_tmp68_);
#line 77 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	result = TRUE;
#line 77 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_g_object_unref0 (style);
#line 77 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return result;
#line 481 "resource-graph.c"
}


gdouble* boxes_resource_graph_get_points (BoxesResourceGraph* self, int* result_length1) {
	gdouble* result;
	gdouble* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gdouble* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = self->priv->_points;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0__length1 = self->priv->_points_length1;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp1_ = _tmp0_;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp1__length1 = _tmp0__length1;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	if (result_length1) {
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		*result_length1 = _tmp1__length1;
#line 505 "resource-graph.c"
	}
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	result = _tmp1_;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return result;
#line 511 "resource-graph.c"
}


static gdouble* _vala_array_dup2 (gdouble* self, int length) {
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return g_memdup (self, length * sizeof (gdouble));
#line 518 "resource-graph.c"
}


void boxes_resource_graph_set_points (BoxesResourceGraph* self, gdouble* value, int value_length1) {
	gdouble* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gdouble* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gdouble _tmp2_ = 0.0;
	gdouble _tmp3_ = 0.0;
	gdouble _tmp4_ = 0.0;
	gdouble* _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	gdouble* _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
#line 7 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_if_fail (self != NULL);
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = value;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0__length1 = value_length1;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp1_ = value;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp1__length1 = value_length1;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp2_ = _tmp0_[_tmp1__length1 - 1];
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp3_ = boxes_resource_graph_get_ymax (self);
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp4_ = _tmp3_;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	if (_tmp2_ > _tmp4_) {
#line 552 "resource-graph.c"
		gdouble* _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		gdouble* _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		gdouble _tmp7_ = 0.0;
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp5_ = value;
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp5__length1 = value_length1;
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp6_ = value;
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp6__length1 = value_length1;
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		_tmp7_ = _tmp5_[_tmp6__length1 - 1];
#line 9 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		boxes_resource_graph_set_ymax (self, _tmp7_);
#line 570 "resource-graph.c"
	}
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp8_ = value;
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp8__length1 = value_length1;
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp9_ = (_tmp8_ != NULL) ? _vala_array_dup2 (_tmp8_, _tmp8__length1) : ((gpointer) _tmp8_);
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp9__length1 = _tmp8__length1;
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_points = (g_free (self->priv->_points), NULL);
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_points = _tmp9_;
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_points_length1 = _tmp9__length1;
#line 11 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->__points_size_ = self->priv->_points_length1;
#line 12 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_widget_queue_draw ((GtkWidget*) self);
#line 590 "resource-graph.c"
}


gint boxes_resource_graph_get_npoints (BoxesResourceGraph* self) {
	gint result;
	gint _tmp0_ = 0;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = self->priv->_npoints;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	result = _tmp0_;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return result;
#line 605 "resource-graph.c"
}


void boxes_resource_graph_set_npoints (BoxesResourceGraph* self, gint value) {
	gint _tmp0_ = 0;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_if_fail (self != NULL);
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = value;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_npoints = _tmp0_;
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_notify ((GObject *) self, "npoints");
#line 619 "resource-graph.c"
}


gdouble boxes_resource_graph_get_ymax (BoxesResourceGraph* self) {
	gdouble result;
	gdouble _tmp0_ = 0.0;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_val_if_fail (self != NULL, 0.0);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = self->priv->_ymax;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	result = _tmp0_;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	return result;
#line 634 "resource-graph.c"
}


void boxes_resource_graph_set_ymax (BoxesResourceGraph* self, gdouble value) {
	gdouble _tmp0_ = 0.0;
#line 19 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_return_if_fail (self != NULL);
#line 20 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	_tmp0_ = value;
#line 20 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_ymax = _tmp0_;
#line 19 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_notify ((GObject *) self, "ymax");
#line 648 "resource-graph.c"
}


static void boxes_resource_graph_class_init (BoxesResourceGraphClass * klass) {
	gint BoxesResourceGraph_private_offset;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	boxes_resource_graph_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_type_class_add_private (klass, sizeof (BoxesResourceGraphPrivate));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	((GtkWidgetClass *) klass)->draw = boxes_resource_graph_real_draw;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_resource_graph_get_property;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_resource_graph_set_property;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_resource_graph_finalize;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_RESOURCE_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 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_RESOURCE_GRAPH_YMAX, g_param_spec_double ("ymax", "ymax", "ymax", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	BoxesResourceGraph_private_offset = g_type_class_get_instance_private_offset (klass);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/resource-graph.ui");
#line 674 "resource-graph.c"
}


static void boxes_resource_graph_instance_init (BoxesResourceGraph * self) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv = BOXES_RESOURCE_GRAPH_GET_PRIVATE (self);
#line 15 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_npoints = -1;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	gtk_widget_init_template (GTK_WIDGET (self));
#line 685 "resource-graph.c"
}


static void boxes_resource_graph_finalize (GObject* obj) {
	BoxesResourceGraph * self;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraph);
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	self->priv->_points = (g_free (self->priv->_points), NULL);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	G_OBJECT_CLASS (boxes_resource_graph_parent_class)->finalize (obj);
#line 697 "resource-graph.c"
}


GType boxes_resource_graph_get_type (void) {
	static volatile gsize boxes_resource_graph_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_resource_graph_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesResourceGraphClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_resource_graph_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesResourceGraph), 0, (GInstanceInitFunc) boxes_resource_graph_instance_init, NULL };
		GType boxes_resource_graph_type_id;
		boxes_resource_graph_type_id = g_type_register_static (gtk_drawing_area_get_type (), "BoxesResourceGraph", &g_define_type_info, 0);
		g_once_init_leave (&boxes_resource_graph_type_id__volatile, boxes_resource_graph_type_id);
	}
	return boxes_resource_graph_type_id__volatile;
}


static void _vala_boxes_resource_graph_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesResourceGraph * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraph);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	switch (property_id) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		case BOXES_RESOURCE_GRAPH_NPOINTS:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		g_value_set_int (value, boxes_resource_graph_get_npoints (self));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		case BOXES_RESOURCE_GRAPH_YMAX:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		g_value_set_double (value, boxes_resource_graph_get_ymax (self));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 730 "resource-graph.c"
		default:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 736 "resource-graph.c"
	}
}


static void _vala_boxes_resource_graph_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesResourceGraph * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_RESOURCE_GRAPH, BoxesResourceGraph);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
	switch (property_id) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		case BOXES_RESOURCE_GRAPH_NPOINTS:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		boxes_resource_graph_set_npoints (self, g_value_get_int (value));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		case BOXES_RESOURCE_GRAPH_YMAX:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		boxes_resource_graph_set_ymax (self, g_value_get_double (value));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 758 "resource-graph.c"
		default:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/resource-graph.vala"
		break;
#line 764 "resource-graph.c"
	}
}



