iPDC-suite/iPDC/lib/liblivechart.so.p/axis.c

1796 lines
48 KiB
C

/* axis.c generated by valac 0.56.0, the Vala compiler
* generated from axis.vala, do not modify */
#include "livechart.h"
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <gobject/gvaluecollector.h>
#include <string.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#define _live_chart_labels_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_labels_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _LiveChartParamSpecXAxis LiveChartParamSpecXAxis;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _LiveChartParamSpecYAxis LiveChartParamSpecYAxis;
struct _LiveChartXAxisPrivate {
gfloat _tick_interval;
gfloat _tick_length;
gboolean _visible;
};
struct _LiveChartParamSpecXAxis {
GParamSpec parent_instance;
};
struct _LiveChartYAxisPrivate {
LiveChartBounds* bounds;
gdouble ratio;
gfloat _ratio_threshold;
gfloat _tick_interval;
gboolean _visible;
gfloat _tick_length;
gchar* _unit;
};
struct _LiveChartParamSpecYAxis {
GParamSpec parent_instance;
};
static gint LiveChartXAxis_private_offset;
static gpointer live_chart_xaxis_parent_class = NULL;
static gint LiveChartYAxis_private_offset;
static gpointer live_chart_yaxis_parent_class = NULL;
static void live_chart_xaxis_finalize (LiveChartXAxis * obj);
static GType live_chart_xaxis_get_type_once (void);
static gfloat* _float_dup (gfloat* self);
static void __lambda5_ (LiveChartYAxis* self);
static void ___lambda5__g_object_notify (GObject* _sender,
GParamSpec* pspec,
gpointer self);
static void live_chart_yaxis_finalize (LiveChartYAxis * obj);
static GType live_chart_yaxis_get_type_once (void);
static inline gpointer
live_chart_xaxis_get_instance_private (LiveChartXAxis* self)
{
return G_STRUCT_MEMBER_P (self, LiveChartXAxis_private_offset);
}
LiveChartXAxis*
live_chart_xaxis_construct (GType object_type)
{
LiveChartXAxis* self = NULL;
LiveChartPath* _tmp0_;
GdkRGBA _tmp1_ = {0};
LiveChartPath* _tmp2_;
GdkRGBA _tmp3_ = {0};
#line 12 "../src/axis.vala"
self = (LiveChartXAxis*) g_type_create_instance (object_type);
#line 13 "../src/axis.vala"
_tmp0_ = self->axis;
#line 13 "../src/axis.vala"
_tmp1_.red = 0.5;
#line 13 "../src/axis.vala"
_tmp1_.green = 0.5;
#line 13 "../src/axis.vala"
_tmp1_.blue = 0.5;
#line 13 "../src/axis.vala"
_tmp1_.alpha = 0.5;
#line 13 "../src/axis.vala"
live_chart_path_set_color (_tmp0_, &_tmp1_);
#line 14 "../src/axis.vala"
_tmp2_ = self->lines;
#line 14 "../src/axis.vala"
_tmp3_.red = 0.5;
#line 14 "../src/axis.vala"
_tmp3_.green = 0.5;
#line 14 "../src/axis.vala"
_tmp3_.blue = 0.5;
#line 14 "../src/axis.vala"
_tmp3_.alpha = 0.2;
#line 14 "../src/axis.vala"
live_chart_path_set_color (_tmp2_, &_tmp3_);
#line 12 "../src/axis.vala"
return self;
#line 103 "axis.c"
}
LiveChartXAxis*
live_chart_xaxis_new (void)
{
#line 12 "../src/axis.vala"
return live_chart_xaxis_construct (LIVE_CHART_TYPE_XAXIS);
#line 111 "axis.c"
}
gdouble
live_chart_xaxis_get_ratio (LiveChartXAxis* self)
{
gfloat _tmp0_;
gfloat _tmp1_;
gdouble result;
#line 17 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0);
#line 18 "../src/axis.vala"
_tmp0_ = self->priv->_tick_length;
#line 18 "../src/axis.vala"
_tmp1_ = self->priv->_tick_interval;
#line 18 "../src/axis.vala"
result = (gdouble) (_tmp0_ / _tmp1_);
#line 18 "../src/axis.vala"
return result;
#line 130 "axis.c"
}
gfloat
live_chart_xaxis_get_tick_interval (LiveChartXAxis* self)
{
gfloat result;
#line 5 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0F);
#line 5 "../src/axis.vala"
result = self->priv->_tick_interval;
#line 5 "../src/axis.vala"
return result;
#line 143 "axis.c"
}
void
live_chart_xaxis_set_tick_interval (LiveChartXAxis* self,
gfloat value)
{
#line 5 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 5 "../src/axis.vala"
self->priv->_tick_interval = value;
#line 154 "axis.c"
}
gfloat
live_chart_xaxis_get_tick_length (LiveChartXAxis* self)
{
gfloat result;
#line 6 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0F);
#line 6 "../src/axis.vala"
result = self->priv->_tick_length;
#line 6 "../src/axis.vala"
return result;
#line 167 "axis.c"
}
void
live_chart_xaxis_set_tick_length (LiveChartXAxis* self,
gfloat value)
{
#line 6 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 6 "../src/axis.vala"
self->priv->_tick_length = value;
#line 178 "axis.c"
}
gboolean
live_chart_xaxis_get_visible (LiveChartXAxis* self)
{
gboolean result;
#line 7 "../src/axis.vala"
g_return_val_if_fail (self != NULL, FALSE);
#line 7 "../src/axis.vala"
result = self->priv->_visible;
#line 7 "../src/axis.vala"
return result;
#line 191 "axis.c"
}
void
live_chart_xaxis_set_visible (LiveChartXAxis* self,
gboolean value)
{
#line 7 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 7 "../src/axis.vala"
self->priv->_visible = value;
#line 202 "axis.c"
}
static void
live_chart_value_xaxis_init (GValue* value)
{
#line 3 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 210 "axis.c"
}
static void
live_chart_value_xaxis_free_value (GValue* value)
{
#line 3 "../src/axis.vala"
if (value->data[0].v_pointer) {
#line 3 "../src/axis.vala"
live_chart_xaxis_unref (value->data[0].v_pointer);
#line 220 "axis.c"
}
}
static void
live_chart_value_xaxis_copy_value (const GValue* src_value,
GValue* dest_value)
{
#line 3 "../src/axis.vala"
if (src_value->data[0].v_pointer) {
#line 3 "../src/axis.vala"
dest_value->data[0].v_pointer = live_chart_xaxis_ref (src_value->data[0].v_pointer);
#line 232 "axis.c"
} else {
#line 3 "../src/axis.vala"
dest_value->data[0].v_pointer = NULL;
#line 236 "axis.c"
}
}
static gpointer
live_chart_value_xaxis_peek_pointer (const GValue* value)
{
#line 3 "../src/axis.vala"
return value->data[0].v_pointer;
#line 245 "axis.c"
}
static gchar*
live_chart_value_xaxis_collect_value (GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
#line 3 "../src/axis.vala"
if (collect_values[0].v_pointer) {
#line 256 "axis.c"
LiveChartXAxis * object;
object = collect_values[0].v_pointer;
#line 3 "../src/axis.vala"
if (object->parent_instance.g_class == NULL) {
#line 3 "../src/axis.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 263 "axis.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 3 "../src/axis.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 267 "axis.c"
}
#line 3 "../src/axis.vala"
value->data[0].v_pointer = live_chart_xaxis_ref (object);
#line 271 "axis.c"
} else {
#line 3 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 275 "axis.c"
}
#line 3 "../src/axis.vala"
return NULL;
#line 279 "axis.c"
}
static gchar*
live_chart_value_xaxis_lcopy_value (const GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
LiveChartXAxis ** object_p;
object_p = collect_values[0].v_pointer;
#line 3 "../src/axis.vala"
if (!object_p) {
#line 3 "../src/axis.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 294 "axis.c"
}
#line 3 "../src/axis.vala"
if (!value->data[0].v_pointer) {
#line 3 "../src/axis.vala"
*object_p = NULL;
#line 300 "axis.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 3 "../src/axis.vala"
*object_p = value->data[0].v_pointer;
#line 304 "axis.c"
} else {
#line 3 "../src/axis.vala"
*object_p = live_chart_xaxis_ref (value->data[0].v_pointer);
#line 308 "axis.c"
}
#line 3 "../src/axis.vala"
return NULL;
#line 312 "axis.c"
}
GParamSpec*
live_chart_param_spec_xaxis (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags)
{
LiveChartParamSpecXAxis* spec;
#line 3 "../src/axis.vala"
g_return_val_if_fail (g_type_is_a (object_type, LIVE_CHART_TYPE_XAXIS), NULL);
#line 3 "../src/axis.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 3 "../src/axis.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 3 "../src/axis.vala"
return G_PARAM_SPEC (spec);
#line 331 "axis.c"
}
gpointer
live_chart_value_get_xaxis (const GValue* value)
{
#line 3 "../src/axis.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_XAXIS), NULL);
#line 3 "../src/axis.vala"
return value->data[0].v_pointer;
#line 341 "axis.c"
}
void
live_chart_value_set_xaxis (GValue* value,
gpointer v_object)
{
LiveChartXAxis * old;
#line 3 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_XAXIS));
#line 3 "../src/axis.vala"
old = value->data[0].v_pointer;
#line 3 "../src/axis.vala"
if (v_object) {
#line 3 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_XAXIS));
#line 3 "../src/axis.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 3 "../src/axis.vala"
value->data[0].v_pointer = v_object;
#line 3 "../src/axis.vala"
live_chart_xaxis_ref (value->data[0].v_pointer);
#line 363 "axis.c"
} else {
#line 3 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 367 "axis.c"
}
#line 3 "../src/axis.vala"
if (old) {
#line 3 "../src/axis.vala"
live_chart_xaxis_unref (old);
#line 373 "axis.c"
}
}
void
live_chart_value_take_xaxis (GValue* value,
gpointer v_object)
{
LiveChartXAxis * old;
#line 3 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_XAXIS));
#line 3 "../src/axis.vala"
old = value->data[0].v_pointer;
#line 3 "../src/axis.vala"
if (v_object) {
#line 3 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_XAXIS));
#line 3 "../src/axis.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 3 "../src/axis.vala"
value->data[0].v_pointer = v_object;
#line 394 "axis.c"
} else {
#line 3 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 398 "axis.c"
}
#line 3 "../src/axis.vala"
if (old) {
#line 3 "../src/axis.vala"
live_chart_xaxis_unref (old);
#line 404 "axis.c"
}
}
static void
live_chart_xaxis_class_init (LiveChartXAxisClass * klass,
gpointer klass_data)
{
#line 3 "../src/axis.vala"
live_chart_xaxis_parent_class = g_type_class_peek_parent (klass);
#line 3 "../src/axis.vala"
((LiveChartXAxisClass *) klass)->finalize = live_chart_xaxis_finalize;
#line 3 "../src/axis.vala"
g_type_class_adjust_private_offset (klass, &LiveChartXAxis_private_offset);
#line 418 "axis.c"
}
static void
live_chart_xaxis_instance_init (LiveChartXAxis * self,
gpointer klass)
{
LiveChartLabels* _tmp0_;
GdkRGBA _tmp1_ = {0};
LiveChartPath* _tmp2_;
GdkRGBA _tmp3_ = {0};
LiveChartPath* _tmp4_;
#line 3 "../src/axis.vala"
self->priv = live_chart_xaxis_get_instance_private (self);
#line 5 "../src/axis.vala"
self->priv->_tick_interval = (gfloat) 10;
#line 6 "../src/axis.vala"
self->priv->_tick_length = (gfloat) 60;
#line 7 "../src/axis.vala"
self->priv->_visible = TRUE;
#line 8 "../src/axis.vala"
_tmp0_ = live_chart_labels_new ();
#line 8 "../src/axis.vala"
self->labels = _tmp0_;
#line 9 "../src/axis.vala"
_tmp1_.red = 1.0;
#line 9 "../src/axis.vala"
_tmp1_.green = 1.0;
#line 9 "../src/axis.vala"
_tmp1_.blue = 1.0;
#line 9 "../src/axis.vala"
_tmp1_.alpha = 1.0;
#line 9 "../src/axis.vala"
_tmp2_ = live_chart_path_new (0.5, &_tmp1_, TRUE, NULL);
#line 9 "../src/axis.vala"
self->axis = _tmp2_;
#line 10 "../src/axis.vala"
_tmp3_.red = 1.0;
#line 10 "../src/axis.vala"
_tmp3_.green = 1.0;
#line 10 "../src/axis.vala"
_tmp3_.blue = 1.0;
#line 10 "../src/axis.vala"
_tmp3_.alpha = 1.0;
#line 10 "../src/axis.vala"
_tmp4_ = live_chart_path_new (0.5, &_tmp3_, TRUE, NULL);
#line 10 "../src/axis.vala"
self->lines = _tmp4_;
#line 3 "../src/axis.vala"
self->ref_count = 1;
#line 468 "axis.c"
}
static void
live_chart_xaxis_finalize (LiveChartXAxis * obj)
{
LiveChartXAxis * self;
#line 3 "../src/axis.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_XAXIS, LiveChartXAxis);
#line 3 "../src/axis.vala"
g_signal_handlers_destroy (self);
#line 8 "../src/axis.vala"
_live_chart_labels_unref0 (self->labels);
#line 9 "../src/axis.vala"
_g_object_unref0 (self->axis);
#line 10 "../src/axis.vala"
_g_object_unref0 (self->lines);
#line 485 "axis.c"
}
static GType
live_chart_xaxis_get_type_once (void)
{
static const GTypeValueTable g_define_type_value_table = { live_chart_value_xaxis_init, live_chart_value_xaxis_free_value, live_chart_value_xaxis_copy_value, live_chart_value_xaxis_peek_pointer, "p", live_chart_value_xaxis_collect_value, "p", live_chart_value_xaxis_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (LiveChartXAxisClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_xaxis_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartXAxis), 0, (GInstanceInitFunc) live_chart_xaxis_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType live_chart_xaxis_type_id;
live_chart_xaxis_type_id = g_type_register_fundamental (g_type_fundamental_next (), "LiveChartXAxis", &g_define_type_info, &g_define_type_fundamental_info, 0);
LiveChartXAxis_private_offset = g_type_add_instance_private (live_chart_xaxis_type_id, sizeof (LiveChartXAxisPrivate));
return live_chart_xaxis_type_id;
}
GType
live_chart_xaxis_get_type (void)
{
static volatile gsize live_chart_xaxis_type_id__once = 0;
if (g_once_init_enter (&live_chart_xaxis_type_id__once)) {
GType live_chart_xaxis_type_id;
live_chart_xaxis_type_id = live_chart_xaxis_get_type_once ();
g_once_init_leave (&live_chart_xaxis_type_id__once, live_chart_xaxis_type_id);
}
return live_chart_xaxis_type_id__once;
}
gpointer
live_chart_xaxis_ref (gpointer instance)
{
LiveChartXAxis * self;
self = instance;
#line 3 "../src/axis.vala"
g_atomic_int_inc (&self->ref_count);
#line 3 "../src/axis.vala"
return instance;
#line 521 "axis.c"
}
void
live_chart_xaxis_unref (gpointer instance)
{
LiveChartXAxis * self;
self = instance;
#line 3 "../src/axis.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 3 "../src/axis.vala"
LIVE_CHART_XAXIS_GET_CLASS (self)->finalize (self);
#line 3 "../src/axis.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 535 "axis.c"
}
}
static gfloat*
_float_dup (gfloat* self)
{
gfloat* dup;
#line 25 "../src/axis.vala"
dup = g_new0 (gfloat, 1);
#line 25 "../src/axis.vala"
memcpy (dup, self, sizeof (gfloat));
#line 25 "../src/axis.vala"
return dup;
#line 549 "axis.c"
}
void
live_chart_ticks_init (LiveChartTicks *self)
{
GeeArrayList* _tmp0_;
#line 24 "../src/axis.vala"
memset (self, 0, sizeof (LiveChartTicks));
#line 25 "../src/axis.vala"
_tmp0_ = gee_array_list_new (G_TYPE_FLOAT, (GBoxedCopyFunc) _float_dup, (GDestroyNotify) g_free, NULL, NULL, NULL);
#line 25 "../src/axis.vala"
_g_object_unref0 ((*self).values);
#line 25 "../src/axis.vala"
(*self).values = (GeeList*) _tmp0_;
#line 564 "axis.c"
}
static gpointer
_g_object_ref0 (gpointer self)
{
#line 22 "../src/axis.vala"
return self ? g_object_ref (self) : NULL;
#line 572 "axis.c"
}
void
live_chart_ticks_copy (const LiveChartTicks* self,
LiveChartTicks* dest)
{
GeeList* _tmp0_;
GeeList* _tmp1_;
#line 22 "../src/axis.vala"
_tmp0_ = (*self).values;
#line 22 "../src/axis.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
#line 22 "../src/axis.vala"
_g_object_unref0 ((*dest).values);
#line 22 "../src/axis.vala"
(*dest).values = _tmp1_;
#line 589 "axis.c"
}
void
live_chart_ticks_destroy (LiveChartTicks* self)
{
#line 23 "../src/axis.vala"
_g_object_unref0 ((*self).values);
#line 597 "axis.c"
}
LiveChartTicks*
live_chart_ticks_dup (const LiveChartTicks* self)
{
LiveChartTicks* dup;
#line 22 "../src/axis.vala"
dup = g_new0 (LiveChartTicks, 1);
#line 22 "../src/axis.vala"
live_chart_ticks_copy (self, dup);
#line 22 "../src/axis.vala"
return dup;
#line 610 "axis.c"
}
void
live_chart_ticks_free (LiveChartTicks* self)
{
#line 22 "../src/axis.vala"
live_chart_ticks_destroy (self);
#line 22 "../src/axis.vala"
g_free (self);
#line 620 "axis.c"
}
static GType
live_chart_ticks_get_type_once (void)
{
GType live_chart_ticks_type_id;
live_chart_ticks_type_id = g_boxed_type_register_static ("LiveChartTicks", (GBoxedCopyFunc) live_chart_ticks_dup, (GBoxedFreeFunc) live_chart_ticks_free);
return live_chart_ticks_type_id;
}
GType
live_chart_ticks_get_type (void)
{
static volatile gsize live_chart_ticks_type_id__once = 0;
if (g_once_init_enter (&live_chart_ticks_type_id__once)) {
GType live_chart_ticks_type_id;
live_chart_ticks_type_id = live_chart_ticks_get_type_once ();
g_once_init_leave (&live_chart_ticks_type_id__once, live_chart_ticks_type_id);
}
return live_chart_ticks_type_id__once;
}
static inline gpointer
live_chart_yaxis_get_instance_private (LiveChartYAxis* self)
{
return G_STRUCT_MEMBER_P (self, LiveChartYAxis_private_offset);
}
static void
__lambda5_ (LiveChartYAxis* self)
{
LiveChartTicks _tmp0_ = {0};
#line 57 "../src/axis.vala"
live_chart_yaxis_get_ticks (self, &_tmp0_);
#line 57 "../src/axis.vala"
live_chart_ticks_destroy (&self->ticks);
#line 57 "../src/axis.vala"
self->ticks = _tmp0_;
#line 659 "axis.c"
}
static void
___lambda5__g_object_notify (GObject* _sender,
GParamSpec* pspec,
gpointer self)
{
#line 56 "../src/axis.vala"
__lambda5_ ((LiveChartYAxis*) self);
#line 669 "axis.c"
}
LiveChartYAxis*
live_chart_yaxis_construct (GType object_type,
const gchar* unit)
{
LiveChartYAxis* self = NULL;
LiveChartTicks _tmp0_ = {0};
LiveChartPath* _tmp1_;
GdkRGBA _tmp2_ = {0};
LiveChartPath* _tmp3_;
GdkRGBA _tmp4_ = {0};
LiveChartBounds* _tmp5_;
#line 51 "../src/axis.vala"
g_return_val_if_fail (unit != NULL, NULL);
#line 51 "../src/axis.vala"
self = (LiveChartYAxis*) g_type_create_instance (object_type);
#line 52 "../src/axis.vala"
live_chart_yaxis_set_unit (self, unit);
#line 53 "../src/axis.vala"
live_chart_yaxis_get_ticks (self, &_tmp0_);
#line 53 "../src/axis.vala"
live_chart_ticks_destroy (&self->ticks);
#line 53 "../src/axis.vala"
self->ticks = _tmp0_;
#line 54 "../src/axis.vala"
_tmp1_ = self->axis;
#line 54 "../src/axis.vala"
_tmp2_.red = 0.5;
#line 54 "../src/axis.vala"
_tmp2_.green = 0.5;
#line 54 "../src/axis.vala"
_tmp2_.blue = 0.5;
#line 54 "../src/axis.vala"
_tmp2_.alpha = 0.5;
#line 54 "../src/axis.vala"
live_chart_path_set_color (_tmp1_, &_tmp2_);
#line 55 "../src/axis.vala"
_tmp3_ = self->lines;
#line 55 "../src/axis.vala"
_tmp4_.red = 0.5;
#line 55 "../src/axis.vala"
_tmp4_.green = 0.5;
#line 55 "../src/axis.vala"
_tmp4_.blue = 0.5;
#line 55 "../src/axis.vala"
_tmp4_.alpha = 0.2;
#line 55 "../src/axis.vala"
live_chart_path_set_color (_tmp3_, &_tmp4_);
#line 56 "../src/axis.vala"
_tmp5_ = self->priv->bounds;
#line 56 "../src/axis.vala"
g_signal_connect ((GObject*) _tmp5_, "notify::upper", (GCallback) ___lambda5__g_object_notify, self);
#line 51 "../src/axis.vala"
return self;
#line 725 "axis.c"
}
LiveChartYAxis*
live_chart_yaxis_new (const gchar* unit)
{
#line 51 "../src/axis.vala"
return live_chart_yaxis_construct (LIVE_CHART_TYPE_YAXIS, unit);
#line 733 "axis.c"
}
gdouble
live_chart_yaxis_get_ratio (LiveChartYAxis* self)
{
gdouble result;
#line 61 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0);
#line 62 "../src/axis.vala"
result = self->priv->ratio;
#line 62 "../src/axis.vala"
return result;
#line 746 "axis.c"
}
LiveChartBounds*
live_chart_yaxis_get_bounds (LiveChartYAxis* self)
{
LiveChartBounds* _tmp0_;
gdouble _tmp1_;
gdouble _tmp2_;
LiveChartBounds* _tmp3_;
gdouble _tmp4_;
gdouble _tmp5_;
LiveChartBounds* _tmp6_;
LiveChartBounds* result;
#line 65 "../src/axis.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 66 "../src/axis.vala"
_tmp0_ = self->priv->bounds;
#line 66 "../src/axis.vala"
_tmp1_ = live_chart_bounds_get_lower (_tmp0_);
#line 66 "../src/axis.vala"
_tmp2_ = _tmp1_;
#line 66 "../src/axis.vala"
_tmp3_ = self->priv->bounds;
#line 66 "../src/axis.vala"
_tmp4_ = live_chart_bounds_get_upper (_tmp3_);
#line 66 "../src/axis.vala"
_tmp5_ = _tmp4_;
#line 66 "../src/axis.vala"
_tmp6_ = live_chart_bounds_new (_tmp2_, _tmp5_);
#line 66 "../src/axis.vala"
result = _tmp6_;
#line 66 "../src/axis.vala"
return result;
#line 780 "axis.c"
}
gboolean
live_chart_yaxis_update_bounds (LiveChartYAxis* self,
gdouble value)
{
LiveChartBounds* _tmp0_;
gboolean result;
#line 69 "../src/axis.vala"
g_return_val_if_fail (self != NULL, FALSE);
#line 70 "../src/axis.vala"
_tmp0_ = self->priv->bounds;
#line 70 "../src/axis.vala"
result = live_chart_bounds_update (_tmp0_, value);
#line 70 "../src/axis.vala"
return result;
#line 797 "axis.c"
}
void
live_chart_yaxis_update (LiveChartYAxis* self,
gint area_height)
{
gboolean _tmp0_ = FALSE;
LiveChartBounds* _tmp1_;
gdouble* _tmp7_;
#line 73 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 74 "../src/axis.vala"
_tmp1_ = self->priv->bounds;
#line 74 "../src/axis.vala"
if (live_chart_bounds_has_upper (_tmp1_)) {
#line 813 "axis.c"
gdouble* _tmp2_;
#line 74 "../src/axis.vala"
_tmp2_ = self->fixed_max;
#line 74 "../src/axis.vala"
_tmp0_ = _tmp2_ == NULL;
#line 819 "axis.c"
} else {
#line 74 "../src/axis.vala"
_tmp0_ = FALSE;
#line 823 "axis.c"
}
#line 74 "../src/axis.vala"
if (_tmp0_) {
#line 827 "axis.c"
LiveChartBounds* _tmp3_;
gdouble _tmp4_;
gdouble _tmp5_;
gfloat _tmp6_;
#line 75 "../src/axis.vala"
_tmp3_ = self->priv->bounds;
#line 75 "../src/axis.vala"
_tmp4_ = live_chart_bounds_get_upper (_tmp3_);
#line 75 "../src/axis.vala"
_tmp5_ = _tmp4_;
#line 75 "../src/axis.vala"
_tmp6_ = self->priv->_ratio_threshold;
#line 75 "../src/axis.vala"
self->priv->ratio = ((gdouble) area_height) / (((gdouble) _tmp5_) * _tmp6_);
#line 842 "axis.c"
}
#line 78 "../src/axis.vala"
_tmp7_ = self->fixed_max;
#line 78 "../src/axis.vala"
if (_tmp7_ != NULL) {
#line 848 "axis.c"
gdouble* _tmp8_;
#line 79 "../src/axis.vala"
_tmp8_ = self->fixed_max;
#line 79 "../src/axis.vala"
self->priv->ratio = ((gdouble) area_height) / ((gdouble) (*_tmp8_));
#line 854 "axis.c"
}
}
gchar*
live_chart_yaxis_get_max_displayed_value (LiveChartYAxis* self)
{
LiveChartTicks _tmp0_;
GeeList* _tmp1_;
gint _tmp2_;
gint _tmp3_;
const gchar* _tmp32_;
gchar* _tmp33_;
gchar* result;
#line 83 "../src/axis.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 84 "../src/axis.vala"
_tmp0_ = self->ticks;
#line 84 "../src/axis.vala"
_tmp1_ = _tmp0_.values;
#line 84 "../src/axis.vala"
_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
#line 84 "../src/axis.vala"
_tmp3_ = _tmp2_;
#line 84 "../src/axis.vala"
if (_tmp3_ > 0) {
#line 880 "axis.c"
gchar* max_displayed_value = NULL;
const gchar* _tmp4_;
LiveChartTicks _tmp5_;
GeeList* _tmp6_;
gpointer _tmp7_;
gfloat* _tmp8_;
gchar* _tmp9_;
gchar* _tmp10_;
#line 85 "../src/axis.vala"
_tmp4_ = self->priv->_unit;
#line 85 "../src/axis.vala"
_tmp5_ = self->ticks;
#line 85 "../src/axis.vala"
_tmp6_ = _tmp5_.values;
#line 85 "../src/axis.vala"
_tmp7_ = gee_list_first (_tmp6_);
#line 85 "../src/axis.vala"
_tmp8_ = (gfloat*) _tmp7_;
#line 85 "../src/axis.vala"
_tmp9_ = live_chart_format_for_y_axis (_tmp4_, *_tmp8_);
#line 85 "../src/axis.vala"
_tmp10_ = _tmp9_;
#line 85 "../src/axis.vala"
_g_free0 (_tmp8_);
#line 85 "../src/axis.vala"
max_displayed_value = _tmp10_;
#line 907 "axis.c"
{
GeeList* _value_list = NULL;
LiveChartTicks _tmp11_;
GeeList* _tmp12_;
gint _value_size = 0;
GeeList* _tmp13_;
gint _tmp14_;
gint _tmp15_;
gint _value_index = 0;
#line 86 "../src/axis.vala"
_tmp11_ = self->ticks;
#line 86 "../src/axis.vala"
_tmp12_ = _tmp11_.values;
#line 86 "../src/axis.vala"
_value_list = _tmp12_;
#line 86 "../src/axis.vala"
_tmp13_ = _value_list;
#line 86 "../src/axis.vala"
_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
#line 86 "../src/axis.vala"
_tmp15_ = _tmp14_;
#line 86 "../src/axis.vala"
_value_size = _tmp15_;
#line 86 "../src/axis.vala"
_value_index = -1;
#line 86 "../src/axis.vala"
while (TRUE) {
#line 935 "axis.c"
gint _tmp16_;
gint _tmp17_;
gfloat value = 0.0F;
GeeList* _tmp18_;
gpointer _tmp19_;
gfloat* _tmp20_;
gfloat _tmp21_;
gchar* formatted_value = NULL;
const gchar* _tmp22_;
gchar* _tmp23_;
const gchar* _tmp24_;
gint _tmp25_;
gint _tmp26_;
const gchar* _tmp27_;
gint _tmp28_;
gint _tmp29_;
#line 86 "../src/axis.vala"
_value_index = _value_index + 1;
#line 86 "../src/axis.vala"
_tmp16_ = _value_index;
#line 86 "../src/axis.vala"
_tmp17_ = _value_size;
#line 86 "../src/axis.vala"
if (!(_tmp16_ < _tmp17_)) {
#line 86 "../src/axis.vala"
break;
#line 962 "axis.c"
}
#line 86 "../src/axis.vala"
_tmp18_ = _value_list;
#line 86 "../src/axis.vala"
_tmp19_ = gee_list_get (_tmp18_, _value_index);
#line 86 "../src/axis.vala"
_tmp20_ = (gfloat*) _tmp19_;
#line 86 "../src/axis.vala"
_tmp21_ = *_tmp20_;
#line 86 "../src/axis.vala"
_g_free0 (_tmp20_);
#line 86 "../src/axis.vala"
value = _tmp21_;
#line 87 "../src/axis.vala"
_tmp22_ = self->priv->_unit;
#line 87 "../src/axis.vala"
_tmp23_ = live_chart_format_for_y_axis (_tmp22_, value);
#line 87 "../src/axis.vala"
formatted_value = _tmp23_;
#line 88 "../src/axis.vala"
_tmp24_ = formatted_value;
#line 88 "../src/axis.vala"
_tmp25_ = strlen (_tmp24_);
#line 88 "../src/axis.vala"
_tmp26_ = _tmp25_;
#line 88 "../src/axis.vala"
_tmp27_ = max_displayed_value;
#line 88 "../src/axis.vala"
_tmp28_ = strlen (_tmp27_);
#line 88 "../src/axis.vala"
_tmp29_ = _tmp28_;
#line 88 "../src/axis.vala"
if (_tmp26_ >= _tmp29_) {
#line 996 "axis.c"
const gchar* _tmp30_;
gchar* _tmp31_;
#line 89 "../src/axis.vala"
_tmp30_ = formatted_value;
#line 89 "../src/axis.vala"
_tmp31_ = g_strdup (_tmp30_);
#line 89 "../src/axis.vala"
_g_free0 (max_displayed_value);
#line 89 "../src/axis.vala"
max_displayed_value = _tmp31_;
#line 1007 "axis.c"
}
#line 86 "../src/axis.vala"
_g_free0 (formatted_value);
#line 1011 "axis.c"
}
}
#line 92 "../src/axis.vala"
result = max_displayed_value;
#line 92 "../src/axis.vala"
return result;
#line 1018 "axis.c"
}
#line 95 "../src/axis.vala"
_tmp32_ = self->priv->_unit;
#line 95 "../src/axis.vala"
_tmp33_ = g_strdup (_tmp32_);
#line 95 "../src/axis.vala"
result = _tmp33_;
#line 95 "../src/axis.vala"
return result;
#line 1028 "axis.c"
}
void
live_chart_yaxis_get_ticks (LiveChartYAxis* self,
LiveChartTicks* result)
{
LiveChartTicks ticks = {0};
gdouble* _tmp0_;
LiveChartBounds* _tmp6_;
#line 98 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 99 "../src/axis.vala"
live_chart_ticks_init (&ticks);
#line 100 "../src/axis.vala"
_tmp0_ = self->fixed_max;
#line 100 "../src/axis.vala"
if (_tmp0_ != NULL) {
#line 1046 "axis.c"
{
gfloat value = 0.0F;
#line 101 "../src/axis.vala"
value = 0.f;
#line 1051 "axis.c"
{
gboolean _tmp1_ = FALSE;
#line 101 "../src/axis.vala"
_tmp1_ = TRUE;
#line 101 "../src/axis.vala"
while (TRUE) {
#line 1058 "axis.c"
gdouble* _tmp3_;
LiveChartTicks _tmp4_;
GeeList* _tmp5_;
#line 101 "../src/axis.vala"
if (!_tmp1_) {
#line 1064 "axis.c"
gfloat _tmp2_;
#line 101 "../src/axis.vala"
_tmp2_ = self->priv->_tick_interval;
#line 101 "../src/axis.vala"
value += _tmp2_;
#line 1070 "axis.c"
}
#line 101 "../src/axis.vala"
_tmp1_ = FALSE;
#line 101 "../src/axis.vala"
_tmp3_ = self->fixed_max;
#line 101 "../src/axis.vala"
if (!(((gdouble) value) <= (*_tmp3_))) {
#line 101 "../src/axis.vala"
break;
#line 1080 "axis.c"
}
#line 102 "../src/axis.vala"
_tmp4_ = ticks;
#line 102 "../src/axis.vala"
_tmp5_ = _tmp4_.values;
#line 102 "../src/axis.vala"
gee_collection_add ((GeeCollection*) _tmp5_, &value);
#line 1088 "axis.c"
}
}
}
#line 105 "../src/axis.vala"
*result = ticks;
#line 105 "../src/axis.vala"
return;
#line 1096 "axis.c"
}
#line 107 "../src/axis.vala"
_tmp6_ = self->priv->bounds;
#line 107 "../src/axis.vala"
if (live_chart_bounds_has_upper (_tmp6_)) {
#line 1102 "axis.c"
gfloat upper = 0.0F;
LiveChartBounds* _tmp7_;
gdouble _tmp8_;
gdouble _tmp9_;
GeeList* divs = NULL;
GeeList* _tmp10_;
GeeList* _tmp11_;
gint _tmp12_;
gint _tmp13_;
#line 108 "../src/axis.vala"
_tmp7_ = self->priv->bounds;
#line 108 "../src/axis.vala"
_tmp8_ = live_chart_bounds_get_upper (_tmp7_);
#line 108 "../src/axis.vala"
_tmp9_ = _tmp8_;
#line 108 "../src/axis.vala"
upper = live_chart_cap ((gfloat) _tmp9_);
#line 109 "../src/axis.vala"
_tmp10_ = live_chart_golden_divisors (upper);
#line 109 "../src/axis.vala"
divs = _tmp10_;
#line 111 "../src/axis.vala"
_tmp11_ = divs;
#line 111 "../src/axis.vala"
_tmp12_ = gee_collection_get_size ((GeeCollection*) _tmp11_);
#line 111 "../src/axis.vala"
_tmp13_ = _tmp12_;
#line 111 "../src/axis.vala"
if (_tmp13_ > 0) {
#line 1132 "axis.c"
gfloat interval = 0.0F;
GeeList* _tmp14_;
gpointer _tmp15_;
gfloat* _tmp16_;
gfloat _tmp17_;
gdouble _tmp29_ = 0.0;
LiveChartBounds* _tmp30_;
gdouble _tmp31_;
gdouble _tmp32_;
gdouble limit = 0.0;
#line 112 "../src/axis.vala"
_tmp14_ = divs;
#line 112 "../src/axis.vala"
_tmp15_ = gee_list_get (_tmp14_, 0);
#line 112 "../src/axis.vala"
_tmp16_ = (gfloat*) _tmp15_;
#line 112 "../src/axis.vala"
_tmp17_ = upper / (*_tmp16_);
#line 112 "../src/axis.vala"
_g_free0 (_tmp16_);
#line 112 "../src/axis.vala"
interval = _tmp17_;
#line 1155 "axis.c"
{
GeeList* _div_list = NULL;
GeeList* _tmp18_;
gint _div_size = 0;
GeeList* _tmp19_;
gint _tmp20_;
gint _tmp21_;
gint _div_index = 0;
#line 113 "../src/axis.vala"
_tmp18_ = divs;
#line 113 "../src/axis.vala"
_div_list = _tmp18_;
#line 113 "../src/axis.vala"
_tmp19_ = _div_list;
#line 113 "../src/axis.vala"
_tmp20_ = gee_collection_get_size ((GeeCollection*) _tmp19_);
#line 113 "../src/axis.vala"
_tmp21_ = _tmp20_;
#line 113 "../src/axis.vala"
_div_size = _tmp21_;
#line 113 "../src/axis.vala"
_div_index = -1;
#line 113 "../src/axis.vala"
while (TRUE) {
#line 1180 "axis.c"
gint _tmp22_;
gint _tmp23_;
gfloat div = 0.0F;
GeeList* _tmp24_;
gpointer _tmp25_;
gfloat* _tmp26_;
gfloat _tmp27_;
gboolean _tmp28_ = FALSE;
#line 113 "../src/axis.vala"
_div_index = _div_index + 1;
#line 113 "../src/axis.vala"
_tmp22_ = _div_index;
#line 113 "../src/axis.vala"
_tmp23_ = _div_size;
#line 113 "../src/axis.vala"
if (!(_tmp22_ < _tmp23_)) {
#line 113 "../src/axis.vala"
break;
#line 1199 "axis.c"
}
#line 113 "../src/axis.vala"
_tmp24_ = _div_list;
#line 113 "../src/axis.vala"
_tmp25_ = gee_list_get (_tmp24_, _div_index);
#line 113 "../src/axis.vala"
_tmp26_ = (gfloat*) _tmp25_;
#line 113 "../src/axis.vala"
_tmp27_ = *_tmp26_;
#line 113 "../src/axis.vala"
_g_free0 (_tmp26_);
#line 113 "../src/axis.vala"
div = _tmp27_;
#line 114 "../src/axis.vala"
interval = upper / div;
#line 115 "../src/axis.vala"
if (div > 3.f) {
#line 115 "../src/axis.vala"
_tmp28_ = div < 7.f;
#line 1219 "axis.c"
} else {
#line 115 "../src/axis.vala"
_tmp28_ = FALSE;
#line 1223 "axis.c"
}
#line 115 "../src/axis.vala"
if (_tmp28_) {
#line 116 "../src/axis.vala"
break;
#line 1229 "axis.c"
}
}
}
#line 119 "../src/axis.vala"
_tmp30_ = self->priv->bounds;
#line 119 "../src/axis.vala"
_tmp31_ = live_chart_bounds_get_upper (_tmp30_);
#line 119 "../src/axis.vala"
_tmp32_ = _tmp31_;
#line 119 "../src/axis.vala"
if (_tmp32_ == ((gdouble) upper)) {
#line 119 "../src/axis.vala"
_tmp29_ = (gdouble) upper;
#line 1243 "axis.c"
} else {
LiveChartBounds* _tmp33_;
gdouble _tmp34_;
gdouble _tmp35_;
#line 119 "../src/axis.vala"
_tmp33_ = self->priv->bounds;
#line 119 "../src/axis.vala"
_tmp34_ = live_chart_bounds_get_upper (_tmp33_);
#line 119 "../src/axis.vala"
_tmp35_ = _tmp34_;
#line 119 "../src/axis.vala"
_tmp29_ = _tmp35_ + interval;
#line 1256 "axis.c"
}
#line 119 "../src/axis.vala"
limit = _tmp29_;
#line 1260 "axis.c"
{
gfloat value = 0.0F;
#line 120 "../src/axis.vala"
value = 0.f;
#line 1265 "axis.c"
{
gboolean _tmp36_ = FALSE;
#line 120 "../src/axis.vala"
_tmp36_ = TRUE;
#line 120 "../src/axis.vala"
while (TRUE) {
#line 1272 "axis.c"
LiveChartTicks _tmp37_;
GeeList* _tmp38_;
#line 120 "../src/axis.vala"
if (!_tmp36_) {
#line 120 "../src/axis.vala"
value += interval;
#line 1279 "axis.c"
}
#line 120 "../src/axis.vala"
_tmp36_ = FALSE;
#line 120 "../src/axis.vala"
if (!(((gdouble) value) <= limit)) {
#line 120 "../src/axis.vala"
break;
#line 1287 "axis.c"
}
#line 121 "../src/axis.vala"
_tmp37_ = ticks;
#line 121 "../src/axis.vala"
_tmp38_ = _tmp37_.values;
#line 121 "../src/axis.vala"
gee_collection_add ((GeeCollection*) _tmp38_, &value);
#line 1295 "axis.c"
}
}
}
}
#line 107 "../src/axis.vala"
_g_object_unref0 (divs);
#line 1302 "axis.c"
}
#line 126 "../src/axis.vala"
*result = ticks;
#line 126 "../src/axis.vala"
return;
#line 1308 "axis.c"
}
gfloat
live_chart_yaxis_get_ratio_threshold (LiveChartYAxis* self)
{
gfloat result;
#line 33 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0F);
#line 33 "../src/axis.vala"
result = self->priv->_ratio_threshold;
#line 33 "../src/axis.vala"
return result;
#line 1321 "axis.c"
}
void
live_chart_yaxis_set_ratio_threshold (LiveChartYAxis* self,
gfloat value)
{
#line 33 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 33 "../src/axis.vala"
self->priv->_ratio_threshold = value;
#line 1332 "axis.c"
}
gfloat
live_chart_yaxis_get_tick_interval (LiveChartYAxis* self)
{
gfloat result;
#line 34 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0F);
#line 34 "../src/axis.vala"
result = self->priv->_tick_interval;
#line 34 "../src/axis.vala"
return result;
#line 1345 "axis.c"
}
void
live_chart_yaxis_set_tick_interval (LiveChartYAxis* self,
gfloat value)
{
#line 34 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 34 "../src/axis.vala"
self->priv->_tick_interval = value;
#line 1356 "axis.c"
}
gboolean
live_chart_yaxis_get_visible (LiveChartYAxis* self)
{
gboolean result;
#line 35 "../src/axis.vala"
g_return_val_if_fail (self != NULL, FALSE);
#line 35 "../src/axis.vala"
result = self->priv->_visible;
#line 35 "../src/axis.vala"
return result;
#line 1369 "axis.c"
}
void
live_chart_yaxis_set_visible (LiveChartYAxis* self,
gboolean value)
{
#line 35 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 35 "../src/axis.vala"
self->priv->_visible = value;
#line 1380 "axis.c"
}
gfloat
live_chart_yaxis_get_tick_length (LiveChartYAxis* self)
{
gfloat result;
#line 42 "../src/axis.vala"
g_return_val_if_fail (self != NULL, 0.0F);
#line 42 "../src/axis.vala"
result = self->priv->_tick_length;
#line 42 "../src/axis.vala"
return result;
#line 1393 "axis.c"
}
void
live_chart_yaxis_set_tick_length (LiveChartYAxis* self,
gfloat value)
{
#line 42 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 42 "../src/axis.vala"
self->priv->_tick_length = value;
#line 1404 "axis.c"
}
const gchar*
live_chart_yaxis_get_unit (LiveChartYAxis* self)
{
const gchar* result;
const gchar* _tmp0_;
#line 43 "../src/axis.vala"
g_return_val_if_fail (self != NULL, NULL);
#line 43 "../src/axis.vala"
_tmp0_ = self->priv->_unit;
#line 43 "../src/axis.vala"
result = _tmp0_;
#line 43 "../src/axis.vala"
return result;
#line 1420 "axis.c"
}
void
live_chart_yaxis_set_unit (LiveChartYAxis* self,
const gchar* value)
{
gchar* _tmp0_;
#line 43 "../src/axis.vala"
g_return_if_fail (self != NULL);
#line 43 "../src/axis.vala"
_tmp0_ = g_strdup (value);
#line 43 "../src/axis.vala"
_g_free0 (self->priv->_unit);
#line 43 "../src/axis.vala"
self->priv->_unit = _tmp0_;
#line 1436 "axis.c"
}
static void
live_chart_value_yaxis_init (GValue* value)
{
#line 29 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 1444 "axis.c"
}
static void
live_chart_value_yaxis_free_value (GValue* value)
{
#line 29 "../src/axis.vala"
if (value->data[0].v_pointer) {
#line 29 "../src/axis.vala"
live_chart_yaxis_unref (value->data[0].v_pointer);
#line 1454 "axis.c"
}
}
static void
live_chart_value_yaxis_copy_value (const GValue* src_value,
GValue* dest_value)
{
#line 29 "../src/axis.vala"
if (src_value->data[0].v_pointer) {
#line 29 "../src/axis.vala"
dest_value->data[0].v_pointer = live_chart_yaxis_ref (src_value->data[0].v_pointer);
#line 1466 "axis.c"
} else {
#line 29 "../src/axis.vala"
dest_value->data[0].v_pointer = NULL;
#line 1470 "axis.c"
}
}
static gpointer
live_chart_value_yaxis_peek_pointer (const GValue* value)
{
#line 29 "../src/axis.vala"
return value->data[0].v_pointer;
#line 1479 "axis.c"
}
static gchar*
live_chart_value_yaxis_collect_value (GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
#line 29 "../src/axis.vala"
if (collect_values[0].v_pointer) {
#line 1490 "axis.c"
LiveChartYAxis * object;
object = collect_values[0].v_pointer;
#line 29 "../src/axis.vala"
if (object->parent_instance.g_class == NULL) {
#line 29 "../src/axis.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1497 "axis.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 29 "../src/axis.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1501 "axis.c"
}
#line 29 "../src/axis.vala"
value->data[0].v_pointer = live_chart_yaxis_ref (object);
#line 1505 "axis.c"
} else {
#line 29 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 1509 "axis.c"
}
#line 29 "../src/axis.vala"
return NULL;
#line 1513 "axis.c"
}
static gchar*
live_chart_value_yaxis_lcopy_value (const GValue* value,
guint n_collect_values,
GTypeCValue* collect_values,
guint collect_flags)
{
LiveChartYAxis ** object_p;
object_p = collect_values[0].v_pointer;
#line 29 "../src/axis.vala"
if (!object_p) {
#line 29 "../src/axis.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 1528 "axis.c"
}
#line 29 "../src/axis.vala"
if (!value->data[0].v_pointer) {
#line 29 "../src/axis.vala"
*object_p = NULL;
#line 1534 "axis.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 29 "../src/axis.vala"
*object_p = value->data[0].v_pointer;
#line 1538 "axis.c"
} else {
#line 29 "../src/axis.vala"
*object_p = live_chart_yaxis_ref (value->data[0].v_pointer);
#line 1542 "axis.c"
}
#line 29 "../src/axis.vala"
return NULL;
#line 1546 "axis.c"
}
GParamSpec*
live_chart_param_spec_yaxis (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags)
{
LiveChartParamSpecYAxis* spec;
#line 29 "../src/axis.vala"
g_return_val_if_fail (g_type_is_a (object_type, LIVE_CHART_TYPE_YAXIS), NULL);
#line 29 "../src/axis.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 29 "../src/axis.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 29 "../src/axis.vala"
return G_PARAM_SPEC (spec);
#line 1565 "axis.c"
}
gpointer
live_chart_value_get_yaxis (const GValue* value)
{
#line 29 "../src/axis.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_YAXIS), NULL);
#line 29 "../src/axis.vala"
return value->data[0].v_pointer;
#line 1575 "axis.c"
}
void
live_chart_value_set_yaxis (GValue* value,
gpointer v_object)
{
LiveChartYAxis * old;
#line 29 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_YAXIS));
#line 29 "../src/axis.vala"
old = value->data[0].v_pointer;
#line 29 "../src/axis.vala"
if (v_object) {
#line 29 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_YAXIS));
#line 29 "../src/axis.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 29 "../src/axis.vala"
value->data[0].v_pointer = v_object;
#line 29 "../src/axis.vala"
live_chart_yaxis_ref (value->data[0].v_pointer);
#line 1597 "axis.c"
} else {
#line 29 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 1601 "axis.c"
}
#line 29 "../src/axis.vala"
if (old) {
#line 29 "../src/axis.vala"
live_chart_yaxis_unref (old);
#line 1607 "axis.c"
}
}
void
live_chart_value_take_yaxis (GValue* value,
gpointer v_object)
{
LiveChartYAxis * old;
#line 29 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_YAXIS));
#line 29 "../src/axis.vala"
old = value->data[0].v_pointer;
#line 29 "../src/axis.vala"
if (v_object) {
#line 29 "../src/axis.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_YAXIS));
#line 29 "../src/axis.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 29 "../src/axis.vala"
value->data[0].v_pointer = v_object;
#line 1628 "axis.c"
} else {
#line 29 "../src/axis.vala"
value->data[0].v_pointer = NULL;
#line 1632 "axis.c"
}
#line 29 "../src/axis.vala"
if (old) {
#line 29 "../src/axis.vala"
live_chart_yaxis_unref (old);
#line 1638 "axis.c"
}
}
static void
live_chart_yaxis_class_init (LiveChartYAxisClass * klass,
gpointer klass_data)
{
#line 29 "../src/axis.vala"
live_chart_yaxis_parent_class = g_type_class_peek_parent (klass);
#line 29 "../src/axis.vala"
((LiveChartYAxisClass *) klass)->finalize = live_chart_yaxis_finalize;
#line 29 "../src/axis.vala"
g_type_class_adjust_private_offset (klass, &LiveChartYAxis_private_offset);
#line 1652 "axis.c"
}
static void
live_chart_yaxis_instance_init (LiveChartYAxis * self,
gpointer klass)
{
LiveChartBounds* _tmp0_;
LiveChartLabels* _tmp1_;
GdkRGBA _tmp2_ = {0};
LiveChartPath* _tmp3_;
GdkRGBA _tmp4_ = {0};
LiveChartPath* _tmp5_;
gchar* _tmp6_;
#line 29 "../src/axis.vala"
self->priv = live_chart_yaxis_get_instance_private (self);
#line 30 "../src/axis.vala"
_tmp0_ = live_chart_bounds_new (((double) NAN), ((double) NAN));
#line 30 "../src/axis.vala"
self->priv->bounds = _tmp0_;
#line 31 "../src/axis.vala"
self->priv->ratio = (gdouble) 1;
#line 33 "../src/axis.vala"
self->priv->_ratio_threshold = 1.118f;
#line 34 "../src/axis.vala"
self->priv->_tick_interval = (gfloat) 60;
#line 35 "../src/axis.vala"
self->priv->_visible = TRUE;
#line 37 "../src/axis.vala"
_tmp1_ = live_chart_labels_new ();
#line 37 "../src/axis.vala"
self->labels = _tmp1_;
#line 38 "../src/axis.vala"
_tmp2_.red = 1.0;
#line 38 "../src/axis.vala"
_tmp2_.green = 1.0;
#line 38 "../src/axis.vala"
_tmp2_.blue = 1.0;
#line 38 "../src/axis.vala"
_tmp2_.alpha = 1.0;
#line 38 "../src/axis.vala"
_tmp3_ = live_chart_path_new (0.5, &_tmp2_, TRUE, NULL);
#line 38 "../src/axis.vala"
self->axis = _tmp3_;
#line 39 "../src/axis.vala"
_tmp4_.red = 1.0;
#line 39 "../src/axis.vala"
_tmp4_.green = 1.0;
#line 39 "../src/axis.vala"
_tmp4_.blue = 1.0;
#line 39 "../src/axis.vala"
_tmp4_.alpha = 1.0;
#line 39 "../src/axis.vala"
_tmp5_ = live_chart_path_new (0.5, &_tmp4_, TRUE, NULL);
#line 39 "../src/axis.vala"
self->lines = _tmp5_;
#line 42 "../src/axis.vala"
self->priv->_tick_length = (gfloat) 60;
#line 43 "../src/axis.vala"
_tmp6_ = g_strdup ("");
#line 43 "../src/axis.vala"
self->priv->_unit = _tmp6_;
#line 46 "../src/axis.vala"
self->smart_ratio = FALSE;
#line 29 "../src/axis.vala"
self->ref_count = 1;
#line 1718 "axis.c"
}
static void
live_chart_yaxis_finalize (LiveChartYAxis * obj)
{
LiveChartYAxis * self;
#line 29 "../src/axis.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_YAXIS, LiveChartYAxis);
#line 29 "../src/axis.vala"
g_signal_handlers_destroy (self);
#line 30 "../src/axis.vala"
_g_object_unref0 (self->priv->bounds);
#line 37 "../src/axis.vala"
_live_chart_labels_unref0 (self->labels);
#line 38 "../src/axis.vala"
_g_object_unref0 (self->axis);
#line 39 "../src/axis.vala"
_g_object_unref0 (self->lines);
#line 43 "../src/axis.vala"
_g_free0 (self->priv->_unit);
#line 48 "../src/axis.vala"
_g_free0 (self->fixed_max);
#line 49 "../src/axis.vala"
live_chart_ticks_destroy (&self->ticks);
#line 1743 "axis.c"
}
static GType
live_chart_yaxis_get_type_once (void)
{
static const GTypeValueTable g_define_type_value_table = { live_chart_value_yaxis_init, live_chart_value_yaxis_free_value, live_chart_value_yaxis_copy_value, live_chart_value_yaxis_peek_pointer, "p", live_chart_value_yaxis_collect_value, "p", live_chart_value_yaxis_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (LiveChartYAxisClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_yaxis_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartYAxis), 0, (GInstanceInitFunc) live_chart_yaxis_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType live_chart_yaxis_type_id;
live_chart_yaxis_type_id = g_type_register_fundamental (g_type_fundamental_next (), "LiveChartYAxis", &g_define_type_info, &g_define_type_fundamental_info, 0);
LiveChartYAxis_private_offset = g_type_add_instance_private (live_chart_yaxis_type_id, sizeof (LiveChartYAxisPrivate));
return live_chart_yaxis_type_id;
}
GType
live_chart_yaxis_get_type (void)
{
static volatile gsize live_chart_yaxis_type_id__once = 0;
if (g_once_init_enter (&live_chart_yaxis_type_id__once)) {
GType live_chart_yaxis_type_id;
live_chart_yaxis_type_id = live_chart_yaxis_get_type_once ();
g_once_init_leave (&live_chart_yaxis_type_id__once, live_chart_yaxis_type_id);
}
return live_chart_yaxis_type_id__once;
}
gpointer
live_chart_yaxis_ref (gpointer instance)
{
LiveChartYAxis * self;
self = instance;
#line 29 "../src/axis.vala"
g_atomic_int_inc (&self->ref_count);
#line 29 "../src/axis.vala"
return instance;
#line 1779 "axis.c"
}
void
live_chart_yaxis_unref (gpointer instance)
{
LiveChartYAxis * self;
self = instance;
#line 29 "../src/axis.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 29 "../src/axis.vala"
LIVE_CHART_YAXIS_GET_CLASS (self)->finalize (self);
#line 29 "../src/axis.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 1793 "axis.c"
}
}