680 lines
22 KiB
C
680 lines
22 KiB
C
|
/* serie.c generated by valac 0.56.0, the Vala compiler
|
||
|
* generated from serie.vala, do not modify */
|
||
|
|
||
|
#include "livechart.h"
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <glib.h>
|
||
|
#include <glib-object.h>
|
||
|
#include <cairo-gobject.h>
|
||
|
#include <float.h>
|
||
|
#include <math.h>
|
||
|
#include <gdk/gdk.h>
|
||
|
#include <gee.h>
|
||
|
|
||
|
enum {
|
||
|
LIVE_CHART_SERIE_0_PROPERTY,
|
||
|
LIVE_CHART_SERIE_NAME_PROPERTY,
|
||
|
LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY,
|
||
|
LIVE_CHART_SERIE_LINE_PROPERTY,
|
||
|
LIVE_CHART_SERIE_VISIBLE_PROPERTY,
|
||
|
LIVE_CHART_SERIE_NUM_PROPERTIES
|
||
|
};
|
||
|
static GParamSpec* live_chart_serie_properties[LIVE_CHART_SERIE_NUM_PROPERTIES];
|
||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||
|
enum {
|
||
|
LIVE_CHART_SERIE_VALUE_ADDED_SIGNAL,
|
||
|
LIVE_CHART_SERIE_NUM_SIGNALS
|
||
|
};
|
||
|
static guint live_chart_serie_signals[LIVE_CHART_SERIE_NUM_SIGNALS] = {0};
|
||
|
|
||
|
struct _LiveChartSeriePrivate {
|
||
|
gchar* _name;
|
||
|
gboolean _visible;
|
||
|
LiveChartSerieRenderer* renderer;
|
||
|
};
|
||
|
|
||
|
static gint LiveChartSerie_private_offset;
|
||
|
static gpointer live_chart_serie_parent_class = NULL;
|
||
|
static LiveChartColorableIface * live_chart_serie_live_chart_colorable_parent_iface = NULL;
|
||
|
static LiveChartDrawableIface * live_chart_serie_live_chart_drawable_parent_iface = NULL;
|
||
|
|
||
|
static void live_chart_serie_real_draw (LiveChartDrawable* base,
|
||
|
cairo_t* ctx,
|
||
|
LiveChartConfig* config);
|
||
|
static void live_chart_serie_real_get_bounding_box (LiveChartDrawable* base,
|
||
|
LiveChartBoundingBox* result);
|
||
|
static void live_chart_serie_finalize (GObject * obj);
|
||
|
static GType live_chart_serie_get_type_once (void);
|
||
|
static void _vala_live_chart_serie_get_property (GObject * object,
|
||
|
guint property_id,
|
||
|
GValue * value,
|
||
|
GParamSpec * pspec);
|
||
|
static void _vala_live_chart_serie_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
|
||
|
live_chart_serie_get_instance_private (LiveChartSerie* self)
|
||
|
{
|
||
|
return G_STRUCT_MEMBER_P (self, LiveChartSerie_private_offset);
|
||
|
}
|
||
|
|
||
|
static gpointer
|
||
|
_g_object_ref0 (gpointer self)
|
||
|
{
|
||
|
#line 38 "../src/serie.vala"
|
||
|
return self ? g_object_ref (self) : NULL;
|
||
|
#line 73 "serie.c"
|
||
|
}
|
||
|
|
||
|
LiveChartSerie*
|
||
|
live_chart_serie_construct (GType object_type,
|
||
|
const gchar* name,
|
||
|
LiveChartSerieRenderer* renderer)
|
||
|
{
|
||
|
LiveChartSerie * self = NULL;
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
#line 36 "../src/serie.vala"
|
||
|
g_return_val_if_fail (name != NULL, NULL);
|
||
|
#line 36 "../src/serie.vala"
|
||
|
g_return_val_if_fail (renderer != NULL, NULL);
|
||
|
#line 36 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) g_object_new (object_type, NULL);
|
||
|
#line 37 "../src/serie.vala"
|
||
|
live_chart_serie_set_name (self, name);
|
||
|
#line 38 "../src/serie.vala"
|
||
|
_tmp0_ = _g_object_ref0 (renderer);
|
||
|
#line 38 "../src/serie.vala"
|
||
|
_g_object_unref0 (self->priv->renderer);
|
||
|
#line 38 "../src/serie.vala"
|
||
|
self->priv->renderer = _tmp0_;
|
||
|
#line 36 "../src/serie.vala"
|
||
|
return self;
|
||
|
#line 99 "serie.c"
|
||
|
}
|
||
|
|
||
|
LiveChartSerie*
|
||
|
live_chart_serie_new (const gchar* name,
|
||
|
LiveChartSerieRenderer* renderer)
|
||
|
{
|
||
|
#line 36 "../src/serie.vala"
|
||
|
return live_chart_serie_construct (LIVE_CHART_TYPE_SERIE, name, renderer);
|
||
|
#line 108 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_real_draw (LiveChartDrawable* base,
|
||
|
cairo_t* ctx,
|
||
|
LiveChartConfig* config)
|
||
|
{
|
||
|
LiveChartSerie * self;
|
||
|
gboolean _tmp0_;
|
||
|
gboolean _tmp1_;
|
||
|
#line 41 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 41 "../src/serie.vala"
|
||
|
g_return_if_fail (ctx != NULL);
|
||
|
#line 41 "../src/serie.vala"
|
||
|
g_return_if_fail (config != NULL);
|
||
|
#line 42 "../src/serie.vala"
|
||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||
|
#line 42 "../src/serie.vala"
|
||
|
_tmp1_ = _tmp0_;
|
||
|
#line 42 "../src/serie.vala"
|
||
|
if (_tmp1_) {
|
||
|
#line 131 "serie.c"
|
||
|
LiveChartSerieRenderer* _tmp2_;
|
||
|
#line 43 "../src/serie.vala"
|
||
|
_tmp2_ = self->priv->renderer;
|
||
|
#line 43 "../src/serie.vala"
|
||
|
live_chart_serie_renderer_draw (_tmp2_, ctx, config);
|
||
|
#line 137 "serie.c"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_add (LiveChartSerie* self,
|
||
|
gdouble value)
|
||
|
{
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartValues* _tmp1_;
|
||
|
LiveChartValues* _tmp2_;
|
||
|
LiveChartTimestampedValue _tmp3_ = {0};
|
||
|
#line 47 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_values (_tmp0_);
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_tmp3_.timestamp = (gdouble) (g_get_real_time () / 1000);
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_tmp3_.value = value;
|
||
|
#line 48 "../src/serie.vala"
|
||
|
live_chart_values_add (_tmp2_, &_tmp3_);
|
||
|
#line 48 "../src/serie.vala"
|
||
|
_g_object_unref0 (_tmp2_);
|
||
|
#line 49 "../src/serie.vala"
|
||
|
g_signal_emit (self, live_chart_serie_signals[LIVE_CHART_SERIE_VALUE_ADDED_SIGNAL], 0, value);
|
||
|
#line 167 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_add_with_timestamp (LiveChartSerie* self,
|
||
|
gdouble value,
|
||
|
gint64 timestamp)
|
||
|
{
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartValues* _tmp1_;
|
||
|
LiveChartValues* _tmp2_;
|
||
|
LiveChartTimestampedValue _tmp3_ = {0};
|
||
|
#line 52 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_values (_tmp0_);
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_tmp3_.timestamp = (gdouble) timestamp;
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_tmp3_.value = value;
|
||
|
#line 53 "../src/serie.vala"
|
||
|
live_chart_values_add (_tmp2_, &_tmp3_);
|
||
|
#line 53 "../src/serie.vala"
|
||
|
_g_object_unref0 (_tmp2_);
|
||
|
#line 54 "../src/serie.vala"
|
||
|
g_signal_emit (self, live_chart_serie_signals[LIVE_CHART_SERIE_VALUE_ADDED_SIGNAL], 0, value);
|
||
|
#line 197 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_set_main_color (LiveChartSerie* self,
|
||
|
GdkRGBA* color)
|
||
|
{
|
||
|
GdkRGBA _tmp0_;
|
||
|
#line 58 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 58 "../src/serie.vala"
|
||
|
g_return_if_fail (color != NULL);
|
||
|
#line 59 "../src/serie.vala"
|
||
|
_tmp0_ = *color;
|
||
|
#line 59 "../src/serie.vala"
|
||
|
live_chart_colorable_set_main_color ((LiveChartColorable*) self, &_tmp0_);
|
||
|
#line 213 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_get_main_color (LiveChartSerie* self,
|
||
|
GdkRGBA* result)
|
||
|
{
|
||
|
GdkRGBA _tmp0_ = {0};
|
||
|
GdkRGBA _tmp1_;
|
||
|
#line 63 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 64 "../src/serie.vala"
|
||
|
live_chart_colorable_get_main_color ((LiveChartColorable*) self, &_tmp0_);
|
||
|
#line 64 "../src/serie.vala"
|
||
|
_tmp1_ = _tmp0_;
|
||
|
#line 64 "../src/serie.vala"
|
||
|
*result = _tmp1_;
|
||
|
#line 64 "../src/serie.vala"
|
||
|
return;
|
||
|
#line 232 "serie.c"
|
||
|
}
|
||
|
|
||
|
LiveChartValues*
|
||
|
live_chart_serie_get_values (LiveChartSerie* self)
|
||
|
{
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartValues* _tmp1_;
|
||
|
LiveChartValues* result;
|
||
|
#line 67 "../src/serie.vala"
|
||
|
g_return_val_if_fail (self != NULL, NULL);
|
||
|
#line 68 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 68 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_values (_tmp0_);
|
||
|
#line 68 "../src/serie.vala"
|
||
|
result = _tmp1_;
|
||
|
#line 68 "../src/serie.vala"
|
||
|
return result;
|
||
|
#line 251 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_clear (LiveChartSerie* self)
|
||
|
{
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartValues* _tmp1_;
|
||
|
LiveChartValues* _tmp2_;
|
||
|
#line 71 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 72 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 72 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_values (_tmp0_);
|
||
|
#line 72 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 72 "../src/serie.vala"
|
||
|
gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp2_);
|
||
|
#line 72 "../src/serie.vala"
|
||
|
_g_object_unref0 (_tmp2_);
|
||
|
#line 272 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_real_get_bounding_box (LiveChartDrawable* base,
|
||
|
LiveChartBoundingBox* result)
|
||
|
{
|
||
|
LiveChartSerie * self;
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartBoundingBox _tmp1_ = {0};
|
||
|
#line 75 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 76 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 76 "../src/serie.vala"
|
||
|
live_chart_drawable_get_bounding_box ((LiveChartDrawable*) _tmp0_, &_tmp1_);
|
||
|
#line 76 "../src/serie.vala"
|
||
|
*result = _tmp1_;
|
||
|
#line 76 "../src/serie.vala"
|
||
|
return;
|
||
|
#line 292 "serie.c"
|
||
|
}
|
||
|
|
||
|
const gchar*
|
||
|
live_chart_serie_get_name (LiveChartSerie* self)
|
||
|
{
|
||
|
const gchar* result;
|
||
|
const gchar* _tmp0_;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
g_return_val_if_fail (self != NULL, NULL);
|
||
|
#line 7 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->_name;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
result = _tmp0_;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
return result;
|
||
|
#line 308 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_set_name (LiveChartSerie* self,
|
||
|
const gchar* value)
|
||
|
{
|
||
|
gchar* old_value;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 7 "../src/serie.vala"
|
||
|
old_value = live_chart_serie_get_name (self);
|
||
|
#line 7 "../src/serie.vala"
|
||
|
if (g_strcmp0 (value, old_value) != 0) {
|
||
|
#line 322 "serie.c"
|
||
|
gchar* _tmp0_;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
_tmp0_ = g_strdup (value);
|
||
|
#line 7 "../src/serie.vala"
|
||
|
_g_free0 (self->priv->_name);
|
||
|
#line 7 "../src/serie.vala"
|
||
|
self->priv->_name = _tmp0_;
|
||
|
#line 7 "../src/serie.vala"
|
||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_properties[LIVE_CHART_SERIE_NAME_PROPERTY]);
|
||
|
#line 332 "serie.c"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_real_get_main_color (LiveChartColorable* base,
|
||
|
GdkRGBA * result)
|
||
|
{
|
||
|
LiveChartSerie* self;
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartPath* _tmp1_;
|
||
|
LiveChartPath* _tmp2_;
|
||
|
GdkRGBA _tmp3_ = {0};
|
||
|
GdkRGBA _tmp4_;
|
||
|
#line 11 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 12 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 12 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_line (_tmp0_);
|
||
|
#line 12 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 12 "../src/serie.vala"
|
||
|
live_chart_path_get_color (_tmp2_, &_tmp3_);
|
||
|
#line 12 "../src/serie.vala"
|
||
|
_tmp4_ = _tmp3_;
|
||
|
#line 12 "../src/serie.vala"
|
||
|
*result = _tmp4_;
|
||
|
#line 12 "../src/serie.vala"
|
||
|
return;
|
||
|
#line 362 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_real_set_main_color (LiveChartColorable* base,
|
||
|
GdkRGBA * value)
|
||
|
{
|
||
|
LiveChartSerie* self;
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartPath* _tmp1_;
|
||
|
LiveChartPath* _tmp2_;
|
||
|
GdkRGBA _tmp3_;
|
||
|
#line 15 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 16 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 16 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_line (_tmp0_);
|
||
|
#line 16 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 16 "../src/serie.vala"
|
||
|
_tmp3_ = *value;
|
||
|
#line 16 "../src/serie.vala"
|
||
|
live_chart_path_set_color (_tmp2_, &_tmp3_);
|
||
|
#line 15 "../src/serie.vala"
|
||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_properties[LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY]);
|
||
|
#line 388 "serie.c"
|
||
|
}
|
||
|
|
||
|
LiveChartPath*
|
||
|
live_chart_serie_get_line (LiveChartSerie* self)
|
||
|
{
|
||
|
LiveChartPath* result;
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
LiveChartPath* _tmp1_;
|
||
|
LiveChartPath* _tmp2_;
|
||
|
#line 21 "../src/serie.vala"
|
||
|
g_return_val_if_fail (self != NULL, NULL);
|
||
|
#line 22 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 22 "../src/serie.vala"
|
||
|
_tmp1_ = live_chart_serie_renderer_get_line (_tmp0_);
|
||
|
#line 22 "../src/serie.vala"
|
||
|
_tmp2_ = _tmp1_;
|
||
|
#line 22 "../src/serie.vala"
|
||
|
result = _tmp2_;
|
||
|
#line 22 "../src/serie.vala"
|
||
|
return result;
|
||
|
#line 410 "serie.c"
|
||
|
}
|
||
|
|
||
|
void
|
||
|
live_chart_serie_set_line (LiveChartSerie* self,
|
||
|
LiveChartPath* value)
|
||
|
{
|
||
|
LiveChartSerieRenderer* _tmp0_;
|
||
|
#line 25 "../src/serie.vala"
|
||
|
g_return_if_fail (self != NULL);
|
||
|
#line 26 "../src/serie.vala"
|
||
|
_tmp0_ = self->priv->renderer;
|
||
|
#line 26 "../src/serie.vala"
|
||
|
live_chart_serie_renderer_set_line (_tmp0_, value);
|
||
|
#line 25 "../src/serie.vala"
|
||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_properties[LIVE_CHART_SERIE_LINE_PROPERTY]);
|
||
|
#line 426 "serie.c"
|
||
|
}
|
||
|
|
||
|
static gboolean
|
||
|
live_chart_serie_real_get_visible (LiveChartDrawable* base)
|
||
|
{
|
||
|
gboolean result;
|
||
|
LiveChartSerie* self;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
result = self->priv->_visible;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
return result;
|
||
|
#line 440 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_real_set_visible (LiveChartDrawable* base,
|
||
|
gboolean value)
|
||
|
{
|
||
|
LiveChartSerie* self;
|
||
|
gboolean old_value;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
self = (LiveChartSerie*) base;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
old_value = live_chart_serie_real_get_visible (base);
|
||
|
#line 30 "../src/serie.vala"
|
||
|
if (old_value != value) {
|
||
|
#line 30 "../src/serie.vala"
|
||
|
self->priv->_visible = value;
|
||
|
#line 30 "../src/serie.vala"
|
||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_properties[LIVE_CHART_SERIE_VISIBLE_PROPERTY]);
|
||
|
#line 459 "serie.c"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_class_init (LiveChartSerieClass * klass,
|
||
|
gpointer klass_data)
|
||
|
{
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_parent_class = g_type_class_peek_parent (klass);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_type_class_adjust_private_offset (klass, &LiveChartSerie_private_offset);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_serie_get_property;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_serie_set_property;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_serie_finalize;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_NAME_PROPERTY, live_chart_serie_properties[LIVE_CHART_SERIE_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY, live_chart_serie_properties[LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY] = g_param_spec_boxed ("main-color", "main-color", "main-color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_LINE_PROPERTY, live_chart_serie_properties[LIVE_CHART_SERIE_LINE_PROPERTY] = g_param_spec_object ("line", "line", "line", LIVE_CHART_TYPE_PATH, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_VISIBLE_PROPERTY, live_chart_serie_properties[LIVE_CHART_SERIE_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_signals[LIVE_CHART_SERIE_VALUE_ADDED_SIGNAL] = g_signal_new ("value-added", LIVE_CHART_TYPE_SERIE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE);
|
||
|
#line 487 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_live_chart_colorable_interface_init (LiveChartColorableIface * iface,
|
||
|
gpointer iface_data)
|
||
|
{
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_live_chart_colorable_parent_iface = g_type_interface_peek_parent (iface);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->get_main_color = live_chart_serie_real_get_main_color;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->set_main_color = live_chart_serie_real_set_main_color;
|
||
|
#line 500 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||
|
gpointer iface_data)
|
||
|
{
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_serie_real_draw;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_serie_real_get_bounding_box;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->get_visible = live_chart_serie_real_get_visible;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
iface->set_visible = live_chart_serie_real_set_visible;
|
||
|
#line 517 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_instance_init (LiveChartSerie * self,
|
||
|
gpointer klass)
|
||
|
{
|
||
|
#line 4 "../src/serie.vala"
|
||
|
self->priv = live_chart_serie_get_instance_private (self);
|
||
|
#line 30 "../src/serie.vala"
|
||
|
self->priv->_visible = TRUE;
|
||
|
#line 528 "serie.c"
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
live_chart_serie_finalize (GObject * obj)
|
||
|
{
|
||
|
LiveChartSerie * self;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_SERIE, LiveChartSerie);
|
||
|
#line 6 "../src/serie.vala"
|
||
|
_g_free0 (self->priv->_name);
|
||
|
#line 34 "../src/serie.vala"
|
||
|
_g_object_unref0 (self->priv->renderer);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_CLASS (live_chart_serie_parent_class)->finalize (obj);
|
||
|
#line 543 "serie.c"
|
||
|
}
|
||
|
|
||
|
static GType
|
||
|
live_chart_serie_get_type_once (void)
|
||
|
{
|
||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartSerieClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_serie_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartSerie), 0, (GInstanceInitFunc) live_chart_serie_instance_init, NULL };
|
||
|
static const GInterfaceInfo live_chart_colorable_info = { (GInterfaceInitFunc) live_chart_serie_live_chart_colorable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_serie_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||
|
GType live_chart_serie_type_id;
|
||
|
live_chart_serie_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartSerie", &g_define_type_info, 0);
|
||
|
g_type_add_interface_static (live_chart_serie_type_id, LIVE_CHART_TYPE_COLORABLE, &live_chart_colorable_info);
|
||
|
g_type_add_interface_static (live_chart_serie_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||
|
LiveChartSerie_private_offset = g_type_add_instance_private (live_chart_serie_type_id, sizeof (LiveChartSeriePrivate));
|
||
|
return live_chart_serie_type_id;
|
||
|
}
|
||
|
|
||
|
GType
|
||
|
live_chart_serie_get_type (void)
|
||
|
{
|
||
|
static volatile gsize live_chart_serie_type_id__once = 0;
|
||
|
if (g_once_init_enter (&live_chart_serie_type_id__once)) {
|
||
|
GType live_chart_serie_type_id;
|
||
|
live_chart_serie_type_id = live_chart_serie_get_type_once ();
|
||
|
g_once_init_leave (&live_chart_serie_type_id__once, live_chart_serie_type_id);
|
||
|
}
|
||
|
return live_chart_serie_type_id__once;
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
_vala_live_chart_serie_get_property (GObject * object,
|
||
|
guint property_id,
|
||
|
GValue * value,
|
||
|
GParamSpec * pspec)
|
||
|
{
|
||
|
LiveChartSerie * self;
|
||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SERIE, LiveChartSerie);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
switch (property_id) {
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_NAME_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_value_set_string (value, live_chart_serie_get_name (self));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY:
|
||
|
#line 590 "serie.c"
|
||
|
{
|
||
|
GdkRGBA boxed;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_colorable_get_main_color ((LiveChartColorable*) self, &boxed);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_value_set_boxed (value, &boxed);
|
||
|
#line 597 "serie.c"
|
||
|
}
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_LINE_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_value_set_object (value, live_chart_serie_get_line (self));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_VISIBLE_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 613 "serie.c"
|
||
|
default:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 619 "serie.c"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
_vala_live_chart_serie_set_property (GObject * object,
|
||
|
guint property_id,
|
||
|
const GValue * value,
|
||
|
GParamSpec * pspec)
|
||
|
{
|
||
|
LiveChartSerie * self;
|
||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SERIE, LiveChartSerie);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
switch (property_id) {
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_NAME_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_set_name (self, g_value_get_string (value));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_MAIN_COLOR_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_colorable_set_main_color ((LiveChartColorable*) self, g_value_get_boxed (value));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_LINE_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_serie_set_line (self, g_value_get_object (value));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 4 "../src/serie.vala"
|
||
|
case LIVE_CHART_SERIE_VISIBLE_PROPERTY:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 657 "serie.c"
|
||
|
default:
|
||
|
#line 4 "../src/serie.vala"
|
||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||
|
#line 4 "../src/serie.vala"
|
||
|
break;
|
||
|
#line 663 "serie.c"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
|