1271 lines
44 KiB
C
1271 lines
44 KiB
C
/* static_grid.c generated by valac 0.56.0, the Vala compiler
|
|
* generated from static_grid.vala, do not modify */
|
|
|
|
#include "livechart_static.h"
|
|
#include <glib.h>
|
|
#include <gdk/gdk.h>
|
|
#include <float.h>
|
|
#include <math.h>
|
|
#include <string.h>
|
|
#include <cairo-gobject.h>
|
|
#include <gee.h>
|
|
#include <glib-object.h>
|
|
#include <stdlib.h>
|
|
|
|
enum {
|
|
LIVE_CHART_STATIC_STATIC_GRID_0_PROPERTY,
|
|
LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY,
|
|
LIVE_CHART_STATIC_STATIC_GRID_MAIN_COLOR_PROPERTY,
|
|
LIVE_CHART_STATIC_STATIC_GRID_NUM_PROPERTIES
|
|
};
|
|
static GParamSpec* live_chart_static_static_grid_properties[LIVE_CHART_STATIC_STATIC_GRID_NUM_PROPERTIES];
|
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
|
|
|
struct _LiveChartStaticStaticGridPrivate {
|
|
gboolean _visible;
|
|
GdkRGBA _main_color;
|
|
};
|
|
|
|
static gint LiveChartStaticStaticGrid_private_offset;
|
|
static gpointer live_chart_static_static_grid_parent_class = NULL;
|
|
static LiveChartDrawableIface * live_chart_static_static_grid_live_chart_drawable_parent_iface = NULL;
|
|
|
|
static void live_chart_static_static_grid_real_draw (LiveChartDrawable* base,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config);
|
|
static void live_chart_static_static_grid_real_get_bounding_box (LiveChartDrawable* base,
|
|
LiveChartBoundingBox* result);
|
|
static gboolean _gdk_rgba_equal (const GdkRGBA * s1,
|
|
const GdkRGBA * s2);
|
|
static void live_chart_static_static_grid_finalize (GObject * obj);
|
|
static GType live_chart_static_static_grid_get_type_once (void);
|
|
static void _vala_live_chart_static_static_grid_get_property (GObject * object,
|
|
guint property_id,
|
|
GValue * value,
|
|
GParamSpec * pspec);
|
|
static void _vala_live_chart_static_static_grid_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_static_static_grid_get_instance_private (LiveChartStaticStaticGrid* self)
|
|
{
|
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticGrid_private_offset);
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_real_draw (LiveChartDrawable* base,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
LiveChartStaticStaticGrid * self;
|
|
gboolean _tmp0_;
|
|
gboolean _tmp1_;
|
|
#line 25 "../src/static/static_grid.vala"
|
|
self = (LiveChartStaticStaticGrid*) base;
|
|
#line 25 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 25 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 26 "../src/static/static_grid.vala"
|
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
|
#line 26 "../src/static/static_grid.vala"
|
|
_tmp1_ = _tmp0_;
|
|
#line 26 "../src/static/static_grid.vala"
|
|
if (_tmp1_) {
|
|
#line 27 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_render_abscissa (self, ctx, config);
|
|
#line 28 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_render_ordinate (self, ctx, config);
|
|
#line 29 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_render_grid (self, ctx, config);
|
|
#line 30 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_update_bounding_box (self, config);
|
|
#line 31 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_debug (self, ctx);
|
|
#line 90 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_real_get_bounding_box (LiveChartDrawable* base,
|
|
LiveChartBoundingBox* result)
|
|
{
|
|
LiveChartStaticStaticGrid * self;
|
|
LiveChartBoundingBox _tmp0_;
|
|
#line 35 "../src/static/static_grid.vala"
|
|
self = (LiveChartStaticStaticGrid*) base;
|
|
#line 36 "../src/static/static_grid.vala"
|
|
_tmp0_ = self->bounding_box;
|
|
#line 36 "../src/static/static_grid.vala"
|
|
*result = _tmp0_;
|
|
#line 36 "../src/static/static_grid.vala"
|
|
return;
|
|
#line 108 "static_grid.c"
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_restore (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx)
|
|
{
|
|
GdkRGBA _tmp0_;
|
|
GdkRGBA _tmp1_;
|
|
GdkRGBA _tmp2_;
|
|
GdkRGBA _tmp3_;
|
|
#line 39 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 39 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 40 "../src/static/static_grid.vala"
|
|
_tmp0_ = self->priv->_main_color;
|
|
#line 40 "../src/static/static_grid.vala"
|
|
_tmp1_ = self->priv->_main_color;
|
|
#line 40 "../src/static/static_grid.vala"
|
|
_tmp2_ = self->priv->_main_color;
|
|
#line 40 "../src/static/static_grid.vala"
|
|
_tmp3_ = self->priv->_main_color;
|
|
#line 40 "../src/static/static_grid.vala"
|
|
cairo_set_source_rgba (ctx, _tmp0_.red, _tmp1_.green, _tmp2_.blue, _tmp3_.alpha);
|
|
#line 41 "../src/static/static_grid.vala"
|
|
cairo_set_line_width (ctx, 0.5);
|
|
#line 42 "../src/static/static_grid.vala"
|
|
cairo_set_dash (ctx, NULL, (gint) 0, 0.0);
|
|
#line 137 "static_grid.c"
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_render_abscissa (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
gboolean _tmp0_ = FALSE;
|
|
LiveChartXAxis* _tmp1_;
|
|
gboolean _tmp2_;
|
|
gboolean _tmp3_;
|
|
#line 45 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 45 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 45 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp1_ = config->x_axis;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp2_ = live_chart_xaxis_get_visible (_tmp1_);
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp3_ = _tmp2_;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
if (_tmp3_) {
|
|
#line 163 "static_grid.c"
|
|
LiveChartXAxis* _tmp4_;
|
|
LiveChartPath* _tmp5_;
|
|
gboolean _tmp6_;
|
|
gboolean _tmp7_;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp4_ = config->x_axis;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp5_ = _tmp4_->axis;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp6_ = live_chart_path_get_visible (_tmp5_);
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp7_ = _tmp6_;
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp0_ = _tmp7_;
|
|
#line 178 "static_grid.c"
|
|
} else {
|
|
#line 46 "../src/static/static_grid.vala"
|
|
_tmp0_ = FALSE;
|
|
#line 182 "static_grid.c"
|
|
}
|
|
#line 46 "../src/static/static_grid.vala"
|
|
if (_tmp0_) {
|
|
#line 186 "static_grid.c"
|
|
LiveChartXAxis* _tmp8_;
|
|
LiveChartPath* _tmp9_;
|
|
LiveChartPadding _tmp10_;
|
|
gint _tmp11_;
|
|
gint _tmp12_;
|
|
LiveChartPadding _tmp13_;
|
|
gint _tmp14_;
|
|
gint _tmp15_;
|
|
LiveChartPadding _tmp16_;
|
|
gint _tmp17_;
|
|
gint _tmp18_;
|
|
LiveChartPadding _tmp19_;
|
|
#line 47 "../src/static/static_grid.vala"
|
|
_tmp8_ = config->x_axis;
|
|
#line 47 "../src/static/static_grid.vala"
|
|
_tmp9_ = _tmp8_->axis;
|
|
#line 47 "../src/static/static_grid.vala"
|
|
live_chart_path_configure (_tmp9_, ctx);
|
|
#line 48 "../src/static/static_grid.vala"
|
|
_tmp10_ = config->padding;
|
|
#line 48 "../src/static/static_grid.vala"
|
|
_tmp11_ = live_chart_config_get_height (config);
|
|
#line 48 "../src/static/static_grid.vala"
|
|
_tmp12_ = _tmp11_;
|
|
#line 48 "../src/static/static_grid.vala"
|
|
_tmp13_ = config->padding;
|
|
#line 48 "../src/static/static_grid.vala"
|
|
cairo_move_to (ctx, _tmp10_.left + 0.5, (_tmp12_ - _tmp13_.bottom) + 0.5);
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp14_ = live_chart_config_get_width (config);
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp15_ = _tmp14_;
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp16_ = config->padding;
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp17_ = live_chart_config_get_height (config);
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp18_ = _tmp17_;
|
|
#line 49 "../src/static/static_grid.vala"
|
|
_tmp19_ = config->padding;
|
|
#line 49 "../src/static/static_grid.vala"
|
|
cairo_line_to (ctx, (_tmp15_ - _tmp16_.right) + 0.5, (_tmp18_ - _tmp19_.bottom) + 0.5);
|
|
#line 50 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 51 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_restore (self, ctx);
|
|
#line 233 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_render_ordinate (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
gboolean _tmp0_ = FALSE;
|
|
LiveChartYAxis* _tmp1_;
|
|
gboolean _tmp2_;
|
|
gboolean _tmp3_;
|
|
#line 55 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 55 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 55 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp1_ = config->y_axis;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp2_ = live_chart_yaxis_get_visible (_tmp1_);
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp3_ = _tmp2_;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
if (_tmp3_) {
|
|
#line 260 "static_grid.c"
|
|
LiveChartYAxis* _tmp4_;
|
|
LiveChartPath* _tmp5_;
|
|
gboolean _tmp6_;
|
|
gboolean _tmp7_;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp4_ = config->y_axis;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp5_ = _tmp4_->axis;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp6_ = live_chart_path_get_visible (_tmp5_);
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp7_ = _tmp6_;
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp0_ = _tmp7_;
|
|
#line 275 "static_grid.c"
|
|
} else {
|
|
#line 56 "../src/static/static_grid.vala"
|
|
_tmp0_ = FALSE;
|
|
#line 279 "static_grid.c"
|
|
}
|
|
#line 56 "../src/static/static_grid.vala"
|
|
if (_tmp0_) {
|
|
#line 283 "static_grid.c"
|
|
LiveChartYAxis* _tmp8_;
|
|
LiveChartPath* _tmp9_;
|
|
LiveChartPadding _tmp10_;
|
|
gint _tmp11_;
|
|
gint _tmp12_;
|
|
LiveChartPadding _tmp13_;
|
|
LiveChartPadding _tmp14_;
|
|
LiveChartPadding _tmp15_;
|
|
#line 57 "../src/static/static_grid.vala"
|
|
_tmp8_ = config->y_axis;
|
|
#line 57 "../src/static/static_grid.vala"
|
|
_tmp9_ = _tmp8_->axis;
|
|
#line 57 "../src/static/static_grid.vala"
|
|
live_chart_path_configure (_tmp9_, ctx);
|
|
#line 58 "../src/static/static_grid.vala"
|
|
_tmp10_ = config->padding;
|
|
#line 58 "../src/static/static_grid.vala"
|
|
_tmp11_ = live_chart_config_get_height (config);
|
|
#line 58 "../src/static/static_grid.vala"
|
|
_tmp12_ = _tmp11_;
|
|
#line 58 "../src/static/static_grid.vala"
|
|
_tmp13_ = config->padding;
|
|
#line 58 "../src/static/static_grid.vala"
|
|
cairo_move_to (ctx, _tmp10_.left + 0.5, (_tmp12_ - _tmp13_.bottom) + 0.5);
|
|
#line 59 "../src/static/static_grid.vala"
|
|
_tmp14_ = config->padding;
|
|
#line 59 "../src/static/static_grid.vala"
|
|
_tmp15_ = config->padding;
|
|
#line 59 "../src/static/static_grid.vala"
|
|
cairo_line_to (ctx, _tmp14_.left + 0.5, _tmp15_.top + 0.5);
|
|
#line 60 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 61 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_restore (self, ctx);
|
|
#line 318 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_render_grid (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
#line 65 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 65 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 65 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 66 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_render_hgrid (self, ctx, config);
|
|
#line 67 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_render_vgrid (self, ctx, config);
|
|
#line 337 "static_grid.c"
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_render_vgrid (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
LiveChartBoundaries boundaries = {0};
|
|
LiveChartBoundaries _tmp0_ = {0};
|
|
gint width_between_each_points = 0;
|
|
LiveChartBoundaries _tmp1_;
|
|
LiveChartBoundary _tmp2_;
|
|
LiveChartBoundaries _tmp3_;
|
|
LiveChartBoundary _tmp4_;
|
|
GeeArrayList* _tmp5_;
|
|
gint _tmp6_;
|
|
gint _tmp7_;
|
|
#line 70 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 70 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 70 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 72 "../src/static/static_grid.vala"
|
|
live_chart_config_boundaries (config, &_tmp0_);
|
|
#line 72 "../src/static/static_grid.vala"
|
|
boundaries = _tmp0_;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp1_ = boundaries;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp2_ = _tmp1_.x;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp3_ = boundaries;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp4_ = _tmp3_.x;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp5_ = config->categories;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
|
|
#line 75 "../src/static/static_grid.vala"
|
|
_tmp7_ = _tmp6_;
|
|
#line 75 "../src/static/static_grid.vala"
|
|
width_between_each_points = (_tmp2_.max - _tmp4_.min) / (_tmp7_ - 1);
|
|
#line 381 "static_grid.c"
|
|
{
|
|
guint8 i = 0U;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
i = (guint8) 0;
|
|
#line 386 "static_grid.c"
|
|
{
|
|
gboolean _tmp8_ = FALSE;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp8_ = TRUE;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
while (TRUE) {
|
|
#line 393 "static_grid.c"
|
|
GeeArrayList* _tmp10_;
|
|
gint _tmp11_;
|
|
gint _tmp12_;
|
|
gchar* category = NULL;
|
|
GeeArrayList* _tmp13_;
|
|
gpointer _tmp14_;
|
|
gboolean _tmp15_ = FALSE;
|
|
LiveChartXAxis* _tmp16_;
|
|
gboolean _tmp17_;
|
|
gboolean _tmp18_;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
if (!_tmp8_) {
|
|
#line 406 "static_grid.c"
|
|
guint8 _tmp9_;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp9_ = i;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
i = _tmp9_ + 1;
|
|
#line 412 "static_grid.c"
|
|
}
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp8_ = FALSE;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp10_ = config->categories;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_tmp12_ = _tmp11_;
|
|
#line 77 "../src/static/static_grid.vala"
|
|
if (!(((gint) i) < _tmp12_)) {
|
|
#line 77 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 426 "static_grid.c"
|
|
}
|
|
#line 78 "../src/static/static_grid.vala"
|
|
_tmp13_ = config->categories;
|
|
#line 78 "../src/static/static_grid.vala"
|
|
_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, (gint) i);
|
|
#line 78 "../src/static/static_grid.vala"
|
|
category = (gchar*) _tmp14_;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp16_ = config->x_axis;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp17_ = live_chart_xaxis_get_visible (_tmp16_);
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp18_ = _tmp17_;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
if (_tmp18_) {
|
|
#line 442 "static_grid.c"
|
|
LiveChartXAxis* _tmp19_;
|
|
LiveChartLabels* _tmp20_;
|
|
gboolean _tmp21_;
|
|
gboolean _tmp22_;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp19_ = config->x_axis;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp20_ = _tmp19_->labels;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp21_ = live_chart_labels_get_visible (_tmp20_);
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp22_ = _tmp21_;
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp15_ = _tmp22_;
|
|
#line 457 "static_grid.c"
|
|
} else {
|
|
#line 79 "../src/static/static_grid.vala"
|
|
_tmp15_ = FALSE;
|
|
#line 461 "static_grid.c"
|
|
}
|
|
#line 79 "../src/static/static_grid.vala"
|
|
if (_tmp15_) {
|
|
#line 465 "static_grid.c"
|
|
LiveChartXAxis* _tmp23_;
|
|
LiveChartLabels* _tmp24_;
|
|
LiveChartFont* _tmp25_;
|
|
LiveChartFont* _tmp26_;
|
|
cairo_text_extents_t extents = {0};
|
|
const gchar* _tmp27_;
|
|
cairo_text_extents_t _tmp28_ = {0};
|
|
const gchar* _tmp29_;
|
|
cairo_text_extents_t _tmp30_;
|
|
gint _tmp31_;
|
|
gint _tmp32_;
|
|
LiveChartPadding _tmp33_;
|
|
LiveChartXAxis* _tmp34_;
|
|
LiveChartLabels* _tmp35_;
|
|
cairo_text_extents_t _tmp36_ = {0};
|
|
cairo_text_extents_t _tmp37_;
|
|
cairo_text_extents_t _tmp38_;
|
|
LiveChartBoundaries _tmp39_;
|
|
LiveChartBoundary _tmp40_;
|
|
gint _tmp41_;
|
|
gint _tmp42_;
|
|
LiveChartPadding _tmp43_;
|
|
LiveChartXAxis* _tmp44_;
|
|
LiveChartLabels* _tmp45_;
|
|
cairo_text_extents_t _tmp46_ = {0};
|
|
cairo_text_extents_t _tmp47_;
|
|
const gchar* _tmp48_;
|
|
#line 80 "../src/static/static_grid.vala"
|
|
_tmp23_ = config->x_axis;
|
|
#line 80 "../src/static/static_grid.vala"
|
|
_tmp24_ = _tmp23_->labels;
|
|
#line 80 "../src/static/static_grid.vala"
|
|
_tmp25_ = live_chart_labels_get_font (_tmp24_);
|
|
#line 80 "../src/static/static_grid.vala"
|
|
_tmp26_ = _tmp25_;
|
|
#line 80 "../src/static/static_grid.vala"
|
|
live_chart_font_configure (_tmp26_, ctx);
|
|
#line 84 "../src/static/static_grid.vala"
|
|
_tmp27_ = category;
|
|
#line 84 "../src/static/static_grid.vala"
|
|
cairo_text_extents (ctx, _tmp27_, &_tmp28_);
|
|
#line 84 "../src/static/static_grid.vala"
|
|
extents = _tmp28_;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp29_ = category;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp30_ = extents;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp31_ = live_chart_config_get_height (config);
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp32_ = _tmp31_;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp33_ = config->padding;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp34_ = config->x_axis;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp35_ = _tmp34_->labels;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
live_chart_labels_get_extents (_tmp35_, &_tmp36_);
|
|
#line 85 "../src/static/static_grid.vala"
|
|
_tmp37_ = _tmp36_;
|
|
#line 85 "../src/static/static_grid.vala"
|
|
g_message ("static_grid.vala:85: Display %s at %f,%f", _tmp29_, ((width_between_each_points + 0.5) - (_tmp30_.width / 2)) * i, (((0.5 + _tmp32_) - _tmp33_.bottom) + _tmp37_.height) + LIVE_CHART_GRID_ABSCISSA_TIME_PADDING);
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp38_ = extents;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp39_ = boundaries;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp40_ = _tmp39_.x;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp41_ = live_chart_config_get_height (config);
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp42_ = _tmp41_;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp43_ = config->padding;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp44_ = config->x_axis;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp45_ = _tmp44_->labels;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
live_chart_labels_get_extents (_tmp45_, &_tmp46_);
|
|
#line 86 "../src/static/static_grid.vala"
|
|
_tmp47_ = _tmp46_;
|
|
#line 86 "../src/static/static_grid.vala"
|
|
cairo_move_to (ctx, (((width_between_each_points * i) + 0.5) - (_tmp38_.width / 2)) + _tmp40_.min, (((0.5 + _tmp42_) - _tmp43_.bottom) + _tmp47_.height) + LIVE_CHART_GRID_ABSCISSA_TIME_PADDING);
|
|
#line 87 "../src/static/static_grid.vala"
|
|
_tmp48_ = category;
|
|
#line 87 "../src/static/static_grid.vala"
|
|
cairo_show_text (ctx, _tmp48_);
|
|
#line 88 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 557 "static_grid.c"
|
|
}
|
|
#line 77 "../src/static/static_grid.vala"
|
|
_g_free0 (category);
|
|
#line 561 "static_grid.c"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_render_hgrid (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx,
|
|
LiveChartConfig* config)
|
|
{
|
|
LiveChartBoundaries boundaries = {0};
|
|
LiveChartBoundaries _tmp0_ = {0};
|
|
#line 117 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 117 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 117 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 119 "../src/static/static_grid.vala"
|
|
live_chart_config_boundaries (config, &_tmp0_);
|
|
#line 119 "../src/static/static_grid.vala"
|
|
boundaries = _tmp0_;
|
|
#line 584 "static_grid.c"
|
|
{
|
|
GeeList* _position_list = NULL;
|
|
LiveChartYAxis* _tmp1_;
|
|
LiveChartTicks _tmp2_;
|
|
GeeList* _tmp3_;
|
|
gint _position_size = 0;
|
|
GeeList* _tmp4_;
|
|
gint _tmp5_;
|
|
gint _tmp6_;
|
|
gint _position_index = 0;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp1_ = config->y_axis;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp2_ = _tmp1_->ticks;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp3_ = _tmp2_.values;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_position_list = _tmp3_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp4_ = _position_list;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp6_ = _tmp5_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_position_size = _tmp6_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_position_index = -1;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
while (TRUE) {
|
|
#line 615 "static_grid.c"
|
|
gint _tmp7_;
|
|
gint _tmp8_;
|
|
gfloat position = 0.0F;
|
|
GeeList* _tmp9_;
|
|
gpointer _tmp10_;
|
|
gfloat* _tmp11_;
|
|
gfloat _tmp12_;
|
|
gdouble y = 0.0;
|
|
LiveChartBoundaries _tmp13_;
|
|
LiveChartBoundaries _tmp14_;
|
|
LiveChartBoundary _tmp15_;
|
|
LiveChartYAxis* _tmp16_;
|
|
LiveChartBoundaries _tmp17_;
|
|
LiveChartBoundary _tmp18_;
|
|
LiveChartYAxis* _tmp19_;
|
|
LiveChartPath* _tmp20_;
|
|
gboolean _tmp21_;
|
|
gboolean _tmp22_;
|
|
gboolean _tmp29_ = FALSE;
|
|
LiveChartYAxis* _tmp30_;
|
|
gboolean _tmp31_;
|
|
gboolean _tmp32_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_position_index = _position_index + 1;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp7_ = _position_index;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp8_ = _position_size;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
if (!(_tmp7_ < _tmp8_)) {
|
|
#line 120 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 648 "static_grid.c"
|
|
}
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp9_ = _position_list;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp10_ = gee_list_get (_tmp9_, _position_index);
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp11_ = (gfloat*) _tmp10_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_tmp12_ = *_tmp11_;
|
|
#line 120 "../src/static/static_grid.vala"
|
|
_g_free0 (_tmp11_);
|
|
#line 120 "../src/static/static_grid.vala"
|
|
position = _tmp12_;
|
|
#line 122 "../src/static/static_grid.vala"
|
|
_tmp13_ = boundaries;
|
|
#line 122 "../src/static/static_grid.vala"
|
|
_tmp14_ = boundaries;
|
|
#line 122 "../src/static/static_grid.vala"
|
|
_tmp15_ = _tmp14_.y;
|
|
#line 122 "../src/static/static_grid.vala"
|
|
_tmp16_ = config->y_axis;
|
|
#line 122 "../src/static/static_grid.vala"
|
|
y = (_tmp13_.height + _tmp15_.min) - (position * live_chart_yaxis_get_ratio (_tmp16_));
|
|
#line 123 "../src/static/static_grid.vala"
|
|
_tmp17_ = boundaries;
|
|
#line 123 "../src/static/static_grid.vala"
|
|
_tmp18_ = _tmp17_.y;
|
|
#line 123 "../src/static/static_grid.vala"
|
|
if (y < ((gdouble) _tmp18_.min)) {
|
|
#line 124 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 680 "static_grid.c"
|
|
}
|
|
#line 126 "../src/static/static_grid.vala"
|
|
_tmp19_ = config->y_axis;
|
|
#line 126 "../src/static/static_grid.vala"
|
|
_tmp20_ = _tmp19_->lines;
|
|
#line 126 "../src/static/static_grid.vala"
|
|
_tmp21_ = live_chart_path_get_visible (_tmp20_);
|
|
#line 126 "../src/static/static_grid.vala"
|
|
_tmp22_ = _tmp21_;
|
|
#line 126 "../src/static/static_grid.vala"
|
|
if (_tmp22_) {
|
|
#line 692 "static_grid.c"
|
|
LiveChartYAxis* _tmp23_;
|
|
LiveChartPath* _tmp24_;
|
|
LiveChartBoundaries _tmp25_;
|
|
LiveChartBoundary _tmp26_;
|
|
LiveChartBoundaries _tmp27_;
|
|
LiveChartBoundary _tmp28_;
|
|
#line 127 "../src/static/static_grid.vala"
|
|
_tmp23_ = config->y_axis;
|
|
#line 127 "../src/static/static_grid.vala"
|
|
_tmp24_ = _tmp23_->lines;
|
|
#line 127 "../src/static/static_grid.vala"
|
|
live_chart_path_configure (_tmp24_, ctx);
|
|
#line 128 "../src/static/static_grid.vala"
|
|
_tmp25_ = boundaries;
|
|
#line 128 "../src/static/static_grid.vala"
|
|
_tmp26_ = _tmp25_.x;
|
|
#line 128 "../src/static/static_grid.vala"
|
|
cairo_move_to (ctx, 0.5 + _tmp26_.max, ((gint) y) + 0.5);
|
|
#line 129 "../src/static/static_grid.vala"
|
|
_tmp27_ = boundaries;
|
|
#line 129 "../src/static/static_grid.vala"
|
|
_tmp28_ = _tmp27_.x;
|
|
#line 129 "../src/static/static_grid.vala"
|
|
cairo_line_to (ctx, _tmp28_.min + 0.5, ((gint) y) + 0.5);
|
|
#line 130 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 131 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_restore (self, ctx);
|
|
#line 721 "static_grid.c"
|
|
}
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp30_ = config->y_axis;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp31_ = live_chart_yaxis_get_visible (_tmp30_);
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp32_ = _tmp31_;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
if (_tmp32_) {
|
|
#line 731 "static_grid.c"
|
|
LiveChartYAxis* _tmp33_;
|
|
LiveChartLabels* _tmp34_;
|
|
gboolean _tmp35_;
|
|
gboolean _tmp36_;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp33_ = config->y_axis;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp34_ = _tmp33_->labels;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp35_ = live_chart_labels_get_visible (_tmp34_);
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp36_ = _tmp35_;
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp29_ = _tmp36_;
|
|
#line 746 "static_grid.c"
|
|
} else {
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_tmp29_ = FALSE;
|
|
#line 750 "static_grid.c"
|
|
}
|
|
#line 135 "../src/static/static_grid.vala"
|
|
if (_tmp29_) {
|
|
#line 754 "static_grid.c"
|
|
LiveChartYAxis* _tmp37_;
|
|
LiveChartLabels* _tmp38_;
|
|
LiveChartFont* _tmp39_;
|
|
LiveChartFont* _tmp40_;
|
|
gchar* value = NULL;
|
|
LiveChartYAxis* _tmp41_;
|
|
const gchar* _tmp42_;
|
|
const gchar* _tmp43_;
|
|
gchar* _tmp44_;
|
|
cairo_text_extents_t extents = {0};
|
|
const gchar* _tmp45_;
|
|
cairo_text_extents_t _tmp46_ = {0};
|
|
LiveChartBoundaries _tmp47_;
|
|
LiveChartBoundary _tmp48_;
|
|
cairo_text_extents_t _tmp49_;
|
|
cairo_text_extents_t _tmp50_;
|
|
const gchar* _tmp51_;
|
|
#line 136 "../src/static/static_grid.vala"
|
|
_tmp37_ = config->y_axis;
|
|
#line 136 "../src/static/static_grid.vala"
|
|
_tmp38_ = _tmp37_->labels;
|
|
#line 136 "../src/static/static_grid.vala"
|
|
_tmp39_ = live_chart_labels_get_font (_tmp38_);
|
|
#line 136 "../src/static/static_grid.vala"
|
|
_tmp40_ = _tmp39_;
|
|
#line 136 "../src/static/static_grid.vala"
|
|
live_chart_font_configure (_tmp40_, ctx);
|
|
#line 137 "../src/static/static_grid.vala"
|
|
_tmp41_ = config->y_axis;
|
|
#line 137 "../src/static/static_grid.vala"
|
|
_tmp42_ = live_chart_yaxis_get_unit (_tmp41_);
|
|
#line 137 "../src/static/static_grid.vala"
|
|
_tmp43_ = _tmp42_;
|
|
#line 137 "../src/static/static_grid.vala"
|
|
_tmp44_ = live_chart_format_for_y_axis (_tmp43_, position);
|
|
#line 137 "../src/static/static_grid.vala"
|
|
value = _tmp44_;
|
|
#line 140 "../src/static/static_grid.vala"
|
|
_tmp45_ = value;
|
|
#line 140 "../src/static/static_grid.vala"
|
|
cairo_text_extents (ctx, _tmp45_, &_tmp46_);
|
|
#line 140 "../src/static/static_grid.vala"
|
|
extents = _tmp46_;
|
|
#line 141 "../src/static/static_grid.vala"
|
|
_tmp47_ = boundaries;
|
|
#line 141 "../src/static/static_grid.vala"
|
|
_tmp48_ = _tmp47_.x;
|
|
#line 141 "../src/static/static_grid.vala"
|
|
_tmp49_ = extents;
|
|
#line 141 "../src/static/static_grid.vala"
|
|
_tmp50_ = extents;
|
|
#line 141 "../src/static/static_grid.vala"
|
|
cairo_move_to (ctx, (_tmp48_.min - _tmp49_.width) - 5, (y + (_tmp50_.height / 2)) + 0.5);
|
|
#line 142 "../src/static/static_grid.vala"
|
|
_tmp51_ = value;
|
|
#line 142 "../src/static/static_grid.vala"
|
|
cairo_show_text (ctx, _tmp51_);
|
|
#line 143 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 135 "../src/static/static_grid.vala"
|
|
_g_free0 (value);
|
|
#line 816 "static_grid.c"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_update_bounding_box (LiveChartStaticStaticGrid* self,
|
|
LiveChartConfig* config)
|
|
{
|
|
LiveChartBoundaries boundaries = {0};
|
|
LiveChartBoundaries _tmp0_ = {0};
|
|
LiveChartBoundaries _tmp1_;
|
|
LiveChartBoundary _tmp2_;
|
|
LiveChartBoundaries _tmp3_;
|
|
LiveChartBoundary _tmp4_;
|
|
LiveChartBoundaries _tmp5_;
|
|
LiveChartBoundary _tmp6_;
|
|
LiveChartBoundaries _tmp7_;
|
|
LiveChartBoundary _tmp8_;
|
|
LiveChartBoundaries _tmp9_;
|
|
LiveChartBoundary _tmp10_;
|
|
LiveChartBoundaries _tmp11_;
|
|
LiveChartBoundary _tmp12_;
|
|
LiveChartBoundingBox _tmp13_ = {0};
|
|
#line 148 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 148 "../src/static/static_grid.vala"
|
|
g_return_if_fail (config != NULL);
|
|
#line 149 "../src/static/static_grid.vala"
|
|
live_chart_config_boundaries (config, &_tmp0_);
|
|
#line 149 "../src/static/static_grid.vala"
|
|
boundaries = _tmp0_;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp1_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp2_ = _tmp1_.x;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp3_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp4_ = _tmp3_.y;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp5_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp6_ = _tmp5_.x;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp7_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp8_ = _tmp7_.x;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp9_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp10_ = _tmp9_.y;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp11_ = boundaries;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp12_ = _tmp11_.y;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
memset (&_tmp13_, 0, sizeof (LiveChartBoundingBox));
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp13_.x = (gdouble) _tmp2_.min;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp13_.y = (gdouble) _tmp4_.min;
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp13_.width = (gdouble) (_tmp6_.max - _tmp8_.min);
|
|
#line 150 "../src/static/static_grid.vala"
|
|
_tmp13_.height = (gdouble) ((_tmp10_.max - _tmp12_.min) + LIVE_CHART_GRID_ABSCISSA_TIME_PADDING);
|
|
#line 150 "../src/static/static_grid.vala"
|
|
self->bounding_box = _tmp13_;
|
|
#line 885 "static_grid.c"
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_debug (LiveChartStaticStaticGrid* self,
|
|
cairo_t* ctx)
|
|
{
|
|
gchar* debug = NULL;
|
|
const gchar* _tmp0_;
|
|
gchar* _tmp1_;
|
|
const gchar* _tmp2_;
|
|
#line 158 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 158 "../src/static/static_grid.vala"
|
|
g_return_if_fail (ctx != NULL);
|
|
#line 159 "../src/static/static_grid.vala"
|
|
_tmp0_ = g_getenv ("LIVE_CHART_DEBUG");
|
|
#line 159 "../src/static/static_grid.vala"
|
|
_tmp1_ = g_strdup (_tmp0_);
|
|
#line 159 "../src/static/static_grid.vala"
|
|
debug = _tmp1_;
|
|
#line 160 "../src/static/static_grid.vala"
|
|
_tmp2_ = debug;
|
|
#line 160 "../src/static/static_grid.vala"
|
|
if (_tmp2_ != NULL) {
|
|
#line 910 "static_grid.c"
|
|
LiveChartBoundingBox _tmp3_;
|
|
LiveChartBoundingBox _tmp4_;
|
|
LiveChartBoundingBox _tmp5_;
|
|
LiveChartBoundingBox _tmp6_;
|
|
#line 161 "../src/static/static_grid.vala"
|
|
_tmp3_ = self->bounding_box;
|
|
#line 161 "../src/static/static_grid.vala"
|
|
_tmp4_ = self->bounding_box;
|
|
#line 161 "../src/static/static_grid.vala"
|
|
_tmp5_ = self->bounding_box;
|
|
#line 161 "../src/static/static_grid.vala"
|
|
_tmp6_ = self->bounding_box;
|
|
#line 161 "../src/static/static_grid.vala"
|
|
cairo_rectangle (ctx, _tmp3_.x, _tmp4_.y, _tmp5_.width, _tmp6_.height);
|
|
#line 162 "../src/static/static_grid.vala"
|
|
cairo_stroke (ctx);
|
|
#line 927 "static_grid.c"
|
|
}
|
|
#line 158 "../src/static/static_grid.vala"
|
|
_g_free0 (debug);
|
|
#line 931 "static_grid.c"
|
|
}
|
|
|
|
LiveChartStaticStaticGrid*
|
|
live_chart_static_static_grid_construct (GType object_type)
|
|
{
|
|
LiveChartStaticStaticGrid * self = NULL;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
self = (LiveChartStaticStaticGrid*) g_object_new (object_type, NULL);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
return self;
|
|
#line 942 "static_grid.c"
|
|
}
|
|
|
|
LiveChartStaticStaticGrid*
|
|
live_chart_static_static_grid_new (void)
|
|
{
|
|
#line 6 "../src/static/static_grid.vala"
|
|
return live_chart_static_static_grid_construct (LIVE_CHART_STATIC_TYPE_STATIC_GRID);
|
|
#line 950 "static_grid.c"
|
|
}
|
|
|
|
static gboolean
|
|
live_chart_static_static_grid_real_get_visible (LiveChartDrawable* base)
|
|
{
|
|
gboolean result;
|
|
LiveChartStaticStaticGrid* self;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
self = (LiveChartStaticStaticGrid*) base;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
result = self->priv->_visible;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
return result;
|
|
#line 964 "static_grid.c"
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_real_set_visible (LiveChartDrawable* base,
|
|
gboolean value)
|
|
{
|
|
LiveChartStaticStaticGrid* self;
|
|
gboolean old_value;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
self = (LiveChartStaticStaticGrid*) base;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
old_value = live_chart_static_static_grid_real_get_visible (base);
|
|
#line 15 "../src/static/static_grid.vala"
|
|
if (old_value != value) {
|
|
#line 15 "../src/static/static_grid.vala"
|
|
self->priv->_visible = value;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_grid_properties[LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY]);
|
|
#line 983 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_get_main_color (LiveChartStaticStaticGrid* self,
|
|
GdkRGBA * result)
|
|
{
|
|
GdkRGBA _tmp0_;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 17 "../src/static/static_grid.vala"
|
|
_tmp0_ = self->priv->_main_color;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
*result = _tmp0_;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return;
|
|
#line 1000 "static_grid.c"
|
|
}
|
|
|
|
static gboolean
|
|
_gdk_rgba_equal (const GdkRGBA * s1,
|
|
const GdkRGBA * s2)
|
|
{
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1 == s2) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return TRUE;
|
|
#line 1011 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1 == NULL) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1017 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s2 == NULL) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1023 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1->red != s2->red) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1029 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1->green != s2->green) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1035 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1->blue != s2->blue) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1041 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (s1->alpha != s2->alpha) {
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return FALSE;
|
|
#line 1047 "static_grid.c"
|
|
}
|
|
#line 17 "../src/static/static_grid.vala"
|
|
return TRUE;
|
|
#line 1051 "static_grid.c"
|
|
}
|
|
|
|
void
|
|
live_chart_static_static_grid_set_main_color (LiveChartStaticStaticGrid* self,
|
|
GdkRGBA * value)
|
|
{
|
|
GdkRGBA old_value;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
g_return_if_fail (self != NULL);
|
|
#line 17 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_get_main_color (self, &old_value);
|
|
#line 17 "../src/static/static_grid.vala"
|
|
if (_gdk_rgba_equal (value, &old_value) != TRUE) {
|
|
#line 1065 "static_grid.c"
|
|
GdkRGBA _tmp0_;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
_tmp0_ = *value;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
self->priv->_main_color = _tmp0_;
|
|
#line 17 "../src/static/static_grid.vala"
|
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_grid_properties[LIVE_CHART_STATIC_STATIC_GRID_MAIN_COLOR_PROPERTY]);
|
|
#line 1073 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_class_init (LiveChartStaticStaticGridClass * klass,
|
|
gpointer klass_data)
|
|
{
|
|
#line 6 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_parent_class = g_type_class_peek_parent (klass);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticGrid_private_offset);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_grid_get_property;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_grid_set_property;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_grid_finalize;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY, live_chart_static_static_grid_properties[LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
#line 6 "../src/static/static_grid.vala"
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_GRID_MAIN_COLOR_PROPERTY, live_chart_static_static_grid_properties[LIVE_CHART_STATIC_STATIC_GRID_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 1095 "static_grid.c"
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
|
gpointer iface_data)
|
|
{
|
|
#line 6 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_static_static_grid_real_draw;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_static_static_grid_real_get_bounding_box;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
iface->get_visible = live_chart_static_static_grid_real_get_visible;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
iface->set_visible = live_chart_static_static_grid_real_set_visible;
|
|
#line 1112 "static_grid.c"
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_instance_init (LiveChartStaticStaticGrid * self,
|
|
gpointer klass)
|
|
{
|
|
LiveChartBoundingBox _tmp0_ = {0};
|
|
GdkRGBA _tmp1_ = {0};
|
|
#line 6 "../src/static/static_grid.vala"
|
|
self->priv = live_chart_static_static_grid_get_instance_private (self);
|
|
#line 8 "../src/static/static_grid.vala"
|
|
memset (&_tmp0_, 0, sizeof (LiveChartBoundingBox));
|
|
#line 8 "../src/static/static_grid.vala"
|
|
_tmp0_.x = (gdouble) 0;
|
|
#line 8 "../src/static/static_grid.vala"
|
|
_tmp0_.y = (gdouble) 0;
|
|
#line 8 "../src/static/static_grid.vala"
|
|
_tmp0_.width = (gdouble) 0;
|
|
#line 8 "../src/static/static_grid.vala"
|
|
_tmp0_.height = (gdouble) 0;
|
|
#line 8 "../src/static/static_grid.vala"
|
|
self->bounding_box = _tmp0_;
|
|
#line 15 "../src/static/static_grid.vala"
|
|
self->priv->_visible = TRUE;
|
|
#line 16 "../src/static/static_grid.vala"
|
|
memset (&_tmp1_, 0, sizeof (GdkRGBA));
|
|
#line 16 "../src/static/static_grid.vala"
|
|
_tmp1_.red = 0.4;
|
|
#line 16 "../src/static/static_grid.vala"
|
|
_tmp1_.green = 0.4;
|
|
#line 16 "../src/static/static_grid.vala"
|
|
_tmp1_.blue = 0.4;
|
|
#line 16 "../src/static/static_grid.vala"
|
|
_tmp1_.alpha = 1.0;
|
|
#line 16 "../src/static/static_grid.vala"
|
|
self->priv->_main_color = _tmp1_;
|
|
#line 1149 "static_grid.c"
|
|
}
|
|
|
|
static void
|
|
live_chart_static_static_grid_finalize (GObject * obj)
|
|
{
|
|
LiveChartStaticStaticGrid * self;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_GRID, LiveChartStaticStaticGrid);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_CLASS (live_chart_static_static_grid_parent_class)->finalize (obj);
|
|
#line 1160 "static_grid.c"
|
|
}
|
|
|
|
static GType
|
|
live_chart_static_static_grid_get_type_once (void)
|
|
{
|
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticGridClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_grid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticGrid), 0, (GInstanceInitFunc) live_chart_static_static_grid_instance_init, NULL };
|
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_static_static_grid_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
|
GType live_chart_static_static_grid_type_id;
|
|
live_chart_static_static_grid_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartStaticStaticGrid", &g_define_type_info, 0);
|
|
g_type_add_interface_static (live_chart_static_static_grid_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
|
LiveChartStaticStaticGrid_private_offset = g_type_add_instance_private (live_chart_static_static_grid_type_id, sizeof (LiveChartStaticStaticGridPrivate));
|
|
return live_chart_static_static_grid_type_id;
|
|
}
|
|
|
|
GType
|
|
live_chart_static_static_grid_get_type (void)
|
|
{
|
|
static volatile gsize live_chart_static_static_grid_type_id__once = 0;
|
|
if (g_once_init_enter (&live_chart_static_static_grid_type_id__once)) {
|
|
GType live_chart_static_static_grid_type_id;
|
|
live_chart_static_static_grid_type_id = live_chart_static_static_grid_get_type_once ();
|
|
g_once_init_leave (&live_chart_static_static_grid_type_id__once, live_chart_static_static_grid_type_id);
|
|
}
|
|
return live_chart_static_static_grid_type_id__once;
|
|
}
|
|
|
|
static void
|
|
_vala_live_chart_static_static_grid_get_property (GObject * object,
|
|
guint property_id,
|
|
GValue * value,
|
|
GParamSpec * pspec)
|
|
{
|
|
LiveChartStaticStaticGrid * self;
|
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_GRID, LiveChartStaticStaticGrid);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
switch (property_id) {
|
|
#line 6 "../src/static/static_grid.vala"
|
|
case LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY:
|
|
#line 6 "../src/static/static_grid.vala"
|
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
case LIVE_CHART_STATIC_STATIC_GRID_MAIN_COLOR_PROPERTY:
|
|
#line 1205 "static_grid.c"
|
|
{
|
|
GdkRGBA boxed;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_get_main_color (self, &boxed);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
g_value_set_boxed (value, &boxed);
|
|
#line 1212 "static_grid.c"
|
|
}
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 1216 "static_grid.c"
|
|
default:
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 1222 "static_grid.c"
|
|
}
|
|
}
|
|
|
|
static void
|
|
_vala_live_chart_static_static_grid_set_property (GObject * object,
|
|
guint property_id,
|
|
const GValue * value,
|
|
GParamSpec * pspec)
|
|
{
|
|
LiveChartStaticStaticGrid * self;
|
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_GRID, LiveChartStaticStaticGrid);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
switch (property_id) {
|
|
#line 6 "../src/static/static_grid.vala"
|
|
case LIVE_CHART_STATIC_STATIC_GRID_VISIBLE_PROPERTY:
|
|
#line 6 "../src/static/static_grid.vala"
|
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 6 "../src/static/static_grid.vala"
|
|
case LIVE_CHART_STATIC_STATIC_GRID_MAIN_COLOR_PROPERTY:
|
|
#line 6 "../src/static/static_grid.vala"
|
|
live_chart_static_static_grid_set_main_color (self, g_value_get_boxed (value));
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 1248 "static_grid.c"
|
|
default:
|
|
#line 6 "../src/static/static_grid.vala"
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
#line 6 "../src/static/static_grid.vala"
|
|
break;
|
|
#line 1254 "static_grid.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;
|
|
}
|
|
|