/* chart-contents.c generated by valac 0.56.19, the Vala compiler
 * generated from chart-contents.vala, do not modify */

/*
 * Copyright (c) 2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include <gtk/gtk.h>
#include "ft_ui.h"
#include <glib.h>
#include <float.h>
#include <math.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <string.h>

#define FT_CHART_CONTENTS_AXIS_TEXT_OFFSET 8
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

typedef struct _FtChartContents FtChartContents;
typedef struct _FtChartContentsClass FtChartContentsClass;
typedef struct _FtChartContentsPrivate FtChartContentsPrivate;
typedef struct _FtCanvas FtCanvas;
typedef struct _FtCanvasClass FtCanvasClass;
enum  {
	FT_CHART_CONTENTS_0_PROPERTY,
	FT_CHART_CONTENTS_CANVAS_PROPERTY,
	FT_CHART_CONTENTS_X_AXIS_PROPERTY,
	FT_CHART_CONTENTS_Y_AXIS_PROPERTY,
	FT_CHART_CONTENTS_GRID_PROPERTY,
	FT_CHART_CONTENTS_X_ORIGIN_PROPERTY,
	FT_CHART_CONTENTS_Y_ORIGIN_PROPERTY,
	FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY,
	FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY,
	FT_CHART_CONTENTS_NUM_PROPERTIES
};
static GParamSpec* ft_chart_contents_properties[FT_CHART_CONTENTS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _FtChartContents {
	GtkWidget parent_instance;
	FtChartContentsPrivate * priv;
};

struct _FtChartContentsClass {
	GtkWidgetClass parent_class;
};

struct _FtChartContentsPrivate {
	FtCanvas* _canvas;
	FtChartAxis* _x_axis;
	FtChartAxis* _y_axis;
	FtChartGrid* _grid;
	gint _x_origin;
	gint _y_origin;
	gfloat _y_value_from;
	gfloat _y_value_to;
	FtChart* chart;
	gboolean is_empty;
};

static gint FtChartContents_private_offset;
static gpointer ft_chart_contents_parent_class = NULL;

static FtChart* ft_chart_contents_get_chart (FtChartContents* self);
VALA_EXTERN void ft_chart_contents_configure_axes (FtChartContents* self,
                                       gint chart_width,
                                       gint chart_height);
static GtkSizeRequestMode ft_chart_contents_real_get_request_mode (GtkWidget* base);
static void ft_chart_contents_real_measure (GtkWidget* base,
                                     GtkOrientation orientation,
                                     gint for_size,
                                     gint* minimum,
                                     gint* natural,
                                     gint* minimum_baseline,
                                     gint* natural_baseline);
static void ft_chart_contents_real_size_allocate (GtkWidget* base,
                                           gint width,
                                           gint height,
                                           gint baseline);
VALA_EXTERN void ft_normalize_rectangle (GdkRectangle* rect);
VALA_EXTERN void ft_canvas_update_origin (FtCanvas* self);
static void ft_chart_contents_real_snapshot (GtkWidget* base,
                                      GtkSnapshot* snapshot);
static void ft_chart_contents_real_unrealize (GtkWidget* base);
static void ft_chart_contents_real_dispose (GObject* base);
static GObject * ft_chart_contents_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
static void ft_chart_contents_finalize (GObject * obj);
static GType ft_chart_contents_get_type_once (void);
static void _vala_ft_chart_contents_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_ft_chart_contents_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_chart_contents_get_instance_private (FtChartContents* self)
{
	return G_STRUCT_MEMBER_P (self, FtChartContents_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static FtChart*
ft_chart_contents_get_chart (FtChartContents* self)
{
	FtChart* _tmp0_;
	GtkWidget* widget = NULL;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	FtChart* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->chart;
	if (_tmp0_ != NULL) {
		FtChart* _tmp1_;
		_tmp1_ = self->priv->chart;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = gtk_widget_get_parent ((GtkWidget*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	widget = _tmp4_;
	while (TRUE) {
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		_tmp5_ = widget;
		if (!(_tmp5_ != NULL)) {
			break;
		}
		_tmp6_ = widget;
		if (FT_IS_CHART (_tmp6_)) {
			GtkWidget* _tmp7_;
			FtChart* _tmp8_;
			_tmp7_ = widget;
			self->priv->chart = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, FT_TYPE_CHART, FtChart);
			_tmp8_ = self->priv->chart;
			result = _tmp8_;
			_g_object_unref0 (widget);
			return result;
		}
		_tmp9_ = widget;
		_tmp10_ = gtk_widget_get_parent (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (widget);
		widget = _tmp12_;
	}
	result = NULL;
	_g_object_unref0 (widget);
	return result;
}

/**
         * Key function for calculating contents layout.
         *
         * Updates children if needed. It's the place where we compute scale.
         */
void
ft_chart_contents_configure_axes (FtChartContents* self,
                                  gint chart_width,
                                  gint chart_height)
{
	FtChart* chart = NULL;
	FtChart* _tmp0_;
	FtChart* _tmp1_;
	FtChart* _tmp2_;
	FtChart* _tmp3_;
	FtCanvas* _tmp4_;
	gfloat x_value_from = 0.0F;
	gfloat x_value_to = 0.0F;
	gfloat y_value_from = 0.0F;
	gfloat y_value_to = 0.0F;
	FtCanvas* _tmp5_;
	gfloat _tmp6_ = 0.0F;
	gfloat _tmp7_ = 0.0F;
	gfloat _tmp8_ = 0.0F;
	gfloat _tmp9_ = 0.0F;
	FtChartAxis* _tmp10_;
	FtChart* _tmp11_;
	gfloat _tmp12_;
	gfloat _tmp13_;
	FtChartAxis* _tmp14_;
	FtChart* _tmp15_;
	gfloat _tmp16_;
	gfloat _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ft_chart_contents_get_chart (self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	chart = _tmp1_;
	_tmp2_ = chart;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (chart);
		return;
	}
	_tmp3_ = chart;
	_tmp4_ = self->priv->_canvas;
	ft_chart_update_canvas (_tmp3_, _tmp4_);
	_tmp5_ = self->priv->_canvas;
	ft_canvas_calculate_range (_tmp5_, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_);
	x_value_from = _tmp6_;
	x_value_to = _tmp7_;
	y_value_from = _tmp8_;
	y_value_to = _tmp9_;
	if (isfinite (self->priv->_y_value_from)) {
		y_value_from = MIN (y_value_from, self->priv->_y_value_from);
	}
	if (isfinite (self->priv->_y_value_to)) {
		y_value_to = MAX (y_value_to, self->priv->_y_value_to);
	}
	_tmp10_ = self->priv->_x_axis;
	_tmp11_ = chart;
	_tmp12_ = ft_chart_get_x_spacing (_tmp11_);
	_tmp13_ = _tmp12_;
	ft_chart_axis_configure (_tmp10_, x_value_from, x_value_to, _tmp13_, chart_width);
	_tmp14_ = self->priv->_y_axis;
	_tmp15_ = chart;
	_tmp16_ = ft_chart_get_y_spacing (_tmp15_);
	_tmp17_ = _tmp16_;
	ft_chart_axis_configure (_tmp14_, y_value_from, y_value_to, _tmp17_, chart_height);
	gtk_widget_queue_resize ((GtkWidget*) self);
	_g_object_unref0 (chart);
}

static GtkSizeRequestMode
ft_chart_contents_real_get_request_mode (GtkWidget* base)
{
	FtChartContents * self;
	FtChart* chart = NULL;
	FtChart* _tmp0_;
	FtChart* _tmp1_;
	GtkSizeRequestMode _tmp2_ = 0;
	FtChart* _tmp3_;
	GtkSizeRequestMode result;
	self = (FtChartContents*) base;
	_tmp0_ = ft_chart_contents_get_chart (self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	chart = _tmp1_;
	_tmp3_ = chart;
	if (_tmp3_ != NULL) {
		FtChart* _tmp4_;
		FtCanvas* _tmp5_;
		_tmp4_ = chart;
		_tmp5_ = self->priv->_canvas;
		_tmp2_ = ft_chart_get_contents_request_mode (_tmp4_, _tmp5_);
	} else {
		_tmp2_ = GTK_SIZE_REQUEST_CONSTANT_SIZE;
	}
	result = _tmp2_;
	_g_object_unref0 (chart);
	return result;
}

static void
ft_chart_contents_real_measure (GtkWidget* base,
                                GtkOrientation orientation,
                                gint for_size,
                                gint* minimum,
                                gint* natural,
                                gint* minimum_baseline,
                                gint* natural_baseline)
{
	FtChartContents * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	FtChart* chart = NULL;
	FtChart* _tmp0_;
	FtChart* _tmp1_;
	FtChart* _tmp2_;
	self = (FtChartContents*) base;
	_tmp0_ = ft_chart_contents_get_chart (self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	chart = _tmp1_;
	_tmp2_ = chart;
	if (_tmp2_ != NULL) {
		FtChart* _tmp3_;
		FtCanvas* _tmp4_;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		FtChartAxis* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		FtChartAxis* _tmp16_;
		gboolean _tmp17_;
		gboolean _tmp18_;
		_tmp3_ = chart;
		_tmp4_ = self->priv->_canvas;
		ft_chart_measure_canvas (_tmp3_, _tmp4_, orientation, for_size, &_tmp5_, &_tmp6_);
		_vala_minimum = _tmp5_;
		_vala_natural = _tmp6_;
		if (_vala_minimum > _vala_natural) {
			_vala_minimum = _vala_natural;
		}
		_tmp7_ = self->priv->_y_axis;
		_tmp8_ = gtk_widget_get_visible ((GtkWidget*) _tmp7_);
		_tmp9_ = _tmp8_;
		if (_tmp9_) {
			if (orientation == GTK_ORIENTATION_HORIZONTAL) {
				FtChartAxis* _tmp10_;
				gint _tmp11_;
				gint _tmp12_;
				FtChartAxis* _tmp13_;
				gint _tmp14_;
				gint _tmp15_;
				_tmp10_ = self->priv->_y_axis;
				_tmp11_ = ft_chart_axis_get_text_offset (_tmp10_);
				_tmp12_ = _tmp11_;
				_vala_minimum = _vala_minimum + _tmp12_;
				_tmp13_ = self->priv->_y_axis;
				_tmp14_ = ft_chart_axis_get_text_offset (_tmp13_);
				_tmp15_ = _tmp14_;
				_vala_natural = _vala_natural + _tmp15_;
			}
		}
		_tmp16_ = self->priv->_x_axis;
		_tmp17_ = gtk_widget_get_visible ((GtkWidget*) _tmp16_);
		_tmp18_ = _tmp17_;
		if (_tmp18_) {
			if (orientation == GTK_ORIENTATION_VERTICAL) {
				FtChartAxis* _tmp19_;
				FtChartAxis* _tmp20_;
				gint _tmp21_;
				gint _tmp22_;
				FtChartAxis* _tmp23_;
				FtChartAxis* _tmp24_;
				gint _tmp25_;
				gint _tmp26_;
				_tmp19_ = self->priv->_x_axis;
				_tmp20_ = self->priv->_x_axis;
				_tmp21_ = ft_chart_axis_get_text_offset (_tmp20_);
				_tmp22_ = _tmp21_;
				_vala_minimum = _vala_minimum + (_tmp19_->label_height + _tmp22_);
				_tmp23_ = self->priv->_x_axis;
				_tmp24_ = self->priv->_x_axis;
				_tmp25_ = ft_chart_axis_get_text_offset (_tmp24_);
				_tmp26_ = _tmp25_;
				_vala_natural = _vala_natural + (_tmp23_->label_height + _tmp26_);
			}
		}
	} else {
		_vala_minimum = 0;
		_vala_natural = 0;
	}
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	_g_object_unref0 (chart);
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
	if (minimum_baseline) {
		*minimum_baseline = _vala_minimum_baseline;
	}
	if (natural_baseline) {
		*natural_baseline = _vala_natural_baseline;
	}
}

static void
ft_chart_contents_real_size_allocate (GtkWidget* base,
                                      gint width,
                                      gint height,
                                      gint baseline)
{
	FtChartContents * self;
	gint canvas_width = 0;
	gint canvas_height = 0;
	gint _tmp0_ = 0;
	FtChartAxis* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gint _tmp8_ = 0;
	FtChartAxis* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GdkRectangle canvas_working_area = {0};
	FtChart* _tmp19_;
	FtCanvas* _tmp20_;
	GdkRectangle _tmp21_ = {0};
	gboolean _tmp22_ = FALSE;
	GdkRectangle _tmp23_;
	gfloat x_scale = 0.0F;
	GdkRectangle _tmp25_;
	FtChartAxis* _tmp26_;
	gfloat _tmp27_;
	gfloat _tmp28_;
	FtChartAxis* _tmp29_;
	gfloat _tmp30_;
	gfloat _tmp31_;
	gfloat y_scale = 0.0F;
	GdkRectangle _tmp32_;
	FtChartAxis* _tmp33_;
	gfloat _tmp34_;
	gfloat _tmp35_;
	FtChartAxis* _tmp36_;
	gfloat _tmp37_;
	gfloat _tmp38_;
	FtCanvas* _tmp39_;
	FtChartAxis* _tmp40_;
	FtChartAxis* _tmp41_;
	gint canvas_x_offset = 0;
	FtChartAxis* _tmp42_;
	GdkRectangle _tmp43_;
	gint _tmp44_ = 0;
	FtChartAxis* _tmp45_;
	gboolean _tmp46_;
	gboolean _tmp47_;
	GtkAllocation y_axis_allocation = {0};
	FtChartAxis* _tmp49_;
	FtChartAxis* _tmp50_;
	gint _tmp51_;
	gint _tmp52_;
	GtkAllocation _tmp53_ = {0};
	GtkAllocation x_axis_allocation = {0};
	GtkAllocation _tmp54_;
	GtkAllocation _tmp55_;
	FtChartAxis* _tmp56_;
	FtChartAxis* _tmp57_;
	gint _tmp58_;
	gint _tmp59_;
	GtkAllocation _tmp60_ = {0};
	gint _tmp61_ = 0;
	FtChartAxis* _tmp62_;
	gboolean _tmp63_;
	gboolean _tmp64_;
	GtkAllocation _tmp66_;
	GtkAllocation grid_allocation = {0};
	GtkAllocation _tmp67_;
	GtkAllocation _tmp68_;
	FtChartAxis* _tmp69_;
	gint _tmp70_;
	gint _tmp71_;
	GtkAllocation _tmp72_;
	GtkAllocation _tmp73_ = {0};
	GtkAllocation _tmp74_;
	GtkAllocation canvas_allocation = {0};
	GtkAllocation _tmp75_;
	GtkAllocation _tmp76_;
	GtkAllocation _tmp77_ = {0};
	FtCanvas* _tmp78_;
	GtkAllocation _tmp79_;
	FtCanvas* _tmp80_;
	gint _tmp81_;
	gint _tmp82_;
	GtkAllocation _tmp83_;
	FtCanvas* _tmp84_;
	gint _tmp85_;
	gint _tmp86_;
	FtChartAxis* _tmp87_;
	GtkAllocation _tmp88_;
	FtChartAxis* _tmp89_;
	GtkAllocation _tmp90_;
	FtChartGrid* _tmp91_;
	GtkAllocation _tmp92_;
	FtChartGrid* _tmp93_;
	GtkAllocation _tmp94_;
	FtCanvas* _tmp95_;
	GtkAllocation _tmp96_;
	FtChartAxis* _tmp97_;
	gboolean _tmp98_;
	gboolean _tmp99_;
	FtChartAxis* _tmp102_;
	gboolean _tmp103_;
	gboolean _tmp104_;
	FtChartGrid* _tmp107_;
	gboolean _tmp108_;
	gboolean _tmp109_;
	self = (FtChartContents*) base;
	canvas_width = width;
	canvas_height = height;
	_tmp1_ = self->priv->_x_axis;
	_tmp2_ = gtk_widget_get_visible ((GtkWidget*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		FtChartAxis* _tmp4_;
		FtChartAxis* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		_tmp4_ = self->priv->_x_axis;
		_tmp5_ = self->priv->_x_axis;
		_tmp6_ = ft_chart_axis_get_text_offset (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp4_->label_height + _tmp7_;
	} else {
		_tmp0_ = 0;
	}
	canvas_height -= _tmp0_;
	_tmp9_ = self->priv->_y_axis;
	_tmp10_ = gtk_widget_get_visible ((GtkWidget*) _tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		FtChartAxis* _tmp12_;
		FtChartAxis* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		_tmp12_ = self->priv->_y_axis;
		_tmp13_ = self->priv->_y_axis;
		_tmp14_ = ft_chart_axis_get_text_offset (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp8_ = _tmp12_->label_width + _tmp15_;
	} else {
		FtChartAxis* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		_tmp16_ = self->priv->_y_axis;
		_tmp17_ = ft_chart_axis_get_text_offset (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp8_ = _tmp18_;
	}
	canvas_width -= _tmp8_;
	_tmp19_ = self->priv->chart;
	_tmp20_ = self->priv->_canvas;
	ft_chart_measure_working_area (_tmp19_, _tmp20_, canvas_width, canvas_height, &_tmp21_);
	canvas_working_area = _tmp21_;
	ft_normalize_rectangle (&canvas_working_area);
	_tmp23_ = canvas_working_area;
	if (_tmp23_.width == 0) {
		_tmp22_ = TRUE;
	} else {
		GdkRectangle _tmp24_;
		_tmp24_ = canvas_working_area;
		_tmp22_ = _tmp24_.height == 0;
	}
	self->priv->is_empty = _tmp22_;
	if (self->priv->is_empty) {
		return;
	}
	_tmp25_ = canvas_working_area;
	_tmp26_ = self->priv->_x_axis;
	_tmp27_ = ft_chart_axis_get_value_to (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = self->priv->_x_axis;
	_tmp30_ = ft_chart_axis_get_value_from (_tmp29_);
	_tmp31_ = _tmp30_;
	x_scale = (gfloat) (((gdouble) _tmp25_.width) / ((gdouble) (_tmp28_ - _tmp31_)));
	_tmp32_ = canvas_working_area;
	_tmp33_ = self->priv->_y_axis;
	_tmp34_ = ft_chart_axis_get_value_to (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = self->priv->_y_axis;
	_tmp37_ = ft_chart_axis_get_value_from (_tmp36_);
	_tmp38_ = _tmp37_;
	y_scale = (gfloat) (((gdouble) _tmp32_.height) / ((gdouble) (_tmp35_ - _tmp38_)));
	_tmp39_ = self->priv->_canvas;
	ft_canvas_set_scale (_tmp39_, x_scale, y_scale);
	_tmp40_ = self->priv->_x_axis;
	ft_chart_axis_set_scale (_tmp40_, x_scale);
	_tmp41_ = self->priv->_y_axis;
	ft_chart_axis_set_scale (_tmp41_, y_scale);
	_tmp42_ = self->priv->_x_axis;
	_tmp43_ = canvas_working_area;
	canvas_x_offset = (_tmp42_->label_width / 2) - _tmp43_.x;
	_tmp45_ = self->priv->_y_axis;
	_tmp46_ = gtk_widget_get_visible ((GtkWidget*) _tmp45_);
	_tmp47_ = _tmp46_;
	if (_tmp47_) {
		_tmp44_ = 0;
	} else {
		FtChartAxis* _tmp48_;
		_tmp48_ = self->priv->_y_axis;
		_tmp44_ = -_tmp48_->label_width;
	}
	_tmp49_ = self->priv->_y_axis;
	_tmp50_ = self->priv->_y_axis;
	_tmp51_ = ft_chart_axis_get_text_offset (_tmp50_);
	_tmp52_ = _tmp51_;
	memset (&_tmp53_, 0, sizeof (GtkAllocation));
	_tmp53_.x = _tmp44_;
	_tmp53_.y = 0;
	_tmp53_.width = _tmp49_->label_width + _tmp52_;
	_tmp53_.height = height;
	y_axis_allocation = _tmp53_;
	_tmp54_ = y_axis_allocation;
	_tmp55_ = y_axis_allocation;
	_tmp56_ = self->priv->_x_axis;
	_tmp57_ = self->priv->_x_axis;
	_tmp58_ = ft_chart_axis_get_text_offset (_tmp57_);
	_tmp59_ = _tmp58_;
	memset (&_tmp60_, 0, sizeof (GtkAllocation));
	_tmp60_.x = (_tmp54_.x + _tmp55_.width) + MAX (0 - canvas_x_offset, 0);
	_tmp60_.height = _tmp56_->label_height + _tmp59_;
	x_axis_allocation = _tmp60_;
	_tmp62_ = self->priv->_x_axis;
	_tmp63_ = gtk_widget_get_visible ((GtkWidget*) _tmp62_);
	_tmp64_ = _tmp63_;
	if (_tmp64_) {
		GtkAllocation _tmp65_;
		_tmp65_ = x_axis_allocation;
		_tmp61_ = _tmp65_.height;
	} else {
		_tmp61_ = 0;
	}
	x_axis_allocation.y = height - _tmp61_;
	_tmp66_ = x_axis_allocation;
	x_axis_allocation.width = width - _tmp66_.x;
	_tmp67_ = y_axis_allocation;
	_tmp68_ = y_axis_allocation;
	_tmp69_ = self->priv->_y_axis;
	_tmp70_ = ft_chart_axis_get_text_offset (_tmp69_);
	_tmp71_ = _tmp70_;
	_tmp72_ = x_axis_allocation;
	memset (&_tmp73_, 0, sizeof (GtkAllocation));
	_tmp73_.x = (_tmp67_.x + _tmp68_.width) - _tmp71_;
	_tmp73_.y = 0;
	_tmp73_.height = height - _tmp72_.y;
	grid_allocation = _tmp73_;
	_tmp74_ = grid_allocation;
	grid_allocation.width = width - _tmp74_.x;
	_tmp75_ = y_axis_allocation;
	_tmp76_ = y_axis_allocation;
	memset (&_tmp77_, 0, sizeof (GtkAllocation));
	_tmp77_.x = (_tmp75_.x + _tmp76_.width) + MAX (canvas_x_offset, 0);
	_tmp77_.y = 0;
	_tmp77_.width = canvas_width;
	_tmp77_.height = canvas_height;
	canvas_allocation = _tmp77_;
	_tmp78_ = self->priv->_canvas;
	ft_canvas_update_origin (_tmp78_);
	_tmp79_ = canvas_allocation;
	_tmp80_ = self->priv->_canvas;
	_tmp81_ = ft_canvas_get_x_origin (_tmp80_);
	_tmp82_ = _tmp81_;
	self->priv->_x_origin = _tmp79_.x + _tmp82_;
	_tmp83_ = canvas_allocation;
	_tmp84_ = self->priv->_canvas;
	_tmp85_ = ft_canvas_get_y_origin (_tmp84_);
	_tmp86_ = _tmp85_;
	self->priv->_y_origin = _tmp83_.y + _tmp86_;
	_tmp87_ = self->priv->_x_axis;
	_tmp88_ = x_axis_allocation;
	ft_chart_axis_set_origin (_tmp87_, self->priv->_x_origin - _tmp88_.x);
	_tmp89_ = self->priv->_y_axis;
	_tmp90_ = y_axis_allocation;
	ft_chart_axis_set_origin (_tmp89_, self->priv->_y_origin - _tmp90_.y);
	_tmp91_ = self->priv->_grid;
	_tmp92_ = grid_allocation;
	ft_chart_grid_set_x_origin (_tmp91_, self->priv->_x_origin - _tmp92_.x);
	_tmp93_ = self->priv->_grid;
	_tmp94_ = grid_allocation;
	ft_chart_grid_set_y_origin (_tmp93_, self->priv->_y_origin - _tmp94_.y);
	_tmp95_ = self->priv->_canvas;
	_tmp96_ = canvas_allocation;
	gtk_widget_size_allocate ((GtkWidget*) _tmp95_, &_tmp96_, -1);
	_tmp97_ = self->priv->_x_axis;
	_tmp98_ = gtk_widget_get_visible ((GtkWidget*) _tmp97_);
	_tmp99_ = _tmp98_;
	if (_tmp99_) {
		FtChartAxis* _tmp100_;
		GtkAllocation _tmp101_;
		_tmp100_ = self->priv->_x_axis;
		_tmp101_ = x_axis_allocation;
		gtk_widget_size_allocate ((GtkWidget*) _tmp100_, &_tmp101_, -1);
	}
	_tmp102_ = self->priv->_y_axis;
	_tmp103_ = gtk_widget_get_visible ((GtkWidget*) _tmp102_);
	_tmp104_ = _tmp103_;
	if (_tmp104_) {
		FtChartAxis* _tmp105_;
		GtkAllocation _tmp106_;
		_tmp105_ = self->priv->_y_axis;
		_tmp106_ = y_axis_allocation;
		gtk_widget_size_allocate ((GtkWidget*) _tmp105_, &_tmp106_, -1);
	}
	_tmp107_ = self->priv->_grid;
	_tmp108_ = gtk_widget_get_visible ((GtkWidget*) _tmp107_);
	_tmp109_ = _tmp108_;
	if (_tmp109_) {
		FtChartGrid* _tmp110_;
		GtkAllocation _tmp111_;
		_tmp110_ = self->priv->_grid;
		_tmp111_ = grid_allocation;
		gtk_widget_size_allocate ((GtkWidget*) _tmp110_, &_tmp111_, -1);
	}
}

static void
ft_chart_contents_real_snapshot (GtkWidget* base,
                                 GtkSnapshot* snapshot)
{
	FtChartContents * self;
	self = (FtChartContents*) base;
	g_return_if_fail (snapshot != NULL);
	if (self->priv->is_empty) {
		return;
	}
	{
		GtkWidget* child = NULL;
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		child = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkWidget* _tmp6_;
				GtkWidget* _tmp7_;
				gboolean _tmp8_;
				gboolean _tmp9_;
				if (!_tmp2_) {
					GtkWidget* _tmp3_;
					GtkWidget* _tmp4_;
					GtkWidget* _tmp5_;
					_tmp3_ = child;
					_tmp4_ = gtk_widget_get_next_sibling (_tmp3_);
					_tmp5_ = _g_object_ref0 (_tmp4_);
					_g_object_unref0 (child);
					child = _tmp5_;
				}
				_tmp2_ = FALSE;
				_tmp6_ = child;
				if (!(_tmp6_ != NULL)) {
					break;
				}
				_tmp7_ = child;
				_tmp8_ = gtk_widget_get_visible (_tmp7_);
				_tmp9_ = _tmp8_;
				if (_tmp9_) {
					GtkWidget* _tmp10_;
					_tmp10_ = child;
					gtk_widget_snapshot_child ((GtkWidget*) self, _tmp10_, snapshot);
				}
			}
		}
		_g_object_unref0 (child);
	}
}

static void
ft_chart_contents_real_unrealize (GtkWidget* base)
{
	FtChartContents * self;
	self = (FtChartContents*) base;
	GTK_WIDGET_CLASS (ft_chart_contents_parent_class)->unrealize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	self->priv->chart = NULL;
}

static void
ft_chart_contents_real_dispose (GObject* base)
{
	FtChartContents * self;
	FtChartGrid* _tmp0_;
	FtChartAxis* _tmp2_;
	FtChartAxis* _tmp4_;
	FtCanvas* _tmp6_;
	self = (FtChartContents*) base;
	self->priv->chart = NULL;
	_tmp0_ = self->priv->_grid;
	if (_tmp0_ != NULL) {
		FtChartGrid* _tmp1_;
		_tmp1_ = self->priv->_grid;
		gtk_widget_unparent ((GtkWidget*) _tmp1_);
		_g_object_unref0 (self->priv->_grid);
		self->priv->_grid = NULL;
	}
	_tmp2_ = self->priv->_x_axis;
	if (_tmp2_ != NULL) {
		FtChartAxis* _tmp3_;
		_tmp3_ = self->priv->_x_axis;
		gtk_widget_unparent ((GtkWidget*) _tmp3_);
		_g_object_unref0 (self->priv->_x_axis);
		self->priv->_x_axis = NULL;
	}
	_tmp4_ = self->priv->_y_axis;
	if (_tmp4_ != NULL) {
		FtChartAxis* _tmp5_;
		_tmp5_ = self->priv->_y_axis;
		gtk_widget_unparent ((GtkWidget*) _tmp5_);
		_g_object_unref0 (self->priv->_y_axis);
		self->priv->_y_axis = NULL;
	}
	_tmp6_ = self->priv->_canvas;
	if (_tmp6_ != NULL) {
		FtCanvas* _tmp7_;
		_tmp7_ = self->priv->_canvas;
		gtk_widget_unparent ((GtkWidget*) _tmp7_);
		_g_object_unref0 (self->priv->_canvas);
		self->priv->_canvas = NULL;
	}
	G_OBJECT_CLASS (ft_chart_contents_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

FtChartContents*
ft_chart_contents_construct (GType object_type)
{
	FtChartContents * self = NULL;
	self = (FtChartContents*) g_object_new (object_type, NULL);
	return self;
}

FtChartContents*
ft_chart_contents_new (void)
{
	return ft_chart_contents_construct (FT_TYPE_CHART_CONTENTS);
}

FtCanvas*
ft_chart_contents_get_canvas (FtChartContents* self)
{
	FtCanvas* result;
	FtCanvas* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_canvas;
	result = _tmp0_;
	return result;
}

FtChartAxis*
ft_chart_contents_get_x_axis (FtChartContents* self)
{
	FtChartAxis* result;
	FtChartAxis* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_x_axis;
	result = _tmp0_;
	return result;
}

FtChartAxis*
ft_chart_contents_get_y_axis (FtChartContents* self)
{
	FtChartAxis* result;
	FtChartAxis* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_y_axis;
	result = _tmp0_;
	return result;
}

FtChartGrid*
ft_chart_contents_get_grid (FtChartContents* self)
{
	FtChartGrid* result;
	FtChartGrid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_grid;
	result = _tmp0_;
	return result;
}

gint
ft_chart_contents_get_x_origin (FtChartContents* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_x_origin;
	return result;
}

gint
ft_chart_contents_get_y_origin (FtChartContents* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_y_origin;
	return result;
}

gfloat
ft_chart_contents_get_y_value_from (FtChartContents* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_y_value_from;
	return result;
}

void
ft_chart_contents_set_y_value_from (FtChartContents* self,
                                    gfloat value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_y_value_from == value) {
		return;
	}
	self->priv->_y_value_from = value;
	gtk_widget_queue_resize ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY]);
}

gfloat
ft_chart_contents_get_y_value_to (FtChartContents* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_y_value_to;
	return result;
}

void
ft_chart_contents_set_y_value_to (FtChartContents* self,
                                  gfloat value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_y_value_to == value) {
		return;
	}
	self->priv->_y_value_to = value;
	gtk_widget_queue_resize ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY]);
}

static GObject *
ft_chart_contents_constructor (GType type,
                               guint n_construct_properties,
                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtChartContents * self;
	FtCanvas* _tmp0_;
	FtChartAxis* _tmp1_;
	FtChartAxis* _tmp2_;
	FtChartAxis* _tmp3_;
	FtChartAxis* _tmp4_;
	FtChartAxis* _tmp5_;
	FtChartAxis* _tmp6_;
	FtChartAxis* _tmp7_;
	FtChartGrid* _tmp8_;
	FtChartGrid* _tmp9_;
	FtChartAxis* _tmp10_;
	FtChartAxis* _tmp11_;
	FtCanvas* _tmp12_;
	parent_class = G_OBJECT_CLASS (ft_chart_contents_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_CHART_CONTENTS, FtChartContents);
	g_object_set ((GtkAccessible*) self, "accessible-role", GTK_ACCESSIBLE_ROLE_IMG, NULL);
	gtk_widget_add_css_class ((GtkWidget*) self, "contents");
	_tmp0_ = ft_canvas_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->_canvas);
	self->priv->_canvas = _tmp0_;
	_tmp1_ = ft_chart_axis_new (GTK_ORIENTATION_HORIZONTAL, NULL, NULL, NULL);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_x_axis);
	self->priv->_x_axis = _tmp1_;
	_tmp2_ = self->priv->_x_axis;
	ft_chart_axis_set_text_offset (_tmp2_, FT_CHART_CONTENTS_AXIS_TEXT_OFFSET);
	_tmp3_ = ft_chart_axis_new (GTK_ORIENTATION_VERTICAL, NULL, NULL, NULL);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->_y_axis);
	self->priv->_y_axis = _tmp3_;
	_tmp4_ = self->priv->_y_axis;
	ft_chart_axis_set_text_offset (_tmp4_, FT_CHART_CONTENTS_AXIS_TEXT_OFFSET);
	_tmp5_ = ft_chart_contents_get_x_axis (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_y_axis;
	_tmp8_ = ft_chart_grid_new (_tmp6_, _tmp7_);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->_grid);
	self->priv->_grid = _tmp8_;
	_tmp9_ = self->priv->_grid;
	gtk_widget_insert_before ((GtkWidget*) _tmp9_, (GtkWidget*) self, NULL);
	_tmp10_ = self->priv->_x_axis;
	gtk_widget_insert_before ((GtkWidget*) _tmp10_, (GtkWidget*) self, NULL);
	_tmp11_ = self->priv->_y_axis;
	gtk_widget_insert_before ((GtkWidget*) _tmp11_, (GtkWidget*) self, NULL);
	_tmp12_ = self->priv->_canvas;
	gtk_widget_insert_before ((GtkWidget*) _tmp12_, (GtkWidget*) self, NULL);
	return obj;
}

static void
ft_chart_contents_class_init (FtChartContentsClass * klass,
                              gpointer klass_data)
{
	ft_chart_contents_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtChartContents_private_offset);
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) ft_chart_contents_real_get_request_mode;
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) ft_chart_contents_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) ft_chart_contents_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) ft_chart_contents_real_snapshot;
	((GtkWidgetClass *) klass)->unrealize = (void (*) (GtkWidget*)) ft_chart_contents_real_unrealize;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_chart_contents_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_chart_contents_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_chart_contents_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_chart_contents_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_chart_contents_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_CANVAS_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_CANVAS_PROPERTY] = g_param_spec_object ("canvas", "canvas", "canvas", FT_TYPE_CANVAS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_X_AXIS_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_X_AXIS_PROPERTY] = g_param_spec_object ("x-axis", "x-axis", "x-axis", FT_TYPE_CHART_AXIS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_Y_AXIS_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_AXIS_PROPERTY] = g_param_spec_object ("y-axis", "y-axis", "y-axis", FT_TYPE_CHART_AXIS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_GRID_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_GRID_PROPERTY] = g_param_spec_object ("grid", "grid", "grid", FT_TYPE_CHART_GRID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_X_ORIGIN_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_X_ORIGIN_PROPERTY] = g_param_spec_int ("x-origin", "x-origin", "x-origin", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_Y_ORIGIN_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_ORIGIN_PROPERTY] = g_param_spec_int ("y-origin", "y-origin", "y-origin", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY] = g_param_spec_float ("y-value-from", "y-value-from", "y-value-from", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY, ft_chart_contents_properties[FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY] = g_param_spec_float ("y-value-to", "y-value-to", "y-value-to", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_chart_contents_instance_init (FtChartContents * self,
                                 gpointer klass)
{
	self->priv = ft_chart_contents_get_instance_private (self);
	self->priv->_canvas = NULL;
	self->priv->_x_axis = NULL;
	self->priv->_y_axis = NULL;
	self->priv->_grid = NULL;
	self->priv->_x_origin = 0;
	self->priv->_y_origin = 0;
	self->priv->_y_value_from = NAN;
	self->priv->_y_value_to = NAN;
	self->priv->chart = NULL;
	self->priv->is_empty = TRUE;
}

static void
ft_chart_contents_finalize (GObject * obj)
{
	FtChartContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_CHART_CONTENTS, FtChartContents);
	_g_object_unref0 (self->priv->_canvas);
	_g_object_unref0 (self->priv->_x_axis);
	_g_object_unref0 (self->priv->_y_axis);
	_g_object_unref0 (self->priv->_grid);
	G_OBJECT_CLASS (ft_chart_contents_parent_class)->finalize (obj);
}

/**
     * Extra wrapper around canvas for displaying axes and grid over charts content.
     */
static GType
ft_chart_contents_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtChartContentsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_chart_contents_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtChartContents), 0, (GInstanceInitFunc) ft_chart_contents_instance_init, NULL };
	GType ft_chart_contents_type_id;
	ft_chart_contents_type_id = g_type_register_static (gtk_widget_get_type (), "FtChartContents", &g_define_type_info, 0);
	FtChartContents_private_offset = g_type_add_instance_private (ft_chart_contents_type_id, sizeof (FtChartContentsPrivate));
	return ft_chart_contents_type_id;
}

GType
ft_chart_contents_get_type (void)
{
	static volatile gsize ft_chart_contents_type_id__once = 0;
	if (g_once_init_enter (&ft_chart_contents_type_id__once)) {
		GType ft_chart_contents_type_id;
		ft_chart_contents_type_id = ft_chart_contents_get_type_once ();
		g_once_init_leave (&ft_chart_contents_type_id__once, ft_chart_contents_type_id);
	}
	return ft_chart_contents_type_id__once;
}

static void
_vala_ft_chart_contents_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	FtChartContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_CHART_CONTENTS, FtChartContents);
	switch (property_id) {
		case FT_CHART_CONTENTS_CANVAS_PROPERTY:
		g_value_set_object (value, ft_chart_contents_get_canvas (self));
		break;
		case FT_CHART_CONTENTS_X_AXIS_PROPERTY:
		g_value_set_object (value, ft_chart_contents_get_x_axis (self));
		break;
		case FT_CHART_CONTENTS_Y_AXIS_PROPERTY:
		g_value_set_object (value, ft_chart_contents_get_y_axis (self));
		break;
		case FT_CHART_CONTENTS_GRID_PROPERTY:
		g_value_set_object (value, ft_chart_contents_get_grid (self));
		break;
		case FT_CHART_CONTENTS_X_ORIGIN_PROPERTY:
		g_value_set_int (value, ft_chart_contents_get_x_origin (self));
		break;
		case FT_CHART_CONTENTS_Y_ORIGIN_PROPERTY:
		g_value_set_int (value, ft_chart_contents_get_y_origin (self));
		break;
		case FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY:
		g_value_set_float (value, ft_chart_contents_get_y_value_from (self));
		break;
		case FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY:
		g_value_set_float (value, ft_chart_contents_get_y_value_to (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_chart_contents_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	FtChartContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_CHART_CONTENTS, FtChartContents);
	switch (property_id) {
		case FT_CHART_CONTENTS_Y_VALUE_FROM_PROPERTY:
		ft_chart_contents_set_y_value_from (self, g_value_get_float (value));
		break;
		case FT_CHART_CONTENTS_Y_VALUE_TO_PROPERTY:
		ft_chart_contents_set_y_value_to (self, g_value_get_float (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

