Compare commits
2 Commits
5d8acb43cf
...
c4b2a05020
Author | SHA1 | Date |
---|---|---|
karthikmurakonda | c4b2a05020 | |
karthikmurakonda | bf76be3e97 |
Binary file not shown.
|
@ -46,8 +46,8 @@ FILE6 = iPDC.desktop
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread
|
||||||
LDLIBS=`pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0`
|
LDLIBS=`pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0 gee-0.8`
|
||||||
CFLAGS=-g -I./inc -fcommon `pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0`
|
CFLAGS=-g -I./inc -I./lib -fcommon `pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0 gee-0.8`
|
||||||
|
|
||||||
PROGRAM = iPDC
|
PROGRAM = iPDC
|
||||||
SOURCE_FILES = $(wildcard src/*.c)
|
SOURCE_FILES = $(wildcard src/*.c)
|
||||||
|
|
|
@ -1,92 +1,84 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.22.2 -->
|
<!-- Generated with glade 3.38.2 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.24"/>
|
<requires lib="gtk+" version="3.24"/>
|
||||||
<object class="GtkAdjustment" id="adjustment1">
|
|
||||||
<property name="upper">100</property>
|
|
||||||
<property name="step_increment">1</property>
|
|
||||||
<property name="page_increment">10</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkWindow" id="util_window">
|
<object class="GtkWindow" id="util_window">
|
||||||
<property name="width_request">800</property>
|
<property name="width-request">800</property>
|
||||||
<property name="height_request">600</property>
|
<property name="height-request">600</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child type="titlebar">
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLayout" id="util_layout">
|
<object class="GtkLayout" id="util_layout">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="margin_left">10</property>
|
<property name="margin-left">10</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-right">10</property>
|
||||||
<property name="margin_bottom">3</property>
|
<property name="margin-bottom">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuBar" id="util_menubar">
|
<object class="GtkMenuBar" id="util_menubar">
|
||||||
<property name="width_request">800</property>
|
<property name="width-request">800</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can-default">True</property>
|
||||||
<property name="resize_mode">immediate</property>
|
<property name="resize-mode">immediate</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem">
|
<object class="GtkMenuItem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">_File</property>
|
<property name="label" translatable="yes">_File</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<child type="submenu">
|
<child type="submenu">
|
||||||
<object class="GtkMenu">
|
<object class="GtkMenu">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-new</property>
|
<property name="label">gtk-new</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-open</property>
|
<property name="label">gtk-open</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-save</property>
|
<property name="label">gtk-save</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-save-as</property>
|
<property name="label">gtk-save-as</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSeparatorMenuItem">
|
<object class="GtkSeparatorMenuItem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-quit</property>
|
<property name="label">gtk-quit</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -96,47 +88,47 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem">
|
<object class="GtkMenuItem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">_Edit</property>
|
<property name="label" translatable="yes">_Edit</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<child type="submenu">
|
<child type="submenu">
|
||||||
<object class="GtkMenu">
|
<object class="GtkMenu">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-cut</property>
|
<property name="label">gtk-cut</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-copy</property>
|
<property name="label">gtk-copy</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-paste</property>
|
<property name="label">gtk-paste</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-delete</property>
|
<property name="label">gtk-delete</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -146,28 +138,28 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem">
|
<object class="GtkMenuItem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">_View</property>
|
<property name="label" translatable="yes">_View</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem">
|
<object class="GtkMenuItem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">_Help</property>
|
<property name="label" translatable="yes">_Help</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<child type="submenu">
|
<child type="submenu">
|
||||||
<object class="GtkMenu">
|
<object class="GtkMenu">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem">
|
<object class="GtkImageMenuItem">
|
||||||
<property name="label">gtk-about</property>
|
<property name="label">gtk-about</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use-underline">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use-stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -177,88 +169,128 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
<!-- n-columns=3 n-rows=3 -->
|
||||||
<object class="GtkGrid">
|
<object class="GtkGrid">
|
||||||
<property name="width_request">100</property>
|
<property name="width-request">100</property>
|
||||||
<property name="height_request">80</property>
|
<property name="height-request">80</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="app_paintable">True</property>
|
<property name="app-paintable">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border_width">5</property>
|
<property name="margin-top">10</property>
|
||||||
<property name="column_spacing">6</property>
|
<property name="column-spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
|
<!-- n-columns=1 n-rows=5 -->
|
||||||
<object class="GtkGrid">
|
<object class="GtkGrid">
|
||||||
<property name="width_request">80</property>
|
<property name="width-request">80</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border_width">5</property>
|
<property name="row-spacing">35</property>
|
||||||
<property name="row_spacing">35</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="voltage">
|
<object class="GtkButton" id="voltage">
|
||||||
<property name="label" translatable="yes">Voltage</property>
|
<property name="label" translatable="yes">Voltage</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives-default">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left-attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top-attach">0</property>
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="current">
|
|
||||||
<property name="label" translatable="yes">Current</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="freq">
|
<object class="GtkButton" id="freq">
|
||||||
<property name="label" translatable="yes">Frequency</property>
|
<property name="label" translatable="yes">Frequency</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives-default">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left-attach">0</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top-attach">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="attack_detection">
|
<object class="GtkButton" id="attack_detection">
|
||||||
<property name="label" translatable="yes">Attack Detection</property>
|
<property name="label" translatable="yes">Attack Detection</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives-default">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left-attach">0</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top-attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="algorithm">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">0</property>
|
||||||
|
<items>
|
||||||
|
<item id="0" translatable="yes">kmeans</item>
|
||||||
|
<item id="1" translatable="yes">simple</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="dimmension">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">0</property>
|
||||||
|
<items>
|
||||||
|
<item id="0" translatable="yes">frequency only</item>
|
||||||
|
<item id="1" translatable="yes">frequency,voltage</item>
|
||||||
|
<item id="2" translatable="yes">voltage</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left-attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top-attach">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLayout" id="map_layout">
|
<object class="GtkLayout" id="map_layout">
|
||||||
<property name="width_request">600</property>
|
<property name="width-request">600</property>
|
||||||
<property name="height_request">500</property>
|
<property name="height-request">500</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border_width">5</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left-attach">1</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top-attach">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="y">30</property>
|
<property name="y">30</property>
|
||||||
|
|
|
@ -63,6 +63,8 @@ struct Lower_Layer_Details {
|
||||||
int data_transmission_off;
|
int data_transmission_off;
|
||||||
int pmu_remove;
|
int pmu_remove;
|
||||||
int request_cfg_frame;
|
int request_cfg_frame;
|
||||||
|
float latitude;
|
||||||
|
float longitude;
|
||||||
struct Lower_Layer_Details *next;
|
struct Lower_Layer_Details *next;
|
||||||
struct Lower_Layer_Details *prev;
|
struct Lower_Layer_Details *prev;
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,7 @@ GtkWidget *add_pmu_window, *chkBtn;
|
||||||
GtkWidget *new_window, *setup_display_window;
|
GtkWidget *new_window, *setup_display_window;
|
||||||
GtkWidget *p_id, *p_udp, *p_tcp, *p_ip;
|
GtkWidget *p_id, *p_udp, *p_tcp, *p_ip;
|
||||||
GtkWidget *p_port, *p_protocol;
|
GtkWidget *p_port, *p_protocol;
|
||||||
|
GtkWidget *p_lattitude, *p_longitude;
|
||||||
pthread_t show_sys_time;
|
pthread_t show_sys_time;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@ typedef struct{
|
||||||
GdkPixbuf *g_red_image;
|
GdkPixbuf *g_red_image;
|
||||||
GdkPixbuf *g_green_image;
|
GdkPixbuf *g_green_image;
|
||||||
OsmGpsMapImage *g_last_image;
|
OsmGpsMapImage *g_last_image;
|
||||||
|
int current_selection;
|
||||||
} myParameters;
|
} myParameters;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gboolean update_images(gpointer* pars);
|
gboolean update_images(gpointer* pars);
|
|
@ -31,7 +31,7 @@
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
int add_PMU(char pmuid[], char ip[], char port[], char protocol[]);
|
int add_PMU(char pmuid[], char ip[], char port[], char protocol[], char latitude[], char longitude[]);
|
||||||
|
|
||||||
void add_PMU_Node(struct Lower_Layer_Details *temp_pmu);
|
void add_PMU_Node(struct Lower_Layer_Details *temp_pmu);
|
||||||
|
|
||||||
|
|
|
@ -166,4 +166,6 @@ unsigned long int to_long_int_convertor(unsigned char array[]);
|
||||||
|
|
||||||
uint16_t compute_CRC(unsigned char *message,int length);
|
uint16_t compute_CRC(unsigned char *message,int length);
|
||||||
|
|
||||||
|
float decode_ieee_single(const void *v);
|
||||||
|
|
||||||
/**************************************** End of File *******************************************************/
|
/**************************************** End of File *******************************************************/
|
||||||
|
|
|
@ -8,6 +8,31 @@
|
||||||
#define CH_GET_WIDGET(builder, name, data) \
|
#define CH_GET_WIDGET(builder, name, data) \
|
||||||
CH_GET_OBJECT(builder, name, GTK_WIDGET, data)
|
CH_GET_OBJECT(builder, name, GTK_WIDGET, data)
|
||||||
|
|
||||||
|
/* Main data structure definition */
|
||||||
|
typedef struct _UtData UtData;
|
||||||
|
|
||||||
|
struct _UtData
|
||||||
|
{
|
||||||
|
/* Main window */
|
||||||
|
GtkWidget *util_window;
|
||||||
|
|
||||||
|
/* ui buttons */
|
||||||
|
GtkWidget *voltage;
|
||||||
|
GtkWidget *frequency;
|
||||||
|
GtkWidget *attack_detection;
|
||||||
|
GtkWidget *algorithm;
|
||||||
|
GtkWidget *dimmension;
|
||||||
|
OsmGpsMap *util_map;
|
||||||
|
GtkContainer *map_layout;
|
||||||
|
};
|
||||||
|
|
||||||
|
UtData *utdata;
|
||||||
|
|
||||||
|
/* UI variables */
|
||||||
|
int curr_measurement = 0;
|
||||||
|
int algorithm =0;
|
||||||
|
int dimmensions = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void utility_tools(GtkButton *but, gpointer udata);
|
void utility_tools(GtkButton *but, gpointer udata);
|
|
@ -0,0 +1,409 @@
|
||||||
|
/* area.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from area.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_AREA_0_PROPERTY,
|
||||||
|
LIVE_CHART_AREA_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_AREA_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_area_properties[LIVE_CHART_AREA_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartAreaPrivate {
|
||||||
|
LiveChartPoints* points;
|
||||||
|
GdkRGBA color;
|
||||||
|
LiveChartBoundingBox bounding_box;
|
||||||
|
gdouble alpha;
|
||||||
|
gboolean _visible;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartArea_private_offset;
|
||||||
|
static gpointer live_chart_area_parent_class = NULL;
|
||||||
|
static LiveChartDrawableIface * live_chart_area_live_chart_drawable_parent_iface = NULL;
|
||||||
|
|
||||||
|
static void live_chart_area_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_area_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result);
|
||||||
|
static void live_chart_area_finalize (GObject * obj);
|
||||||
|
static GType live_chart_area_get_type_once (void);
|
||||||
|
static void _vala_live_chart_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_area_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_area_get_instance_private (LiveChartArea* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartArea_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 17 "../src/area.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 61 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartArea*
|
||||||
|
live_chart_area_construct (GType object_type,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
GdkRGBA* color,
|
||||||
|
gdouble alpha)
|
||||||
|
{
|
||||||
|
LiveChartArea * self = NULL;
|
||||||
|
LiveChartPoints* _tmp0_;
|
||||||
|
GdkRGBA _tmp1_;
|
||||||
|
#line 16 "../src/area.vala"
|
||||||
|
g_return_val_if_fail (points != NULL, NULL);
|
||||||
|
#line 16 "../src/area.vala"
|
||||||
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
#line 16 "../src/area.vala"
|
||||||
|
self = (LiveChartArea*) g_object_new (object_type, NULL);
|
||||||
|
#line 17 "../src/area.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (points);
|
||||||
|
#line 17 "../src/area.vala"
|
||||||
|
_g_object_unref0 (self->priv->points);
|
||||||
|
#line 17 "../src/area.vala"
|
||||||
|
self->priv->points = _tmp0_;
|
||||||
|
#line 18 "../src/area.vala"
|
||||||
|
_tmp1_ = *color;
|
||||||
|
#line 18 "../src/area.vala"
|
||||||
|
self->priv->color = _tmp1_;
|
||||||
|
#line 19 "../src/area.vala"
|
||||||
|
self->priv->alpha = alpha;
|
||||||
|
#line 16 "../src/area.vala"
|
||||||
|
return self;
|
||||||
|
#line 93 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartArea*
|
||||||
|
live_chart_area_new (LiveChartPoints* points,
|
||||||
|
GdkRGBA* color,
|
||||||
|
gdouble alpha)
|
||||||
|
{
|
||||||
|
#line 16 "../src/area.vala"
|
||||||
|
return live_chart_area_construct (LIVE_CHART_TYPE_AREA, points, color, alpha);
|
||||||
|
#line 103 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartArea * self;
|
||||||
|
LiveChartPoints* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
#line 22 "../src/area.vala"
|
||||||
|
self = (LiveChartArea*) base;
|
||||||
|
#line 22 "../src/area.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 22 "../src/area.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 23 "../src/area.vala"
|
||||||
|
_tmp0_ = self->priv->points;
|
||||||
|
#line 23 "../src/area.vala"
|
||||||
|
_tmp1_ = live_chart_points_get_size (_tmp0_);
|
||||||
|
#line 23 "../src/area.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 23 "../src/area.vala"
|
||||||
|
if (_tmp2_ > 0) {
|
||||||
|
#line 129 "area.c"
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp3_ = {0};
|
||||||
|
LiveChartPoint first_point = {0};
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
LiveChartPoint last_point = {0};
|
||||||
|
LiveChartPoints* _tmp6_;
|
||||||
|
LiveChartPoint _tmp7_ = {0};
|
||||||
|
GdkRGBA _tmp8_;
|
||||||
|
GdkRGBA _tmp9_;
|
||||||
|
GdkRGBA _tmp10_;
|
||||||
|
LiveChartPoint _tmp11_;
|
||||||
|
LiveChartPoint _tmp12_;
|
||||||
|
LiveChartPoint _tmp13_;
|
||||||
|
LiveChartBoundaries _tmp14_;
|
||||||
|
LiveChartBoundary _tmp15_;
|
||||||
|
LiveChartPoint _tmp16_;
|
||||||
|
LiveChartBoundaries _tmp17_;
|
||||||
|
LiveChartBoundary _tmp18_;
|
||||||
|
LiveChartPoint _tmp19_;
|
||||||
|
LiveChartPoint _tmp20_;
|
||||||
|
#line 24 "../src/area.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp3_);
|
||||||
|
#line 24 "../src/area.vala"
|
||||||
|
boundaries = _tmp3_;
|
||||||
|
#line 25 "../src/area.vala"
|
||||||
|
_tmp4_ = self->priv->points;
|
||||||
|
#line 25 "../src/area.vala"
|
||||||
|
live_chart_points_first (_tmp4_, &_tmp5_);
|
||||||
|
#line 25 "../src/area.vala"
|
||||||
|
first_point = _tmp5_;
|
||||||
|
#line 26 "../src/area.vala"
|
||||||
|
_tmp6_ = self->priv->points;
|
||||||
|
#line 26 "../src/area.vala"
|
||||||
|
live_chart_points_last (_tmp6_, &_tmp7_);
|
||||||
|
#line 26 "../src/area.vala"
|
||||||
|
last_point = _tmp7_;
|
||||||
|
#line 28 "../src/area.vala"
|
||||||
|
_tmp8_ = self->priv->color;
|
||||||
|
#line 28 "../src/area.vala"
|
||||||
|
_tmp9_ = self->priv->color;
|
||||||
|
#line 28 "../src/area.vala"
|
||||||
|
_tmp10_ = self->priv->color;
|
||||||
|
#line 28 "../src/area.vala"
|
||||||
|
cairo_set_source_rgba (ctx, _tmp8_.red, _tmp9_.green, _tmp10_.blue, self->priv->alpha);
|
||||||
|
#line 29 "../src/area.vala"
|
||||||
|
_tmp11_ = last_point;
|
||||||
|
#line 29 "../src/area.vala"
|
||||||
|
_tmp12_ = last_point;
|
||||||
|
#line 29 "../src/area.vala"
|
||||||
|
cairo_line_to (ctx, _tmp11_.x, _tmp12_.y);
|
||||||
|
#line 30 "../src/area.vala"
|
||||||
|
_tmp13_ = last_point;
|
||||||
|
#line 30 "../src/area.vala"
|
||||||
|
_tmp14_ = boundaries;
|
||||||
|
#line 30 "../src/area.vala"
|
||||||
|
_tmp15_ = _tmp14_.y;
|
||||||
|
#line 30 "../src/area.vala"
|
||||||
|
cairo_line_to (ctx, _tmp13_.x, (gdouble) _tmp15_.max);
|
||||||
|
#line 31 "../src/area.vala"
|
||||||
|
_tmp16_ = first_point;
|
||||||
|
#line 31 "../src/area.vala"
|
||||||
|
_tmp17_ = boundaries;
|
||||||
|
#line 31 "../src/area.vala"
|
||||||
|
_tmp18_ = _tmp17_.y;
|
||||||
|
#line 31 "../src/area.vala"
|
||||||
|
cairo_line_to (ctx, _tmp16_.x, (gdouble) _tmp18_.max);
|
||||||
|
#line 32 "../src/area.vala"
|
||||||
|
_tmp19_ = first_point;
|
||||||
|
#line 32 "../src/area.vala"
|
||||||
|
_tmp20_ = first_point;
|
||||||
|
#line 32 "../src/area.vala"
|
||||||
|
cairo_line_to (ctx, _tmp19_.x, _tmp20_.y);
|
||||||
|
#line 33 "../src/area.vala"
|
||||||
|
cairo_close_path (ctx);
|
||||||
|
#line 205 "area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartArea * self;
|
||||||
|
LiveChartBoundingBox _tmp0_;
|
||||||
|
#line 37 "../src/area.vala"
|
||||||
|
self = (LiveChartArea*) base;
|
||||||
|
#line 38 "../src/area.vala"
|
||||||
|
_tmp0_ = self->priv->bounding_box;
|
||||||
|
#line 38 "../src/area.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 38 "../src/area.vala"
|
||||||
|
return;
|
||||||
|
#line 223 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_area_real_get_visible (LiveChartDrawable* base)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
LiveChartArea* self;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
self = (LiveChartArea*) base;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
return result;
|
||||||
|
#line 237 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_real_set_visible (LiveChartDrawable* base,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartArea* self;
|
||||||
|
gboolean old_value;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
self = (LiveChartArea*) base;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
old_value = live_chart_area_real_get_visible (base);
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_area_properties[LIVE_CHART_AREA_VISIBLE_PROPERTY]);
|
||||||
|
#line 256 "area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_class_init (LiveChartAreaClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
live_chart_area_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartArea_private_offset);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_area_get_property;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_area_set_property;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_area_finalize;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_AREA_VISIBLE_PROPERTY, live_chart_area_properties[LIVE_CHART_AREA_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 276 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
live_chart_area_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_area_real_draw;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_area_real_get_bounding_box;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
iface->get_visible = live_chart_area_real_get_visible;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
iface->set_visible = live_chart_area_real_set_visible;
|
||||||
|
#line 293 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_instance_init (LiveChartArea * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartBoundingBox _tmp0_ = {0};
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
self->priv = live_chart_area_get_instance_private (self);
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
memset (&_tmp0_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
_tmp0_.x = (gdouble) 0;
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
_tmp0_.y = (gdouble) 0;
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
_tmp0_.width = (gdouble) 0;
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
_tmp0_.height = (gdouble) 0;
|
||||||
|
#line 7 "../src/area.vala"
|
||||||
|
self->priv->bounding_box = _tmp0_;
|
||||||
|
#line 13 "../src/area.vala"
|
||||||
|
self->priv->alpha = 0.3;
|
||||||
|
#line 14 "../src/area.vala"
|
||||||
|
self->priv->_visible = TRUE;
|
||||||
|
#line 319 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_area_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartArea * self;
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_AREA, LiveChartArea);
|
||||||
|
#line 5 "../src/area.vala"
|
||||||
|
_g_object_unref0 (self->priv->points);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_area_parent_class)->finalize (obj);
|
||||||
|
#line 332 "area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_area_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartArea), 0, (GInstanceInitFunc) live_chart_area_instance_init, NULL };
|
||||||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_area_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_area_type_id;
|
||||||
|
live_chart_area_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartArea", &g_define_type_info, 0);
|
||||||
|
g_type_add_interface_static (live_chart_area_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||||||
|
LiveChartArea_private_offset = g_type_add_instance_private (live_chart_area_type_id, sizeof (LiveChartAreaPrivate));
|
||||||
|
return live_chart_area_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_area_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_area_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_area_type_id__once)) {
|
||||||
|
GType live_chart_area_type_id;
|
||||||
|
live_chart_area_type_id = live_chart_area_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_area_type_id__once, live_chart_area_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_area_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_AREA, LiveChartArea);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
case LIVE_CHART_AREA_VISIBLE_PROPERTY:
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
break;
|
||||||
|
#line 375 "area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
break;
|
||||||
|
#line 381 "area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_area_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_AREA, LiveChartArea);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
case LIVE_CHART_AREA_VISIBLE_PROPERTY:
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
break;
|
||||||
|
#line 401 "area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/area.vala"
|
||||||
|
break;
|
||||||
|
#line 407 "area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,559 @@
|
||||||
|
/* background.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from background.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 <glib-object.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_BACKGROUND_0_PROPERTY,
|
||||||
|
LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_BACKGROUND_COLOR_PROPERTY,
|
||||||
|
LIVE_CHART_BACKGROUND_MAIN_COLOR_PROPERTY,
|
||||||
|
LIVE_CHART_BACKGROUND_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_background_properties[LIVE_CHART_BACKGROUND_NUM_PROPERTIES];
|
||||||
|
|
||||||
|
struct _LiveChartBackgroundPrivate {
|
||||||
|
LiveChartBoundingBox bounding_box;
|
||||||
|
gboolean _visible;
|
||||||
|
GdkRGBA _main_color;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartBackground_private_offset;
|
||||||
|
static gpointer live_chart_background_parent_class = NULL;
|
||||||
|
static LiveChartDrawableIface * live_chart_background_live_chart_drawable_parent_iface = NULL;
|
||||||
|
|
||||||
|
static void live_chart_background_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_background_update_bounding_box (LiveChartBackground* self,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_background_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result);
|
||||||
|
static gboolean _gdk_rgba_equal (const GdkRGBA * s1,
|
||||||
|
const GdkRGBA * s2);
|
||||||
|
static void live_chart_background_finalize (GObject * obj);
|
||||||
|
static GType live_chart_background_get_type_once (void);
|
||||||
|
static void _vala_live_chart_background_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_background_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_background_get_instance_private (LiveChartBackground* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartBackground_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 33 "../src/background.vala"
|
||||||
|
self = (LiveChartBackground*) base;
|
||||||
|
#line 33 "../src/background.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 33 "../src/background.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 34 "../src/background.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 34 "../src/background.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 34 "../src/background.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 79 "background.c"
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
gint _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
GdkRGBA _tmp6_ = {0};
|
||||||
|
GdkRGBA _tmp7_;
|
||||||
|
GdkRGBA _tmp8_ = {0};
|
||||||
|
GdkRGBA _tmp9_;
|
||||||
|
GdkRGBA _tmp10_ = {0};
|
||||||
|
GdkRGBA _tmp11_;
|
||||||
|
GdkRGBA _tmp12_ = {0};
|
||||||
|
GdkRGBA _tmp13_;
|
||||||
|
#line 35 "../src/background.vala"
|
||||||
|
live_chart_background_update_bounding_box (self, config);
|
||||||
|
#line 36 "../src/background.vala"
|
||||||
|
_tmp2_ = live_chart_config_get_width (config);
|
||||||
|
#line 36 "../src/background.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 36 "../src/background.vala"
|
||||||
|
_tmp4_ = live_chart_config_get_height (config);
|
||||||
|
#line 36 "../src/background.vala"
|
||||||
|
_tmp5_ = _tmp4_;
|
||||||
|
#line 36 "../src/background.vala"
|
||||||
|
cairo_rectangle (ctx, (gdouble) 0, (gdouble) 0, (gdouble) _tmp3_, (gdouble) _tmp5_);
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
live_chart_background_get_color (self, &_tmp6_);
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
_tmp7_ = _tmp6_;
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
live_chart_background_get_color (self, &_tmp8_);
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
live_chart_background_get_color (self, &_tmp10_);
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
_tmp11_ = _tmp10_;
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
live_chart_background_get_color (self, &_tmp12_);
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
_tmp13_ = _tmp12_;
|
||||||
|
#line 37 "../src/background.vala"
|
||||||
|
cairo_set_source_rgba (ctx, _tmp7_.red, _tmp9_.green, _tmp11_.blue, _tmp13_.alpha);
|
||||||
|
#line 38 "../src/background.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 124 "background.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self;
|
||||||
|
LiveChartBoundingBox _tmp0_;
|
||||||
|
#line 42 "../src/background.vala"
|
||||||
|
self = (LiveChartBackground*) base;
|
||||||
|
#line 43 "../src/background.vala"
|
||||||
|
_tmp0_ = self->priv->bounding_box;
|
||||||
|
#line 43 "../src/background.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 43 "../src/background.vala"
|
||||||
|
return;
|
||||||
|
#line 142 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_update_bounding_box (LiveChartBackground* self,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
LiveChartBoundingBox _tmp4_ = {0};
|
||||||
|
#line 46 "../src/background.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 46 "../src/background.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp0_ = live_chart_config_get_width (config);
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp2_ = live_chart_config_get_height (config);
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
memset (&_tmp4_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp4_.x = (gdouble) 0;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp4_.y = (gdouble) 0;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp4_.width = (gdouble) _tmp1_;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
_tmp4_.height = (gdouble) _tmp3_;
|
||||||
|
#line 47 "../src/background.vala"
|
||||||
|
self->priv->bounding_box = _tmp4_;
|
||||||
|
#line 178 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBackground*
|
||||||
|
live_chart_background_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self = NULL;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
self = (LiveChartBackground*) g_object_new (object_type, NULL);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
return self;
|
||||||
|
#line 189 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBackground*
|
||||||
|
live_chart_background_new (void)
|
||||||
|
{
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
return live_chart_background_construct (LIVE_CHART_TYPE_BACKGROUND);
|
||||||
|
#line 197 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_background_real_get_visible (LiveChartDrawable* base)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
LiveChartBackground* self;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
self = (LiveChartBackground*) base;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
return result;
|
||||||
|
#line 211 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_real_set_visible (LiveChartDrawable* base,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartBackground* self;
|
||||||
|
gboolean old_value;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
self = (LiveChartBackground*) base;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
old_value = live_chart_background_real_get_visible (base);
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_background_properties[LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY]);
|
||||||
|
#line 230 "background.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_background_get_color (LiveChartBackground* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 15 "../src/background.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 16 "../src/background.vala"
|
||||||
|
_tmp0_ = self->priv->_main_color;
|
||||||
|
#line 16 "../src/background.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 16 "../src/background.vala"
|
||||||
|
return;
|
||||||
|
#line 247 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_background_set_color (LiveChartBackground* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 18 "../src/background.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 19 "../src/background.vala"
|
||||||
|
_tmp0_ = *value;
|
||||||
|
#line 19 "../src/background.vala"
|
||||||
|
live_chart_background_set_main_color (self, &_tmp0_);
|
||||||
|
#line 18 "../src/background.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_background_properties[LIVE_CHART_BACKGROUND_COLOR_PROPERTY]);
|
||||||
|
#line 263 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_background_get_main_color (LiveChartBackground* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
_tmp0_ = self->priv->_main_color;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return;
|
||||||
|
#line 279 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_gdk_rgba_equal (const GdkRGBA * s1,
|
||||||
|
const GdkRGBA * s2)
|
||||||
|
{
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1 == s2) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return TRUE;
|
||||||
|
#line 290 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1 == NULL) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 296 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s2 == NULL) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 302 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1->red != s2->red) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 308 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1->green != s2->green) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 314 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1->blue != s2->blue) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 320 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (s1->alpha != s2->alpha) {
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 326 "background.c"
|
||||||
|
}
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
return TRUE;
|
||||||
|
#line 330 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_background_set_main_color (LiveChartBackground* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
GdkRGBA old_value;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
live_chart_background_get_main_color (self, &old_value);
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
if (_gdk_rgba_equal (value, &old_value) != TRUE) {
|
||||||
|
#line 344 "background.c"
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
_tmp0_ = *value;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
self->priv->_main_color = _tmp0_;
|
||||||
|
#line 25 "../src/background.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_background_properties[LIVE_CHART_BACKGROUND_MAIN_COLOR_PROPERTY]);
|
||||||
|
#line 352 "background.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_class_init (LiveChartBackgroundClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_background_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartBackground_private_offset);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_background_get_property;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_background_set_property;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_background_finalize;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY, live_chart_background_properties[LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_BACKGROUND_COLOR_PROPERTY, live_chart_background_properties[LIVE_CHART_BACKGROUND_COLOR_PROPERTY] = g_param_spec_boxed ("color", "color", "color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_BACKGROUND_MAIN_COLOR_PROPERTY, live_chart_background_properties[LIVE_CHART_BACKGROUND_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 | G_PARAM_DEPRECATED));
|
||||||
|
#line 376 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_background_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_background_real_draw;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_background_real_get_bounding_box;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
iface->get_visible = live_chart_background_real_get_visible;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
iface->set_visible = live_chart_background_real_set_visible;
|
||||||
|
#line 393 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_instance_init (LiveChartBackground * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartBoundingBox _tmp0_ = {0};
|
||||||
|
GdkRGBA _tmp1_ = {0};
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
self->priv = live_chart_background_get_instance_private (self);
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
memset (&_tmp0_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
_tmp0_.x = (gdouble) 0;
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
_tmp0_.y = (gdouble) 0;
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
_tmp0_.width = (gdouble) 0;
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
_tmp0_.height = (gdouble) 0;
|
||||||
|
#line 5 "../src/background.vala"
|
||||||
|
self->priv->bounding_box = _tmp0_;
|
||||||
|
#line 12 "../src/background.vala"
|
||||||
|
self->priv->_visible = TRUE;
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
memset (&_tmp1_, 0, sizeof (GdkRGBA));
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
_tmp1_.red = 0.1;
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
_tmp1_.green = 0.1;
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
_tmp1_.blue = 0.1;
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
_tmp1_.alpha = 1.0;
|
||||||
|
#line 24 "../src/background.vala"
|
||||||
|
self->priv->_main_color = _tmp1_;
|
||||||
|
#line 430 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_background_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_BACKGROUND, LiveChartBackground);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_background_parent_class)->finalize (obj);
|
||||||
|
#line 441 "background.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_background_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartBackgroundClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_background_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartBackground), 0, (GInstanceInitFunc) live_chart_background_instance_init, NULL };
|
||||||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_background_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_background_type_id;
|
||||||
|
live_chart_background_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartBackground", &g_define_type_info, 0);
|
||||||
|
g_type_add_interface_static (live_chart_background_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||||||
|
LiveChartBackground_private_offset = g_type_add_instance_private (live_chart_background_type_id, sizeof (LiveChartBackgroundPrivate));
|
||||||
|
return live_chart_background_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_background_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_background_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_background_type_id__once)) {
|
||||||
|
GType live_chart_background_type_id;
|
||||||
|
live_chart_background_type_id = live_chart_background_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_background_type_id__once, live_chart_background_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_background_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_background_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_BACKGROUND, LiveChartBackground);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY:
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_COLOR_PROPERTY:
|
||||||
|
#line 486 "background.c"
|
||||||
|
{
|
||||||
|
GdkRGBA boxed;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_background_get_color (self, &boxed);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
g_value_set_boxed (value, &boxed);
|
||||||
|
#line 493 "background.c"
|
||||||
|
}
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_MAIN_COLOR_PROPERTY:
|
||||||
|
#line 499 "background.c"
|
||||||
|
{
|
||||||
|
GdkRGBA boxed;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_background_get_main_color (self, &boxed);
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
#line 505 "background.c"
|
||||||
|
g_value_set_boxed (value, &boxed);
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
}
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 511 "background.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 517 "background.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_background_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartBackground * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_BACKGROUND, LiveChartBackground);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_VISIBLE_PROPERTY:
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_COLOR_PROPERTY:
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
live_chart_background_set_color (self, g_value_get_boxed (value));
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
case LIVE_CHART_BACKGROUND_MAIN_COLOR_PROPERTY:
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
#line 546 "background.c"
|
||||||
|
live_chart_background_set_main_color (self, g_value_get_boxed (value));
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 551 "background.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/background.vala"
|
||||||
|
break;
|
||||||
|
#line 557 "background.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,329 @@
|
||||||
|
/* bar.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from bar.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_BAR_0_PROPERTY,
|
||||||
|
LIVE_CHART_BAR_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_bar_properties[LIVE_CHART_BAR_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
static gpointer live_chart_bar_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_bar_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_bar_update_bounding_box (LiveChartBar* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static GType live_chart_bar_get_type_once (void);
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 7 "../src/bar.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 34 "bar.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBar*
|
||||||
|
live_chart_bar_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartBar * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 5 "../src/bar.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 6 "../src/bar.vala"
|
||||||
|
self = (LiveChartBar*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 7 "../src/bar.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (values);
|
||||||
|
#line 7 "../src/bar.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 7 "../src/bar.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 5 "../src/bar.vala"
|
||||||
|
return self;
|
||||||
|
#line 55 "bar.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBar*
|
||||||
|
live_chart_bar_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 5 "../src/bar.vala"
|
||||||
|
return live_chart_bar_construct (LIVE_CHART_TYPE_BAR, values);
|
||||||
|
#line 63 "bar.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bar_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartBar * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 10 "../src/bar.vala"
|
||||||
|
self = (LiveChartBar*) base;
|
||||||
|
#line 10 "../src/bar.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 10 "../src/bar.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 11 "../src/bar.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 11 "../src/bar.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 11 "../src/bar.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 86 "bar.c"
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartPoints* _tmp3_;
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 12 "../src/bar.vala"
|
||||||
|
_tmp2_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 12 "../src/bar.vala"
|
||||||
|
_tmp3_ = live_chart_points_create (_tmp2_, config);
|
||||||
|
#line 12 "../src/bar.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 13 "../src/bar.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 13 "../src/bar.vala"
|
||||||
|
_tmp5_ = live_chart_points_get_size (_tmp4_);
|
||||||
|
#line 13 "../src/bar.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 13 "../src/bar.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 107 "bar.c"
|
||||||
|
LiveChartPath* _tmp7_;
|
||||||
|
LiveChartPath* _tmp8_;
|
||||||
|
LiveChartPoints* _tmp9_;
|
||||||
|
#line 14 "../src/bar.vala"
|
||||||
|
_tmp7_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 14 "../src/bar.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 14 "../src/bar.vala"
|
||||||
|
live_chart_path_configure (_tmp8_, ctx);
|
||||||
|
#line 16 "../src/bar.vala"
|
||||||
|
_tmp9_ = points;
|
||||||
|
#line 16 "../src/bar.vala"
|
||||||
|
live_chart_bar_update_bounding_box (self, _tmp9_, config);
|
||||||
|
#line 17 "../src/bar.vala"
|
||||||
|
live_chart_serie_renderer_debug ((LiveChartSerieRenderer*) self, ctx);
|
||||||
|
#line 123 "bar.c"
|
||||||
|
{
|
||||||
|
gint pos = 0;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
pos = 0;
|
||||||
|
#line 128 "bar.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp10_ = FALSE;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp10_ = TRUE;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 135 "bar.c"
|
||||||
|
LiveChartPoints* _tmp12_;
|
||||||
|
gint _tmp13_;
|
||||||
|
gint _tmp14_;
|
||||||
|
LiveChartPoint current_point = {0};
|
||||||
|
LiveChartPoints* _tmp15_;
|
||||||
|
LiveChartPoint _tmp16_ = {0};
|
||||||
|
LiveChartPoint next_point = {0};
|
||||||
|
LiveChartPoints* _tmp17_;
|
||||||
|
LiveChartPoint _tmp18_ = {0};
|
||||||
|
LiveChartPoint _tmp19_;
|
||||||
|
LiveChartPadding _tmp20_;
|
||||||
|
gdouble bar_width = 0.0;
|
||||||
|
LiveChartPoint _tmp21_;
|
||||||
|
LiveChartPoint _tmp22_;
|
||||||
|
LiveChartPoint _tmp23_;
|
||||||
|
LiveChartPoint _tmp24_;
|
||||||
|
LiveChartPoint _tmp25_;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
if (!_tmp10_) {
|
||||||
|
#line 155 "bar.c"
|
||||||
|
gint _tmp11_;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp11_ = pos;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
pos = _tmp11_ + 1;
|
||||||
|
#line 161 "bar.c"
|
||||||
|
}
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp10_ = FALSE;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp12_ = points;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp13_ = live_chart_points_get_size (_tmp12_);
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
if (!(pos <= (_tmp14_ - 1))) {
|
||||||
|
#line 19 "../src/bar.vala"
|
||||||
|
break;
|
||||||
|
#line 175 "bar.c"
|
||||||
|
}
|
||||||
|
#line 20 "../src/bar.vala"
|
||||||
|
_tmp15_ = points;
|
||||||
|
#line 20 "../src/bar.vala"
|
||||||
|
live_chart_points_get (_tmp15_, pos, &_tmp16_);
|
||||||
|
#line 20 "../src/bar.vala"
|
||||||
|
current_point = _tmp16_;
|
||||||
|
#line 21 "../src/bar.vala"
|
||||||
|
_tmp17_ = points;
|
||||||
|
#line 21 "../src/bar.vala"
|
||||||
|
live_chart_points_after (_tmp17_, pos, &_tmp18_);
|
||||||
|
#line 21 "../src/bar.vala"
|
||||||
|
next_point = _tmp18_;
|
||||||
|
#line 23 "../src/bar.vala"
|
||||||
|
_tmp19_ = current_point;
|
||||||
|
#line 23 "../src/bar.vala"
|
||||||
|
_tmp20_ = config->padding;
|
||||||
|
#line 23 "../src/bar.vala"
|
||||||
|
if (_tmp19_.x < ((gdouble) _tmp20_.left)) {
|
||||||
|
#line 24 "../src/bar.vala"
|
||||||
|
continue;
|
||||||
|
#line 197 "bar.c"
|
||||||
|
}
|
||||||
|
#line 26 "../src/bar.vala"
|
||||||
|
_tmp21_ = current_point;
|
||||||
|
#line 26 "../src/bar.vala"
|
||||||
|
_tmp22_ = next_point;
|
||||||
|
#line 26 "../src/bar.vala"
|
||||||
|
bar_width = (_tmp21_.x - _tmp22_.x) / 1.2;
|
||||||
|
#line 27 "../src/bar.vala"
|
||||||
|
_tmp23_ = next_point;
|
||||||
|
#line 27 "../src/bar.vala"
|
||||||
|
_tmp24_ = next_point;
|
||||||
|
#line 27 "../src/bar.vala"
|
||||||
|
_tmp25_ = next_point;
|
||||||
|
#line 27 "../src/bar.vala"
|
||||||
|
cairo_rectangle (ctx, _tmp23_.x, _tmp24_.y, bar_width, _tmp25_.height);
|
||||||
|
#line 213 "bar.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 30 "../src/bar.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 219 "bar.c"
|
||||||
|
}
|
||||||
|
#line 11 "../src/bar.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 223 "bar.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bar_update_bounding_box (LiveChartBar* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
LiveChartBounds* _tmp2_;
|
||||||
|
gdouble _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
LiveChartPoint _tmp6_ = {0};
|
||||||
|
LiveChartBoundaries _tmp7_ = {0};
|
||||||
|
LiveChartBoundary _tmp8_;
|
||||||
|
LiveChartBounds* _tmp9_;
|
||||||
|
LiveChartBounds* _tmp10_;
|
||||||
|
gdouble _tmp11_;
|
||||||
|
gdouble _tmp12_;
|
||||||
|
LiveChartBoundingBox _tmp13_ = {0};
|
||||||
|
#line 35 "../src/bar.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 35 "../src/bar.vala"
|
||||||
|
g_return_if_fail (points != NULL);
|
||||||
|
#line 35 "../src/bar.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
live_chart_points_first (points, &_tmp0_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp1_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp3_ = live_chart_bounds_get_lower (_tmp2_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
live_chart_points_last (points, &_tmp5_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
live_chart_points_first (points, &_tmp6_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp7_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp8_ = _tmp7_.y;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp9_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp11_ = live_chart_bounds_get_lower (_tmp10_);
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
memset (&_tmp13_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp13_.x = _tmp0_.x;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp13_.y = _tmp4_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp13_.width = _tmp5_.x - _tmp6_.x;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
_tmp13_.height = _tmp8_.max - _tmp12_;
|
||||||
|
#line 36 "../src/bar.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->bounding_box = _tmp13_;
|
||||||
|
#line 290 "bar.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bar_class_init (LiveChartBarClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/bar.vala"
|
||||||
|
live_chart_bar_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/bar.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_bar_real_draw;
|
||||||
|
#line 301 "bar.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bar_instance_init (LiveChartBar * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_bar_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartBar), 0, (GInstanceInitFunc) live_chart_bar_instance_init, NULL };
|
||||||
|
GType live_chart_bar_type_id;
|
||||||
|
live_chart_bar_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartBar", &g_define_type_info, 0);
|
||||||
|
return live_chart_bar_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_bar_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_bar_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_bar_type_id__once)) {
|
||||||
|
GType live_chart_bar_type_id;
|
||||||
|
live_chart_bar_type_id = live_chart_bar_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_bar_type_id__once, live_chart_bar_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_bar_type_id__once;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,534 @@
|
||||||
|
/* bezier.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from bezier.vala, do not modify */
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define LIVE_CHART_POLYNOMIAL_TOLERANCE 1e-6
|
||||||
|
|
||||||
|
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
VALA_EXTERN GeeList* live_chart_get_cubic_roots (gdouble C3,
|
||||||
|
gdouble C2,
|
||||||
|
gdouble C1,
|
||||||
|
gdouble C0);
|
||||||
|
static gdouble* _double_dup (gdouble* self);
|
||||||
|
|
||||||
|
GeeList*
|
||||||
|
live_chart_find_intersections_between (LiveChartSegment* segment,
|
||||||
|
LiveChartBezierCurve* bezier)
|
||||||
|
{
|
||||||
|
gdouble ax = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp0_;
|
||||||
|
LiveChartCoord _tmp1_;
|
||||||
|
LiveChartBezierCurve _tmp2_;
|
||||||
|
LiveChartCoord _tmp3_;
|
||||||
|
LiveChartBezierCurve _tmp4_;
|
||||||
|
LiveChartCoord _tmp5_;
|
||||||
|
LiveChartBezierCurve _tmp6_;
|
||||||
|
LiveChartCoord _tmp7_;
|
||||||
|
gdouble ay = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp8_;
|
||||||
|
LiveChartCoord _tmp9_;
|
||||||
|
LiveChartBezierCurve _tmp10_;
|
||||||
|
LiveChartCoord _tmp11_;
|
||||||
|
LiveChartBezierCurve _tmp12_;
|
||||||
|
LiveChartCoord _tmp13_;
|
||||||
|
LiveChartBezierCurve _tmp14_;
|
||||||
|
LiveChartCoord _tmp15_;
|
||||||
|
gdouble bx = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp16_;
|
||||||
|
LiveChartCoord _tmp17_;
|
||||||
|
LiveChartBezierCurve _tmp18_;
|
||||||
|
LiveChartCoord _tmp19_;
|
||||||
|
LiveChartBezierCurve _tmp20_;
|
||||||
|
LiveChartCoord _tmp21_;
|
||||||
|
gdouble by = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp22_;
|
||||||
|
LiveChartCoord _tmp23_;
|
||||||
|
LiveChartBezierCurve _tmp24_;
|
||||||
|
LiveChartCoord _tmp25_;
|
||||||
|
LiveChartBezierCurve _tmp26_;
|
||||||
|
LiveChartCoord _tmp27_;
|
||||||
|
gdouble cx = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp28_;
|
||||||
|
LiveChartCoord _tmp29_;
|
||||||
|
LiveChartBezierCurve _tmp30_;
|
||||||
|
LiveChartCoord _tmp31_;
|
||||||
|
gdouble cy = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp32_;
|
||||||
|
LiveChartCoord _tmp33_;
|
||||||
|
LiveChartBezierCurve _tmp34_;
|
||||||
|
LiveChartCoord _tmp35_;
|
||||||
|
gdouble dx = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp36_;
|
||||||
|
LiveChartCoord _tmp37_;
|
||||||
|
gdouble dy = 0.0;
|
||||||
|
LiveChartBezierCurve _tmp38_;
|
||||||
|
LiveChartCoord _tmp39_;
|
||||||
|
gdouble vx = 0.0;
|
||||||
|
LiveChartSegment _tmp40_;
|
||||||
|
LiveChartCoord _tmp41_;
|
||||||
|
LiveChartSegment _tmp42_;
|
||||||
|
LiveChartCoord _tmp43_;
|
||||||
|
gdouble vy = 0.0;
|
||||||
|
LiveChartSegment _tmp44_;
|
||||||
|
LiveChartCoord _tmp45_;
|
||||||
|
LiveChartSegment _tmp46_;
|
||||||
|
LiveChartCoord _tmp47_;
|
||||||
|
gdouble d = 0.0;
|
||||||
|
LiveChartSegment _tmp48_;
|
||||||
|
LiveChartCoord _tmp49_;
|
||||||
|
LiveChartSegment _tmp50_;
|
||||||
|
LiveChartCoord _tmp51_;
|
||||||
|
GeeList* roots = NULL;
|
||||||
|
GeeList* _tmp52_;
|
||||||
|
GeeArrayList* results = NULL;
|
||||||
|
GeeArrayList* _tmp53_;
|
||||||
|
GeeList* result;
|
||||||
|
#line 6 "../src/bezier.vala"
|
||||||
|
g_return_val_if_fail (segment != NULL, NULL);
|
||||||
|
#line 6 "../src/bezier.vala"
|
||||||
|
g_return_val_if_fail (bezier != NULL, NULL);
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp0_ = *bezier;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp1_ = _tmp0_.c1;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp2_ = *bezier;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp3_ = _tmp2_.c2;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp4_ = *bezier;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp5_ = _tmp4_.c3;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp6_ = *bezier;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
_tmp7_ = _tmp6_.c0;
|
||||||
|
#line 8 "../src/bezier.vala"
|
||||||
|
ax = ((3 * (_tmp1_.x - _tmp3_.x)) + _tmp5_.x) - _tmp7_.x;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp8_ = *bezier;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp9_ = _tmp8_.c1;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp10_ = *bezier;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp11_ = _tmp10_.c2;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp12_ = *bezier;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp13_ = _tmp12_.c3;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp14_ = *bezier;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
_tmp15_ = _tmp14_.c0;
|
||||||
|
#line 9 "../src/bezier.vala"
|
||||||
|
ay = ((3 * (_tmp9_.y - _tmp11_.y)) + _tmp13_.y) - _tmp15_.y;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp16_ = *bezier;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp17_ = _tmp16_.c0;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp18_ = *bezier;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp19_ = _tmp18_.c1;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp20_ = *bezier;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
_tmp21_ = _tmp20_.c2;
|
||||||
|
#line 11 "../src/bezier.vala"
|
||||||
|
bx = 3 * ((_tmp17_.x - (2 * _tmp19_.x)) + _tmp21_.x);
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp22_ = *bezier;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp23_ = _tmp22_.c0;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp24_ = *bezier;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp25_ = _tmp24_.c1;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp26_ = *bezier;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
_tmp27_ = _tmp26_.c2;
|
||||||
|
#line 12 "../src/bezier.vala"
|
||||||
|
by = 3 * ((_tmp23_.y - (2 * _tmp25_.y)) + _tmp27_.y);
|
||||||
|
#line 14 "../src/bezier.vala"
|
||||||
|
_tmp28_ = *bezier;
|
||||||
|
#line 14 "../src/bezier.vala"
|
||||||
|
_tmp29_ = _tmp28_.c1;
|
||||||
|
#line 14 "../src/bezier.vala"
|
||||||
|
_tmp30_ = *bezier;
|
||||||
|
#line 14 "../src/bezier.vala"
|
||||||
|
_tmp31_ = _tmp30_.c0;
|
||||||
|
#line 14 "../src/bezier.vala"
|
||||||
|
cx = 3 * (_tmp29_.x - _tmp31_.x);
|
||||||
|
#line 15 "../src/bezier.vala"
|
||||||
|
_tmp32_ = *bezier;
|
||||||
|
#line 15 "../src/bezier.vala"
|
||||||
|
_tmp33_ = _tmp32_.c1;
|
||||||
|
#line 15 "../src/bezier.vala"
|
||||||
|
_tmp34_ = *bezier;
|
||||||
|
#line 15 "../src/bezier.vala"
|
||||||
|
_tmp35_ = _tmp34_.c0;
|
||||||
|
#line 15 "../src/bezier.vala"
|
||||||
|
cy = 3 * (_tmp33_.y - _tmp35_.y);
|
||||||
|
#line 17 "../src/bezier.vala"
|
||||||
|
_tmp36_ = *bezier;
|
||||||
|
#line 17 "../src/bezier.vala"
|
||||||
|
_tmp37_ = _tmp36_.c0;
|
||||||
|
#line 17 "../src/bezier.vala"
|
||||||
|
dx = _tmp37_.x;
|
||||||
|
#line 18 "../src/bezier.vala"
|
||||||
|
_tmp38_ = *bezier;
|
||||||
|
#line 18 "../src/bezier.vala"
|
||||||
|
_tmp39_ = _tmp38_.c0;
|
||||||
|
#line 18 "../src/bezier.vala"
|
||||||
|
dy = _tmp39_.y;
|
||||||
|
#line 20 "../src/bezier.vala"
|
||||||
|
_tmp40_ = *segment;
|
||||||
|
#line 20 "../src/bezier.vala"
|
||||||
|
_tmp41_ = _tmp40_.to;
|
||||||
|
#line 20 "../src/bezier.vala"
|
||||||
|
_tmp42_ = *segment;
|
||||||
|
#line 20 "../src/bezier.vala"
|
||||||
|
_tmp43_ = _tmp42_.from;
|
||||||
|
#line 20 "../src/bezier.vala"
|
||||||
|
vx = _tmp41_.y - _tmp43_.y;
|
||||||
|
#line 21 "../src/bezier.vala"
|
||||||
|
_tmp44_ = *segment;
|
||||||
|
#line 21 "../src/bezier.vala"
|
||||||
|
_tmp45_ = _tmp44_.from;
|
||||||
|
#line 21 "../src/bezier.vala"
|
||||||
|
_tmp46_ = *segment;
|
||||||
|
#line 21 "../src/bezier.vala"
|
||||||
|
_tmp47_ = _tmp46_.to;
|
||||||
|
#line 21 "../src/bezier.vala"
|
||||||
|
vy = _tmp45_.x - _tmp47_.x;
|
||||||
|
#line 23 "../src/bezier.vala"
|
||||||
|
_tmp48_ = *segment;
|
||||||
|
#line 23 "../src/bezier.vala"
|
||||||
|
_tmp49_ = _tmp48_.from;
|
||||||
|
#line 23 "../src/bezier.vala"
|
||||||
|
_tmp50_ = *segment;
|
||||||
|
#line 23 "../src/bezier.vala"
|
||||||
|
_tmp51_ = _tmp50_.from;
|
||||||
|
#line 23 "../src/bezier.vala"
|
||||||
|
d = (_tmp49_.x * vx) + (_tmp51_.y * vy);
|
||||||
|
#line 25 "../src/bezier.vala"
|
||||||
|
_tmp52_ = live_chart_get_cubic_roots ((vx * ax) + (vy * ay), (vx * bx) + (vy * by), (vx * cx) + (vy * cy), ((vx * dx) + (vy * dy)) - d);
|
||||||
|
#line 25 "../src/bezier.vala"
|
||||||
|
roots = _tmp52_;
|
||||||
|
#line 32 "../src/bezier.vala"
|
||||||
|
_tmp53_ = gee_array_list_new (LIVE_CHART_TYPE_COORD, (GBoxedCopyFunc) live_chart_coord_dup, (GDestroyNotify) live_chart_coord_free, NULL, NULL, NULL);
|
||||||
|
#line 32 "../src/bezier.vala"
|
||||||
|
results = _tmp53_;
|
||||||
|
#line 234 "bezier.c"
|
||||||
|
{
|
||||||
|
gint i = 0;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
i = 0;
|
||||||
|
#line 239 "bezier.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp54_ = FALSE;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp54_ = TRUE;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 246 "bezier.c"
|
||||||
|
GeeList* _tmp56_;
|
||||||
|
gint _tmp57_;
|
||||||
|
gint _tmp58_;
|
||||||
|
gdouble* root = NULL;
|
||||||
|
GeeList* _tmp59_;
|
||||||
|
gpointer _tmp60_;
|
||||||
|
gboolean _tmp61_ = FALSE;
|
||||||
|
gdouble* _tmp62_;
|
||||||
|
GeeArrayList* _tmp64_;
|
||||||
|
gdouble* _tmp65_;
|
||||||
|
gdouble* _tmp66_;
|
||||||
|
gdouble* _tmp67_;
|
||||||
|
gdouble* _tmp68_;
|
||||||
|
gdouble* _tmp69_;
|
||||||
|
gdouble* _tmp70_;
|
||||||
|
LiveChartCoord _tmp71_ = {0};
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
if (!_tmp54_) {
|
||||||
|
#line 265 "bezier.c"
|
||||||
|
gint _tmp55_;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp55_ = i;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
i = _tmp55_ + 1;
|
||||||
|
#line 271 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp54_ = FALSE;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp56_ = roots;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp57_ = gee_collection_get_size ((GeeCollection*) _tmp56_);
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_tmp58_ = _tmp57_;
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
if (!(i < _tmp58_)) {
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
break;
|
||||||
|
#line 285 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 34 "../src/bezier.vala"
|
||||||
|
_tmp59_ = roots;
|
||||||
|
#line 34 "../src/bezier.vala"
|
||||||
|
_tmp60_ = gee_list_get (_tmp59_, i);
|
||||||
|
#line 34 "../src/bezier.vala"
|
||||||
|
root = (gdouble*) _tmp60_;
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
_tmp62_ = root;
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
if (((gdouble) 0) > (*_tmp62_)) {
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
_tmp61_ = TRUE;
|
||||||
|
#line 299 "bezier.c"
|
||||||
|
} else {
|
||||||
|
gdouble* _tmp63_;
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
_tmp63_ = root;
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
_tmp61_ = (*_tmp63_) > ((gdouble) 1);
|
||||||
|
#line 306 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
if (_tmp61_) {
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
_g_free0 (root);
|
||||||
|
#line 35 "../src/bezier.vala"
|
||||||
|
continue;
|
||||||
|
#line 314 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp64_ = results;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp65_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp66_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp67_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp68_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp69_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp70_ = root;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp71_.x = (((((ax * (*_tmp65_)) + bx) * (*_tmp66_)) + cx) * (*_tmp67_)) + dx;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
_tmp71_.y = (((((ay * (*_tmp68_)) + by) * (*_tmp69_)) + cy) * (*_tmp70_)) + dy;
|
||||||
|
#line 36 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp64_, &_tmp71_);
|
||||||
|
#line 33 "../src/bezier.vala"
|
||||||
|
_g_free0 (root);
|
||||||
|
#line 338 "bezier.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 42 "../src/bezier.vala"
|
||||||
|
result = (GeeList*) results;
|
||||||
|
#line 42 "../src/bezier.vala"
|
||||||
|
_g_object_unref0 (roots);
|
||||||
|
#line 42 "../src/bezier.vala"
|
||||||
|
return result;
|
||||||
|
#line 348 "bezier.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gdouble*
|
||||||
|
_double_dup (gdouble* self)
|
||||||
|
{
|
||||||
|
gdouble* dup;
|
||||||
|
#line 47 "../src/bezier.vala"
|
||||||
|
dup = g_new0 (gdouble, 1);
|
||||||
|
#line 47 "../src/bezier.vala"
|
||||||
|
memcpy (dup, self, sizeof (gdouble));
|
||||||
|
#line 47 "../src/bezier.vala"
|
||||||
|
return dup;
|
||||||
|
#line 361 "bezier.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
GeeList*
|
||||||
|
live_chart_get_cubic_roots (gdouble C3,
|
||||||
|
gdouble C2,
|
||||||
|
gdouble C1,
|
||||||
|
gdouble C0)
|
||||||
|
{
|
||||||
|
GeeArrayList* roots = NULL;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gdouble c3 = 0.0;
|
||||||
|
gdouble c2 = 0.0;
|
||||||
|
gdouble c1 = 0.0;
|
||||||
|
gdouble c0 = 0.0;
|
||||||
|
gdouble a = 0.0;
|
||||||
|
gdouble b = 0.0;
|
||||||
|
gdouble offset = 0.0;
|
||||||
|
gdouble discrim = 0.0;
|
||||||
|
gdouble halfB = 0.0;
|
||||||
|
gdouble tmp = 0.0;
|
||||||
|
gdouble root = 0.0;
|
||||||
|
GeeList* result;
|
||||||
|
#line 47 "../src/bezier.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (G_TYPE_DOUBLE, (GBoxedCopyFunc) _double_dup, (GDestroyNotify) g_free, NULL, NULL, NULL);
|
||||||
|
#line 47 "../src/bezier.vala"
|
||||||
|
roots = _tmp0_;
|
||||||
|
#line 50 "../src/bezier.vala"
|
||||||
|
c3 = C3;
|
||||||
|
#line 51 "../src/bezier.vala"
|
||||||
|
c2 = C2 / c3;
|
||||||
|
#line 52 "../src/bezier.vala"
|
||||||
|
c1 = C1 / c3;
|
||||||
|
#line 53 "../src/bezier.vala"
|
||||||
|
c0 = C0 / c3;
|
||||||
|
#line 55 "../src/bezier.vala"
|
||||||
|
a = ((3 * c1) - (c2 * c2)) / 3;
|
||||||
|
#line 56 "../src/bezier.vala"
|
||||||
|
b = (((((2 * c2) * c2) * c2) - ((9 * c1) * c2)) + (27 * c0)) / 27;
|
||||||
|
#line 57 "../src/bezier.vala"
|
||||||
|
offset = c2 / 3;
|
||||||
|
#line 58 "../src/bezier.vala"
|
||||||
|
discrim = ((b * b) / 4) + (((a * a) * a) / 27);
|
||||||
|
#line 59 "../src/bezier.vala"
|
||||||
|
halfB = b / 2;
|
||||||
|
#line 61 "../src/bezier.vala"
|
||||||
|
tmp = (gdouble) 0;
|
||||||
|
#line 62 "../src/bezier.vala"
|
||||||
|
root = (gdouble) 0;
|
||||||
|
#line 64 "../src/bezier.vala"
|
||||||
|
if (fabs (discrim) <= LIVE_CHART_POLYNOMIAL_TOLERANCE) {
|
||||||
|
#line 64 "../src/bezier.vala"
|
||||||
|
discrim = (gdouble) 0;
|
||||||
|
#line 414 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 66 "../src/bezier.vala"
|
||||||
|
if (discrim > ((gdouble) 0)) {
|
||||||
|
#line 418 "bezier.c"
|
||||||
|
gdouble e = 0.0;
|
||||||
|
GeeArrayList* _tmp1_;
|
||||||
|
gdouble _tmp2_;
|
||||||
|
#line 67 "../src/bezier.vala"
|
||||||
|
e = sqrt (discrim);
|
||||||
|
#line 69 "../src/bezier.vala"
|
||||||
|
tmp = (-halfB) + e;
|
||||||
|
#line 70 "../src/bezier.vala"
|
||||||
|
if (tmp >= ((gdouble) 0)) {
|
||||||
|
#line 70 "../src/bezier.vala"
|
||||||
|
root = pow (tmp, (gdouble) (1 / 3));
|
||||||
|
#line 430 "bezier.c"
|
||||||
|
} else {
|
||||||
|
#line 71 "../src/bezier.vala"
|
||||||
|
root = -pow (-tmp, (gdouble) (1 / 3));
|
||||||
|
#line 434 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 73 "../src/bezier.vala"
|
||||||
|
tmp = (-halfB) - e;
|
||||||
|
#line 74 "../src/bezier.vala"
|
||||||
|
if (tmp >= ((gdouble) 0)) {
|
||||||
|
#line 74 "../src/bezier.vala"
|
||||||
|
root += pow (tmp, (gdouble) (1 / 3));
|
||||||
|
#line 442 "bezier.c"
|
||||||
|
} else {
|
||||||
|
#line 75 "../src/bezier.vala"
|
||||||
|
root -= pow (-tmp, (gdouble) (1 / 3));
|
||||||
|
#line 446 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 77 "../src/bezier.vala"
|
||||||
|
_tmp1_ = roots;
|
||||||
|
#line 77 "../src/bezier.vala"
|
||||||
|
_tmp2_ = root - offset;
|
||||||
|
#line 77 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, &_tmp2_);
|
||||||
|
#line 454 "bezier.c"
|
||||||
|
} else {
|
||||||
|
#line 78 "../src/bezier.vala"
|
||||||
|
if (discrim < ((gdouble) 0)) {
|
||||||
|
#line 458 "bezier.c"
|
||||||
|
gdouble distance = 0.0;
|
||||||
|
gdouble angle = 0.0;
|
||||||
|
gdouble _cos = 0.0;
|
||||||
|
gdouble _sin = 0.0;
|
||||||
|
gdouble sqrt3 = 0.0;
|
||||||
|
GeeArrayList* _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
GeeArrayList* _tmp5_;
|
||||||
|
gdouble _tmp6_;
|
||||||
|
GeeArrayList* _tmp7_;
|
||||||
|
gdouble _tmp8_;
|
||||||
|
#line 79 "../src/bezier.vala"
|
||||||
|
distance = sqrt ((-a) / 3);
|
||||||
|
#line 80 "../src/bezier.vala"
|
||||||
|
angle = atan2 (sqrt (-discrim), -halfB) / 3;
|
||||||
|
#line 81 "../src/bezier.vala"
|
||||||
|
_cos = cos (angle);
|
||||||
|
#line 82 "../src/bezier.vala"
|
||||||
|
_sin = sin (angle);
|
||||||
|
#line 83 "../src/bezier.vala"
|
||||||
|
sqrt3 = sqrt ((gdouble) 3);
|
||||||
|
#line 85 "../src/bezier.vala"
|
||||||
|
_tmp3_ = roots;
|
||||||
|
#line 85 "../src/bezier.vala"
|
||||||
|
_tmp4_ = ((2 * distance) * _cos) - offset;
|
||||||
|
#line 85 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, &_tmp4_);
|
||||||
|
#line 86 "../src/bezier.vala"
|
||||||
|
_tmp5_ = roots;
|
||||||
|
#line 86 "../src/bezier.vala"
|
||||||
|
_tmp6_ = ((-distance) * (_cos + (sqrt3 * _sin))) - offset;
|
||||||
|
#line 86 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, &_tmp6_);
|
||||||
|
#line 87 "../src/bezier.vala"
|
||||||
|
_tmp7_ = roots;
|
||||||
|
#line 87 "../src/bezier.vala"
|
||||||
|
_tmp8_ = ((-distance) * (_cos - (sqrt3 * _sin))) - offset;
|
||||||
|
#line 87 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, &_tmp8_);
|
||||||
|
#line 498 "bezier.c"
|
||||||
|
} else {
|
||||||
|
GeeArrayList* _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
GeeArrayList* _tmp11_;
|
||||||
|
gdouble _tmp12_;
|
||||||
|
#line 89 "../src/bezier.vala"
|
||||||
|
if (halfB >= ((gdouble) 0)) {
|
||||||
|
#line 89 "../src/bezier.vala"
|
||||||
|
tmp = -pow (halfB, (gdouble) (1 / 3));
|
||||||
|
#line 508 "bezier.c"
|
||||||
|
} else {
|
||||||
|
#line 90 "../src/bezier.vala"
|
||||||
|
tmp = pow (-halfB, (gdouble) (1 / 3));
|
||||||
|
#line 512 "bezier.c"
|
||||||
|
}
|
||||||
|
#line 92 "../src/bezier.vala"
|
||||||
|
_tmp9_ = roots;
|
||||||
|
#line 92 "../src/bezier.vala"
|
||||||
|
_tmp10_ = (2 * tmp) - offset;
|
||||||
|
#line 92 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, &_tmp10_);
|
||||||
|
#line 94 "../src/bezier.vala"
|
||||||
|
_tmp11_ = roots;
|
||||||
|
#line 94 "../src/bezier.vala"
|
||||||
|
_tmp12_ = (-tmp) - offset;
|
||||||
|
#line 94 "../src/bezier.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, &_tmp12_);
|
||||||
|
#line 526 "bezier.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 97 "../src/bezier.vala"
|
||||||
|
result = (GeeList*) roots;
|
||||||
|
#line 97 "../src/bezier.vala"
|
||||||
|
return result;
|
||||||
|
#line 533 "bezier.c"
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,350 @@
|
||||||
|
/* bounds.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from bounds.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_BOUNDS_0_PROPERTY,
|
||||||
|
LIVE_CHART_BOUNDS_LOWER_PROPERTY,
|
||||||
|
LIVE_CHART_BOUNDS_UPPER_PROPERTY,
|
||||||
|
LIVE_CHART_BOUNDS_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_bounds_properties[LIVE_CHART_BOUNDS_NUM_PROPERTIES];
|
||||||
|
|
||||||
|
struct _LiveChartBoundsPrivate {
|
||||||
|
gdouble _lower;
|
||||||
|
gdouble _upper;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartBounds_private_offset;
|
||||||
|
static gpointer live_chart_bounds_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_bounds_set_lower (LiveChartBounds* self,
|
||||||
|
gdouble value);
|
||||||
|
static void live_chart_bounds_set_upper (LiveChartBounds* self,
|
||||||
|
gdouble value);
|
||||||
|
static void live_chart_bounds_finalize (GObject * obj);
|
||||||
|
static GType live_chart_bounds_get_type_once (void);
|
||||||
|
static void _vala_live_chart_bounds_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_bounds_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_bounds_get_instance_private (LiveChartBounds* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartBounds_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_bounds_construct (GType object_type,
|
||||||
|
gdouble lower,
|
||||||
|
gdouble upper)
|
||||||
|
{
|
||||||
|
LiveChartBounds * self = NULL;
|
||||||
|
#line 12 "../src/bounds.vala"
|
||||||
|
self = (LiveChartBounds*) g_object_new (object_type, NULL);
|
||||||
|
#line 13 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_lower (self, lower);
|
||||||
|
#line 14 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_upper (self, upper);
|
||||||
|
#line 12 "../src/bounds.vala"
|
||||||
|
return self;
|
||||||
|
#line 62 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_bounds_new (gdouble lower,
|
||||||
|
gdouble upper)
|
||||||
|
{
|
||||||
|
#line 12 "../src/bounds.vala"
|
||||||
|
return live_chart_bounds_construct (LIVE_CHART_TYPE_BOUNDS, lower, upper);
|
||||||
|
#line 71 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_bounds_has_lower (LiveChartBounds* self)
|
||||||
|
{
|
||||||
|
gdouble _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 17 "../src/bounds.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 18 "../src/bounds.vala"
|
||||||
|
_tmp0_ = self->priv->_lower;
|
||||||
|
#line 18 "../src/bounds.vala"
|
||||||
|
result = !isnan (_tmp0_);
|
||||||
|
#line 18 "../src/bounds.vala"
|
||||||
|
return result;
|
||||||
|
#line 87 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_bounds_has_upper (LiveChartBounds* self)
|
||||||
|
{
|
||||||
|
gdouble _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 21 "../src/bounds.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 22 "../src/bounds.vala"
|
||||||
|
_tmp0_ = self->priv->_upper;
|
||||||
|
#line 22 "../src/bounds.vala"
|
||||||
|
result = !isnan (_tmp0_);
|
||||||
|
#line 22 "../src/bounds.vala"
|
||||||
|
return result;
|
||||||
|
#line 103 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_bounds_update (LiveChartBounds* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gboolean updated = FALSE;
|
||||||
|
gdouble _tmp0_;
|
||||||
|
gdouble _tmp1_;
|
||||||
|
gboolean result;
|
||||||
|
#line 25 "../src/bounds.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 26 "../src/bounds.vala"
|
||||||
|
updated = FALSE;
|
||||||
|
#line 27 "../src/bounds.vala"
|
||||||
|
if (!live_chart_bounds_has_lower (self)) {
|
||||||
|
#line 28 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_lower (self, value);
|
||||||
|
#line 29 "../src/bounds.vala"
|
||||||
|
updated = TRUE;
|
||||||
|
#line 124 "bounds.c"
|
||||||
|
}
|
||||||
|
#line 32 "../src/bounds.vala"
|
||||||
|
if (!live_chart_bounds_has_upper (self)) {
|
||||||
|
#line 33 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_upper (self, value);
|
||||||
|
#line 34 "../src/bounds.vala"
|
||||||
|
updated = TRUE;
|
||||||
|
#line 132 "bounds.c"
|
||||||
|
}
|
||||||
|
#line 36 "../src/bounds.vala"
|
||||||
|
_tmp0_ = self->priv->_lower;
|
||||||
|
#line 36 "../src/bounds.vala"
|
||||||
|
if (value < _tmp0_) {
|
||||||
|
#line 37 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_lower (self, value);
|
||||||
|
#line 38 "../src/bounds.vala"
|
||||||
|
updated = TRUE;
|
||||||
|
#line 142 "bounds.c"
|
||||||
|
}
|
||||||
|
#line 40 "../src/bounds.vala"
|
||||||
|
_tmp1_ = self->priv->_upper;
|
||||||
|
#line 40 "../src/bounds.vala"
|
||||||
|
if (value > _tmp1_) {
|
||||||
|
#line 41 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_upper (self, value);
|
||||||
|
#line 42 "../src/bounds.vala"
|
||||||
|
updated = TRUE;
|
||||||
|
#line 152 "bounds.c"
|
||||||
|
}
|
||||||
|
#line 44 "../src/bounds.vala"
|
||||||
|
result = updated;
|
||||||
|
#line 44 "../src/bounds.vala"
|
||||||
|
return result;
|
||||||
|
#line 158 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_bounds_get_lower (LiveChartBounds* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
result = self->priv->_lower;
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
return result;
|
||||||
|
#line 171 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bounds_set_lower (LiveChartBounds* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
old_value = live_chart_bounds_get_lower (self);
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
self->priv->_lower = value;
|
||||||
|
#line 6 "../src/bounds.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_bounds_properties[LIVE_CHART_BOUNDS_LOWER_PROPERTY]);
|
||||||
|
#line 189 "bounds.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_bounds_get_upper (LiveChartBounds* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
result = self->priv->_upper;
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
return result;
|
||||||
|
#line 203 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bounds_set_upper (LiveChartBounds* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
old_value = live_chart_bounds_get_upper (self);
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
self->priv->_upper = value;
|
||||||
|
#line 9 "../src/bounds.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_bounds_properties[LIVE_CHART_BOUNDS_UPPER_PROPERTY]);
|
||||||
|
#line 221 "bounds.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bounds_class_init (LiveChartBoundsClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartBounds_private_offset);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_bounds_get_property;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_bounds_set_property;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_bounds_finalize;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_BOUNDS_LOWER_PROPERTY, live_chart_bounds_properties[LIVE_CHART_BOUNDS_LOWER_PROPERTY] = g_param_spec_double ("lower", "lower", "lower", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_BOUNDS_UPPER_PROPERTY, live_chart_bounds_properties[LIVE_CHART_BOUNDS_UPPER_PROPERTY] = g_param_spec_double ("upper", "upper", "upper", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 243 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bounds_instance_init (LiveChartBounds * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
self->priv = live_chart_bounds_get_instance_private (self);
|
||||||
|
#line 252 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bounds_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartBounds * self;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_BOUNDS, LiveChartBounds);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_bounds_parent_class)->finalize (obj);
|
||||||
|
#line 263 "bounds.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_bounds_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartBoundsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_bounds_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartBounds), 0, (GInstanceInitFunc) live_chart_bounds_instance_init, NULL };
|
||||||
|
GType live_chart_bounds_type_id;
|
||||||
|
live_chart_bounds_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartBounds", &g_define_type_info, 0);
|
||||||
|
LiveChartBounds_private_offset = g_type_add_instance_private (live_chart_bounds_type_id, sizeof (LiveChartBoundsPrivate));
|
||||||
|
return live_chart_bounds_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_bounds_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_bounds_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_bounds_type_id__once)) {
|
||||||
|
GType live_chart_bounds_type_id;
|
||||||
|
live_chart_bounds_type_id = live_chart_bounds_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_bounds_type_id__once, live_chart_bounds_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_bounds_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_bounds_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartBounds * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_BOUNDS, LiveChartBounds);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
case LIVE_CHART_BOUNDS_LOWER_PROPERTY:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
g_value_set_double (value, live_chart_bounds_get_lower (self));
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
case LIVE_CHART_BOUNDS_UPPER_PROPERTY:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
g_value_set_double (value, live_chart_bounds_get_upper (self));
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 310 "bounds.c"
|
||||||
|
default:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 316 "bounds.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_bounds_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartBounds * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_BOUNDS, LiveChartBounds);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
case LIVE_CHART_BOUNDS_LOWER_PROPERTY:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_lower (self, g_value_get_double (value));
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
case LIVE_CHART_BOUNDS_UPPER_PROPERTY:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
live_chart_bounds_set_upper (self, g_value_get_double (value));
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 342 "bounds.c"
|
||||||
|
default:
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 3 "../src/bounds.vala"
|
||||||
|
break;
|
||||||
|
#line 348 "bounds.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,222 @@
|
||||||
|
/* drawable.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from drawable.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
|
||||||
|
static GType live_chart_drawable_get_type_once (void);
|
||||||
|
static GType live_chart_colorable_get_type_once (void);
|
||||||
|
|
||||||
|
LiveChartBoundingBox*
|
||||||
|
live_chart_bounding_box_dup (const LiveChartBoundingBox* self)
|
||||||
|
{
|
||||||
|
LiveChartBoundingBox* dup;
|
||||||
|
#line 4 "../src/drawable.vala"
|
||||||
|
dup = g_new0 (LiveChartBoundingBox, 1);
|
||||||
|
#line 4 "../src/drawable.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 4 "../src/drawable.vala"
|
||||||
|
return dup;
|
||||||
|
#line 23 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_bounding_box_free (LiveChartBoundingBox* self)
|
||||||
|
{
|
||||||
|
#line 4 "../src/drawable.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 31 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_bounding_box_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_bounding_box_type_id;
|
||||||
|
live_chart_bounding_box_type_id = g_boxed_type_register_static ("LiveChartBoundingBox", (GBoxedCopyFunc) live_chart_bounding_box_dup, (GBoxedFreeFunc) live_chart_bounding_box_free);
|
||||||
|
return live_chart_bounding_box_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_bounding_box_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_bounding_box_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_bounding_box_type_id__once)) {
|
||||||
|
GType live_chart_bounding_box_type_id;
|
||||||
|
live_chart_bounding_box_type_id = live_chart_bounding_box_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_bounding_box_type_id__once, live_chart_bounding_box_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_bounding_box_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_drawable_draw (LiveChartDrawable* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartDrawableIface* _iface_;
|
||||||
|
#line 13 "../src/drawable.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 13 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_DRAWABLE_GET_INTERFACE (self);
|
||||||
|
#line 13 "../src/drawable.vala"
|
||||||
|
if (_iface_->draw) {
|
||||||
|
#line 13 "../src/drawable.vala"
|
||||||
|
_iface_->draw (self, ctx, config);
|
||||||
|
#line 68 "drawable.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_drawable_get_bounding_box (LiveChartDrawable* self,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartDrawableIface* _iface_;
|
||||||
|
#line 15 "../src/drawable.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 15 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_DRAWABLE_GET_INTERFACE (self);
|
||||||
|
#line 15 "../src/drawable.vala"
|
||||||
|
if (_iface_->get_bounding_box) {
|
||||||
|
#line 15 "../src/drawable.vala"
|
||||||
|
_iface_->get_bounding_box (self, result);
|
||||||
|
#line 85 "drawable.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_drawable_get_visible (LiveChartDrawable* self)
|
||||||
|
{
|
||||||
|
LiveChartDrawableIface* _iface_;
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_DRAWABLE_GET_INTERFACE (self);
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
if (_iface_->get_visible) {
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
return _iface_->get_visible (self);
|
||||||
|
#line 101 "drawable.c"
|
||||||
|
}
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 105 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_drawable_set_visible (LiveChartDrawable* self,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartDrawableIface* _iface_;
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_DRAWABLE_GET_INTERFACE (self);
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
if (_iface_->set_visible) {
|
||||||
|
#line 11 "../src/drawable.vala"
|
||||||
|
_iface_->set_visible (self, value);
|
||||||
|
#line 121 "drawable.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_drawable_default_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 10 "../src/drawable.vala"
|
||||||
|
g_object_interface_install_property (iface, g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 131 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_drawable_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartDrawableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_drawable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
|
||||||
|
GType live_chart_drawable_type_id;
|
||||||
|
live_chart_drawable_type_id = g_type_register_static (G_TYPE_INTERFACE, "LiveChartDrawable", &g_define_type_info, 0);
|
||||||
|
g_type_interface_add_prerequisite (live_chart_drawable_type_id, G_TYPE_OBJECT);
|
||||||
|
return live_chart_drawable_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_drawable_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_drawable_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_drawable_type_id__once)) {
|
||||||
|
GType live_chart_drawable_type_id;
|
||||||
|
live_chart_drawable_type_id = live_chart_drawable_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_drawable_type_id__once, live_chart_drawable_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_drawable_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_colorable_get_main_color (LiveChartColorable* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
LiveChartColorableIface* _iface_;
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_COLORABLE_GET_INTERFACE (self);
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
if (_iface_->get_main_color) {
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
_iface_->get_main_color (self, result);
|
||||||
|
#line 169 "drawable.c"
|
||||||
|
}
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
return;
|
||||||
|
#line 173 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_colorable_set_main_color (LiveChartColorable* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
LiveChartColorableIface* _iface_;
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
_iface_ = LIVE_CHART_COLORABLE_GET_INTERFACE (self);
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
if (_iface_->set_main_color) {
|
||||||
|
#line 22 "../src/drawable.vala"
|
||||||
|
_iface_->set_main_color (self, value);
|
||||||
|
#line 189 "drawable.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_colorable_default_init (LiveChartColorableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 20 "../src/drawable.vala"
|
||||||
|
g_object_interface_install_property (iface, g_param_spec_boxed ("main-color", "main-color", "main-color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_DEPRECATED));
|
||||||
|
#line 199 "drawable.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_colorable_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartColorableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_colorable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
|
||||||
|
GType live_chart_colorable_type_id;
|
||||||
|
live_chart_colorable_type_id = g_type_register_static (G_TYPE_INTERFACE, "LiveChartColorable", &g_define_type_info, 0);
|
||||||
|
g_type_interface_add_prerequisite (live_chart_colorable_type_id, G_TYPE_OBJECT);
|
||||||
|
return live_chart_colorable_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_colorable_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_colorable_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_colorable_type_id__once)) {
|
||||||
|
GType live_chart_colorable_type_id;
|
||||||
|
live_chart_colorable_type_id = live_chart_colorable_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_colorable_type_id__once, live_chart_colorable_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_colorable_type_id__once;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,544 @@
|
||||||
|
/* font.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from font.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
typedef struct _LiveChartParamSpecFont LiveChartParamSpecFont;
|
||||||
|
|
||||||
|
struct _LiveChartFontPrivate {
|
||||||
|
guint8 _size;
|
||||||
|
gchar* _face;
|
||||||
|
cairo_font_slant_t _slant;
|
||||||
|
cairo_font_weight_t _weight;
|
||||||
|
GdkRGBA _color;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _LiveChartParamSpecFont {
|
||||||
|
GParamSpec parent_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartFont_private_offset;
|
||||||
|
static gpointer live_chart_font_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_font_finalize (LiveChartFont * obj);
|
||||||
|
static GType live_chart_font_get_type_once (void);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_font_get_instance_private (LiveChartFont* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartFont_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartFont*
|
||||||
|
live_chart_font_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartFont* self = NULL;
|
||||||
|
GdkRGBA _tmp0_ = {0};
|
||||||
|
#line 12 "../src/font.vala"
|
||||||
|
self = (LiveChartFont*) g_type_create_instance (object_type);
|
||||||
|
#line 13 "../src/font.vala"
|
||||||
|
live_chart_font_set_size (self, (guint8) 10);
|
||||||
|
#line 14 "../src/font.vala"
|
||||||
|
live_chart_font_set_face (self, "Sans serif");
|
||||||
|
#line 15 "../src/font.vala"
|
||||||
|
live_chart_font_set_slant (self, CAIRO_FONT_SLANT_NORMAL);
|
||||||
|
#line 16 "../src/font.vala"
|
||||||
|
live_chart_font_set_weight (self, CAIRO_FONT_WEIGHT_NORMAL);
|
||||||
|
#line 17 "../src/font.vala"
|
||||||
|
_tmp0_.red = 0.4;
|
||||||
|
#line 17 "../src/font.vala"
|
||||||
|
_tmp0_.green = 0.4;
|
||||||
|
#line 17 "../src/font.vala"
|
||||||
|
_tmp0_.blue = 0.4;
|
||||||
|
#line 17 "../src/font.vala"
|
||||||
|
_tmp0_.alpha = 1.0;
|
||||||
|
#line 17 "../src/font.vala"
|
||||||
|
live_chart_font_set_color (self, &_tmp0_);
|
||||||
|
#line 12 "../src/font.vala"
|
||||||
|
return self;
|
||||||
|
#line 69 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartFont*
|
||||||
|
live_chart_font_new (void)
|
||||||
|
{
|
||||||
|
#line 12 "../src/font.vala"
|
||||||
|
return live_chart_font_construct (LIVE_CHART_TYPE_FONT);
|
||||||
|
#line 77 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_configure (LiveChartFont* self,
|
||||||
|
cairo_t* ctx)
|
||||||
|
{
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
cairo_font_slant_t _tmp1_;
|
||||||
|
cairo_font_weight_t _tmp2_;
|
||||||
|
guint8 _tmp3_;
|
||||||
|
GdkRGBA _tmp4_;
|
||||||
|
GdkRGBA _tmp5_;
|
||||||
|
GdkRGBA _tmp6_;
|
||||||
|
GdkRGBA _tmp7_;
|
||||||
|
#line 20 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 20 "../src/font.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 21 "../src/font.vala"
|
||||||
|
_tmp0_ = self->priv->_face;
|
||||||
|
#line 21 "../src/font.vala"
|
||||||
|
_tmp1_ = self->priv->_slant;
|
||||||
|
#line 21 "../src/font.vala"
|
||||||
|
_tmp2_ = self->priv->_weight;
|
||||||
|
#line 21 "../src/font.vala"
|
||||||
|
cairo_select_font_face (ctx, _tmp0_, _tmp1_, _tmp2_);
|
||||||
|
#line 22 "../src/font.vala"
|
||||||
|
_tmp3_ = self->priv->_size;
|
||||||
|
#line 22 "../src/font.vala"
|
||||||
|
cairo_set_font_size (ctx, (gdouble) _tmp3_);
|
||||||
|
#line 23 "../src/font.vala"
|
||||||
|
_tmp4_ = self->priv->_color;
|
||||||
|
#line 23 "../src/font.vala"
|
||||||
|
_tmp5_ = self->priv->_color;
|
||||||
|
#line 23 "../src/font.vala"
|
||||||
|
_tmp6_ = self->priv->_color;
|
||||||
|
#line 23 "../src/font.vala"
|
||||||
|
_tmp7_ = self->priv->_color;
|
||||||
|
#line 23 "../src/font.vala"
|
||||||
|
cairo_set_source_rgba (ctx, _tmp4_.red, _tmp5_.green, _tmp6_.blue, _tmp7_.alpha);
|
||||||
|
#line 118 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
guint8
|
||||||
|
live_chart_font_get_size (LiveChartFont* self)
|
||||||
|
{
|
||||||
|
guint8 result;
|
||||||
|
#line 6 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0U);
|
||||||
|
#line 6 "../src/font.vala"
|
||||||
|
result = self->priv->_size;
|
||||||
|
#line 6 "../src/font.vala"
|
||||||
|
return result;
|
||||||
|
#line 131 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_set_size (LiveChartFont* self,
|
||||||
|
guint8 value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/font.vala"
|
||||||
|
self->priv->_size = value;
|
||||||
|
#line 142 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
live_chart_font_get_face (LiveChartFont* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
_tmp0_ = self->priv->_face;
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
return result;
|
||||||
|
#line 158 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_set_face (LiveChartFont* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
gchar* _tmp0_;
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
_g_free0 (self->priv->_face);
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
self->priv->_face = _tmp0_;
|
||||||
|
#line 174 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo_font_slant_t
|
||||||
|
live_chart_font_get_slant (LiveChartFont* self)
|
||||||
|
{
|
||||||
|
cairo_font_slant_t result;
|
||||||
|
#line 8 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
#line 8 "../src/font.vala"
|
||||||
|
result = self->priv->_slant;
|
||||||
|
#line 8 "../src/font.vala"
|
||||||
|
return result;
|
||||||
|
#line 187 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_set_slant (LiveChartFont* self,
|
||||||
|
cairo_font_slant_t value)
|
||||||
|
{
|
||||||
|
#line 8 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 8 "../src/font.vala"
|
||||||
|
self->priv->_slant = value;
|
||||||
|
#line 198 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo_font_weight_t
|
||||||
|
live_chart_font_get_weight (LiveChartFont* self)
|
||||||
|
{
|
||||||
|
cairo_font_weight_t result;
|
||||||
|
#line 9 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
#line 9 "../src/font.vala"
|
||||||
|
result = self->priv->_weight;
|
||||||
|
#line 9 "../src/font.vala"
|
||||||
|
return result;
|
||||||
|
#line 211 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_set_weight (LiveChartFont* self,
|
||||||
|
cairo_font_weight_t value)
|
||||||
|
{
|
||||||
|
#line 9 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 9 "../src/font.vala"
|
||||||
|
self->priv->_weight = value;
|
||||||
|
#line 222 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_get_color (LiveChartFont* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
_tmp0_ = self->priv->_color;
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
return;
|
||||||
|
#line 238 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_set_color (LiveChartFont* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
_tmp0_ = *value;
|
||||||
|
#line 10 "../src/font.vala"
|
||||||
|
self->priv->_color = _tmp0_;
|
||||||
|
#line 252 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_font_init (GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 260 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_font_free_value (GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
live_chart_font_unref (value->data[0].v_pointer);
|
||||||
|
#line 270 "font.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_font_copy_value (const GValue* src_value,
|
||||||
|
GValue* dest_value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (src_value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
dest_value->data[0].v_pointer = live_chart_font_ref (src_value->data[0].v_pointer);
|
||||||
|
#line 282 "font.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
dest_value->data[0].v_pointer = NULL;
|
||||||
|
#line 286 "font.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
live_chart_value_font_peek_pointer (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 295 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_font_collect_value (GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (collect_values[0].v_pointer) {
|
||||||
|
#line 306 "font.c"
|
||||||
|
LiveChartFont * object;
|
||||||
|
object = collect_values[0].v_pointer;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (object->parent_instance.g_class == NULL) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
|
||||||
|
#line 313 "font.c"
|
||||||
|
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
|
||||||
|
#line 5 "../src/font.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 317 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = live_chart_font_ref (object);
|
||||||
|
#line 321 "font.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 325 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 329 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_font_lcopy_value (const GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
LiveChartFont ** object_p;
|
||||||
|
object_p = collect_values[0].v_pointer;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (!object_p) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
|
||||||
|
#line 344 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (!value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
*object_p = NULL;
|
||||||
|
#line 350 "font.c"
|
||||||
|
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
*object_p = value->data[0].v_pointer;
|
||||||
|
#line 354 "font.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
*object_p = live_chart_font_ref (value->data[0].v_pointer);
|
||||||
|
#line 358 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 362 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
GParamSpec*
|
||||||
|
live_chart_param_spec_font (const gchar* name,
|
||||||
|
const gchar* nick,
|
||||||
|
const gchar* blurb,
|
||||||
|
GType object_type,
|
||||||
|
GParamFlags flags)
|
||||||
|
{
|
||||||
|
LiveChartParamSpecFont* spec;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (g_type_is_a (object_type, LIVE_CHART_TYPE_FONT), NULL);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
G_PARAM_SPEC (spec)->value_type = object_type;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return G_PARAM_SPEC (spec);
|
||||||
|
#line 381 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_value_get_font (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_FONT), NULL);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 391 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_set_font (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartFont * old;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_FONT));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_FONT));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
live_chart_font_ref (value->data[0].v_pointer);
|
||||||
|
#line 413 "font.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 417 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
live_chart_font_unref (old);
|
||||||
|
#line 423 "font.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_take_font (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartFont * old;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_FONT));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_FONT));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 444 "font.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 448 "font.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
live_chart_font_unref (old);
|
||||||
|
#line 454 "font.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_font_class_init (LiveChartFontClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
live_chart_font_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
((LiveChartFontClass *) klass)->finalize = live_chart_font_finalize;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartFont_private_offset);
|
||||||
|
#line 468 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_font_instance_init (LiveChartFont * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
self->priv = live_chart_font_get_instance_private (self);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
self->ref_count = 1;
|
||||||
|
#line 479 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_font_finalize (LiveChartFont * obj)
|
||||||
|
{
|
||||||
|
LiveChartFont * self;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_FONT, LiveChartFont);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_signal_handlers_destroy (self);
|
||||||
|
#line 7 "../src/font.vala"
|
||||||
|
_g_free0 (self->priv->_face);
|
||||||
|
#line 492 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_font_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeValueTable g_define_type_value_table = { live_chart_value_font_init, live_chart_value_font_free_value, live_chart_value_font_copy_value, live_chart_value_font_peek_pointer, "p", live_chart_value_font_collect_value, "p", live_chart_value_font_lcopy_value };
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartFontClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_font_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartFont), 0, (GInstanceInitFunc) live_chart_font_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_font_type_id;
|
||||||
|
live_chart_font_type_id = g_type_register_fundamental (g_type_fundamental_next (), "LiveChartFont", &g_define_type_info, &g_define_type_fundamental_info, 0);
|
||||||
|
LiveChartFont_private_offset = g_type_add_instance_private (live_chart_font_type_id, sizeof (LiveChartFontPrivate));
|
||||||
|
return live_chart_font_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_font_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_font_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_font_type_id__once)) {
|
||||||
|
GType live_chart_font_type_id;
|
||||||
|
live_chart_font_type_id = live_chart_font_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_font_type_id__once, live_chart_font_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_font_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_font_ref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartFont * self;
|
||||||
|
self = instance;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_atomic_int_inc (&self->ref_count);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
return instance;
|
||||||
|
#line 528 "font.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_font_unref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartFont * self;
|
||||||
|
self = instance;
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&self->ref_count)) {
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
LIVE_CHART_FONT_GET_CLASS (self)->finalize (self);
|
||||||
|
#line 5 "../src/font.vala"
|
||||||
|
g_type_free_instance ((GTypeInstance *) self);
|
||||||
|
#line 542 "font.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,213 @@
|
||||||
|
/* geometry.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from geometry.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
LiveChartCoord*
|
||||||
|
live_chart_coord_dup (const LiveChartCoord* self)
|
||||||
|
{
|
||||||
|
LiveChartCoord* dup;
|
||||||
|
#line 2 "../src/geometry.vala"
|
||||||
|
dup = g_new0 (LiveChartCoord, 1);
|
||||||
|
#line 2 "../src/geometry.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartCoord));
|
||||||
|
#line 2 "../src/geometry.vala"
|
||||||
|
return dup;
|
||||||
|
#line 21 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_coord_free (LiveChartCoord* self)
|
||||||
|
{
|
||||||
|
#line 2 "../src/geometry.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 29 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_coord_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_coord_type_id;
|
||||||
|
live_chart_coord_type_id = g_boxed_type_register_static ("LiveChartCoord", (GBoxedCopyFunc) live_chart_coord_dup, (GBoxedFreeFunc) live_chart_coord_free);
|
||||||
|
return live_chart_coord_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_coord_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_coord_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_coord_type_id__once)) {
|
||||||
|
GType live_chart_coord_type_id;
|
||||||
|
live_chart_coord_type_id = live_chart_coord_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_coord_type_id__once, live_chart_coord_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_coord_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSegment*
|
||||||
|
live_chart_segment_dup (const LiveChartSegment* self)
|
||||||
|
{
|
||||||
|
LiveChartSegment* dup;
|
||||||
|
#line 7 "../src/geometry.vala"
|
||||||
|
dup = g_new0 (LiveChartSegment, 1);
|
||||||
|
#line 7 "../src/geometry.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartSegment));
|
||||||
|
#line 7 "../src/geometry.vala"
|
||||||
|
return dup;
|
||||||
|
#line 62 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_segment_free (LiveChartSegment* self)
|
||||||
|
{
|
||||||
|
#line 7 "../src/geometry.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 70 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_segment_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_segment_type_id;
|
||||||
|
live_chart_segment_type_id = g_boxed_type_register_static ("LiveChartSegment", (GBoxedCopyFunc) live_chart_segment_dup, (GBoxedFreeFunc) live_chart_segment_free);
|
||||||
|
return live_chart_segment_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_segment_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_segment_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_segment_type_id__once)) {
|
||||||
|
GType live_chart_segment_type_id;
|
||||||
|
live_chart_segment_type_id = live_chart_segment_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_segment_type_id__once, live_chart_segment_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_segment_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBezierCurve*
|
||||||
|
live_chart_bezier_curve_dup (const LiveChartBezierCurve* self)
|
||||||
|
{
|
||||||
|
LiveChartBezierCurve* dup;
|
||||||
|
#line 11 "../src/geometry.vala"
|
||||||
|
dup = g_new0 (LiveChartBezierCurve, 1);
|
||||||
|
#line 11 "../src/geometry.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartBezierCurve));
|
||||||
|
#line 11 "../src/geometry.vala"
|
||||||
|
return dup;
|
||||||
|
#line 103 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_bezier_curve_free (LiveChartBezierCurve* self)
|
||||||
|
{
|
||||||
|
#line 11 "../src/geometry.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 111 "geometry.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_bezier_curve_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_bezier_curve_type_id;
|
||||||
|
live_chart_bezier_curve_type_id = g_boxed_type_register_static ("LiveChartBezierCurve", (GBoxedCopyFunc) live_chart_bezier_curve_dup, (GBoxedFreeFunc) live_chart_bezier_curve_free);
|
||||||
|
return live_chart_bezier_curve_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_bezier_curve_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_bezier_curve_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_bezier_curve_type_id__once)) {
|
||||||
|
GType live_chart_bezier_curve_type_id;
|
||||||
|
live_chart_bezier_curve_type_id = live_chart_bezier_curve_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_bezier_curve_type_id__once, live_chart_bezier_curve_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_bezier_curve_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_build_bezier_curve_from_points (LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* target,
|
||||||
|
LiveChartBezierCurve* result)
|
||||||
|
{
|
||||||
|
gdouble pressure = 0.0;
|
||||||
|
LiveChartPoint _tmp0_;
|
||||||
|
LiveChartPoint _tmp1_;
|
||||||
|
LiveChartBezierCurve bezier = {0};
|
||||||
|
LiveChartPoint _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
LiveChartCoord _tmp4_ = {0};
|
||||||
|
LiveChartPoint _tmp5_;
|
||||||
|
LiveChartPoint _tmp6_;
|
||||||
|
LiveChartCoord _tmp7_ = {0};
|
||||||
|
LiveChartPoint _tmp8_;
|
||||||
|
LiveChartPoint _tmp9_;
|
||||||
|
LiveChartCoord _tmp10_ = {0};
|
||||||
|
LiveChartPoint _tmp11_;
|
||||||
|
LiveChartPoint _tmp12_;
|
||||||
|
LiveChartCoord _tmp13_ = {0};
|
||||||
|
LiveChartBezierCurve _tmp14_ = {0};
|
||||||
|
#line 18 "../src/geometry.vala"
|
||||||
|
g_return_if_fail (previous != NULL);
|
||||||
|
#line 18 "../src/geometry.vala"
|
||||||
|
g_return_if_fail (target != NULL);
|
||||||
|
#line 19 "../src/geometry.vala"
|
||||||
|
_tmp0_ = *target;
|
||||||
|
#line 19 "../src/geometry.vala"
|
||||||
|
_tmp1_ = *previous;
|
||||||
|
#line 19 "../src/geometry.vala"
|
||||||
|
pressure = (_tmp0_.x - _tmp1_.x) / 2.0;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp2_ = *previous;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp3_ = *previous;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp4_.x = _tmp2_.x;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp4_.y = _tmp3_.y;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp5_ = *previous;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp6_ = *previous;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp7_.x = _tmp5_.x + pressure;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp7_.y = _tmp6_.y;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp8_ = *target;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp9_ = *target;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp10_.x = _tmp8_.x - pressure;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp10_.y = _tmp9_.y;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp11_ = *target;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp12_ = *target;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp13_.x = _tmp11_.x;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp13_.y = _tmp12_.y;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp14_.c0 = _tmp4_;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp14_.c1 = _tmp7_;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp14_.c2 = _tmp10_;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
_tmp14_.c3 = _tmp13_;
|
||||||
|
#line 20 "../src/geometry.vala"
|
||||||
|
bezier = _tmp14_;
|
||||||
|
#line 39 "../src/geometry.vala"
|
||||||
|
*result = bezier;
|
||||||
|
#line 39 "../src/geometry.vala"
|
||||||
|
return;
|
||||||
|
#line 212 "geometry.c"
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,800 @@
|
||||||
|
/* intersections.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from intersections.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_INTERSECTIONS_0_PROPERTY,
|
||||||
|
LIVE_CHART_INTERSECTIONS_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_intersections_properties[LIVE_CHART_INTERSECTIONS_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_INTERSECTION_0_PROPERTY,
|
||||||
|
LIVE_CHART_INTERSECTION_REGION_PROPERTY,
|
||||||
|
LIVE_CHART_INTERSECTION_START_X_PROPERTY,
|
||||||
|
LIVE_CHART_INTERSECTION_END_X_PROPERTY,
|
||||||
|
LIVE_CHART_INTERSECTION_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_intersection_properties[LIVE_CHART_INTERSECTION_NUM_PROPERTIES];
|
||||||
|
#define _live_chart_region_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_region_unref (var), NULL)))
|
||||||
|
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartIntersectionsPrivate {
|
||||||
|
GeeList* intersections;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _LiveChartIntersectionPrivate {
|
||||||
|
LiveChartRegion* _region;
|
||||||
|
gdouble _start_x;
|
||||||
|
gdouble _end_x;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartIntersections_private_offset;
|
||||||
|
static gpointer live_chart_intersections_parent_class = NULL;
|
||||||
|
static gint LiveChartIntersection_private_offset;
|
||||||
|
static gpointer live_chart_intersection_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_intersections_finalize (GObject * obj);
|
||||||
|
static GType live_chart_intersections_get_type_once (void);
|
||||||
|
static void live_chart_intersection_set_start_x (LiveChartIntersection* self,
|
||||||
|
gdouble value);
|
||||||
|
static void live_chart_intersection_set_end_x (LiveChartIntersection* self,
|
||||||
|
gdouble value);
|
||||||
|
static gdouble* _double_dup (gdouble* self);
|
||||||
|
static void live_chart_intersection_finalize (GObject * obj);
|
||||||
|
static GType live_chart_intersection_get_type_once (void);
|
||||||
|
static void _vala_live_chart_intersection_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_intersection_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_intersections_get_instance_private (LiveChartIntersections* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartIntersections_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersections_close (LiveChartIntersections* self,
|
||||||
|
gdouble x,
|
||||||
|
gdouble exited_at)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartIntersection* _tmp2_;
|
||||||
|
#line 5 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 6 "../src/intersections.vala"
|
||||||
|
_tmp1_ = gee_list_last (_tmp0_);
|
||||||
|
#line 6 "../src/intersections.vala"
|
||||||
|
_tmp2_ = (LiveChartIntersection*) _tmp1_;
|
||||||
|
#line 6 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_close (_tmp2_, x, exited_at);
|
||||||
|
#line 6 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 89 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersections_update (LiveChartIntersections* self,
|
||||||
|
gdouble x)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartIntersection* _tmp2_;
|
||||||
|
#line 9 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 10 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 10 "../src/intersections.vala"
|
||||||
|
_tmp1_ = gee_list_last (_tmp0_);
|
||||||
|
#line 10 "../src/intersections.vala"
|
||||||
|
_tmp2_ = (LiveChartIntersection*) _tmp1_;
|
||||||
|
#line 10 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_update (_tmp2_, x);
|
||||||
|
#line 10 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 111 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersections_open (LiveChartIntersections* self,
|
||||||
|
LiveChartRegion* region,
|
||||||
|
gdouble x,
|
||||||
|
gdouble entered_at)
|
||||||
|
{
|
||||||
|
LiveChartIntersection* intersection = NULL;
|
||||||
|
LiveChartIntersection* _tmp0_;
|
||||||
|
GeeList* _tmp1_;
|
||||||
|
#line 13 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 13 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (region != NULL);
|
||||||
|
#line 14 "../src/intersections.vala"
|
||||||
|
_tmp0_ = live_chart_intersection_new (region, x, entered_at);
|
||||||
|
#line 14 "../src/intersections.vala"
|
||||||
|
intersection = _tmp0_;
|
||||||
|
#line 15 "../src/intersections.vala"
|
||||||
|
_tmp1_ = self->priv->intersections;
|
||||||
|
#line 15 "../src/intersections.vala"
|
||||||
|
gee_collection_add ((GeeCollection*) _tmp1_, intersection);
|
||||||
|
#line 13 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (intersection);
|
||||||
|
#line 137 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersections_open_without_entrypoint (LiveChartIntersections* self,
|
||||||
|
LiveChartRegion* region,
|
||||||
|
gdouble x)
|
||||||
|
{
|
||||||
|
LiveChartIntersection* intersection = NULL;
|
||||||
|
LiveChartIntersection* _tmp0_;
|
||||||
|
GeeList* _tmp1_;
|
||||||
|
#line 18 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 18 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (region != NULL);
|
||||||
|
#line 19 "../src/intersections.vala"
|
||||||
|
_tmp0_ = live_chart_intersection_new_without_entry_point (region, x);
|
||||||
|
#line 19 "../src/intersections.vala"
|
||||||
|
intersection = _tmp0_;
|
||||||
|
#line 20 "../src/intersections.vala"
|
||||||
|
_tmp1_ = self->priv->intersections;
|
||||||
|
#line 20 "../src/intersections.vala"
|
||||||
|
gee_collection_add ((GeeCollection*) _tmp1_, intersection);
|
||||||
|
#line 18 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (intersection);
|
||||||
|
#line 162 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersections_foreach (LiveChartIntersections* self,
|
||||||
|
GeeForallFunc f,
|
||||||
|
gpointer f_target)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
#line 23 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 24 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 24 "../src/intersections.vala"
|
||||||
|
gee_traversable_foreach ((GeeTraversable*) _tmp0_, f, f_target);
|
||||||
|
#line 177 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_intersections_has_an_opened_intersection (LiveChartIntersections* self)
|
||||||
|
{
|
||||||
|
gboolean _tmp0_ = FALSE;
|
||||||
|
GeeList* _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
gboolean result;
|
||||||
|
#line 27 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp1_ = self->priv->intersections;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
if (_tmp3_ > 0) {
|
||||||
|
#line 198 "intersections.c"
|
||||||
|
GeeList* _tmp4_;
|
||||||
|
gpointer _tmp5_;
|
||||||
|
LiveChartIntersection* _tmp6_;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp4_ = self->priv->intersections;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp5_ = gee_list_last (_tmp4_);
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp6_ = (LiveChartIntersection*) _tmp5_;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp0_ = live_chart_intersection_is_open (_tmp6_);
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (_tmp6_);
|
||||||
|
#line 212 "intersections.c"
|
||||||
|
} else {
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
_tmp0_ = FALSE;
|
||||||
|
#line 216 "intersections.c"
|
||||||
|
}
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 28 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 222 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_region_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
return self ? live_chart_region_ref (self) : NULL;
|
||||||
|
#line 230 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartRegion*
|
||||||
|
live_chart_intersections_get_current_region (LiveChartIntersections* self)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartIntersection* _tmp2_;
|
||||||
|
LiveChartRegion* _tmp3_;
|
||||||
|
LiveChartRegion* _tmp4_;
|
||||||
|
LiveChartRegion* _tmp5_;
|
||||||
|
LiveChartRegion* _tmp6_;
|
||||||
|
LiveChartRegion* result;
|
||||||
|
#line 30 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp1_ = gee_list_last (_tmp0_);
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp2_ = (LiveChartIntersection*) _tmp1_;
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp3_ = live_chart_intersection_get_region (_tmp2_);
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp5_ = _live_chart_region_ref0 (_tmp4_);
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
result = _tmp6_;
|
||||||
|
#line 31 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 266 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
live_chart_intersections_size (LiveChartIntersections* self)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint result;
|
||||||
|
#line 34 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
#line 35 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 35 "../src/intersections.vala"
|
||||||
|
_tmp1_ = gee_collection_get_size ((GeeCollection*) _tmp0_);
|
||||||
|
#line 35 "../src/intersections.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 35 "../src/intersections.vala"
|
||||||
|
result = _tmp2_;
|
||||||
|
#line 35 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 288 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersection*
|
||||||
|
live_chart_intersections_get (LiveChartIntersections* self,
|
||||||
|
gint index)
|
||||||
|
{
|
||||||
|
GeeList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartIntersection* result;
|
||||||
|
#line 38 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 39 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->intersections;
|
||||||
|
#line 39 "../src/intersections.vala"
|
||||||
|
_tmp1_ = gee_list_get (_tmp0_, index);
|
||||||
|
#line 39 "../src/intersections.vala"
|
||||||
|
result = (LiveChartIntersection*) _tmp1_;
|
||||||
|
#line 39 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 308 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersections*
|
||||||
|
live_chart_intersections_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartIntersections * self = NULL;
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
self = (LiveChartIntersections*) g_object_new (object_type, NULL);
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
return self;
|
||||||
|
#line 319 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersections*
|
||||||
|
live_chart_intersections_new (void)
|
||||||
|
{
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
return live_chart_intersections_construct (LIVE_CHART_TYPE_INTERSECTIONS);
|
||||||
|
#line 327 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersections_class_init (LiveChartIntersectionsClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
live_chart_intersections_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartIntersections_private_offset);
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_intersections_finalize;
|
||||||
|
#line 340 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersections_instance_init (LiveChartIntersections * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
self->priv = live_chart_intersections_get_instance_private (self);
|
||||||
|
#line 3 "../src/intersections.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (LIVE_CHART_TYPE_INTERSECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
|
||||||
|
#line 3 "../src/intersections.vala"
|
||||||
|
self->priv->intersections = (GeeList*) _tmp0_;
|
||||||
|
#line 354 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersections_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartIntersections * self;
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_INTERSECTIONS, LiveChartIntersections);
|
||||||
|
#line 3 "../src/intersections.vala"
|
||||||
|
_g_object_unref0 (self->priv->intersections);
|
||||||
|
#line 2 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_intersections_parent_class)->finalize (obj);
|
||||||
|
#line 367 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_intersections_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartIntersectionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_intersections_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartIntersections), 0, (GInstanceInitFunc) live_chart_intersections_instance_init, NULL };
|
||||||
|
GType live_chart_intersections_type_id;
|
||||||
|
live_chart_intersections_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartIntersections", &g_define_type_info, 0);
|
||||||
|
LiveChartIntersections_private_offset = g_type_add_instance_private (live_chart_intersections_type_id, sizeof (LiveChartIntersectionsPrivate));
|
||||||
|
return live_chart_intersections_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_intersections_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_intersections_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_intersections_type_id__once)) {
|
||||||
|
GType live_chart_intersections_type_id;
|
||||||
|
live_chart_intersections_type_id = live_chart_intersections_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_intersections_type_id__once, live_chart_intersections_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_intersections_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_intersection_get_instance_private (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartIntersection_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gdouble*
|
||||||
|
_double_dup (gdouble* self)
|
||||||
|
{
|
||||||
|
gdouble* dup;
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
dup = g_new0 (gdouble, 1);
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
memcpy (dup, self, sizeof (gdouble));
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
return dup;
|
||||||
|
#line 408 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
__double_dup0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
return self ? _double_dup (self) : NULL;
|
||||||
|
#line 416 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersection*
|
||||||
|
live_chart_intersection_construct (GType object_type,
|
||||||
|
LiveChartRegion* region,
|
||||||
|
gdouble start_x,
|
||||||
|
gdouble entered_at)
|
||||||
|
{
|
||||||
|
LiveChartIntersection * self = NULL;
|
||||||
|
gdouble* _tmp0_;
|
||||||
|
#line 50 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (region != NULL, NULL);
|
||||||
|
#line 50 "../src/intersections.vala"
|
||||||
|
self = (LiveChartIntersection*) g_object_new (object_type, NULL);
|
||||||
|
#line 51 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_region (self, region);
|
||||||
|
#line 52 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_start_x (self, start_x);
|
||||||
|
#line 53 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_end_x (self, start_x);
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
_tmp0_ = __double_dup0 (&entered_at);
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
_g_free0 (self->entered_at);
|
||||||
|
#line 54 "../src/intersections.vala"
|
||||||
|
self->entered_at = _tmp0_;
|
||||||
|
#line 50 "../src/intersections.vala"
|
||||||
|
return self;
|
||||||
|
#line 445 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersection*
|
||||||
|
live_chart_intersection_new (LiveChartRegion* region,
|
||||||
|
gdouble start_x,
|
||||||
|
gdouble entered_at)
|
||||||
|
{
|
||||||
|
#line 50 "../src/intersections.vala"
|
||||||
|
return live_chart_intersection_construct (LIVE_CHART_TYPE_INTERSECTION, region, start_x, entered_at);
|
||||||
|
#line 455 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersection*
|
||||||
|
live_chart_intersection_construct_without_entry_point (GType object_type,
|
||||||
|
LiveChartRegion* region,
|
||||||
|
gdouble start_x)
|
||||||
|
{
|
||||||
|
LiveChartIntersection * self = NULL;
|
||||||
|
#line 56 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (region != NULL, NULL);
|
||||||
|
#line 56 "../src/intersections.vala"
|
||||||
|
self = (LiveChartIntersection*) g_object_new (object_type, NULL);
|
||||||
|
#line 57 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_region (self, region);
|
||||||
|
#line 58 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_start_x (self, start_x);
|
||||||
|
#line 59 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_end_x (self, start_x);
|
||||||
|
#line 56 "../src/intersections.vala"
|
||||||
|
return self;
|
||||||
|
#line 476 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartIntersection*
|
||||||
|
live_chart_intersection_new_without_entry_point (LiveChartRegion* region,
|
||||||
|
gdouble start_x)
|
||||||
|
{
|
||||||
|
#line 56 "../src/intersections.vala"
|
||||||
|
return live_chart_intersection_construct_without_entry_point (LIVE_CHART_TYPE_INTERSECTION, region, start_x);
|
||||||
|
#line 485 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersection_update (LiveChartIntersection* self,
|
||||||
|
gdouble x)
|
||||||
|
{
|
||||||
|
#line 62 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 63 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_end_x (self, x);
|
||||||
|
#line 496 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersection_close (LiveChartIntersection* self,
|
||||||
|
gdouble x,
|
||||||
|
gdouble exited_at)
|
||||||
|
{
|
||||||
|
gdouble* _tmp0_;
|
||||||
|
#line 66 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 67 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_end_x (self, x);
|
||||||
|
#line 68 "../src/intersections.vala"
|
||||||
|
_tmp0_ = __double_dup0 (&exited_at);
|
||||||
|
#line 68 "../src/intersections.vala"
|
||||||
|
_g_free0 (self->exited_at);
|
||||||
|
#line 68 "../src/intersections.vala"
|
||||||
|
self->exited_at = _tmp0_;
|
||||||
|
#line 515 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_intersection_is_open (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
gdouble* _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 71 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 72 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->exited_at;
|
||||||
|
#line 72 "../src/intersections.vala"
|
||||||
|
result = _tmp0_ == NULL;
|
||||||
|
#line 72 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 531 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_intersection_is_closed (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
gdouble* _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 75 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 76 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->exited_at;
|
||||||
|
#line 76 "../src/intersections.vala"
|
||||||
|
result = _tmp0_ != NULL;
|
||||||
|
#line 76 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 547 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartRegion*
|
||||||
|
live_chart_intersection_get_region (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
LiveChartRegion* result;
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
_tmp0_ = self->priv->_region;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 563 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersection_set_region (LiveChartIntersection* self,
|
||||||
|
LiveChartRegion* value)
|
||||||
|
{
|
||||||
|
LiveChartRegion* old_value;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
old_value = live_chart_intersection_get_region (self);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 577 "intersections.c"
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
_tmp0_ = _live_chart_region_ref0 (value);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->_region);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
self->priv->_region = _tmp0_;
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_REGION_PROPERTY]);
|
||||||
|
#line 587 "intersections.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_intersection_get_start_x (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
result = self->priv->_start_x;
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 601 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersection_set_start_x (LiveChartIntersection* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
old_value = live_chart_intersection_get_start_x (self);
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
self->priv->_start_x = value;
|
||||||
|
#line 45 "../src/intersections.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_START_X_PROPERTY]);
|
||||||
|
#line 619 "intersections.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_intersection_get_end_x (LiveChartIntersection* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
result = self->priv->_end_x;
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
return result;
|
||||||
|
#line 633 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersection_set_end_x (LiveChartIntersection* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
old_value = live_chart_intersection_get_end_x (self);
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
self->priv->_end_x = value;
|
||||||
|
#line 46 "../src/intersections.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_END_X_PROPERTY]);
|
||||||
|
#line 651 "intersections.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersection_class_init (LiveChartIntersectionClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartIntersection_private_offset);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_intersection_get_property;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_intersection_set_property;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_intersection_finalize;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_INTERSECTION_REGION_PROPERTY, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_REGION_PROPERTY] = live_chart_param_spec_region ("region", "region", "region", LIVE_CHART_TYPE_REGION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_INTERSECTION_START_X_PROPERTY, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_START_X_PROPERTY] = g_param_spec_double ("start-x", "start-x", "start-x", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_INTERSECTION_END_X_PROPERTY, live_chart_intersection_properties[LIVE_CHART_INTERSECTION_END_X_PROPERTY] = g_param_spec_double ("end-x", "end-x", "end-x", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 675 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersection_instance_init (LiveChartIntersection * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
self->priv = live_chart_intersection_get_instance_private (self);
|
||||||
|
#line 684 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersection_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartIntersection * self;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_INTERSECTION, LiveChartIntersection);
|
||||||
|
#line 44 "../src/intersections.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->_region);
|
||||||
|
#line 47 "../src/intersections.vala"
|
||||||
|
_g_free0 (self->entered_at);
|
||||||
|
#line 48 "../src/intersections.vala"
|
||||||
|
_g_free0 (self->exited_at);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_intersection_parent_class)->finalize (obj);
|
||||||
|
#line 701 "intersections.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_intersection_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartIntersectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_intersection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartIntersection), 0, (GInstanceInitFunc) live_chart_intersection_instance_init, NULL };
|
||||||
|
GType live_chart_intersection_type_id;
|
||||||
|
live_chart_intersection_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartIntersection", &g_define_type_info, 0);
|
||||||
|
LiveChartIntersection_private_offset = g_type_add_instance_private (live_chart_intersection_type_id, sizeof (LiveChartIntersectionPrivate));
|
||||||
|
return live_chart_intersection_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_intersection_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_intersection_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_intersection_type_id__once)) {
|
||||||
|
GType live_chart_intersection_type_id;
|
||||||
|
live_chart_intersection_type_id = live_chart_intersection_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_intersection_type_id__once, live_chart_intersection_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_intersection_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_intersection_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartIntersection * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_INTERSECTION, LiveChartIntersection);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_REGION_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
live_chart_value_set_region (value, live_chart_intersection_get_region (self));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_START_X_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_value_set_double (value, live_chart_intersection_get_start_x (self));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_END_X_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
g_value_set_double (value, live_chart_intersection_get_end_x (self));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 754 "intersections.c"
|
||||||
|
default:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 760 "intersections.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_intersection_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartIntersection * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_INTERSECTION, LiveChartIntersection);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_REGION_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_region (self, live_chart_value_get_region (value));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_START_X_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_start_x (self, g_value_get_double (value));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
case LIVE_CHART_INTERSECTION_END_X_PROPERTY:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
live_chart_intersection_set_end_x (self, g_value_get_double (value));
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 792 "intersections.c"
|
||||||
|
default:
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 43 "../src/intersections.vala"
|
||||||
|
break;
|
||||||
|
#line 798 "intersections.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,726 @@
|
||||||
|
/* intersectors.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from intersectors.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
|
#define _live_chart_region_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_region_unref (var), NULL)))
|
||||||
|
#define _live_chart_config_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_config_unref (var), NULL)))
|
||||||
|
#define _live_chart_bezier_curve_free0(var) ((var == NULL) ? NULL : (var = (live_chart_bezier_curve_free (var), NULL)))
|
||||||
|
typedef struct _Block2Data Block2Data;
|
||||||
|
#define _live_chart_bezier_intersector_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_bezier_intersector_unref (var), NULL)))
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
typedef struct _LiveChartParamSpecBezierIntersector LiveChartParamSpecBezierIntersector;
|
||||||
|
|
||||||
|
struct _LiveChartBezierIntersectorPrivate {
|
||||||
|
LiveChartRegion* region;
|
||||||
|
LiveChartConfig* config;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Block2Data {
|
||||||
|
int _ref_count_;
|
||||||
|
LiveChartBezierIntersector* self;
|
||||||
|
LiveChartBezierCurve* path;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _LiveChartParamSpecBezierIntersector {
|
||||||
|
GParamSpec parent_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartBezierIntersector_private_offset;
|
||||||
|
static gpointer live_chart_bezier_intersector_parent_class = NULL;
|
||||||
|
static LiveChartIntersectorIface * live_chart_bezier_intersector_live_chart_intersector_parent_iface = NULL;
|
||||||
|
|
||||||
|
static GType live_chart_intersector_get_type_once (void);
|
||||||
|
static void live_chart_bezier_intersector_real_intersect (LiveChartIntersector* base,
|
||||||
|
LiveChartIntersections* intersections,
|
||||||
|
LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* current,
|
||||||
|
LiveChartBezierCurve* path);
|
||||||
|
static Block2Data* block2_data_ref (Block2Data* _data2_);
|
||||||
|
static void block2_data_unref (void * _userdata_);
|
||||||
|
static LiveChartCoord* __lambda12_ (Block2Data* _data2_,
|
||||||
|
gdouble value);
|
||||||
|
static LiveChartCoord* live_chart_bezier_intersector_intersect_at (LiveChartBezierIntersector* self,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBezierCurve* curve,
|
||||||
|
gdouble at_value);
|
||||||
|
static LiveChartCoord* ___lambda12__live_chart_get_intersection (gdouble at_value,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_bezier_intersector_create_intersection_segment_at (LiveChartBezierIntersector* self,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
gdouble at_y,
|
||||||
|
LiveChartSegment* result);
|
||||||
|
static void live_chart_bezier_intersector_finalize (LiveChartBezierIntersector * obj);
|
||||||
|
static GType live_chart_bezier_intersector_get_type_once (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_intersector_intersect (LiveChartIntersector* self,
|
||||||
|
LiveChartIntersections* intersections,
|
||||||
|
LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* current,
|
||||||
|
gconstpointer path)
|
||||||
|
{
|
||||||
|
LiveChartIntersectorIface* _iface_;
|
||||||
|
#line 3 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 3 "../src/intersectors.vala"
|
||||||
|
_iface_ = LIVE_CHART_INTERSECTOR_GET_INTERFACE (self);
|
||||||
|
#line 3 "../src/intersectors.vala"
|
||||||
|
if (_iface_->intersect) {
|
||||||
|
#line 3 "../src/intersectors.vala"
|
||||||
|
_iface_->intersect (self, intersections, previous, current, path);
|
||||||
|
#line 79 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_intersector_default_init (LiveChartIntersectorIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_intersector_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartIntersectorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_intersector_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
|
||||||
|
GType live_chart_intersector_type_id;
|
||||||
|
live_chart_intersector_type_id = g_type_register_static (G_TYPE_INTERFACE, "LiveChartIntersector", &g_define_type_info, 0);
|
||||||
|
return live_chart_intersector_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_intersector_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_intersector_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_intersector_type_id__once)) {
|
||||||
|
GType live_chart_intersector_type_id;
|
||||||
|
live_chart_intersector_type_id = live_chart_intersector_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_intersector_type_id__once, live_chart_intersector_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_intersector_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_bezier_intersector_get_instance_private (LiveChartBezierIntersector* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartBezierIntersector_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_region_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 11 "../src/intersectors.vala"
|
||||||
|
return self ? live_chart_region_ref (self) : NULL;
|
||||||
|
#line 121 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_config_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 12 "../src/intersectors.vala"
|
||||||
|
return self ? live_chart_config_ref (self) : NULL;
|
||||||
|
#line 129 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBezierIntersector*
|
||||||
|
live_chart_bezier_intersector_construct (GType object_type,
|
||||||
|
LiveChartRegion* region,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector* self = NULL;
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
LiveChartConfig* _tmp1_;
|
||||||
|
#line 10 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (region != NULL, NULL);
|
||||||
|
#line 10 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 10 "../src/intersectors.vala"
|
||||||
|
self = (LiveChartBezierIntersector*) g_type_create_instance (object_type);
|
||||||
|
#line 11 "../src/intersectors.vala"
|
||||||
|
_tmp0_ = _live_chart_region_ref0 (region);
|
||||||
|
#line 11 "../src/intersectors.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->region);
|
||||||
|
#line 11 "../src/intersectors.vala"
|
||||||
|
self->priv->region = _tmp0_;
|
||||||
|
#line 12 "../src/intersectors.vala"
|
||||||
|
_tmp1_ = _live_chart_config_ref0 (config);
|
||||||
|
#line 12 "../src/intersectors.vala"
|
||||||
|
_live_chart_config_unref0 (self->priv->config);
|
||||||
|
#line 12 "../src/intersectors.vala"
|
||||||
|
self->priv->config = _tmp1_;
|
||||||
|
#line 10 "../src/intersectors.vala"
|
||||||
|
return self;
|
||||||
|
#line 160 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBezierIntersector*
|
||||||
|
live_chart_bezier_intersector_new (LiveChartRegion* region,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
#line 10 "../src/intersectors.vala"
|
||||||
|
return live_chart_bezier_intersector_construct (LIVE_CHART_TYPE_BEZIER_INTERSECTOR, region, config);
|
||||||
|
#line 169 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_bezier_curve_dup0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
return self ? live_chart_bezier_curve_dup (self) : NULL;
|
||||||
|
#line 177 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static Block2Data*
|
||||||
|
block2_data_ref (Block2Data* _data2_)
|
||||||
|
{
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
g_atomic_int_inc (&_data2_->_ref_count_);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
return _data2_;
|
||||||
|
#line 187 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
block2_data_unref (void * _userdata_)
|
||||||
|
{
|
||||||
|
Block2Data* _data2_;
|
||||||
|
_data2_ = (Block2Data*) _userdata_;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
|
||||||
|
#line 197 "intersectors.c"
|
||||||
|
LiveChartBezierIntersector* self;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
self = _data2_->self;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_live_chart_bezier_curve_free0 (_data2_->path);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_live_chart_bezier_intersector_unref0 (self);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
g_slice_free (Block2Data, _data2_);
|
||||||
|
#line 207 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static LiveChartCoord*
|
||||||
|
__lambda12_ (Block2Data* _data2_,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector* self;
|
||||||
|
LiveChartConfig* _tmp0_;
|
||||||
|
LiveChartBezierCurve _tmp1_;
|
||||||
|
LiveChartCoord* _tmp2_;
|
||||||
|
LiveChartCoord* result;
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
self = _data2_->self;
|
||||||
|
#line 17 "../src/intersectors.vala"
|
||||||
|
_tmp0_ = self->priv->config;
|
||||||
|
#line 17 "../src/intersectors.vala"
|
||||||
|
_tmp1_ = *_data2_->path;
|
||||||
|
#line 17 "../src/intersectors.vala"
|
||||||
|
_tmp2_ = live_chart_bezier_intersector_intersect_at (self, _tmp0_, &_tmp1_, value);
|
||||||
|
#line 17 "../src/intersectors.vala"
|
||||||
|
result = _tmp2_;
|
||||||
|
#line 17 "../src/intersectors.vala"
|
||||||
|
return result;
|
||||||
|
#line 232 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static LiveChartCoord*
|
||||||
|
___lambda12__live_chart_get_intersection (gdouble at_value,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
LiveChartCoord* result;
|
||||||
|
result = __lambda12_ (self, at_value);
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
return result;
|
||||||
|
#line 243 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_real_intersect (LiveChartIntersector* base,
|
||||||
|
LiveChartIntersections* intersections,
|
||||||
|
LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* current,
|
||||||
|
LiveChartBezierCurve* path)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * self;
|
||||||
|
Block2Data* _data2_;
|
||||||
|
LiveChartBezierCurve* _tmp0_;
|
||||||
|
LiveChartRegion* _tmp1_;
|
||||||
|
LiveChartPoint _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
self = (LiveChartBezierIntersector*) base;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (intersections != NULL);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (previous != NULL);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (current != NULL);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_data2_ = g_slice_new0 (Block2Data);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_data2_->_ref_count_ = 1;
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_data2_->self = live_chart_bezier_intersector_ref (self);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_tmp0_ = _live_chart_bezier_curve_dup0 (path);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_live_chart_bezier_curve_free0 (_data2_->path);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_data2_->path = _tmp0_;
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
_tmp1_ = self->priv->region;
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
_tmp2_ = *previous;
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
_tmp3_ = *current;
|
||||||
|
#line 16 "../src/intersectors.vala"
|
||||||
|
live_chart_region_handle (_tmp1_, intersections, &_tmp2_, &_tmp3_, ___lambda12__live_chart_get_intersection, _data2_);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
block2_data_unref (_data2_);
|
||||||
|
#line 15 "../src/intersectors.vala"
|
||||||
|
_data2_ = NULL;
|
||||||
|
#line 291 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static LiveChartCoord*
|
||||||
|
live_chart_bezier_intersector_intersect_at (LiveChartBezierIntersector* self,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBezierCurve* curve,
|
||||||
|
gdouble at_value)
|
||||||
|
{
|
||||||
|
LiveChartSegment intersection_segment = {0};
|
||||||
|
LiveChartSegment _tmp0_ = {0};
|
||||||
|
GeeList* intersections = NULL;
|
||||||
|
LiveChartSegment _tmp1_;
|
||||||
|
LiveChartBezierCurve _tmp2_;
|
||||||
|
GeeList* _tmp3_;
|
||||||
|
GeeList* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
LiveChartCoord* result;
|
||||||
|
#line 21 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 21 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 21 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (curve != NULL, NULL);
|
||||||
|
#line 22 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_create_intersection_segment_at (self, config, at_value, &_tmp0_);
|
||||||
|
#line 22 "../src/intersectors.vala"
|
||||||
|
intersection_segment = _tmp0_;
|
||||||
|
#line 23 "../src/intersectors.vala"
|
||||||
|
_tmp1_ = intersection_segment;
|
||||||
|
#line 23 "../src/intersectors.vala"
|
||||||
|
_tmp2_ = *curve;
|
||||||
|
#line 23 "../src/intersectors.vala"
|
||||||
|
_tmp3_ = live_chart_find_intersections_between (&_tmp1_, &_tmp2_);
|
||||||
|
#line 23 "../src/intersectors.vala"
|
||||||
|
intersections = _tmp3_;
|
||||||
|
#line 24 "../src/intersectors.vala"
|
||||||
|
_tmp4_ = intersections;
|
||||||
|
#line 24 "../src/intersectors.vala"
|
||||||
|
_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
|
||||||
|
#line 24 "../src/intersectors.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 24 "../src/intersectors.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 336 "intersectors.c"
|
||||||
|
GeeList* _tmp7_;
|
||||||
|
gpointer _tmp8_;
|
||||||
|
#line 25 "../src/intersectors.vala"
|
||||||
|
_tmp7_ = intersections;
|
||||||
|
#line 25 "../src/intersectors.vala"
|
||||||
|
_tmp8_ = gee_list_first (_tmp7_);
|
||||||
|
#line 25 "../src/intersectors.vala"
|
||||||
|
result = (LiveChartCoord*) _tmp8_;
|
||||||
|
#line 25 "../src/intersectors.vala"
|
||||||
|
_g_object_unref0 (intersections);
|
||||||
|
#line 25 "../src/intersectors.vala"
|
||||||
|
return result;
|
||||||
|
#line 349 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 27 "../src/intersectors.vala"
|
||||||
|
result = NULL;
|
||||||
|
#line 27 "../src/intersectors.vala"
|
||||||
|
_g_object_unref0 (intersections);
|
||||||
|
#line 27 "../src/intersectors.vala"
|
||||||
|
return result;
|
||||||
|
#line 357 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_create_intersection_segment_at (LiveChartBezierIntersector* self,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
gdouble at_y,
|
||||||
|
LiveChartSegment* result)
|
||||||
|
{
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp0_ = {0};
|
||||||
|
gdouble y = 0.0;
|
||||||
|
LiveChartBoundaries _tmp1_;
|
||||||
|
LiveChartBoundary _tmp2_;
|
||||||
|
LiveChartYAxis* _tmp3_;
|
||||||
|
LiveChartBoundaries _tmp4_;
|
||||||
|
LiveChartBoundary _tmp5_;
|
||||||
|
LiveChartCoord _tmp6_ = {0};
|
||||||
|
LiveChartBoundaries _tmp7_;
|
||||||
|
LiveChartBoundary _tmp8_;
|
||||||
|
LiveChartCoord _tmp9_ = {0};
|
||||||
|
LiveChartSegment _tmp10_ = {0};
|
||||||
|
#line 30 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 30 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 31 "../src/intersectors.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp0_);
|
||||||
|
#line 31 "../src/intersectors.vala"
|
||||||
|
boundaries = _tmp0_;
|
||||||
|
#line 32 "../src/intersectors.vala"
|
||||||
|
_tmp1_ = boundaries;
|
||||||
|
#line 32 "../src/intersectors.vala"
|
||||||
|
_tmp2_ = _tmp1_.y;
|
||||||
|
#line 32 "../src/intersectors.vala"
|
||||||
|
_tmp3_ = config->y_axis;
|
||||||
|
#line 32 "../src/intersectors.vala"
|
||||||
|
y = _tmp2_.max - (at_y * live_chart_yaxis_get_ratio (_tmp3_));
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp4_ = boundaries;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp5_ = _tmp4_.x;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp6_.x = (gdouble) _tmp5_.min;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp6_.y = y;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp7_ = boundaries;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp8_ = _tmp7_.x;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp9_.x = (gdouble) _tmp8_.max;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp9_.y = y;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp10_.from = _tmp6_;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
_tmp10_.to = _tmp9_;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
*result = _tmp10_;
|
||||||
|
#line 33 "../src/intersectors.vala"
|
||||||
|
return;
|
||||||
|
#line 419 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_bezier_intersector_init (GValue* value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 427 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_bezier_intersector_free_value (GValue* value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (value->data[0].v_pointer) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_unref (value->data[0].v_pointer);
|
||||||
|
#line 437 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_bezier_intersector_copy_value (const GValue* src_value,
|
||||||
|
GValue* dest_value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (src_value->data[0].v_pointer) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
dest_value->data[0].v_pointer = live_chart_bezier_intersector_ref (src_value->data[0].v_pointer);
|
||||||
|
#line 449 "intersectors.c"
|
||||||
|
} else {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
dest_value->data[0].v_pointer = NULL;
|
||||||
|
#line 453 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
live_chart_value_bezier_intersector_peek_pointer (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 462 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_bezier_intersector_collect_value (GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (collect_values[0].v_pointer) {
|
||||||
|
#line 473 "intersectors.c"
|
||||||
|
LiveChartBezierIntersector * object;
|
||||||
|
object = collect_values[0].v_pointer;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (object->parent_instance.g_class == NULL) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
|
||||||
|
#line 480 "intersectors.c"
|
||||||
|
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
|
||||||
|
#line 6 "../src/intersectors.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 484 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = live_chart_bezier_intersector_ref (object);
|
||||||
|
#line 488 "intersectors.c"
|
||||||
|
} else {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 492 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 496 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_bezier_intersector_lcopy_value (const GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector ** object_p;
|
||||||
|
object_p = collect_values[0].v_pointer;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (!object_p) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
|
||||||
|
#line 511 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (!value->data[0].v_pointer) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
*object_p = NULL;
|
||||||
|
#line 517 "intersectors.c"
|
||||||
|
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
*object_p = value->data[0].v_pointer;
|
||||||
|
#line 521 "intersectors.c"
|
||||||
|
} else {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
*object_p = live_chart_bezier_intersector_ref (value->data[0].v_pointer);
|
||||||
|
#line 525 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 529 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
GParamSpec*
|
||||||
|
live_chart_param_spec_bezier_intersector (const gchar* name,
|
||||||
|
const gchar* nick,
|
||||||
|
const gchar* blurb,
|
||||||
|
GType object_type,
|
||||||
|
GParamFlags flags)
|
||||||
|
{
|
||||||
|
LiveChartParamSpecBezierIntersector* spec;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (g_type_is_a (object_type, LIVE_CHART_TYPE_BEZIER_INTERSECTOR), NULL);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
G_PARAM_SPEC (spec)->value_type = object_type;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return G_PARAM_SPEC (spec);
|
||||||
|
#line 548 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_value_get_bezier_intersector (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_BEZIER_INTERSECTOR), NULL);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 558 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_set_bezier_intersector (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * old;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_BEZIER_INTERSECTOR));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_BEZIER_INTERSECTOR));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_ref (value->data[0].v_pointer);
|
||||||
|
#line 580 "intersectors.c"
|
||||||
|
} else {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 584 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_unref (old);
|
||||||
|
#line 590 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_take_bezier_intersector (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * old;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_BEZIER_INTERSECTOR));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_BEZIER_INTERSECTOR));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 611 "intersectors.c"
|
||||||
|
} else {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 615 "intersectors.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_unref (old);
|
||||||
|
#line 621 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_class_init (LiveChartBezierIntersectorClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
((LiveChartBezierIntersectorClass *) klass)->finalize = live_chart_bezier_intersector_finalize;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartBezierIntersector_private_offset);
|
||||||
|
#line 635 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_live_chart_intersector_interface_init (LiveChartIntersectorIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
live_chart_bezier_intersector_live_chart_intersector_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
iface->intersect = (void (*) (LiveChartIntersector*, LiveChartIntersections*, LiveChartPoint*, LiveChartPoint*, gconstpointer)) live_chart_bezier_intersector_real_intersect;
|
||||||
|
#line 646 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_instance_init (LiveChartBezierIntersector * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
self->priv = live_chart_bezier_intersector_get_instance_private (self);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
self->ref_count = 1;
|
||||||
|
#line 657 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_bezier_intersector_finalize (LiveChartBezierIntersector * obj)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * self;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_BEZIER_INTERSECTOR, LiveChartBezierIntersector);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_signal_handlers_destroy (self);
|
||||||
|
#line 7 "../src/intersectors.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->region);
|
||||||
|
#line 8 "../src/intersectors.vala"
|
||||||
|
_live_chart_config_unref0 (self->priv->config);
|
||||||
|
#line 672 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_bezier_intersector_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeValueTable g_define_type_value_table = { live_chart_value_bezier_intersector_init, live_chart_value_bezier_intersector_free_value, live_chart_value_bezier_intersector_copy_value, live_chart_value_bezier_intersector_peek_pointer, "p", live_chart_value_bezier_intersector_collect_value, "p", live_chart_value_bezier_intersector_lcopy_value };
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartBezierIntersectorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_bezier_intersector_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartBezierIntersector), 0, (GInstanceInitFunc) live_chart_bezier_intersector_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) };
|
||||||
|
static const GInterfaceInfo live_chart_intersector_info = { (GInterfaceInitFunc) live_chart_bezier_intersector_live_chart_intersector_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_bezier_intersector_type_id;
|
||||||
|
live_chart_bezier_intersector_type_id = g_type_register_fundamental (g_type_fundamental_next (), "LiveChartBezierIntersector", &g_define_type_info, &g_define_type_fundamental_info, 0);
|
||||||
|
g_type_add_interface_static (live_chart_bezier_intersector_type_id, LIVE_CHART_TYPE_INTERSECTOR, &live_chart_intersector_info);
|
||||||
|
LiveChartBezierIntersector_private_offset = g_type_add_instance_private (live_chart_bezier_intersector_type_id, sizeof (LiveChartBezierIntersectorPrivate));
|
||||||
|
return live_chart_bezier_intersector_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_bezier_intersector_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_bezier_intersector_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_bezier_intersector_type_id__once)) {
|
||||||
|
GType live_chart_bezier_intersector_type_id;
|
||||||
|
live_chart_bezier_intersector_type_id = live_chart_bezier_intersector_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_bezier_intersector_type_id__once, live_chart_bezier_intersector_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_bezier_intersector_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_bezier_intersector_ref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * self;
|
||||||
|
self = instance;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_atomic_int_inc (&self->ref_count);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
return instance;
|
||||||
|
#line 710 "intersectors.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_bezier_intersector_unref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartBezierIntersector * self;
|
||||||
|
self = instance;
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&self->ref_count)) {
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
LIVE_CHART_BEZIER_INTERSECTOR_GET_CLASS (self)->finalize (self);
|
||||||
|
#line 6 "../src/intersectors.vala"
|
||||||
|
g_type_free_instance ((GTypeInstance *) self);
|
||||||
|
#line 724 "intersectors.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,485 @@
|
||||||
|
/* labels.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from labels.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
|
#define _live_chart_font_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_font_unref (var), NULL)))
|
||||||
|
typedef struct _LiveChartParamSpecLabels LiveChartParamSpecLabels;
|
||||||
|
|
||||||
|
struct _LiveChartLabelsPrivate {
|
||||||
|
gboolean _visible;
|
||||||
|
cairo_text_extents_t _extents;
|
||||||
|
LiveChartFont* _font;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _LiveChartParamSpecLabels {
|
||||||
|
GParamSpec parent_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartLabels_private_offset;
|
||||||
|
static gpointer live_chart_labels_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_labels_finalize (LiveChartLabels * obj);
|
||||||
|
static GType live_chart_labels_get_type_once (void);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_labels_get_instance_private (LiveChartLabels* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartLabels_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLabels*
|
||||||
|
live_chart_labels_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartLabels* self = NULL;
|
||||||
|
cairo_text_extents_t _tmp0_ = {0};
|
||||||
|
LiveChartFont* _tmp1_;
|
||||||
|
LiveChartFont* _tmp2_;
|
||||||
|
cairo_text_extents_t _tmp3_;
|
||||||
|
cairo_text_extents_t _tmp4_;
|
||||||
|
cairo_text_extents_t _tmp5_;
|
||||||
|
cairo_text_extents_t _tmp6_;
|
||||||
|
cairo_text_extents_t _tmp7_;
|
||||||
|
cairo_text_extents_t _tmp8_;
|
||||||
|
#line 11 "../src/labels.vala"
|
||||||
|
self = (LiveChartLabels*) g_type_create_instance (object_type);
|
||||||
|
#line 13 "../src/labels.vala"
|
||||||
|
live_chart_labels_set_visible (self, TRUE);
|
||||||
|
#line 14 "../src/labels.vala"
|
||||||
|
memset (&_tmp0_, 0, sizeof (cairo_text_extents_t));
|
||||||
|
#line 14 "../src/labels.vala"
|
||||||
|
live_chart_labels_set_extents (self, &_tmp0_);
|
||||||
|
#line 15 "../src/labels.vala"
|
||||||
|
_tmp1_ = live_chart_font_new ();
|
||||||
|
#line 15 "../src/labels.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 15 "../src/labels.vala"
|
||||||
|
live_chart_labels_set_font (self, _tmp2_);
|
||||||
|
#line 15 "../src/labels.vala"
|
||||||
|
_live_chart_font_unref0 (_tmp2_);
|
||||||
|
#line 17 "../src/labels.vala"
|
||||||
|
_tmp3_ = self->priv->_extents;
|
||||||
|
#line 17 "../src/labels.vala"
|
||||||
|
_tmp3_.height = 0.0;
|
||||||
|
#line 18 "../src/labels.vala"
|
||||||
|
_tmp4_ = self->priv->_extents;
|
||||||
|
#line 18 "../src/labels.vala"
|
||||||
|
_tmp4_.width = 0.0;
|
||||||
|
#line 19 "../src/labels.vala"
|
||||||
|
_tmp5_ = self->priv->_extents;
|
||||||
|
#line 19 "../src/labels.vala"
|
||||||
|
_tmp5_.x_advance = 0.0;
|
||||||
|
#line 20 "../src/labels.vala"
|
||||||
|
_tmp6_ = self->priv->_extents;
|
||||||
|
#line 20 "../src/labels.vala"
|
||||||
|
_tmp6_.x_bearing = 0.0;
|
||||||
|
#line 21 "../src/labels.vala"
|
||||||
|
_tmp7_ = self->priv->_extents;
|
||||||
|
#line 21 "../src/labels.vala"
|
||||||
|
_tmp7_.y_advance = 0.0;
|
||||||
|
#line 22 "../src/labels.vala"
|
||||||
|
_tmp8_ = self->priv->_extents;
|
||||||
|
#line 22 "../src/labels.vala"
|
||||||
|
_tmp8_.y_bearing = 0.0;
|
||||||
|
#line 11 "../src/labels.vala"
|
||||||
|
return self;
|
||||||
|
#line 91 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLabels*
|
||||||
|
live_chart_labels_new (void)
|
||||||
|
{
|
||||||
|
#line 11 "../src/labels.vala"
|
||||||
|
return live_chart_labels_construct (LIVE_CHART_TYPE_LABELS);
|
||||||
|
#line 99 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_labels_get_visible (LiveChartLabels* self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
#line 7 "../src/labels.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 7 "../src/labels.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 7 "../src/labels.vala"
|
||||||
|
return result;
|
||||||
|
#line 112 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_labels_set_visible (LiveChartLabels* self,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
#line 7 "../src/labels.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 7 "../src/labels.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 123 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_labels_get_extents (LiveChartLabels* self,
|
||||||
|
cairo_text_extents_t * result)
|
||||||
|
{
|
||||||
|
cairo_text_extents_t _tmp0_;
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
_tmp0_ = self->priv->_extents;
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
return;
|
||||||
|
#line 139 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_labels_set_extents (LiveChartLabels* self,
|
||||||
|
cairo_text_extents_t * value)
|
||||||
|
{
|
||||||
|
cairo_text_extents_t _tmp0_;
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
_tmp0_ = *value;
|
||||||
|
#line 8 "../src/labels.vala"
|
||||||
|
self->priv->_extents = _tmp0_;
|
||||||
|
#line 153 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartFont*
|
||||||
|
live_chart_labels_get_font (LiveChartLabels* self)
|
||||||
|
{
|
||||||
|
LiveChartFont* result;
|
||||||
|
LiveChartFont* _tmp0_;
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
_tmp0_ = self->priv->_font;
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
return result;
|
||||||
|
#line 169 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_font_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
return self ? live_chart_font_ref (self) : NULL;
|
||||||
|
#line 177 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_labels_set_font (LiveChartLabels* self,
|
||||||
|
LiveChartFont* value)
|
||||||
|
{
|
||||||
|
LiveChartFont* _tmp0_;
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
_tmp0_ = _live_chart_font_ref0 (value);
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
_live_chart_font_unref0 (self->priv->_font);
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
self->priv->_font = _tmp0_;
|
||||||
|
#line 193 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_labels_init (GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 201 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_labels_free_value (GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
live_chart_labels_unref (value->data[0].v_pointer);
|
||||||
|
#line 211 "labels.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_value_labels_copy_value (const GValue* src_value,
|
||||||
|
GValue* dest_value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (src_value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
dest_value->data[0].v_pointer = live_chart_labels_ref (src_value->data[0].v_pointer);
|
||||||
|
#line 223 "labels.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
dest_value->data[0].v_pointer = NULL;
|
||||||
|
#line 227 "labels.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
live_chart_value_labels_peek_pointer (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 236 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_labels_collect_value (GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (collect_values[0].v_pointer) {
|
||||||
|
#line 247 "labels.c"
|
||||||
|
LiveChartLabels * object;
|
||||||
|
object = collect_values[0].v_pointer;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (object->parent_instance.g_class == NULL) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
|
||||||
|
#line 254 "labels.c"
|
||||||
|
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
|
||||||
|
#line 5 "../src/labels.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 258 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = live_chart_labels_ref (object);
|
||||||
|
#line 262 "labels.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 266 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 270 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar*
|
||||||
|
live_chart_value_labels_lcopy_value (const GValue* value,
|
||||||
|
guint n_collect_values,
|
||||||
|
GTypeCValue* collect_values,
|
||||||
|
guint collect_flags)
|
||||||
|
{
|
||||||
|
LiveChartLabels ** object_p;
|
||||||
|
object_p = collect_values[0].v_pointer;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (!object_p) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
|
||||||
|
#line 285 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (!value->data[0].v_pointer) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
*object_p = NULL;
|
||||||
|
#line 291 "labels.c"
|
||||||
|
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
*object_p = value->data[0].v_pointer;
|
||||||
|
#line 295 "labels.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
*object_p = live_chart_labels_ref (value->data[0].v_pointer);
|
||||||
|
#line 299 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 303 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
GParamSpec*
|
||||||
|
live_chart_param_spec_labels (const gchar* name,
|
||||||
|
const gchar* nick,
|
||||||
|
const gchar* blurb,
|
||||||
|
GType object_type,
|
||||||
|
GParamFlags flags)
|
||||||
|
{
|
||||||
|
LiveChartParamSpecLabels* spec;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_val_if_fail (g_type_is_a (object_type, LIVE_CHART_TYPE_LABELS), NULL);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
G_PARAM_SPEC (spec)->value_type = object_type;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return G_PARAM_SPEC (spec);
|
||||||
|
#line 322 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_value_get_labels (const GValue* value)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_LABELS), NULL);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return value->data[0].v_pointer;
|
||||||
|
#line 332 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_set_labels (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartLabels * old;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_LABELS));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_LABELS));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
live_chart_labels_ref (value->data[0].v_pointer);
|
||||||
|
#line 354 "labels.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 358 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
live_chart_labels_unref (old);
|
||||||
|
#line 364 "labels.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_value_take_labels (GValue* value,
|
||||||
|
gpointer v_object)
|
||||||
|
{
|
||||||
|
LiveChartLabels * old;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, LIVE_CHART_TYPE_LABELS));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
old = value->data[0].v_pointer;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (v_object) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, LIVE_CHART_TYPE_LABELS));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = v_object;
|
||||||
|
#line 385 "labels.c"
|
||||||
|
} else {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
value->data[0].v_pointer = NULL;
|
||||||
|
#line 389 "labels.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (old) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
live_chart_labels_unref (old);
|
||||||
|
#line 395 "labels.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_labels_class_init (LiveChartLabelsClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
live_chart_labels_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
((LiveChartLabelsClass *) klass)->finalize = live_chart_labels_finalize;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartLabels_private_offset);
|
||||||
|
#line 409 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_labels_instance_init (LiveChartLabels * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
self->priv = live_chart_labels_get_instance_private (self);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
self->ref_count = 1;
|
||||||
|
#line 420 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_labels_finalize (LiveChartLabels * obj)
|
||||||
|
{
|
||||||
|
LiveChartLabels * self;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_LABELS, LiveChartLabels);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_signal_handlers_destroy (self);
|
||||||
|
#line 9 "../src/labels.vala"
|
||||||
|
_live_chart_font_unref0 (self->priv->_font);
|
||||||
|
#line 433 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_labels_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeValueTable g_define_type_value_table = { live_chart_value_labels_init, live_chart_value_labels_free_value, live_chart_value_labels_copy_value, live_chart_value_labels_peek_pointer, "p", live_chart_value_labels_collect_value, "p", live_chart_value_labels_lcopy_value };
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartLabelsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_labels_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartLabels), 0, (GInstanceInitFunc) live_chart_labels_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_labels_type_id;
|
||||||
|
live_chart_labels_type_id = g_type_register_fundamental (g_type_fundamental_next (), "LiveChartLabels", &g_define_type_info, &g_define_type_fundamental_info, 0);
|
||||||
|
LiveChartLabels_private_offset = g_type_add_instance_private (live_chart_labels_type_id, sizeof (LiveChartLabelsPrivate));
|
||||||
|
return live_chart_labels_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_labels_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_labels_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_labels_type_id__once)) {
|
||||||
|
GType live_chart_labels_type_id;
|
||||||
|
live_chart_labels_type_id = live_chart_labels_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_labels_type_id__once, live_chart_labels_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_labels_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
live_chart_labels_ref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartLabels * self;
|
||||||
|
self = instance;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_atomic_int_inc (&self->ref_count);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
return instance;
|
||||||
|
#line 469 "labels.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_labels_unref (gpointer instance)
|
||||||
|
{
|
||||||
|
LiveChartLabels * self;
|
||||||
|
self = instance;
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&self->ref_count)) {
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
LIVE_CHART_LABELS_GET_CLASS (self)->finalize (self);
|
||||||
|
#line 5 "../src/labels.vala"
|
||||||
|
g_type_free_instance ((GTypeInstance *) self);
|
||||||
|
#line 483 "labels.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,375 @@
|
||||||
|
/* line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_line_properties[LIVE_CHART_LINE_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
static gpointer live_chart_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_line_update_bounding_box (LiveChartLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static GType live_chart_line_get_type_once (void);
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 8 "../src/line.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 34 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLine*
|
||||||
|
live_chart_line_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 6 "../src/line.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 7 "../src/line.vala"
|
||||||
|
self = (LiveChartLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 8 "../src/line.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (values);
|
||||||
|
#line 8 "../src/line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 8 "../src/line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 6 "../src/line.vala"
|
||||||
|
return self;
|
||||||
|
#line 55 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLine*
|
||||||
|
live_chart_line_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 6 "../src/line.vala"
|
||||||
|
return live_chart_line_construct (LIVE_CHART_TYPE_LINE, values);
|
||||||
|
#line 63 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 11 "../src/line.vala"
|
||||||
|
self = (LiveChartLine*) base;
|
||||||
|
#line 11 "../src/line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 11 "../src/line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 12 "../src/line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 12 "../src/line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 12 "../src/line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 86 "line.c"
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartPoints* _tmp3_;
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 13 "../src/line.vala"
|
||||||
|
_tmp2_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 13 "../src/line.vala"
|
||||||
|
_tmp3_ = live_chart_points_create (_tmp2_, config);
|
||||||
|
#line 13 "../src/line.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 14 "../src/line.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 14 "../src/line.vala"
|
||||||
|
_tmp5_ = live_chart_points_get_size (_tmp4_);
|
||||||
|
#line 14 "../src/line.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 14 "../src/line.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 107 "line.c"
|
||||||
|
LiveChartPoints* _tmp7_;
|
||||||
|
LiveChartPoints* _tmp8_;
|
||||||
|
LiveChartPoints* _tmp9_;
|
||||||
|
#line 15 "../src/line.vala"
|
||||||
|
_tmp7_ = points;
|
||||||
|
#line 15 "../src/line.vala"
|
||||||
|
_tmp8_ = live_chart_line_draw_line (self, _tmp7_, ctx, config);
|
||||||
|
#line 15 "../src/line.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 15 "../src/line.vala"
|
||||||
|
_g_object_unref0 (_tmp9_);
|
||||||
|
#line 16 "../src/line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 121 "line.c"
|
||||||
|
}
|
||||||
|
#line 12 "../src/line.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 125 "line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPoints*
|
||||||
|
live_chart_line_draw_line (LiveChartLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPoint first_point = {0};
|
||||||
|
LiveChartPoint _tmp2_ = {0};
|
||||||
|
LiveChartPath* _tmp3_;
|
||||||
|
LiveChartPath* _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_;
|
||||||
|
LiveChartPoint _tmp6_;
|
||||||
|
LiveChartPoints* _tmp18_;
|
||||||
|
LiveChartPoints* result;
|
||||||
|
#line 21 "../src/line.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 21 "../src/line.vala"
|
||||||
|
g_return_val_if_fail (points != NULL, NULL);
|
||||||
|
#line 21 "../src/line.vala"
|
||||||
|
g_return_val_if_fail (ctx != NULL, NULL);
|
||||||
|
#line 21 "../src/line.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 22 "../src/line.vala"
|
||||||
|
_tmp0_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 22 "../src/line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 22 "../src/line.vala"
|
||||||
|
live_chart_path_configure (_tmp1_, ctx);
|
||||||
|
#line 24 "../src/line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp2_);
|
||||||
|
#line 24 "../src/line.vala"
|
||||||
|
first_point = _tmp2_;
|
||||||
|
#line 26 "../src/line.vala"
|
||||||
|
live_chart_line_update_bounding_box (self, points, config);
|
||||||
|
#line 27 "../src/line.vala"
|
||||||
|
live_chart_serie_renderer_debug ((LiveChartSerieRenderer*) self, ctx);
|
||||||
|
#line 29 "../src/line.vala"
|
||||||
|
_tmp3_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 29 "../src/line.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 29 "../src/line.vala"
|
||||||
|
live_chart_path_configure (_tmp4_, ctx);
|
||||||
|
#line 31 "../src/line.vala"
|
||||||
|
_tmp5_ = first_point;
|
||||||
|
#line 31 "../src/line.vala"
|
||||||
|
_tmp6_ = first_point;
|
||||||
|
#line 31 "../src/line.vala"
|
||||||
|
cairo_move_to (ctx, _tmp5_.x, _tmp6_.y);
|
||||||
|
#line 179 "line.c"
|
||||||
|
{
|
||||||
|
gint pos = 0;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
pos = 0;
|
||||||
|
#line 184 "line.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp7_ = FALSE;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
_tmp7_ = TRUE;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 191 "line.c"
|
||||||
|
gint _tmp9_;
|
||||||
|
gint _tmp10_;
|
||||||
|
LiveChartPoint current_point = {0};
|
||||||
|
LiveChartPoint _tmp11_ = {0};
|
||||||
|
LiveChartPoint next_point = {0};
|
||||||
|
LiveChartPoint _tmp12_ = {0};
|
||||||
|
LiveChartPoint _tmp13_;
|
||||||
|
LiveChartPoint _tmp16_;
|
||||||
|
LiveChartPoint _tmp17_;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
if (!_tmp7_) {
|
||||||
|
#line 203 "line.c"
|
||||||
|
gint _tmp8_;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
_tmp8_ = pos;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
pos = _tmp8_ + 1;
|
||||||
|
#line 209 "line.c"
|
||||||
|
}
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
_tmp7_ = FALSE;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
_tmp9_ = live_chart_points_get_size (points);
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
if (!(pos < (_tmp10_ - 1))) {
|
||||||
|
#line 32 "../src/line.vala"
|
||||||
|
break;
|
||||||
|
#line 221 "line.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/line.vala"
|
||||||
|
live_chart_points_get (points, pos, &_tmp11_);
|
||||||
|
#line 33 "../src/line.vala"
|
||||||
|
current_point = _tmp11_;
|
||||||
|
#line 34 "../src/line.vala"
|
||||||
|
live_chart_points_after (points, pos, &_tmp12_);
|
||||||
|
#line 34 "../src/line.vala"
|
||||||
|
next_point = _tmp12_;
|
||||||
|
#line 35 "../src/line.vala"
|
||||||
|
_tmp13_ = current_point;
|
||||||
|
#line 35 "../src/line.vala"
|
||||||
|
if (live_chart_serie_renderer_is_out_of_area ((LiveChartSerieRenderer*) self, &_tmp13_)) {
|
||||||
|
#line 235 "line.c"
|
||||||
|
LiveChartPoint _tmp14_;
|
||||||
|
LiveChartPoint _tmp15_;
|
||||||
|
#line 36 "../src/line.vala"
|
||||||
|
_tmp14_ = current_point;
|
||||||
|
#line 36 "../src/line.vala"
|
||||||
|
_tmp15_ = current_point;
|
||||||
|
#line 36 "../src/line.vala"
|
||||||
|
cairo_move_to (ctx, _tmp14_.x, _tmp15_.y);
|
||||||
|
#line 37 "../src/line.vala"
|
||||||
|
continue;
|
||||||
|
#line 246 "line.c"
|
||||||
|
}
|
||||||
|
#line 40 "../src/line.vala"
|
||||||
|
_tmp16_ = next_point;
|
||||||
|
#line 40 "../src/line.vala"
|
||||||
|
_tmp17_ = next_point;
|
||||||
|
#line 40 "../src/line.vala"
|
||||||
|
cairo_line_to (ctx, _tmp16_.x, _tmp17_.y);
|
||||||
|
#line 254 "line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 43 "../src/line.vala"
|
||||||
|
_tmp18_ = _g_object_ref0 (points);
|
||||||
|
#line 43 "../src/line.vala"
|
||||||
|
result = _tmp18_;
|
||||||
|
#line 43 "../src/line.vala"
|
||||||
|
return result;
|
||||||
|
#line 264 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_update_bounding_box (LiveChartLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
LiveChartBounds* _tmp2_;
|
||||||
|
gdouble _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
LiveChartPoint _tmp6_ = {0};
|
||||||
|
LiveChartBounds* _tmp7_;
|
||||||
|
LiveChartBounds* _tmp8_;
|
||||||
|
gdouble _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
LiveChartBounds* _tmp11_;
|
||||||
|
LiveChartBounds* _tmp12_;
|
||||||
|
gdouble _tmp13_;
|
||||||
|
gdouble _tmp14_;
|
||||||
|
LiveChartBoundingBox _tmp15_ = {0};
|
||||||
|
#line 46 "../src/line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 46 "../src/line.vala"
|
||||||
|
g_return_if_fail (points != NULL);
|
||||||
|
#line 46 "../src/line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp0_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp1_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp3_ = live_chart_bounds_get_lower (_tmp2_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
live_chart_points_last (points, &_tmp5_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp6_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp7_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp9_ = live_chart_bounds_get_upper (_tmp8_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp11_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp13_ = live_chart_bounds_get_lower (_tmp12_);
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
memset (&_tmp15_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp15_.x = _tmp0_.x;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp15_.y = _tmp4_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp15_.width = _tmp5_.x - _tmp6_.x;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
_tmp15_.height = _tmp10_ - _tmp14_;
|
||||||
|
#line 47 "../src/line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->bounding_box = _tmp15_;
|
||||||
|
#line 336 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_class_init (LiveChartLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/line.vala"
|
||||||
|
live_chart_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/line.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_line_real_draw;
|
||||||
|
#line 347 "line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_instance_init (LiveChartLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartLine), 0, (GInstanceInitFunc) live_chart_line_instance_init, NULL };
|
||||||
|
GType live_chart_line_type_id;
|
||||||
|
live_chart_line_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartLine", &g_define_type_info, 0);
|
||||||
|
return live_chart_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_line_type_id__once)) {
|
||||||
|
GType live_chart_line_type_id;
|
||||||
|
live_chart_line_type_id = live_chart_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_line_type_id__once, live_chart_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,308 @@
|
||||||
|
/* line_area.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from line_area.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_LINE_AREA_0_PROPERTY,
|
||||||
|
LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY,
|
||||||
|
LIVE_CHART_LINE_AREA_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_line_area_properties[LIVE_CHART_LINE_AREA_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartLineAreaPrivate {
|
||||||
|
gdouble _area_alpha;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartLineArea_private_offset;
|
||||||
|
static gpointer live_chart_line_area_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_line_area_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_line_area_finalize (GObject * obj);
|
||||||
|
static GType live_chart_line_area_get_type_once (void);
|
||||||
|
static void _vala_live_chart_line_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_line_area_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_line_area_get_instance_private (LiveChartLineArea* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartLineArea_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLineArea*
|
||||||
|
live_chart_line_area_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartLineArea * self = NULL;
|
||||||
|
#line 8 "../src/line_area.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 9 "../src/line_area.vala"
|
||||||
|
self = (LiveChartLineArea*) live_chart_line_construct (object_type, values);
|
||||||
|
#line 8 "../src/line_area.vala"
|
||||||
|
return self;
|
||||||
|
#line 58 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLineArea*
|
||||||
|
live_chart_line_area_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 8 "../src/line_area.vala"
|
||||||
|
return live_chart_line_area_construct (LIVE_CHART_TYPE_LINE_AREA, values);
|
||||||
|
#line 66 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_area_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartLineArea * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 12 "../src/line_area.vala"
|
||||||
|
self = (LiveChartLineArea*) base;
|
||||||
|
#line 12 "../src/line_area.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 12 "../src/line_area.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 13 "../src/line_area.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 13 "../src/line_area.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 13 "../src/line_area.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 89 "line_area.c"
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartPoints* _tmp3_;
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 14 "../src/line_area.vala"
|
||||||
|
_tmp2_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 14 "../src/line_area.vala"
|
||||||
|
_tmp3_ = live_chart_points_create (_tmp2_, config);
|
||||||
|
#line 14 "../src/line_area.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 15 "../src/line_area.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 15 "../src/line_area.vala"
|
||||||
|
_tmp5_ = live_chart_points_get_size (_tmp4_);
|
||||||
|
#line 15 "../src/line_area.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 15 "../src/line_area.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 110 "line_area.c"
|
||||||
|
LiveChartPoints* _tmp7_;
|
||||||
|
LiveChartPoints* _tmp8_;
|
||||||
|
LiveChartPoints* _tmp9_;
|
||||||
|
LiveChartArea* area = NULL;
|
||||||
|
LiveChartPoints* _tmp10_;
|
||||||
|
GdkRGBA _tmp11_ = {0};
|
||||||
|
GdkRGBA _tmp12_;
|
||||||
|
gdouble _tmp13_;
|
||||||
|
LiveChartArea* _tmp14_;
|
||||||
|
LiveChartArea* _tmp15_;
|
||||||
|
#line 16 "../src/line_area.vala"
|
||||||
|
_tmp7_ = points;
|
||||||
|
#line 16 "../src/line_area.vala"
|
||||||
|
_tmp8_ = live_chart_line_draw_line ((LiveChartLine*) self, _tmp7_, ctx, config);
|
||||||
|
#line 16 "../src/line_area.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 16 "../src/line_area.vala"
|
||||||
|
_g_object_unref0 (_tmp9_);
|
||||||
|
#line 17 "../src/line_area.vala"
|
||||||
|
cairo_stroke_preserve (ctx);
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
_tmp10_ = points;
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
live_chart_serie_renderer_get_main_color ((LiveChartSerieRenderer*) self, &_tmp11_);
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
_tmp13_ = self->priv->_area_alpha;
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
_tmp14_ = live_chart_area_new (_tmp10_, &_tmp12_, _tmp13_);
|
||||||
|
#line 19 "../src/line_area.vala"
|
||||||
|
area = _tmp14_;
|
||||||
|
#line 20 "../src/line_area.vala"
|
||||||
|
_tmp15_ = area;
|
||||||
|
#line 20 "../src/line_area.vala"
|
||||||
|
live_chart_drawable_draw ((LiveChartDrawable*) _tmp15_, ctx, config);
|
||||||
|
#line 21 "../src/line_area.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 15 "../src/line_area.vala"
|
||||||
|
_g_object_unref0 (area);
|
||||||
|
#line 151 "line_area.c"
|
||||||
|
}
|
||||||
|
#line 24 "../src/line_area.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 13 "../src/line_area.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 157 "line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_line_area_get_area_alpha (LiveChartLineArea* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
result = self->priv->_area_alpha;
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
return result;
|
||||||
|
#line 171 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_line_area_set_area_alpha (LiveChartLineArea* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
old_value = live_chart_line_area_get_area_alpha (self);
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
self->priv->_area_alpha = value;
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_line_area_properties[LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY]);
|
||||||
|
#line 189 "line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_area_class_init (LiveChartLineAreaClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
live_chart_line_area_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartLineArea_private_offset);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_line_area_real_draw;
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_line_area_get_property;
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_line_area_set_property;
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_line_area_finalize;
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY, live_chart_line_area_properties[LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY] = g_param_spec_double ("area-alpha", "area-alpha", "area-alpha", -G_MAXDOUBLE, G_MAXDOUBLE, 0.1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 211 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_area_instance_init (LiveChartLineArea * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
self->priv = live_chart_line_area_get_instance_private (self);
|
||||||
|
#line 6 "../src/line_area.vala"
|
||||||
|
self->priv->_area_alpha = 0.1;
|
||||||
|
#line 222 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_line_area_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartLineArea * self;
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_LINE_AREA, LiveChartLineArea);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_line_area_parent_class)->finalize (obj);
|
||||||
|
#line 233 "line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_line_area_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartLineAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_line_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartLineArea), 0, (GInstanceInitFunc) live_chart_line_area_instance_init, NULL };
|
||||||
|
GType live_chart_line_area_type_id;
|
||||||
|
live_chart_line_area_type_id = g_type_register_static (LIVE_CHART_TYPE_LINE, "LiveChartLineArea", &g_define_type_info, 0);
|
||||||
|
LiveChartLineArea_private_offset = g_type_add_instance_private (live_chart_line_area_type_id, sizeof (LiveChartLineAreaPrivate));
|
||||||
|
return live_chart_line_area_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_line_area_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_line_area_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_line_area_type_id__once)) {
|
||||||
|
GType live_chart_line_area_type_id;
|
||||||
|
live_chart_line_area_type_id = live_chart_line_area_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_line_area_type_id__once, live_chart_line_area_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_line_area_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_line_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartLineArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_LINE_AREA, LiveChartLineArea);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
case LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY:
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
g_value_set_double (value, live_chart_line_area_get_area_alpha (self));
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 274 "line_area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 280 "line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_line_area_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartLineArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_LINE_AREA, LiveChartLineArea);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
case LIVE_CHART_LINE_AREA_AREA_ALPHA_PROPERTY:
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
live_chart_line_area_set_area_alpha (self, g_value_get_double (value));
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 300 "line_area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 306 "line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,249 @@
|
||||||
|
/* max_bound_line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from max_bound_line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_MAX_BOUND_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_MAX_BOUND_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_max_bound_line_properties[LIVE_CHART_MAX_BOUND_LINE_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
static gpointer live_chart_max_bound_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_max_bound_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static GType live_chart_max_bound_line_get_type_once (void);
|
||||||
|
|
||||||
|
LiveChartMaxBoundLine*
|
||||||
|
live_chart_max_bound_line_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartMaxBoundLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 8 "../src/max_bound_line.vala"
|
||||||
|
self = (LiveChartMaxBoundLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 9 "../src/max_bound_line.vala"
|
||||||
|
_tmp0_ = live_chart_values_new (1000);
|
||||||
|
#line 9 "../src/max_bound_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 9 "../src/max_bound_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 7 "../src/max_bound_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 42 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMaxBoundLine*
|
||||||
|
live_chart_max_bound_line_new (void)
|
||||||
|
{
|
||||||
|
#line 7 "../src/max_bound_line.vala"
|
||||||
|
return live_chart_max_bound_line_construct (LIVE_CHART_TYPE_MAX_BOUND_LINE);
|
||||||
|
#line 50 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMaxBoundLine*
|
||||||
|
live_chart_max_bound_line_construct_from_serie (GType object_type,
|
||||||
|
LiveChartSerie* serie)
|
||||||
|
{
|
||||||
|
LiveChartMaxBoundLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 12 "../src/max_bound_line.vala"
|
||||||
|
g_return_val_if_fail (serie != NULL, NULL);
|
||||||
|
#line 12 "../src/max_bound_line.vala"
|
||||||
|
self = (LiveChartMaxBoundLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 13 "../src/max_bound_line.vala"
|
||||||
|
_tmp0_ = live_chart_serie_get_values (serie);
|
||||||
|
#line 13 "../src/max_bound_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 13 "../src/max_bound_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 12 "../src/max_bound_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 71 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMaxBoundLine*
|
||||||
|
live_chart_max_bound_line_new_from_serie (LiveChartSerie* serie)
|
||||||
|
{
|
||||||
|
#line 12 "../src/max_bound_line.vala"
|
||||||
|
return live_chart_max_bound_line_construct_from_serie (LIVE_CHART_TYPE_MAX_BOUND_LINE, serie);
|
||||||
|
#line 79 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_max_bound_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartMaxBoundLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 16 "../src/max_bound_line.vala"
|
||||||
|
self = (LiveChartMaxBoundLine*) base;
|
||||||
|
#line 16 "../src/max_bound_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 16 "../src/max_bound_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 17 "../src/max_bound_line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 17 "../src/max_bound_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 17 "../src/max_bound_line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 102 "max_bound_line.c"
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp2_ = {0};
|
||||||
|
gdouble _tmp3_ = 0.0;
|
||||||
|
LiveChartValues* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
gdouble y = 0.0;
|
||||||
|
LiveChartPath* _tmp19_;
|
||||||
|
LiveChartPath* _tmp20_;
|
||||||
|
LiveChartBoundaries _tmp21_;
|
||||||
|
LiveChartBoundary _tmp22_;
|
||||||
|
LiveChartBoundaries _tmp23_;
|
||||||
|
LiveChartBoundary _tmp24_;
|
||||||
|
LiveChartBoundaries _tmp25_;
|
||||||
|
LiveChartBoundary _tmp26_;
|
||||||
|
LiveChartBoundaries _tmp27_;
|
||||||
|
LiveChartBoundary _tmp28_;
|
||||||
|
#line 18 "../src/max_bound_line.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp2_);
|
||||||
|
#line 18 "../src/max_bound_line.vala"
|
||||||
|
boundaries = _tmp2_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp4_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
if (_tmp6_ == 0) {
|
||||||
|
#line 132 "max_bound_line.c"
|
||||||
|
LiveChartYAxis* _tmp7_;
|
||||||
|
LiveChartBounds* _tmp8_;
|
||||||
|
LiveChartBounds* _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
gdouble _tmp11_;
|
||||||
|
LiveChartYAxis* _tmp12_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp7_ = config->y_axis;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp8_ = live_chart_yaxis_get_bounds (_tmp7_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp10_ = live_chart_bounds_get_upper (_tmp9_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp11_ = _tmp10_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp12_ = config->y_axis;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp3_ = _tmp11_ * live_chart_yaxis_get_ratio (_tmp12_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_g_object_unref0 (_tmp9_);
|
||||||
|
#line 155 "max_bound_line.c"
|
||||||
|
} else {
|
||||||
|
LiveChartValues* _tmp13_;
|
||||||
|
LiveChartBounds* _tmp14_;
|
||||||
|
LiveChartBounds* _tmp15_;
|
||||||
|
gdouble _tmp16_;
|
||||||
|
gdouble _tmp17_;
|
||||||
|
LiveChartYAxis* _tmp18_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp13_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp14_ = live_chart_values_get_bounds (_tmp13_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp15_ = _tmp14_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp16_ = live_chart_bounds_get_upper (_tmp15_);
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp17_ = _tmp16_;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp18_ = config->y_axis;
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
_tmp3_ = _tmp17_ * live_chart_yaxis_get_ratio (_tmp18_);
|
||||||
|
#line 177 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
#line 19 "../src/max_bound_line.vala"
|
||||||
|
y = _tmp3_;
|
||||||
|
#line 20 "../src/max_bound_line.vala"
|
||||||
|
_tmp19_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 20 "../src/max_bound_line.vala"
|
||||||
|
_tmp20_ = _tmp19_;
|
||||||
|
#line 20 "../src/max_bound_line.vala"
|
||||||
|
live_chart_path_configure (_tmp20_, ctx);
|
||||||
|
#line 21 "../src/max_bound_line.vala"
|
||||||
|
_tmp21_ = boundaries;
|
||||||
|
#line 21 "../src/max_bound_line.vala"
|
||||||
|
_tmp22_ = _tmp21_.x;
|
||||||
|
#line 21 "../src/max_bound_line.vala"
|
||||||
|
_tmp23_ = boundaries;
|
||||||
|
#line 21 "../src/max_bound_line.vala"
|
||||||
|
_tmp24_ = _tmp23_.y;
|
||||||
|
#line 21 "../src/max_bound_line.vala"
|
||||||
|
cairo_move_to (ctx, (gdouble) _tmp22_.min, _tmp24_.max - y);
|
||||||
|
#line 22 "../src/max_bound_line.vala"
|
||||||
|
_tmp25_ = boundaries;
|
||||||
|
#line 22 "../src/max_bound_line.vala"
|
||||||
|
_tmp26_ = _tmp25_.x;
|
||||||
|
#line 22 "../src/max_bound_line.vala"
|
||||||
|
_tmp27_ = boundaries;
|
||||||
|
#line 22 "../src/max_bound_line.vala"
|
||||||
|
_tmp28_ = _tmp27_.y;
|
||||||
|
#line 22 "../src/max_bound_line.vala"
|
||||||
|
cairo_line_to (ctx, (gdouble) _tmp26_.max, _tmp28_.max - y);
|
||||||
|
#line 23 "../src/max_bound_line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 209 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_max_bound_line_class_init (LiveChartMaxBoundLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/max_bound_line.vala"
|
||||||
|
live_chart_max_bound_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/max_bound_line.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_max_bound_line_real_draw;
|
||||||
|
#line 221 "max_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_max_bound_line_instance_init (LiveChartMaxBoundLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_max_bound_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartMaxBoundLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_max_bound_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartMaxBoundLine), 0, (GInstanceInitFunc) live_chart_max_bound_line_instance_init, NULL };
|
||||||
|
GType live_chart_max_bound_line_type_id;
|
||||||
|
live_chart_max_bound_line_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartMaxBoundLine", &g_define_type_info, 0);
|
||||||
|
return live_chart_max_bound_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_max_bound_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_max_bound_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_max_bound_line_type_id__once)) {
|
||||||
|
GType live_chart_max_bound_line_type_id;
|
||||||
|
live_chart_max_bound_line_type_id = live_chart_max_bound_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_max_bound_line_type_id__once, live_chart_max_bound_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_max_bound_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,260 @@
|
||||||
|
/* min_bound_line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from min_bound_line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_MIN_BOUND_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_MIN_BOUND_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_min_bound_line_properties[LIVE_CHART_MIN_BOUND_LINE_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
static gpointer live_chart_min_bound_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_min_bound_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static GType live_chart_min_bound_line_get_type_once (void);
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 9 "../src/min_bound_line.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 32 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMinBoundLine*
|
||||||
|
live_chart_min_bound_line_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartMinBoundLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 7 "../src/min_bound_line.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 8 "../src/min_bound_line.vala"
|
||||||
|
self = (LiveChartMinBoundLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 9 "../src/min_bound_line.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (values);
|
||||||
|
#line 9 "../src/min_bound_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 9 "../src/min_bound_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 7 "../src/min_bound_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 53 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMinBoundLine*
|
||||||
|
live_chart_min_bound_line_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 7 "../src/min_bound_line.vala"
|
||||||
|
return live_chart_min_bound_line_construct (LIVE_CHART_TYPE_MIN_BOUND_LINE, values);
|
||||||
|
#line 61 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMinBoundLine*
|
||||||
|
live_chart_min_bound_line_construct_from_serie (GType object_type,
|
||||||
|
LiveChartSerie* serie)
|
||||||
|
{
|
||||||
|
LiveChartMinBoundLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 12 "../src/min_bound_line.vala"
|
||||||
|
g_return_val_if_fail (serie != NULL, NULL);
|
||||||
|
#line 12 "../src/min_bound_line.vala"
|
||||||
|
self = (LiveChartMinBoundLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 13 "../src/min_bound_line.vala"
|
||||||
|
_tmp0_ = live_chart_serie_get_values (serie);
|
||||||
|
#line 13 "../src/min_bound_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 13 "../src/min_bound_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 12 "../src/min_bound_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 82 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartMinBoundLine*
|
||||||
|
live_chart_min_bound_line_new_from_serie (LiveChartSerie* serie)
|
||||||
|
{
|
||||||
|
#line 12 "../src/min_bound_line.vala"
|
||||||
|
return live_chart_min_bound_line_construct_from_serie (LIVE_CHART_TYPE_MIN_BOUND_LINE, serie);
|
||||||
|
#line 90 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_min_bound_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartMinBoundLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 16 "../src/min_bound_line.vala"
|
||||||
|
self = (LiveChartMinBoundLine*) base;
|
||||||
|
#line 16 "../src/min_bound_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 16 "../src/min_bound_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 17 "../src/min_bound_line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 17 "../src/min_bound_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 17 "../src/min_bound_line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 113 "min_bound_line.c"
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp2_ = {0};
|
||||||
|
gdouble _tmp3_ = 0.0;
|
||||||
|
LiveChartValues* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
gdouble y = 0.0;
|
||||||
|
LiveChartPath* _tmp19_;
|
||||||
|
LiveChartPath* _tmp20_;
|
||||||
|
LiveChartBoundaries _tmp21_;
|
||||||
|
LiveChartBoundary _tmp22_;
|
||||||
|
LiveChartBoundaries _tmp23_;
|
||||||
|
LiveChartBoundary _tmp24_;
|
||||||
|
LiveChartBoundaries _tmp25_;
|
||||||
|
LiveChartBoundary _tmp26_;
|
||||||
|
LiveChartBoundaries _tmp27_;
|
||||||
|
LiveChartBoundary _tmp28_;
|
||||||
|
#line 18 "../src/min_bound_line.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp2_);
|
||||||
|
#line 18 "../src/min_bound_line.vala"
|
||||||
|
boundaries = _tmp2_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp4_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
if (_tmp6_ == 0) {
|
||||||
|
#line 143 "min_bound_line.c"
|
||||||
|
LiveChartYAxis* _tmp7_;
|
||||||
|
LiveChartBounds* _tmp8_;
|
||||||
|
LiveChartBounds* _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
gdouble _tmp11_;
|
||||||
|
LiveChartYAxis* _tmp12_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp7_ = config->y_axis;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp8_ = live_chart_yaxis_get_bounds (_tmp7_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp10_ = live_chart_bounds_get_lower (_tmp9_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp11_ = _tmp10_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp12_ = config->y_axis;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp3_ = _tmp11_ * live_chart_yaxis_get_ratio (_tmp12_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_g_object_unref0 (_tmp9_);
|
||||||
|
#line 166 "min_bound_line.c"
|
||||||
|
} else {
|
||||||
|
LiveChartValues* _tmp13_;
|
||||||
|
LiveChartBounds* _tmp14_;
|
||||||
|
LiveChartBounds* _tmp15_;
|
||||||
|
gdouble _tmp16_;
|
||||||
|
gdouble _tmp17_;
|
||||||
|
LiveChartYAxis* _tmp18_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp13_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp14_ = live_chart_values_get_bounds (_tmp13_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp15_ = _tmp14_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp16_ = live_chart_bounds_get_lower (_tmp15_);
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp17_ = _tmp16_;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp18_ = config->y_axis;
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
_tmp3_ = _tmp17_ * live_chart_yaxis_get_ratio (_tmp18_);
|
||||||
|
#line 188 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
#line 19 "../src/min_bound_line.vala"
|
||||||
|
y = _tmp3_;
|
||||||
|
#line 20 "../src/min_bound_line.vala"
|
||||||
|
_tmp19_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 20 "../src/min_bound_line.vala"
|
||||||
|
_tmp20_ = _tmp19_;
|
||||||
|
#line 20 "../src/min_bound_line.vala"
|
||||||
|
live_chart_path_configure (_tmp20_, ctx);
|
||||||
|
#line 21 "../src/min_bound_line.vala"
|
||||||
|
_tmp21_ = boundaries;
|
||||||
|
#line 21 "../src/min_bound_line.vala"
|
||||||
|
_tmp22_ = _tmp21_.x;
|
||||||
|
#line 21 "../src/min_bound_line.vala"
|
||||||
|
_tmp23_ = boundaries;
|
||||||
|
#line 21 "../src/min_bound_line.vala"
|
||||||
|
_tmp24_ = _tmp23_.y;
|
||||||
|
#line 21 "../src/min_bound_line.vala"
|
||||||
|
cairo_move_to (ctx, (gdouble) _tmp22_.min, _tmp24_.max - y);
|
||||||
|
#line 22 "../src/min_bound_line.vala"
|
||||||
|
_tmp25_ = boundaries;
|
||||||
|
#line 22 "../src/min_bound_line.vala"
|
||||||
|
_tmp26_ = _tmp25_.x;
|
||||||
|
#line 22 "../src/min_bound_line.vala"
|
||||||
|
_tmp27_ = boundaries;
|
||||||
|
#line 22 "../src/min_bound_line.vala"
|
||||||
|
_tmp28_ = _tmp27_.y;
|
||||||
|
#line 22 "../src/min_bound_line.vala"
|
||||||
|
cairo_line_to (ctx, (gdouble) _tmp26_.max, _tmp28_.max - y);
|
||||||
|
#line 23 "../src/min_bound_line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 220 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_min_bound_line_class_init (LiveChartMinBoundLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/min_bound_line.vala"
|
||||||
|
live_chart_min_bound_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/min_bound_line.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_min_bound_line_real_draw;
|
||||||
|
#line 232 "min_bound_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_min_bound_line_instance_init (LiveChartMinBoundLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_min_bound_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartMinBoundLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_min_bound_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartMinBoundLine), 0, (GInstanceInitFunc) live_chart_min_bound_line_instance_init, NULL };
|
||||||
|
GType live_chart_min_bound_line_type_id;
|
||||||
|
live_chart_min_bound_line_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartMinBoundLine", &g_define_type_info, 0);
|
||||||
|
return live_chart_min_bound_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_min_bound_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_min_bound_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_min_bound_line_type_id__once)) {
|
||||||
|
GType live_chart_min_bound_line_type_id;
|
||||||
|
live_chart_min_bound_line_type_id = live_chart_min_bound_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_min_bound_line_type_id__once, live_chart_min_bound_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_min_bound_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,586 @@
|
||||||
|
/* path.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from path.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_PATH_0_PROPERTY,
|
||||||
|
LIVE_CHART_PATH_WIDTH_PROPERTY,
|
||||||
|
LIVE_CHART_PATH_COLOR_PROPERTY,
|
||||||
|
LIVE_CHART_PATH_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_PATH_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_path_properties[LIVE_CHART_PATH_NUM_PROPERTIES];
|
||||||
|
#define _live_chart_dash_free0(var) ((var == NULL) ? NULL : (var = (live_chart_dash_free (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartPathPrivate {
|
||||||
|
gdouble _width;
|
||||||
|
GdkRGBA _color;
|
||||||
|
gboolean _visible;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartPath_private_offset;
|
||||||
|
static gpointer live_chart_path_parent_class = NULL;
|
||||||
|
|
||||||
|
static gdouble* _vala_array_dup1 (gdouble* self,
|
||||||
|
gssize length);
|
||||||
|
static gboolean _gdk_rgba_equal (const GdkRGBA * s1,
|
||||||
|
const GdkRGBA * s2);
|
||||||
|
static void live_chart_path_finalize (GObject * obj);
|
||||||
|
static GType live_chart_path_get_type_once (void);
|
||||||
|
static void _vala_live_chart_path_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_path_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_dash_init (LiveChartDash *self)
|
||||||
|
{
|
||||||
|
#line 8 "../src/path.vala"
|
||||||
|
memset (self, 0, sizeof (LiveChartDash));
|
||||||
|
#line 9 "../src/path.vala"
|
||||||
|
(*self).offset = (gdouble) 0;
|
||||||
|
#line 57 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gdouble*
|
||||||
|
_vala_array_dup1 (gdouble* self,
|
||||||
|
gssize length)
|
||||||
|
{
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
if (length > 0) {
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
return _vala_memdup2 (self, length * sizeof (gdouble));
|
||||||
|
#line 68 "path.c"
|
||||||
|
}
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 72 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_dash_copy (const LiveChartDash* self,
|
||||||
|
LiveChartDash* dest)
|
||||||
|
{
|
||||||
|
gdouble* _tmp0_;
|
||||||
|
gint _tmp0__length1;
|
||||||
|
gdouble* _tmp1_;
|
||||||
|
gint _tmp1__length1;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
_tmp0_ = (*self).dashes;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
_tmp0__length1 = (*self).dashes_length1;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : _tmp0_;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
_tmp1__length1 = _tmp0__length1;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
(*dest).dashes = (g_free ((*dest).dashes), NULL);
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
(*dest).dashes = _tmp1_;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
(*dest).dashes_length1 = _tmp1__length1;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
(*dest).offset = (*self).offset;
|
||||||
|
#line 99 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_dash_destroy (LiveChartDash* self)
|
||||||
|
{
|
||||||
|
#line 6 "../src/path.vala"
|
||||||
|
(*self).dashes = (g_free ((*self).dashes), NULL);
|
||||||
|
#line 107 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartDash*
|
||||||
|
live_chart_dash_dup (const LiveChartDash* self)
|
||||||
|
{
|
||||||
|
LiveChartDash* dup;
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
dup = g_new0 (LiveChartDash, 1);
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
live_chart_dash_copy (self, dup);
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
return dup;
|
||||||
|
#line 120 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_dash_free (LiveChartDash* self)
|
||||||
|
{
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
live_chart_dash_destroy (self);
|
||||||
|
#line 5 "../src/path.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 130 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_dash_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_dash_type_id;
|
||||||
|
live_chart_dash_type_id = g_boxed_type_register_static ("LiveChartDash", (GBoxedCopyFunc) live_chart_dash_dup, (GBoxedFreeFunc) live_chart_dash_free);
|
||||||
|
return live_chart_dash_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_dash_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_dash_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_dash_type_id__once)) {
|
||||||
|
GType live_chart_dash_type_id;
|
||||||
|
live_chart_dash_type_id = live_chart_dash_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_dash_type_id__once, live_chart_dash_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_dash_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_path_get_instance_private (LiveChartPath* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartPath_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_dash_dup0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 23 "../src/path.vala"
|
||||||
|
return self ? live_chart_dash_dup (self) : NULL;
|
||||||
|
#line 164 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPath*
|
||||||
|
live_chart_path_construct (GType object_type,
|
||||||
|
gdouble width,
|
||||||
|
GdkRGBA* color,
|
||||||
|
gboolean visible,
|
||||||
|
LiveChartDash* dash)
|
||||||
|
{
|
||||||
|
LiveChartPath * self = NULL;
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
LiveChartDash* _tmp1_;
|
||||||
|
#line 19 "../src/path.vala"
|
||||||
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
#line 19 "../src/path.vala"
|
||||||
|
self = (LiveChartPath*) g_object_new (object_type, NULL);
|
||||||
|
#line 20 "../src/path.vala"
|
||||||
|
live_chart_path_set_width (self, width);
|
||||||
|
#line 21 "../src/path.vala"
|
||||||
|
_tmp0_ = *color;
|
||||||
|
#line 21 "../src/path.vala"
|
||||||
|
live_chart_path_set_color (self, &_tmp0_);
|
||||||
|
#line 22 "../src/path.vala"
|
||||||
|
live_chart_path_set_visible (self, TRUE);
|
||||||
|
#line 23 "../src/path.vala"
|
||||||
|
_tmp1_ = _live_chart_dash_dup0 (dash);
|
||||||
|
#line 23 "../src/path.vala"
|
||||||
|
_live_chart_dash_free0 (self->dash);
|
||||||
|
#line 23 "../src/path.vala"
|
||||||
|
self->dash = _tmp1_;
|
||||||
|
#line 19 "../src/path.vala"
|
||||||
|
return self;
|
||||||
|
#line 197 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPath*
|
||||||
|
live_chart_path_new (gdouble width,
|
||||||
|
GdkRGBA* color,
|
||||||
|
gboolean visible,
|
||||||
|
LiveChartDash* dash)
|
||||||
|
{
|
||||||
|
#line 19 "../src/path.vala"
|
||||||
|
return live_chart_path_construct (LIVE_CHART_TYPE_PATH, width, color, visible, dash);
|
||||||
|
#line 208 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_path_configure (LiveChartPath* self,
|
||||||
|
cairo_t* ctx)
|
||||||
|
{
|
||||||
|
gboolean _tmp0_;
|
||||||
|
#line 26 "../src/path.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 26 "../src/path.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 27 "../src/path.vala"
|
||||||
|
_tmp0_ = self->priv->_visible;
|
||||||
|
#line 27 "../src/path.vala"
|
||||||
|
if (_tmp0_) {
|
||||||
|
#line 224 "path.c"
|
||||||
|
LiveChartDash* _tmp1_;
|
||||||
|
GdkRGBA _tmp5_;
|
||||||
|
GdkRGBA _tmp6_;
|
||||||
|
GdkRGBA _tmp7_;
|
||||||
|
GdkRGBA _tmp8_;
|
||||||
|
gdouble _tmp9_;
|
||||||
|
#line 28 "../src/path.vala"
|
||||||
|
_tmp1_ = self->dash;
|
||||||
|
#line 28 "../src/path.vala"
|
||||||
|
if (_tmp1_ != NULL) {
|
||||||
|
#line 235 "path.c"
|
||||||
|
LiveChartDash* _tmp2_;
|
||||||
|
gdouble* _tmp3_;
|
||||||
|
gint _tmp3__length1;
|
||||||
|
LiveChartDash* _tmp4_;
|
||||||
|
#line 29 "../src/path.vala"
|
||||||
|
_tmp2_ = self->dash;
|
||||||
|
#line 29 "../src/path.vala"
|
||||||
|
_tmp3_ = (*_tmp2_).dashes;
|
||||||
|
#line 29 "../src/path.vala"
|
||||||
|
_tmp3__length1 = (*_tmp2_).dashes_length1;
|
||||||
|
#line 29 "../src/path.vala"
|
||||||
|
_tmp4_ = self->dash;
|
||||||
|
#line 29 "../src/path.vala"
|
||||||
|
cairo_set_dash (ctx, _tmp3_, (gint) _tmp3__length1, (*_tmp4_).offset);
|
||||||
|
#line 250 "path.c"
|
||||||
|
}
|
||||||
|
#line 31 "../src/path.vala"
|
||||||
|
_tmp5_ = self->priv->_color;
|
||||||
|
#line 31 "../src/path.vala"
|
||||||
|
_tmp6_ = self->priv->_color;
|
||||||
|
#line 31 "../src/path.vala"
|
||||||
|
_tmp7_ = self->priv->_color;
|
||||||
|
#line 31 "../src/path.vala"
|
||||||
|
_tmp8_ = self->priv->_color;
|
||||||
|
#line 31 "../src/path.vala"
|
||||||
|
cairo_set_source_rgba (ctx, _tmp5_.red, _tmp6_.green, _tmp7_.blue, _tmp8_.alpha);
|
||||||
|
#line 32 "../src/path.vala"
|
||||||
|
_tmp9_ = self->priv->_width;
|
||||||
|
#line 32 "../src/path.vala"
|
||||||
|
cairo_set_line_width (ctx, _tmp9_);
|
||||||
|
#line 266 "path.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_path_get_width (LiveChartPath* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
result = self->priv->_width;
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
return result;
|
||||||
|
#line 280 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_path_set_width (LiveChartPath* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
old_value = live_chart_path_get_width (self);
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
self->priv->_width = value;
|
||||||
|
#line 14 "../src/path.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_path_properties[LIVE_CHART_PATH_WIDTH_PROPERTY]);
|
||||||
|
#line 298 "path.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_path_get_color (LiveChartPath* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
_tmp0_ = self->priv->_color;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return;
|
||||||
|
#line 315 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_gdk_rgba_equal (const GdkRGBA * s1,
|
||||||
|
const GdkRGBA * s2)
|
||||||
|
{
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1 == s2) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return TRUE;
|
||||||
|
#line 326 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1 == NULL) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 332 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s2 == NULL) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 338 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1->red != s2->red) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 344 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1->green != s2->green) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 350 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1->blue != s2->blue) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 356 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (s1->alpha != s2->alpha) {
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return FALSE;
|
||||||
|
#line 362 "path.c"
|
||||||
|
}
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
return TRUE;
|
||||||
|
#line 366 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_path_set_color (LiveChartPath* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
GdkRGBA old_value;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
live_chart_path_get_color (self, &old_value);
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
if (_gdk_rgba_equal (value, &old_value) != TRUE) {
|
||||||
|
#line 380 "path.c"
|
||||||
|
GdkRGBA _tmp0_;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
_tmp0_ = *value;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
self->priv->_color = _tmp0_;
|
||||||
|
#line 16 "../src/path.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_path_properties[LIVE_CHART_PATH_COLOR_PROPERTY]);
|
||||||
|
#line 388 "path.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_path_get_visible (LiveChartPath* self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
return result;
|
||||||
|
#line 402 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_path_set_visible (LiveChartPath* self,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
gboolean old_value;
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
old_value = live_chart_path_get_visible (self);
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 17 "../src/path.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_path_properties[LIVE_CHART_PATH_VISIBLE_PROPERTY]);
|
||||||
|
#line 420 "path.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_path_class_init (LiveChartPathClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
live_chart_path_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartPath_private_offset);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_path_get_property;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_path_set_property;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_path_finalize;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_PATH_WIDTH_PROPERTY, live_chart_path_properties[LIVE_CHART_PATH_WIDTH_PROPERTY] = g_param_spec_double ("width", "width", "width", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_PATH_COLOR_PROPERTY, live_chart_path_properties[LIVE_CHART_PATH_COLOR_PROPERTY] = g_param_spec_boxed ("color", "color", "color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_PATH_VISIBLE_PROPERTY, live_chart_path_properties[LIVE_CHART_PATH_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 444 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_path_instance_init (LiveChartPath * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
self->priv = live_chart_path_get_instance_private (self);
|
||||||
|
#line 453 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_path_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartPath * self;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_PATH, LiveChartPath);
|
||||||
|
#line 15 "../src/path.vala"
|
||||||
|
_live_chart_dash_free0 (self->dash);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_path_parent_class)->finalize (obj);
|
||||||
|
#line 466 "path.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_path_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartPathClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_path_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartPath), 0, (GInstanceInitFunc) live_chart_path_instance_init, NULL };
|
||||||
|
GType live_chart_path_type_id;
|
||||||
|
live_chart_path_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartPath", &g_define_type_info, 0);
|
||||||
|
LiveChartPath_private_offset = g_type_add_instance_private (live_chart_path_type_id, sizeof (LiveChartPathPrivate));
|
||||||
|
return live_chart_path_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_path_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_path_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_path_type_id__once)) {
|
||||||
|
GType live_chart_path_type_id;
|
||||||
|
live_chart_path_type_id = live_chart_path_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_path_type_id__once, live_chart_path_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_path_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_path_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartPath * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_PATH, LiveChartPath);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_WIDTH_PROPERTY:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_value_set_double (value, live_chart_path_get_width (self));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_COLOR_PROPERTY:
|
||||||
|
#line 509 "path.c"
|
||||||
|
{
|
||||||
|
GdkRGBA boxed;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
live_chart_path_get_color (self, &boxed);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_value_set_boxed (value, &boxed);
|
||||||
|
#line 516 "path.c"
|
||||||
|
}
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_VISIBLE_PROPERTY:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_path_get_visible (self));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 526 "path.c"
|
||||||
|
default:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 532 "path.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_path_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartPath * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_PATH, LiveChartPath);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_WIDTH_PROPERTY:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
live_chart_path_set_width (self, g_value_get_double (value));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_COLOR_PROPERTY:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
live_chart_path_set_color (self, g_value_get_boxed (value));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
case LIVE_CHART_PATH_VISIBLE_PROPERTY:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
live_chart_path_set_visible (self, g_value_get_boolean (value));
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 564 "path.c"
|
||||||
|
default:
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 13 "../src/path.vala"
|
||||||
|
break;
|
||||||
|
#line 570 "path.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,739 @@
|
||||||
|
/* points.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from points.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_POINTS_0_PROPERTY,
|
||||||
|
LIVE_CHART_POINTS_BOUNDS_PROPERTY,
|
||||||
|
LIVE_CHART_POINTS_SIZE_PROPERTY,
|
||||||
|
LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY,
|
||||||
|
LIVE_CHART_POINTS_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_points_properties[LIVE_CHART_POINTS_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _live_chart_point_free0(var) ((var == NULL) ? NULL : (var = (live_chart_point_free (var), NULL)))
|
||||||
|
#define _live_chart_timestamped_value_free0(var) ((var == NULL) ? NULL : (var = (live_chart_timestamped_value_free (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartPointsPrivate {
|
||||||
|
GeeArrayList* points;
|
||||||
|
LiveChartBounds* _bounds;
|
||||||
|
gdouble _realtime_delta;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartPoints_private_offset;
|
||||||
|
static gpointer live_chart_points_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_points_value_to_point (LiveChartTimestampedValue* last_value,
|
||||||
|
LiveChartTimestampedValue* current_value,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBoundaries* boundaries,
|
||||||
|
gdouble realtime_delta,
|
||||||
|
LiveChartPoint* result);
|
||||||
|
static void live_chart_points_finalize (GObject * obj);
|
||||||
|
static GType live_chart_points_get_type_once (void);
|
||||||
|
static void _vala_live_chart_points_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_points_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
LiveChartPoint*
|
||||||
|
live_chart_point_dup (const LiveChartPoint* self)
|
||||||
|
{
|
||||||
|
LiveChartPoint* dup;
|
||||||
|
#line 4 "../src/points.vala"
|
||||||
|
dup = g_new0 (LiveChartPoint, 1);
|
||||||
|
#line 4 "../src/points.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartPoint));
|
||||||
|
#line 4 "../src/points.vala"
|
||||||
|
return dup;
|
||||||
|
#line 63 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_point_free (LiveChartPoint* self)
|
||||||
|
{
|
||||||
|
#line 4 "../src/points.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 71 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_point_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_point_type_id;
|
||||||
|
live_chart_point_type_id = g_boxed_type_register_static ("LiveChartPoint", (GBoxedCopyFunc) live_chart_point_dup, (GBoxedFreeFunc) live_chart_point_free);
|
||||||
|
return live_chart_point_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_point_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_point_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_point_type_id__once)) {
|
||||||
|
GType live_chart_point_type_id;
|
||||||
|
live_chart_point_type_id = live_chart_point_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_point_type_id__once, live_chart_point_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_point_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_points_get_instance_private (LiveChartPoints* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartPoints_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPoints*
|
||||||
|
live_chart_points_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartPoints * self = NULL;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
#line 17 "../src/points.vala"
|
||||||
|
self = (LiveChartPoints*) g_object_new (object_type, NULL);
|
||||||
|
#line 18 "../src/points.vala"
|
||||||
|
_tmp0_ = live_chart_bounds_new (((double) NAN), ((double) NAN));
|
||||||
|
#line 18 "../src/points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 18 "../src/points.vala"
|
||||||
|
live_chart_points_set_bounds (self, _tmp1_);
|
||||||
|
#line 18 "../src/points.vala"
|
||||||
|
_g_object_unref0 (_tmp1_);
|
||||||
|
#line 17 "../src/points.vala"
|
||||||
|
return self;
|
||||||
|
#line 118 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPoints*
|
||||||
|
live_chart_points_new (void)
|
||||||
|
{
|
||||||
|
#line 17 "../src/points.vala"
|
||||||
|
return live_chart_points_construct (LIVE_CHART_TYPE_POINTS);
|
||||||
|
#line 126 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_add (LiveChartPoints* self,
|
||||||
|
LiveChartPoint* point)
|
||||||
|
{
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartPoint _tmp1_;
|
||||||
|
GeeArrayList* _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
#line 21 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 21 "../src/points.vala"
|
||||||
|
g_return_if_fail (point != NULL);
|
||||||
|
#line 22 "../src/points.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 22 "../src/points.vala"
|
||||||
|
_tmp1_ = *point;
|
||||||
|
#line 22 "../src/points.vala"
|
||||||
|
live_chart_bounds_update (_tmp0_, _tmp1_.y);
|
||||||
|
#line 23 "../src/points.vala"
|
||||||
|
_tmp2_ = self->priv->points;
|
||||||
|
#line 23 "../src/points.vala"
|
||||||
|
_tmp3_ = *point;
|
||||||
|
#line 23 "../src/points.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, &_tmp3_);
|
||||||
|
#line 153 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_get (LiveChartPoints* self,
|
||||||
|
gint at,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartPoint* _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
#line 36 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
_tmp0_ = self->priv->points;
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
_tmp1_ = gee_abstract_list_get ((GeeAbstractList*) _tmp0_, at);
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
_tmp2_ = (LiveChartPoint*) _tmp1_;
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
_tmp3_ = *_tmp2_;
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
_live_chart_point_free0 (_tmp2_);
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
*result = _tmp3_;
|
||||||
|
#line 37 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 181 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_after (LiveChartPoints* self,
|
||||||
|
gint at,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
#line 40 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
_tmp0_ = live_chart_points_get_size (self);
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
if ((at + 1) >= _tmp1_) {
|
||||||
|
#line 200 "points.c"
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
LiveChartPoint _tmp4_ = {0};
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
_tmp2_ = live_chart_points_get_size (self);
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
live_chart_points_get (self, _tmp3_ - 1, &_tmp4_);
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
*result = _tmp4_;
|
||||||
|
#line 41 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 214 "points.c"
|
||||||
|
}
|
||||||
|
#line 42 "../src/points.vala"
|
||||||
|
live_chart_points_get (self, at + 1, &_tmp5_);
|
||||||
|
#line 42 "../src/points.vala"
|
||||||
|
*result = _tmp5_;
|
||||||
|
#line 42 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 222 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_first (LiveChartPoints* self,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
#line 45 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 46 "../src/points.vala"
|
||||||
|
live_chart_points_get (self, 0, &_tmp0_);
|
||||||
|
#line 46 "../src/points.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 46 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 238 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_last (LiveChartPoints* self,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
LiveChartPoint _tmp2_ = {0};
|
||||||
|
#line 49 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 50 "../src/points.vala"
|
||||||
|
_tmp0_ = live_chart_points_get_size (self);
|
||||||
|
#line 50 "../src/points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 50 "../src/points.vala"
|
||||||
|
live_chart_points_get (self, _tmp1_ - 1, &_tmp2_);
|
||||||
|
#line 50 "../src/points.vala"
|
||||||
|
*result = _tmp2_;
|
||||||
|
#line 50 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 260 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPoints*
|
||||||
|
live_chart_points_create (LiveChartValues* values,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp0_ = {0};
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartPoints* _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
LiveChartPoints* result;
|
||||||
|
#line 53 "../src/points.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 53 "../src/points.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 54 "../src/points.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp0_);
|
||||||
|
#line 54 "../src/points.vala"
|
||||||
|
boundaries = _tmp0_;
|
||||||
|
#line 56 "../src/points.vala"
|
||||||
|
_tmp1_ = live_chart_points_new ();
|
||||||
|
#line 56 "../src/points.vala"
|
||||||
|
points = _tmp1_;
|
||||||
|
#line 57 "../src/points.vala"
|
||||||
|
_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) values);
|
||||||
|
#line 57 "../src/points.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 57 "../src/points.vala"
|
||||||
|
if (_tmp3_ > 0) {
|
||||||
|
#line 292 "points.c"
|
||||||
|
LiveChartTimestampedValue* last_value = NULL;
|
||||||
|
gpointer _tmp4_;
|
||||||
|
LiveChartPoints* _tmp5_;
|
||||||
|
LiveChartTimestampedValue* _tmp6_;
|
||||||
|
LiveChartXAxis* _tmp7_;
|
||||||
|
#line 58 "../src/points.vala"
|
||||||
|
_tmp4_ = gee_linked_list_last ((GeeLinkedList*) values);
|
||||||
|
#line 58 "../src/points.vala"
|
||||||
|
last_value = (LiveChartTimestampedValue*) _tmp4_;
|
||||||
|
#line 59 "../src/points.vala"
|
||||||
|
_tmp5_ = points;
|
||||||
|
#line 59 "../src/points.vala"
|
||||||
|
_tmp6_ = last_value;
|
||||||
|
#line 59 "../src/points.vala"
|
||||||
|
_tmp7_ = config->x_axis;
|
||||||
|
#line 59 "../src/points.vala"
|
||||||
|
live_chart_points_set_realtime_delta (_tmp5_, (((g_get_real_time () / 1000) - (*_tmp6_).timestamp) * live_chart_xaxis_get_ratio (_tmp7_)) / 1000);
|
||||||
|
#line 310 "points.c"
|
||||||
|
{
|
||||||
|
LiveChartValues* _value_list = NULL;
|
||||||
|
gint _value_size = 0;
|
||||||
|
LiveChartValues* _tmp8_;
|
||||||
|
gint _tmp9_;
|
||||||
|
gint _tmp10_;
|
||||||
|
gint _value_index = 0;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_value_list = values;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp8_ = _value_list;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_value_size = _tmp10_;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_value_index = -1;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 332 "points.c"
|
||||||
|
gint _tmp11_;
|
||||||
|
gint _tmp12_;
|
||||||
|
LiveChartTimestampedValue value = {0};
|
||||||
|
LiveChartValues* _tmp13_;
|
||||||
|
gpointer _tmp14_;
|
||||||
|
LiveChartTimestampedValue* _tmp15_;
|
||||||
|
LiveChartTimestampedValue _tmp16_;
|
||||||
|
LiveChartPoint point = {0};
|
||||||
|
LiveChartTimestampedValue* _tmp17_;
|
||||||
|
LiveChartTimestampedValue _tmp18_;
|
||||||
|
LiveChartBoundaries _tmp19_;
|
||||||
|
LiveChartPoints* _tmp20_;
|
||||||
|
gdouble _tmp21_;
|
||||||
|
LiveChartTimestampedValue _tmp22_;
|
||||||
|
LiveChartPoint _tmp23_ = {0};
|
||||||
|
LiveChartPoints* _tmp24_;
|
||||||
|
LiveChartPoint _tmp25_;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_value_index = _value_index + 1;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp11_ = _value_index;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp12_ = _value_size;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
if (!(_tmp11_ < _tmp12_)) {
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 360 "points.c"
|
||||||
|
}
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp13_ = _value_list;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _value_index);
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp15_ = (LiveChartTimestampedValue*) _tmp14_;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_tmp16_ = *_tmp15_;
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
_live_chart_timestamped_value_free0 (_tmp15_);
|
||||||
|
#line 61 "../src/points.vala"
|
||||||
|
value = _tmp16_;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp17_ = last_value;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp18_ = value;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp19_ = boundaries;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp20_ = points;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp21_ = _tmp20_->priv->_realtime_delta;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
_tmp22_ = *_tmp17_;
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
live_chart_points_value_to_point (&_tmp22_, &_tmp18_, config, &_tmp19_, _tmp21_, &_tmp23_);
|
||||||
|
#line 62 "../src/points.vala"
|
||||||
|
point = _tmp23_;
|
||||||
|
#line 63 "../src/points.vala"
|
||||||
|
_tmp24_ = points;
|
||||||
|
#line 63 "../src/points.vala"
|
||||||
|
_tmp25_ = point;
|
||||||
|
#line 63 "../src/points.vala"
|
||||||
|
live_chart_points_add (_tmp24_, &_tmp25_);
|
||||||
|
#line 396 "points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 57 "../src/points.vala"
|
||||||
|
_live_chart_timestamped_value_free0 (last_value);
|
||||||
|
#line 401 "points.c"
|
||||||
|
}
|
||||||
|
#line 67 "../src/points.vala"
|
||||||
|
result = points;
|
||||||
|
#line 67 "../src/points.vala"
|
||||||
|
return result;
|
||||||
|
#line 407 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_points_value_to_point (LiveChartTimestampedValue* last_value,
|
||||||
|
LiveChartTimestampedValue* current_value,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBoundaries* boundaries,
|
||||||
|
gdouble realtime_delta,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
LiveChartBoundaries _tmp0_;
|
||||||
|
LiveChartBoundary _tmp1_;
|
||||||
|
LiveChartTimestampedValue _tmp2_;
|
||||||
|
LiveChartTimestampedValue _tmp3_;
|
||||||
|
LiveChartXAxis* _tmp4_;
|
||||||
|
LiveChartBoundaries _tmp5_;
|
||||||
|
LiveChartBoundary _tmp6_;
|
||||||
|
LiveChartTimestampedValue _tmp7_;
|
||||||
|
LiveChartYAxis* _tmp8_;
|
||||||
|
LiveChartTimestampedValue _tmp9_;
|
||||||
|
LiveChartYAxis* _tmp10_;
|
||||||
|
LiveChartTimestampedValue _tmp11_;
|
||||||
|
LiveChartPoint _tmp12_ = {0};
|
||||||
|
#line 70 "../src/points.vala"
|
||||||
|
g_return_if_fail (last_value != NULL);
|
||||||
|
#line 70 "../src/points.vala"
|
||||||
|
g_return_if_fail (current_value != NULL);
|
||||||
|
#line 70 "../src/points.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 70 "../src/points.vala"
|
||||||
|
g_return_if_fail (boundaries != NULL);
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp0_ = *boundaries;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp1_ = _tmp0_.x;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp2_ = *last_value;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp3_ = *current_value;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp4_ = config->x_axis;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp5_ = *boundaries;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp6_ = _tmp5_.y;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp7_ = *current_value;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp8_ = config->y_axis;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp9_ = *current_value;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp10_ = config->y_axis;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp11_ = *current_value;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
memset (&_tmp12_, 0, sizeof (LiveChartPoint));
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp12_.x = (_tmp1_.max - (((_tmp2_.timestamp - _tmp3_.timestamp) / 1000) * live_chart_xaxis_get_ratio (_tmp4_))) - realtime_delta;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp12_.y = _tmp6_.max - (_tmp7_.value * live_chart_yaxis_get_ratio (_tmp8_));
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp12_.height = _tmp9_.value * live_chart_yaxis_get_ratio (_tmp10_);
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
_tmp12_.data = _tmp11_;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
*result = _tmp12_;
|
||||||
|
#line 71 "../src/points.vala"
|
||||||
|
return;
|
||||||
|
#line 477 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_points_get_bounds (LiveChartPoints* self)
|
||||||
|
{
|
||||||
|
LiveChartBounds* result;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
return result;
|
||||||
|
#line 493 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 501 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_set_bounds (LiveChartPoints* self,
|
||||||
|
LiveChartBounds* value)
|
||||||
|
{
|
||||||
|
LiveChartBounds* old_value;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
old_value = live_chart_points_get_bounds (self);
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 515 "points.c"
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
self->priv->_bounds = _tmp0_;
|
||||||
|
#line 14 "../src/points.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_points_properties[LIVE_CHART_POINTS_BOUNDS_PROPERTY]);
|
||||||
|
#line 525 "points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
live_chart_points_get_size (LiveChartPoints* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
#line 27 "../src/points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
#line 28 "../src/points.vala"
|
||||||
|
_tmp0_ = self->priv->points;
|
||||||
|
#line 28 "../src/points.vala"
|
||||||
|
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
|
||||||
|
#line 28 "../src/points.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 28 "../src/points.vala"
|
||||||
|
result = _tmp2_;
|
||||||
|
#line 28 "../src/points.vala"
|
||||||
|
return result;
|
||||||
|
#line 548 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_points_get_realtime_delta (LiveChartPoints* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
result = self->priv->_realtime_delta;
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
return result;
|
||||||
|
#line 561 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_points_set_realtime_delta (LiveChartPoints* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
old_value = live_chart_points_get_realtime_delta (self);
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
self->priv->_realtime_delta = value;
|
||||||
|
#line 33 "../src/points.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_points_properties[LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY]);
|
||||||
|
#line 579 "points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_points_class_init (LiveChartPointsClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
live_chart_points_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartPoints_private_offset);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_points_get_property;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_points_set_property;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_points_finalize;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_POINTS_BOUNDS_PROPERTY, live_chart_points_properties[LIVE_CHART_POINTS_BOUNDS_PROPERTY] = g_param_spec_object ("bounds", "bounds", "bounds", LIVE_CHART_TYPE_BOUNDS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_POINTS_SIZE_PROPERTY, live_chart_points_properties[LIVE_CHART_POINTS_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY, live_chart_points_properties[LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY] = g_param_spec_double ("realtime-delta", "realtime-delta", "realtime-delta", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 603 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_points_instance_init (LiveChartPoints * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
self->priv = live_chart_points_get_instance_private (self);
|
||||||
|
#line 12 "../src/points.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (LIVE_CHART_TYPE_POINT, (GBoxedCopyFunc) live_chart_point_dup, (GDestroyNotify) live_chart_point_free, NULL, NULL, NULL);
|
||||||
|
#line 12 "../src/points.vala"
|
||||||
|
self->priv->points = _tmp0_;
|
||||||
|
#line 617 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_points_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartPoints * self;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_POINTS, LiveChartPoints);
|
||||||
|
#line 12 "../src/points.vala"
|
||||||
|
_g_object_unref0 (self->priv->points);
|
||||||
|
#line 13 "../src/points.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_points_parent_class)->finalize (obj);
|
||||||
|
#line 632 "points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_points_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartPointsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_points_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartPoints), 0, (GInstanceInitFunc) live_chart_points_instance_init, NULL };
|
||||||
|
GType live_chart_points_type_id;
|
||||||
|
live_chart_points_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartPoints", &g_define_type_info, 0);
|
||||||
|
LiveChartPoints_private_offset = g_type_add_instance_private (live_chart_points_type_id, sizeof (LiveChartPointsPrivate));
|
||||||
|
return live_chart_points_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_points_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_points_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_points_type_id__once)) {
|
||||||
|
GType live_chart_points_type_id;
|
||||||
|
live_chart_points_type_id = live_chart_points_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_points_type_id__once, live_chart_points_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_points_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_points_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartPoints * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_POINTS, LiveChartPoints);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
case LIVE_CHART_POINTS_BOUNDS_PROPERTY:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_value_set_object (value, live_chart_points_get_bounds (self));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
case LIVE_CHART_POINTS_SIZE_PROPERTY:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_value_set_int (value, live_chart_points_get_size (self));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
case LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
g_value_set_double (value, live_chart_points_get_realtime_delta (self));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 685 "points.c"
|
||||||
|
default:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 691 "points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_points_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartPoints * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_POINTS, LiveChartPoints);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
case LIVE_CHART_POINTS_BOUNDS_PROPERTY:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
live_chart_points_set_bounds (self, g_value_get_object (value));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
case LIVE_CHART_POINTS_REALTIME_DELTA_PROPERTY:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
live_chart_points_set_realtime_delta (self, g_value_get_double (value));
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 717 "points.c"
|
||||||
|
default:
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 10 "../src/points.vala"
|
||||||
|
break;
|
||||||
|
#line 723 "points.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;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,679 @@
|
||||||
|
/* serie.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from serie.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,549 @@
|
||||||
|
/* serie_renderer.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from serie_renderer.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define LIVE_CHART_SERIE_RENDERER_VIRTUAL_LEFT_PADDING -200
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_SERIE_RENDERER_0_PROPERTY,
|
||||||
|
LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_SERIE_RENDERER_MAIN_COLOR_PROPERTY,
|
||||||
|
LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY,
|
||||||
|
LIVE_CHART_SERIE_RENDERER_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
struct _LiveChartSerieRendererPrivate {
|
||||||
|
gboolean _visible;
|
||||||
|
LiveChartPath* _line;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartSerieRenderer_private_offset;
|
||||||
|
static gpointer live_chart_serie_renderer_parent_class = NULL;
|
||||||
|
static LiveChartDrawableIface * live_chart_serie_renderer_live_chart_drawable_parent_iface = NULL;
|
||||||
|
|
||||||
|
static void live_chart_serie_renderer_real_draw (LiveChartSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_serie_renderer_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result);
|
||||||
|
static void live_chart_serie_renderer_finalize (GObject * obj);
|
||||||
|
static GType live_chart_serie_renderer_get_type_once (void);
|
||||||
|
static void _vala_live_chart_serie_renderer_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_serie_renderer_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_renderer_get_instance_private (LiveChartSerieRenderer* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartSerieRenderer_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSerieRenderer*
|
||||||
|
live_chart_serie_renderer_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer * self = NULL;
|
||||||
|
GdkRGBA _tmp0_ = {0};
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPath* _tmp2_;
|
||||||
|
#line 23 "../src/serie_renderer.vala"
|
||||||
|
self = (LiveChartSerieRenderer*) g_object_new (object_type, NULL);
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.red = 1.0;
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.green = 1.0;
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.blue = 1.0;
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.alpha = 1.0;
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp1_ = live_chart_path_new ((gdouble) 1, &_tmp0_, TRUE, NULL);
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
live_chart_serie_renderer_set_line (self, _tmp2_);
|
||||||
|
#line 24 "../src/serie_renderer.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 23 "../src/serie_renderer.vala"
|
||||||
|
return self;
|
||||||
|
#line 88 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 36 "../src/serie_renderer.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 96 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartValues*
|
||||||
|
live_chart_serie_renderer_get_values (LiveChartSerieRenderer* self)
|
||||||
|
{
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
LiveChartValues* _tmp1_;
|
||||||
|
LiveChartValues* result;
|
||||||
|
#line 35 "../src/serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 36 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = self->values;
|
||||||
|
#line 36 "../src/serie_renderer.vala"
|
||||||
|
_tmp1_ = _g_object_ref0 (_tmp0_);
|
||||||
|
#line 36 "../src/serie_renderer.vala"
|
||||||
|
result = _tmp1_;
|
||||||
|
#line 36 "../src/serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 115 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_real_draw (LiveChartSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
g_critical ("Type `%s' does not implement abstract method `live_chart_serie_renderer_draw'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
return;
|
||||||
|
#line 127 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_serie_renderer_draw (LiveChartSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartSerieRendererClass* _klass_;
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
_klass_ = LIVE_CHART_SERIE_RENDERER_GET_CLASS (self);
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
if (_klass_->draw) {
|
||||||
|
#line 39 "../src/serie_renderer.vala"
|
||||||
|
_klass_->draw (self, ctx, config);
|
||||||
|
#line 144 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer * self;
|
||||||
|
LiveChartBoundingBox _tmp0_;
|
||||||
|
#line 41 "../src/serie_renderer.vala"
|
||||||
|
self = (LiveChartSerieRenderer*) base;
|
||||||
|
#line 42 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = self->bounding_box;
|
||||||
|
#line 42 "../src/serie_renderer.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 42 "../src/serie_renderer.vala"
|
||||||
|
return;
|
||||||
|
#line 162 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_serie_renderer_debug (LiveChartSerieRenderer* self,
|
||||||
|
cairo_t* ctx)
|
||||||
|
{
|
||||||
|
gchar* debug = NULL;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
gchar* _tmp1_;
|
||||||
|
const gchar* _tmp2_;
|
||||||
|
#line 45 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 45 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 46 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = g_getenv ("LIVE_CHART_DEBUG");
|
||||||
|
#line 46 "../src/serie_renderer.vala"
|
||||||
|
_tmp1_ = g_strdup (_tmp0_);
|
||||||
|
#line 46 "../src/serie_renderer.vala"
|
||||||
|
debug = _tmp1_;
|
||||||
|
#line 47 "../src/serie_renderer.vala"
|
||||||
|
_tmp2_ = debug;
|
||||||
|
#line 47 "../src/serie_renderer.vala"
|
||||||
|
if (_tmp2_ != NULL) {
|
||||||
|
#line 187 "serie_renderer.c"
|
||||||
|
LiveChartBoundingBox _tmp3_;
|
||||||
|
LiveChartBoundingBox _tmp4_;
|
||||||
|
LiveChartBoundingBox _tmp5_;
|
||||||
|
LiveChartBoundingBox _tmp6_;
|
||||||
|
#line 48 "../src/serie_renderer.vala"
|
||||||
|
_tmp3_ = self->bounding_box;
|
||||||
|
#line 48 "../src/serie_renderer.vala"
|
||||||
|
_tmp4_ = self->bounding_box;
|
||||||
|
#line 48 "../src/serie_renderer.vala"
|
||||||
|
_tmp5_ = self->bounding_box;
|
||||||
|
#line 48 "../src/serie_renderer.vala"
|
||||||
|
_tmp6_ = self->bounding_box;
|
||||||
|
#line 48 "../src/serie_renderer.vala"
|
||||||
|
cairo_rectangle (ctx, _tmp3_.x, _tmp4_.y, _tmp5_.width, _tmp6_.height);
|
||||||
|
#line 49 "../src/serie_renderer.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 204 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
#line 45 "../src/serie_renderer.vala"
|
||||||
|
_g_free0 (debug);
|
||||||
|
#line 208 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_serie_renderer_is_out_of_area (LiveChartSerieRenderer* self,
|
||||||
|
LiveChartPoint* point)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 53 "../src/serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 53 "../src/serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (point != NULL, FALSE);
|
||||||
|
#line 54 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = *point;
|
||||||
|
#line 54 "../src/serie_renderer.vala"
|
||||||
|
result = _tmp0_.x < ((gdouble) LIVE_CHART_SERIE_RENDERER_VIRTUAL_LEFT_PADDING);
|
||||||
|
#line 54 "../src/serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 227 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_serie_renderer_real_get_visible (LiveChartDrawable* base)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
LiveChartSerieRenderer* self;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
self = (LiveChartSerieRenderer*) base;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 241 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_real_set_visible (LiveChartDrawable* base,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer* self;
|
||||||
|
gboolean old_value;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
self = (LiveChartSerieRenderer*) base;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
old_value = live_chart_serie_renderer_real_get_visible (base);
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY]);
|
||||||
|
#line 260 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_serie_renderer_get_main_color (LiveChartSerieRenderer* self,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
GdkRGBA _tmp1_ = {0};
|
||||||
|
GdkRGBA _tmp2_;
|
||||||
|
#line 13 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 14 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = self->priv->_line;
|
||||||
|
#line 14 "../src/serie_renderer.vala"
|
||||||
|
live_chart_path_get_color (_tmp0_, &_tmp1_);
|
||||||
|
#line 14 "../src/serie_renderer.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 14 "../src/serie_renderer.vala"
|
||||||
|
*result = _tmp2_;
|
||||||
|
#line 14 "../src/serie_renderer.vala"
|
||||||
|
return;
|
||||||
|
#line 283 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_serie_renderer_set_main_color (LiveChartSerieRenderer* self,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
GdkRGBA _tmp1_;
|
||||||
|
#line 17 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 18 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = self->priv->_line;
|
||||||
|
#line 18 "../src/serie_renderer.vala"
|
||||||
|
_tmp1_ = *value;
|
||||||
|
#line 18 "../src/serie_renderer.vala"
|
||||||
|
live_chart_path_set_color (_tmp0_, &_tmp1_);
|
||||||
|
#line 17 "../src/serie_renderer.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_MAIN_COLOR_PROPERTY]);
|
||||||
|
#line 302 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPath*
|
||||||
|
live_chart_serie_renderer_get_line (LiveChartSerieRenderer* self)
|
||||||
|
{
|
||||||
|
LiveChartPath* result;
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = self->priv->_line;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 318 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_serie_renderer_set_line (LiveChartSerieRenderer* self,
|
||||||
|
LiveChartPath* value)
|
||||||
|
{
|
||||||
|
LiveChartPath* old_value;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
old_value = live_chart_serie_renderer_get_line (self);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 332 "serie_renderer.c"
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->priv->_line);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
self->priv->_line = _tmp0_;
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY]);
|
||||||
|
#line 342 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_class_init (LiveChartSerieRendererClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
live_chart_serie_renderer_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartSerieRenderer_private_offset);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_serie_renderer_real_draw;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_serie_renderer_get_property;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_serie_renderer_set_property;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_serie_renderer_finalize;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_RENDERER_MAIN_COLOR_PROPERTY, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_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 | G_PARAM_DEPRECATED));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY, live_chart_serie_renderer_properties[LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY] = g_param_spec_object ("line", "line", "line", LIVE_CHART_TYPE_PATH, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 368 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
live_chart_serie_renderer_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_serie_renderer_draw;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_serie_renderer_real_get_bounding_box;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
iface->get_visible = live_chart_serie_renderer_real_get_visible;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
iface->set_visible = live_chart_serie_renderer_real_set_visible;
|
||||||
|
#line 385 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_instance_init (LiveChartSerieRenderer * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartBoundingBox _tmp0_ = {0};
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
self->priv = live_chart_serie_renderer_get_instance_private (self);
|
||||||
|
#line 9 "../src/serie_renderer.vala"
|
||||||
|
self->priv->_visible = TRUE;
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
memset (&_tmp0_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.x = (gdouble) 0;
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.y = (gdouble) 0;
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.width = (gdouble) 0;
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
_tmp0_.height = (gdouble) 0;
|
||||||
|
#line 27 "../src/serie_renderer.vala"
|
||||||
|
self->bounding_box = _tmp0_;
|
||||||
|
#line 409 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_serie_renderer_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer * self;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_SERIE_RENDERER, LiveChartSerieRenderer);
|
||||||
|
#line 21 "../src/serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->priv->_line);
|
||||||
|
#line 34 "../src/serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->values);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_serie_renderer_parent_class)->finalize (obj);
|
||||||
|
#line 424 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_serie_renderer_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartSerieRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_serie_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartSerieRenderer), 0, (GInstanceInitFunc) live_chart_serie_renderer_instance_init, NULL };
|
||||||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_serie_renderer_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_serie_renderer_type_id;
|
||||||
|
live_chart_serie_renderer_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartSerieRenderer", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
|
||||||
|
g_type_add_interface_static (live_chart_serie_renderer_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||||||
|
LiveChartSerieRenderer_private_offset = g_type_add_instance_private (live_chart_serie_renderer_type_id, sizeof (LiveChartSerieRendererPrivate));
|
||||||
|
return live_chart_serie_renderer_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_serie_renderer_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_serie_renderer_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_serie_renderer_type_id__once)) {
|
||||||
|
GType live_chart_serie_renderer_type_id;
|
||||||
|
live_chart_serie_renderer_type_id = live_chart_serie_renderer_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_serie_renderer_type_id__once, live_chart_serie_renderer_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_serie_renderer_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_serie_renderer_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SERIE_RENDERER, LiveChartSerieRenderer);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_MAIN_COLOR_PROPERTY:
|
||||||
|
#line 469 "serie_renderer.c"
|
||||||
|
{
|
||||||
|
GdkRGBA boxed;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
live_chart_serie_renderer_get_main_color (self, &boxed);
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
#line 475 "serie_renderer.c"
|
||||||
|
g_value_set_boxed (value, &boxed);
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
}
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
g_value_set_object (value, live_chart_serie_renderer_get_line (self));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 487 "serie_renderer.c"
|
||||||
|
default:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 493 "serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_serie_renderer_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSerieRenderer * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SERIE_RENDERER, LiveChartSerieRenderer);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_VISIBLE_PROPERTY:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_MAIN_COLOR_PROPERTY:
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
#line 516 "serie_renderer.c"
|
||||||
|
live_chart_serie_renderer_set_main_color (self, g_value_get_boxed (value));
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
case LIVE_CHART_SERIE_RENDERER_LINE_PROPERTY:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
live_chart_serie_renderer_set_line (self, g_value_get_object (value));
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 527 "serie_renderer.c"
|
||||||
|
default:
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 5 "../src/serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 533 "serie_renderer.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,491 @@
|
||||||
|
/* series.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from series.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_SERIES_0_PROPERTY,
|
||||||
|
LIVE_CHART_SERIES_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_series_properties[LIVE_CHART_SERIES_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _live_chart_timestamped_value_free0(var) ((var == NULL) ? NULL : (var = (live_chart_timestamped_value_free (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
struct _LiveChartSeriesPrivate {
|
||||||
|
GeeArrayList* series;
|
||||||
|
LiveChartChart* chart;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartSeries_private_offset;
|
||||||
|
static gpointer live_chart_series_parent_class = NULL;
|
||||||
|
|
||||||
|
static gboolean __lambda7_ (LiveChartSeries* self,
|
||||||
|
LiveChartTimestampedValue* value);
|
||||||
|
static gboolean ___lambda7__gee_forall_func (gpointer g,
|
||||||
|
gpointer self);
|
||||||
|
static void __lambda8_ (LiveChartSeries* self,
|
||||||
|
gdouble value);
|
||||||
|
static void ___lambda8__live_chart_serie_value_added (LiveChartSerie* _sender,
|
||||||
|
gdouble value,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_series_finalize (GObject * obj);
|
||||||
|
static GType live_chart_series_get_type_once (void);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_series_get_instance_private (LiveChartSeries* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartSeries_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 10 "../src/series.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 56 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSeries*
|
||||||
|
live_chart_series_construct (GType object_type,
|
||||||
|
LiveChartChart* chart)
|
||||||
|
{
|
||||||
|
LiveChartSeries * self = NULL;
|
||||||
|
LiveChartChart* _tmp0_;
|
||||||
|
#line 9 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (chart != NULL, NULL);
|
||||||
|
#line 9 "../src/series.vala"
|
||||||
|
self = (LiveChartSeries*) g_object_new (object_type, NULL);
|
||||||
|
#line 10 "../src/series.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (chart);
|
||||||
|
#line 10 "../src/series.vala"
|
||||||
|
_g_object_unref0 (self->priv->chart);
|
||||||
|
#line 10 "../src/series.vala"
|
||||||
|
self->priv->chart = _tmp0_;
|
||||||
|
#line 9 "../src/series.vala"
|
||||||
|
return self;
|
||||||
|
#line 77 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSeries*
|
||||||
|
live_chart_series_new (LiveChartChart* chart)
|
||||||
|
{
|
||||||
|
#line 9 "../src/series.vala"
|
||||||
|
return live_chart_series_construct (LIVE_CHART_TYPE_SERIES, chart);
|
||||||
|
#line 85 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
__lambda7_ (LiveChartSeries* self,
|
||||||
|
LiveChartTimestampedValue* value)
|
||||||
|
{
|
||||||
|
LiveChartChart* _tmp0_;
|
||||||
|
LiveChartConfig* _tmp1_;
|
||||||
|
LiveChartYAxis* _tmp2_;
|
||||||
|
gboolean result;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->chart;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_tmp1_ = _tmp0_->config;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_tmp2_ = _tmp1_->y_axis;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
live_chart_yaxis_update_bounds (_tmp2_, (*value).value);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
result = TRUE;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_live_chart_timestamped_value_free0 (value);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 110 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
___lambda7__gee_forall_func (gpointer g,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
result = __lambda7_ ((LiveChartSeries*) self, (LiveChartTimestampedValue*) g);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 121 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
__lambda8_ (LiveChartSeries* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
LiveChartChart* _tmp0_;
|
||||||
|
LiveChartConfig* _tmp1_;
|
||||||
|
LiveChartYAxis* _tmp2_;
|
||||||
|
#line 20 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->chart;
|
||||||
|
#line 20 "../src/series.vala"
|
||||||
|
_tmp1_ = _tmp0_->config;
|
||||||
|
#line 20 "../src/series.vala"
|
||||||
|
_tmp2_ = _tmp1_->y_axis;
|
||||||
|
#line 20 "../src/series.vala"
|
||||||
|
live_chart_yaxis_update_bounds (_tmp2_, value);
|
||||||
|
#line 139 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
___lambda8__live_chart_serie_value_added (LiveChartSerie* _sender,
|
||||||
|
gdouble value,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
#line 19 "../src/series.vala"
|
||||||
|
__lambda8_ ((LiveChartSeries*) self, value);
|
||||||
|
#line 149 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSerie*
|
||||||
|
live_chart_series_register (LiveChartSeries* self,
|
||||||
|
LiveChartSerie* serie)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
LiveChartValues* _tmp1_;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartChart* _tmp3_;
|
||||||
|
LiveChartLegend* _tmp4_;
|
||||||
|
LiveChartLegend* _tmp5_;
|
||||||
|
LiveChartSerie* _tmp9_;
|
||||||
|
LiveChartSerie* result;
|
||||||
|
#line 13 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 13 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (serie != NULL, NULL);
|
||||||
|
#line 14 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 14 "../src/series.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, serie);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_tmp1_ = live_chart_serie_get_values (serie);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
gee_abstract_collection_foreach ((GeeAbstractCollection*) _tmp2_, ___lambda7__gee_forall_func, self);
|
||||||
|
#line 16 "../src/series.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp3_ = self->priv->chart;
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp4_ = live_chart_chart_get_legend (_tmp3_);
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp5_ = _tmp4_;
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
if (_tmp5_ != NULL) {
|
||||||
|
#line 188 "series.c"
|
||||||
|
LiveChartChart* _tmp6_;
|
||||||
|
LiveChartLegend* _tmp7_;
|
||||||
|
LiveChartLegend* _tmp8_;
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp6_ = self->priv->chart;
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp7_ = live_chart_chart_get_legend (_tmp6_);
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 18 "../src/series.vala"
|
||||||
|
live_chart_legend_add_legend (_tmp8_, serie);
|
||||||
|
#line 200 "series.c"
|
||||||
|
}
|
||||||
|
#line 19 "../src/series.vala"
|
||||||
|
g_signal_connect_object (serie, "value-added", (GCallback) ___lambda8__live_chart_serie_value_added, self, 0);
|
||||||
|
#line 22 "../src/series.vala"
|
||||||
|
_tmp9_ = _g_object_ref0 (serie);
|
||||||
|
#line 22 "../src/series.vala"
|
||||||
|
result = _tmp9_;
|
||||||
|
#line 22 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 210 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSerie*
|
||||||
|
live_chart_series_get (LiveChartSeries* self,
|
||||||
|
gint index,
|
||||||
|
GError** error)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
GeeArrayList* _tmp7_;
|
||||||
|
gpointer _tmp8_;
|
||||||
|
GError* _inner_error0_ = NULL;
|
||||||
|
LiveChartSerie* result;
|
||||||
|
#line 25 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 26 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 26 "../src/series.vala"
|
||||||
|
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
|
||||||
|
#line 26 "../src/series.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 26 "../src/series.vala"
|
||||||
|
if (index > (_tmp2_ - 1)) {
|
||||||
|
#line 235 "series.c"
|
||||||
|
gchar* _tmp3_;
|
||||||
|
gchar* _tmp4_;
|
||||||
|
GError* _tmp5_;
|
||||||
|
GError* _tmp6_;
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_tmp3_ = g_strdup_printf ("Serie at index %d not found", index);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_tmp5_ = g_error_new_literal (LIVE_CHART_CHART_ERROR, LIVE_CHART_CHART_ERROR_SERIE_NOT_FOUND, _tmp4_);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_g_free0 (_tmp4_);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
_inner_error0_ = _tmp6_;
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
if (_inner_error0_->domain == LIVE_CHART_CHART_ERROR) {
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
g_propagate_error (error, _inner_error0_);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 258 "series.c"
|
||||||
|
} else {
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
g_clear_error (&_inner_error0_);
|
||||||
|
#line 27 "../src/series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 266 "series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 29 "../src/series.vala"
|
||||||
|
_tmp7_ = self->priv->series;
|
||||||
|
#line 29 "../src/series.vala"
|
||||||
|
_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, index);
|
||||||
|
#line 29 "../src/series.vala"
|
||||||
|
result = (LiveChartSerie*) _tmp8_;
|
||||||
|
#line 29 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 277 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSerie*
|
||||||
|
live_chart_series_get_by_name (LiveChartSeries* self,
|
||||||
|
const gchar* name,
|
||||||
|
GError** error)
|
||||||
|
{
|
||||||
|
gchar* _tmp11_;
|
||||||
|
gchar* _tmp12_;
|
||||||
|
GError* _tmp13_;
|
||||||
|
GError* _tmp14_;
|
||||||
|
GError* _inner_error0_ = NULL;
|
||||||
|
LiveChartSerie* result;
|
||||||
|
#line 32 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 32 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
#line 295 "series.c"
|
||||||
|
{
|
||||||
|
GeeArrayList* _serie_list = NULL;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _serie_size = 0;
|
||||||
|
GeeArrayList* _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
gint _serie_index = 0;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_serie_list = _tmp0_;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp1_ = _serie_list;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_serie_size = _tmp3_;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_serie_index = -1;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 320 "series.c"
|
||||||
|
gint _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
LiveChartSerie* serie = NULL;
|
||||||
|
GeeArrayList* _tmp6_;
|
||||||
|
gpointer _tmp7_;
|
||||||
|
LiveChartSerie* _tmp8_;
|
||||||
|
const gchar* _tmp9_;
|
||||||
|
const gchar* _tmp10_;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_serie_index = _serie_index + 1;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp4_ = _serie_index;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp5_ = _serie_size;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
if (!(_tmp4_ < _tmp5_)) {
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
break;
|
||||||
|
#line 339 "series.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp6_ = _serie_list;
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _serie_index);
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
serie = (LiveChartSerie*) _tmp7_;
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
_tmp8_ = serie;
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
_tmp9_ = live_chart_serie_get_name (_tmp8_);
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
if (g_strcmp0 (_tmp10_, name) == 0) {
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
result = serie;
|
||||||
|
#line 34 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 359 "series.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/series.vala"
|
||||||
|
_g_object_unref0 (serie);
|
||||||
|
#line 363 "series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_tmp11_ = g_strdup_printf ("Serie with name %s not found", name);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_tmp13_ = g_error_new_literal (LIVE_CHART_CHART_ERROR, LIVE_CHART_CHART_ERROR_SERIE_NOT_FOUND, _tmp12_);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_g_free0 (_tmp12_);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
_inner_error0_ = _tmp14_;
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
if (_inner_error0_->domain == LIVE_CHART_CHART_ERROR) {
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
g_propagate_error (error, _inner_error0_);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 384 "series.c"
|
||||||
|
} else {
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
g_clear_error (&_inner_error0_);
|
||||||
|
#line 36 "../src/series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 392 "series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GeeIterator*
|
||||||
|
live_chart_series_iterator (LiveChartSeries* self)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
GeeListIterator* _tmp1_;
|
||||||
|
GeeIterator* result;
|
||||||
|
#line 39 "../src/series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 40 "../src/series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 40 "../src/series.vala"
|
||||||
|
_tmp1_ = gee_abstract_list_list_iterator ((GeeAbstractList*) _tmp0_);
|
||||||
|
#line 40 "../src/series.vala"
|
||||||
|
result = (GeeIterator*) _tmp1_;
|
||||||
|
#line 40 "../src/series.vala"
|
||||||
|
return result;
|
||||||
|
#line 412 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_series_class_init (LiveChartSeriesClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
live_chart_series_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartSeries_private_offset);
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_series_finalize;
|
||||||
|
#line 425 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_series_instance_init (LiveChartSeries * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
self->priv = live_chart_series_get_instance_private (self);
|
||||||
|
#line 6 "../src/series.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (LIVE_CHART_TYPE_SERIE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
|
||||||
|
#line 6 "../src/series.vala"
|
||||||
|
self->priv->series = _tmp0_;
|
||||||
|
#line 439 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_series_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartSeries * self;
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_SERIES, LiveChartSeries);
|
||||||
|
#line 6 "../src/series.vala"
|
||||||
|
_g_object_unref0 (self->priv->series);
|
||||||
|
#line 7 "../src/series.vala"
|
||||||
|
_g_object_unref0 (self->priv->chart);
|
||||||
|
#line 4 "../src/series.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_series_parent_class)->finalize (obj);
|
||||||
|
#line 454 "series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_series_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartSeriesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_series_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartSeries), 0, (GInstanceInitFunc) live_chart_series_instance_init, NULL };
|
||||||
|
GType live_chart_series_type_id;
|
||||||
|
live_chart_series_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartSeries", &g_define_type_info, 0);
|
||||||
|
LiveChartSeries_private_offset = g_type_add_instance_private (live_chart_series_type_id, sizeof (LiveChartSeriesPrivate));
|
||||||
|
return live_chart_series_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_series_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_series_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_series_type_id__once)) {
|
||||||
|
GType live_chart_series_type_id;
|
||||||
|
live_chart_series_type_id = live_chart_series_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_series_type_id__once, live_chart_series_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_series_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,887 @@
|
||||||
|
/* smooth_line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from smooth_line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_SMOOTH_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY,
|
||||||
|
LIVE_CHART_SMOOTH_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_smooth_line_properties[LIVE_CHART_SMOOTH_LINE_NUM_PROPERTIES];
|
||||||
|
#define _live_chart_region_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_region_unref (var), NULL)))
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _cairo_path_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_path_destroy (var), NULL)))
|
||||||
|
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
|
||||||
|
typedef struct _Block6Data Block6Data;
|
||||||
|
#define _live_chart_bezier_intersector_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_bezier_intersector_unref (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartSmoothLinePrivate {
|
||||||
|
LiveChartRegion* _region;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Block6Data {
|
||||||
|
int _ref_count_;
|
||||||
|
LiveChartSmoothLine* self;
|
||||||
|
LiveChartBoundaries boundaries;
|
||||||
|
cairo_t* ctx;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartSmoothLine_private_offset;
|
||||||
|
static gpointer live_chart_smooth_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_smooth_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_smooth_line_update_bounding_box (LiveChartSmoothLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_smooth_line_generate_intersections (LiveChartSmoothLine* self,
|
||||||
|
LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* target,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBezierCurve* curve);
|
||||||
|
static Block6Data* block6_data_ref (Block6Data* _data6_);
|
||||||
|
static void block6_data_unref (void * _userdata_);
|
||||||
|
static gboolean __lambda13_ (Block6Data* _data6_,
|
||||||
|
LiveChartIntersection* intersection);
|
||||||
|
static gboolean ___lambda13__gee_forall_func (gpointer g,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_smooth_line_finalize (GObject * obj);
|
||||||
|
static GType live_chart_smooth_line_get_type_once (void);
|
||||||
|
static void _vala_live_chart_smooth_line_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_smooth_line_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_smooth_line_get_instance_private (LiveChartSmoothLine* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartSmoothLine_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 10 "../src/smooth_line.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 82 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSmoothLine*
|
||||||
|
live_chart_smooth_line_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine * self = NULL;
|
||||||
|
LiveChartValues* _tmp0_;
|
||||||
|
#line 8 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 9 "../src/smooth_line.vala"
|
||||||
|
self = (LiveChartSmoothLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 10 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (values);
|
||||||
|
#line 10 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartSerieRenderer*) self)->values);
|
||||||
|
#line 10 "../src/smooth_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 8 "../src/smooth_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 103 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSmoothLine*
|
||||||
|
live_chart_smooth_line_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 8 "../src/smooth_line.vala"
|
||||||
|
return live_chart_smooth_line_construct (LIVE_CHART_TYPE_SMOOTH_LINE, values);
|
||||||
|
#line 111 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 13 "../src/smooth_line.vala"
|
||||||
|
self = (LiveChartSmoothLine*) base;
|
||||||
|
#line 13 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 13 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 14 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 14 "../src/smooth_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 14 "../src/smooth_line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 134 "smooth_line.c"
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartPoints* _tmp3_;
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 15 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 15 "../src/smooth_line.vala"
|
||||||
|
_tmp3_ = live_chart_points_create (_tmp2_, config);
|
||||||
|
#line 15 "../src/smooth_line.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 16 "../src/smooth_line.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 16 "../src/smooth_line.vala"
|
||||||
|
_tmp5_ = live_chart_points_get_size (_tmp4_);
|
||||||
|
#line 16 "../src/smooth_line.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 16 "../src/smooth_line.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 155 "smooth_line.c"
|
||||||
|
LiveChartRegion* _tmp7_;
|
||||||
|
LiveChartPoints* _tmp8_;
|
||||||
|
cairo_path_t* _tmp9_;
|
||||||
|
cairo_path_t* _tmp10_;
|
||||||
|
LiveChartRegion* _tmp11_;
|
||||||
|
#line 18 "../src/smooth_line.vala"
|
||||||
|
_tmp7_ = self->priv->_region;
|
||||||
|
#line 18 "../src/smooth_line.vala"
|
||||||
|
if (_tmp7_ != NULL) {
|
||||||
|
#line 19 "../src/smooth_line.vala"
|
||||||
|
cairo_push_group (ctx);
|
||||||
|
#line 167 "smooth_line.c"
|
||||||
|
}
|
||||||
|
#line 22 "../src/smooth_line.vala"
|
||||||
|
_tmp8_ = points;
|
||||||
|
#line 22 "../src/smooth_line.vala"
|
||||||
|
_tmp9_ = live_chart_smooth_line_draw_smooth_line (self, _tmp8_, ctx, config);
|
||||||
|
#line 22 "../src/smooth_line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 22 "../src/smooth_line.vala"
|
||||||
|
_cairo_path_destroy0 (_tmp10_);
|
||||||
|
#line 23 "../src/smooth_line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 25 "../src/smooth_line.vala"
|
||||||
|
_tmp11_ = self->priv->_region;
|
||||||
|
#line 25 "../src/smooth_line.vala"
|
||||||
|
if (_tmp11_ != NULL) {
|
||||||
|
#line 26 "../src/smooth_line.vala"
|
||||||
|
cairo_set_operator (ctx, CAIRO_OPERATOR_ATOP);
|
||||||
|
#line 27 "../src/smooth_line.vala"
|
||||||
|
live_chart_smooth_line_draw_regions_on_line (self, ctx, config);
|
||||||
|
#line 28 "../src/smooth_line.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 29 "../src/smooth_line.vala"
|
||||||
|
cairo_pop_group_to_source (ctx);
|
||||||
|
#line 30 "../src/smooth_line.vala"
|
||||||
|
cairo_paint (ctx);
|
||||||
|
#line 193 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 14 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 198 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo_path_t*
|
||||||
|
live_chart_smooth_line_draw_smooth_line (LiveChartSmoothLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartIntersections* _tmp0_;
|
||||||
|
LiveChartPoint first_point = {0};
|
||||||
|
LiveChartPoint _tmp1_ = {0};
|
||||||
|
LiveChartPoint _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
LiveChartPath* _tmp4_;
|
||||||
|
LiveChartPath* _tmp5_;
|
||||||
|
cairo_path_t* _tmp32_;
|
||||||
|
cairo_path_t* result;
|
||||||
|
#line 36 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 36 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (points != NULL, NULL);
|
||||||
|
#line 36 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (ctx != NULL, NULL);
|
||||||
|
#line 36 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 37 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = live_chart_intersections_new ();
|
||||||
|
#line 37 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (self->intersections);
|
||||||
|
#line 37 "../src/smooth_line.vala"
|
||||||
|
self->intersections = _tmp0_;
|
||||||
|
#line 38 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp1_);
|
||||||
|
#line 38 "../src/smooth_line.vala"
|
||||||
|
first_point = _tmp1_;
|
||||||
|
#line 40 "../src/smooth_line.vala"
|
||||||
|
live_chart_smooth_line_update_bounding_box (self, points, config);
|
||||||
|
#line 41 "../src/smooth_line.vala"
|
||||||
|
live_chart_serie_renderer_debug ((LiveChartSerieRenderer*) self, ctx);
|
||||||
|
#line 43 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = first_point;
|
||||||
|
#line 43 "../src/smooth_line.vala"
|
||||||
|
_tmp3_ = first_point;
|
||||||
|
#line 43 "../src/smooth_line.vala"
|
||||||
|
cairo_move_to (ctx, _tmp2_.x, _tmp3_.y);
|
||||||
|
#line 44 "../src/smooth_line.vala"
|
||||||
|
_tmp4_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 44 "../src/smooth_line.vala"
|
||||||
|
_tmp5_ = _tmp4_;
|
||||||
|
#line 44 "../src/smooth_line.vala"
|
||||||
|
live_chart_path_configure (_tmp5_, ctx);
|
||||||
|
#line 251 "smooth_line.c"
|
||||||
|
{
|
||||||
|
gint pos = 0;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
pos = 0;
|
||||||
|
#line 256 "smooth_line.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp6_ = FALSE;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
_tmp6_ = TRUE;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 263 "smooth_line.c"
|
||||||
|
gint _tmp8_;
|
||||||
|
gint _tmp9_;
|
||||||
|
LiveChartPoint previous_point = {0};
|
||||||
|
LiveChartPoint _tmp10_ = {0};
|
||||||
|
LiveChartPoint target_point = {0};
|
||||||
|
LiveChartPoint _tmp11_ = {0};
|
||||||
|
LiveChartPoint _tmp12_;
|
||||||
|
LiveChartBezierCurve curve = {0};
|
||||||
|
LiveChartPoint _tmp13_;
|
||||||
|
LiveChartPoint _tmp14_;
|
||||||
|
LiveChartBezierCurve _tmp15_ = {0};
|
||||||
|
LiveChartBezierCurve _tmp16_;
|
||||||
|
LiveChartCoord _tmp17_;
|
||||||
|
LiveChartBezierCurve _tmp18_;
|
||||||
|
LiveChartCoord _tmp19_;
|
||||||
|
LiveChartBezierCurve _tmp20_;
|
||||||
|
LiveChartCoord _tmp21_;
|
||||||
|
LiveChartBezierCurve _tmp22_;
|
||||||
|
LiveChartCoord _tmp23_;
|
||||||
|
LiveChartBezierCurve _tmp24_;
|
||||||
|
LiveChartCoord _tmp25_;
|
||||||
|
LiveChartBezierCurve _tmp26_;
|
||||||
|
LiveChartCoord _tmp27_;
|
||||||
|
LiveChartRegion* _tmp28_;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
if (!_tmp6_) {
|
||||||
|
#line 290 "smooth_line.c"
|
||||||
|
gint _tmp7_;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
_tmp7_ = pos;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
pos = _tmp7_ + 1;
|
||||||
|
#line 296 "smooth_line.c"
|
||||||
|
}
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
_tmp6_ = FALSE;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
_tmp8_ = live_chart_points_get_size (points);
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
_tmp9_ = _tmp8_;
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
if (!(pos <= (_tmp9_ - 1))) {
|
||||||
|
#line 46 "../src/smooth_line.vala"
|
||||||
|
break;
|
||||||
|
#line 308 "smooth_line.c"
|
||||||
|
}
|
||||||
|
#line 48 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_get (points, pos, &_tmp10_);
|
||||||
|
#line 48 "../src/smooth_line.vala"
|
||||||
|
previous_point = _tmp10_;
|
||||||
|
#line 49 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_after (points, pos, &_tmp11_);
|
||||||
|
#line 49 "../src/smooth_line.vala"
|
||||||
|
target_point = _tmp11_;
|
||||||
|
#line 51 "../src/smooth_line.vala"
|
||||||
|
_tmp12_ = previous_point;
|
||||||
|
#line 51 "../src/smooth_line.vala"
|
||||||
|
if (live_chart_serie_renderer_is_out_of_area ((LiveChartSerieRenderer*) self, &_tmp12_)) {
|
||||||
|
#line 52 "../src/smooth_line.vala"
|
||||||
|
continue;
|
||||||
|
#line 324 "smooth_line.c"
|
||||||
|
}
|
||||||
|
#line 55 "../src/smooth_line.vala"
|
||||||
|
_tmp13_ = previous_point;
|
||||||
|
#line 55 "../src/smooth_line.vala"
|
||||||
|
_tmp14_ = target_point;
|
||||||
|
#line 55 "../src/smooth_line.vala"
|
||||||
|
live_chart_build_bezier_curve_from_points (&_tmp13_, &_tmp14_, &_tmp15_);
|
||||||
|
#line 55 "../src/smooth_line.vala"
|
||||||
|
curve = _tmp15_;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp16_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp17_ = _tmp16_.c1;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp18_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp19_ = _tmp18_.c1;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp20_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp21_ = _tmp20_.c2;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp22_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp23_ = _tmp22_.c2;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp24_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp25_ = _tmp24_.c3;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp26_ = curve;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
_tmp27_ = _tmp26_.c3;
|
||||||
|
#line 57 "../src/smooth_line.vala"
|
||||||
|
cairo_curve_to (ctx, _tmp17_.x, _tmp19_.y, _tmp21_.x, _tmp23_.y, _tmp25_.x, _tmp27_.y);
|
||||||
|
#line 62 "../src/smooth_line.vala"
|
||||||
|
_tmp28_ = self->priv->_region;
|
||||||
|
#line 62 "../src/smooth_line.vala"
|
||||||
|
if (_tmp28_ != NULL) {
|
||||||
|
#line 364 "smooth_line.c"
|
||||||
|
LiveChartPoint _tmp29_;
|
||||||
|
LiveChartPoint _tmp30_;
|
||||||
|
LiveChartBezierCurve _tmp31_;
|
||||||
|
#line 63 "../src/smooth_line.vala"
|
||||||
|
_tmp29_ = previous_point;
|
||||||
|
#line 63 "../src/smooth_line.vala"
|
||||||
|
_tmp30_ = target_point;
|
||||||
|
#line 63 "../src/smooth_line.vala"
|
||||||
|
_tmp31_ = curve;
|
||||||
|
#line 63 "../src/smooth_line.vala"
|
||||||
|
live_chart_smooth_line_generate_intersections (self, &_tmp29_, &_tmp30_, config, &_tmp31_);
|
||||||
|
#line 376 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 67 "../src/smooth_line.vala"
|
||||||
|
_tmp32_ = cairo_copy_path (ctx);
|
||||||
|
#line 67 "../src/smooth_line.vala"
|
||||||
|
result = _tmp32_;
|
||||||
|
#line 67 "../src/smooth_line.vala"
|
||||||
|
return result;
|
||||||
|
#line 387 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_cairo_reference0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
return self ? cairo_reference (self) : NULL;
|
||||||
|
#line 395 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static Block6Data*
|
||||||
|
block6_data_ref (Block6Data* _data6_)
|
||||||
|
{
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
g_atomic_int_inc (&_data6_->_ref_count_);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
return _data6_;
|
||||||
|
#line 405 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
block6_data_unref (void * _userdata_)
|
||||||
|
{
|
||||||
|
Block6Data* _data6_;
|
||||||
|
_data6_ = (Block6Data*) _userdata_;
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
|
||||||
|
#line 415 "smooth_line.c"
|
||||||
|
LiveChartSmoothLine* self;
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
self = _data6_->self;
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_cairo_destroy0 (_data6_->ctx);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (self);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
g_slice_free (Block6Data, _data6_);
|
||||||
|
#line 425 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
__lambda13_ (Block6Data* _data6_,
|
||||||
|
LiveChartIntersection* intersection)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine* self;
|
||||||
|
gboolean result;
|
||||||
|
#line 72 "../src/smooth_line.vala"
|
||||||
|
self = _data6_->self;
|
||||||
|
#line 73 "../src/smooth_line.vala"
|
||||||
|
if (intersection != NULL) {
|
||||||
|
#line 439 "smooth_line.c"
|
||||||
|
gdouble _tmp0_;
|
||||||
|
gdouble _tmp1_;
|
||||||
|
LiveChartBoundaries _tmp2_;
|
||||||
|
LiveChartBoundary _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
gdouble _tmp5_;
|
||||||
|
gdouble _tmp6_;
|
||||||
|
gdouble _tmp7_;
|
||||||
|
LiveChartBoundaries _tmp8_;
|
||||||
|
LiveChartRegion* _tmp9_;
|
||||||
|
LiveChartRegion* _tmp10_;
|
||||||
|
GdkRGBA _tmp11_ = {0};
|
||||||
|
GdkRGBA _tmp12_;
|
||||||
|
LiveChartRegion* _tmp13_;
|
||||||
|
LiveChartRegion* _tmp14_;
|
||||||
|
GdkRGBA _tmp15_ = {0};
|
||||||
|
GdkRGBA _tmp16_;
|
||||||
|
LiveChartRegion* _tmp17_;
|
||||||
|
LiveChartRegion* _tmp18_;
|
||||||
|
GdkRGBA _tmp19_ = {0};
|
||||||
|
GdkRGBA _tmp20_;
|
||||||
|
LiveChartRegion* _tmp21_;
|
||||||
|
LiveChartRegion* _tmp22_;
|
||||||
|
GdkRGBA _tmp23_ = {0};
|
||||||
|
GdkRGBA _tmp24_;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = live_chart_intersection_get_start_x (intersection);
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = _data6_->boundaries;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp3_ = _tmp2_.y;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp4_ = live_chart_intersection_get_end_x (intersection);
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp5_ = _tmp4_;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp6_ = live_chart_intersection_get_start_x (intersection);
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp7_ = _tmp6_;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
_tmp8_ = _data6_->boundaries;
|
||||||
|
#line 74 "../src/smooth_line.vala"
|
||||||
|
cairo_rectangle (_data6_->ctx, _tmp1_, (gdouble) _tmp3_.min, _tmp5_ - _tmp7_, (gdouble) _tmp8_.height);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp9_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
live_chart_region_get_line_color (_tmp10_, &_tmp11_);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp13_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
live_chart_region_get_line_color (_tmp14_, &_tmp15_);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp16_ = _tmp15_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp17_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp18_ = _tmp17_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
live_chart_region_get_line_color (_tmp18_, &_tmp19_);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp20_ = _tmp19_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp21_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp22_ = _tmp21_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
live_chart_region_get_line_color (_tmp22_, &_tmp23_);
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
_tmp24_ = _tmp23_;
|
||||||
|
#line 75 "../src/smooth_line.vala"
|
||||||
|
cairo_set_source_rgba (_data6_->ctx, _tmp12_.red, _tmp16_.green, _tmp20_.blue, _tmp24_.alpha);
|
||||||
|
#line 519 "smooth_line.c"
|
||||||
|
}
|
||||||
|
#line 77 "../src/smooth_line.vala"
|
||||||
|
result = TRUE;
|
||||||
|
#line 77 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (intersection);
|
||||||
|
#line 77 "../src/smooth_line.vala"
|
||||||
|
return result;
|
||||||
|
#line 527 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
___lambda13__gee_forall_func (gpointer g,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
result = __lambda13_ (self, (LiveChartIntersection*) g);
|
||||||
|
#line 72 "../src/smooth_line.vala"
|
||||||
|
return result;
|
||||||
|
#line 538 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_smooth_line_draw_regions_on_line (LiveChartSmoothLine* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
Block6Data* _data6_;
|
||||||
|
cairo_t* _tmp0_;
|
||||||
|
LiveChartBoundaries _tmp1_ = {0};
|
||||||
|
LiveChartIntersections* _tmp2_;
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_data6_ = g_slice_new0 (Block6Data);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_data6_->_ref_count_ = 1;
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_data6_->self = g_object_ref (self);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = _cairo_reference0 (ctx);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_cairo_destroy0 (_data6_->ctx);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_data6_->ctx = _tmp0_;
|
||||||
|
#line 71 "../src/smooth_line.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp1_);
|
||||||
|
#line 71 "../src/smooth_line.vala"
|
||||||
|
_data6_->boundaries = _tmp1_;
|
||||||
|
#line 72 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = self->intersections;
|
||||||
|
#line 72 "../src/smooth_line.vala"
|
||||||
|
live_chart_intersections_foreach (_tmp2_, ___lambda13__gee_forall_func, _data6_);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
block6_data_unref (_data6_);
|
||||||
|
#line 70 "../src/smooth_line.vala"
|
||||||
|
_data6_ = NULL;
|
||||||
|
#line 580 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_generate_intersections (LiveChartSmoothLine* self,
|
||||||
|
LiveChartPoint* previous,
|
||||||
|
LiveChartPoint* target,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBezierCurve* curve)
|
||||||
|
{
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
LiveChartBezierIntersector* _tmp1_;
|
||||||
|
LiveChartBezierIntersector* _tmp2_;
|
||||||
|
LiveChartIntersections* _tmp3_;
|
||||||
|
LiveChartPoint _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_;
|
||||||
|
LiveChartBezierCurve _tmp6_;
|
||||||
|
#line 81 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 81 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (previous != NULL);
|
||||||
|
#line 81 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (target != NULL);
|
||||||
|
#line 81 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 81 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (curve != NULL);
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = self->priv->_region;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp1_ = live_chart_bezier_intersector_new (_tmp0_, config);
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp3_ = self->intersections;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp4_ = *previous;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp5_ = *target;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_tmp6_ = *curve;
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
live_chart_intersector_intersect ((LiveChartIntersector*) _tmp2_, _tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
|
||||||
|
#line 82 "../src/smooth_line.vala"
|
||||||
|
_live_chart_bezier_intersector_unref0 (_tmp2_);
|
||||||
|
#line 625 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_update_bounding_box (LiveChartSmoothLine* self,
|
||||||
|
LiveChartPoints* points,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
LiveChartBounds* _tmp2_;
|
||||||
|
gdouble _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
LiveChartPoint _tmp6_ = {0};
|
||||||
|
LiveChartBounds* _tmp7_;
|
||||||
|
LiveChartBounds* _tmp8_;
|
||||||
|
gdouble _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
LiveChartBounds* _tmp11_;
|
||||||
|
LiveChartBounds* _tmp12_;
|
||||||
|
gdouble _tmp13_;
|
||||||
|
gdouble _tmp14_;
|
||||||
|
LiveChartBoundingBox _tmp15_ = {0};
|
||||||
|
#line 85 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 85 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (points != NULL);
|
||||||
|
#line 85 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp0_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp1_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp3_ = live_chart_bounds_get_lower (_tmp2_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_last (points, &_tmp5_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
live_chart_points_first (points, &_tmp6_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp7_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp9_ = live_chart_bounds_get_upper (_tmp8_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp11_ = live_chart_points_get_bounds (points);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp13_ = live_chart_bounds_get_lower (_tmp12_);
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
memset (&_tmp15_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp15_.x = _tmp0_.x;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp15_.y = _tmp4_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp15_.width = _tmp5_.x - _tmp6_.x;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
_tmp15_.height = _tmp10_ - _tmp14_;
|
||||||
|
#line 86 "../src/smooth_line.vala"
|
||||||
|
((LiveChartSerieRenderer*) self)->bounding_box = _tmp15_;
|
||||||
|
#line 697 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartRegion*
|
||||||
|
live_chart_smooth_line_get_region (LiveChartSmoothLine* self)
|
||||||
|
{
|
||||||
|
LiveChartRegion* result;
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = self->priv->_region;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
return result;
|
||||||
|
#line 713 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_region_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
return self ? live_chart_region_ref (self) : NULL;
|
||||||
|
#line 721 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_smooth_line_set_region (LiveChartSmoothLine* self,
|
||||||
|
LiveChartRegion* value)
|
||||||
|
{
|
||||||
|
LiveChartRegion* old_value;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
old_value = live_chart_smooth_line_get_region (self);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 735 "smooth_line.c"
|
||||||
|
LiveChartRegion* _tmp0_;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = _live_chart_region_ref0 (value);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->_region);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
self->priv->_region = _tmp0_;
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_smooth_line_properties[LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY]);
|
||||||
|
#line 745 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_class_init (LiveChartSmoothLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
live_chart_smooth_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartSmoothLine_private_offset);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_smooth_line_real_draw;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_smooth_line_get_property;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_smooth_line_set_property;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_smooth_line_finalize;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY, live_chart_smooth_line_properties[LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY] = live_chart_param_spec_region ("region", "region", "region", LIVE_CHART_TYPE_REGION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 767 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_instance_init (LiveChartSmoothLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartIntersections* _tmp0_;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
self->priv = live_chart_smooth_line_get_instance_private (self);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
self->priv->_region = NULL;
|
||||||
|
#line 7 "../src/smooth_line.vala"
|
||||||
|
_tmp0_ = live_chart_intersections_new ();
|
||||||
|
#line 7 "../src/smooth_line.vala"
|
||||||
|
self->intersections = _tmp0_;
|
||||||
|
#line 783 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine * self;
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_SMOOTH_LINE, LiveChartSmoothLine);
|
||||||
|
#line 6 "../src/smooth_line.vala"
|
||||||
|
_live_chart_region_unref0 (self->priv->_region);
|
||||||
|
#line 7 "../src/smooth_line.vala"
|
||||||
|
_g_object_unref0 (self->intersections);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_smooth_line_parent_class)->finalize (obj);
|
||||||
|
#line 798 "smooth_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_smooth_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartSmoothLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_smooth_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartSmoothLine), 0, (GInstanceInitFunc) live_chart_smooth_line_instance_init, NULL };
|
||||||
|
GType live_chart_smooth_line_type_id;
|
||||||
|
live_chart_smooth_line_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartSmoothLine", &g_define_type_info, 0);
|
||||||
|
LiveChartSmoothLine_private_offset = g_type_add_instance_private (live_chart_smooth_line_type_id, sizeof (LiveChartSmoothLinePrivate));
|
||||||
|
return live_chart_smooth_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_smooth_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_smooth_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_smooth_line_type_id__once)) {
|
||||||
|
GType live_chart_smooth_line_type_id;
|
||||||
|
live_chart_smooth_line_type_id = live_chart_smooth_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_smooth_line_type_id__once, live_chart_smooth_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_smooth_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_smooth_line_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SMOOTH_LINE, LiveChartSmoothLine);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
case LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY:
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
live_chart_value_set_region (value, live_chart_smooth_line_get_region (self));
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
break;
|
||||||
|
#line 839 "smooth_line.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
break;
|
||||||
|
#line 845 "smooth_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_smooth_line_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLine * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SMOOTH_LINE, LiveChartSmoothLine);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
case LIVE_CHART_SMOOTH_LINE_REGION_PROPERTY:
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
live_chart_smooth_line_set_region (self, live_chart_value_get_region (value));
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
break;
|
||||||
|
#line 865 "smooth_line.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/smooth_line.vala"
|
||||||
|
break;
|
||||||
|
#line 871 "smooth_line.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,564 @@
|
||||||
|
/* smooth_line_area.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from smooth_line_area.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_SMOOTH_LINE_AREA_0_PROPERTY,
|
||||||
|
LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY,
|
||||||
|
LIVE_CHART_SMOOTH_LINE_AREA_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_smooth_line_area_properties[LIVE_CHART_SMOOTH_LINE_AREA_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _cairo_path_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_path_destroy (var), NULL)))
|
||||||
|
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
|
||||||
|
typedef struct _Block5Data Block5Data;
|
||||||
|
|
||||||
|
struct _LiveChartSmoothLineAreaPrivate {
|
||||||
|
gdouble _area_alpha;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Block5Data {
|
||||||
|
int _ref_count_;
|
||||||
|
LiveChartSmoothLineArea* self;
|
||||||
|
LiveChartBoundaries boundaries;
|
||||||
|
cairo_t* ctx;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartSmoothLineArea_private_offset;
|
||||||
|
static gpointer live_chart_smooth_line_area_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_smooth_line_area_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static Block5Data* block5_data_ref (Block5Data* _data5_);
|
||||||
|
static void block5_data_unref (void * _userdata_);
|
||||||
|
static gboolean __lambda14_ (Block5Data* _data5_,
|
||||||
|
LiveChartIntersection* intersection);
|
||||||
|
static gboolean ___lambda14__gee_forall_func (gpointer g,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_smooth_line_area_finalize (GObject * obj);
|
||||||
|
static GType live_chart_smooth_line_area_get_type_once (void);
|
||||||
|
static void _vala_live_chart_smooth_line_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_smooth_line_area_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_smooth_line_area_get_instance_private (LiveChartSmoothLineArea* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartSmoothLineArea_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSmoothLineArea*
|
||||||
|
live_chart_smooth_line_area_construct (GType object_type,
|
||||||
|
LiveChartValues* values)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea * self = NULL;
|
||||||
|
#line 8 "../src/smooth_line_area.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 9 "../src/smooth_line_area.vala"
|
||||||
|
self = (LiveChartSmoothLineArea*) live_chart_smooth_line_construct (object_type, values);
|
||||||
|
#line 8 "../src/smooth_line_area.vala"
|
||||||
|
return self;
|
||||||
|
#line 77 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartSmoothLineArea*
|
||||||
|
live_chart_smooth_line_area_new (LiveChartValues* values)
|
||||||
|
{
|
||||||
|
#line 8 "../src/smooth_line_area.vala"
|
||||||
|
return live_chart_smooth_line_area_construct (LIVE_CHART_TYPE_SMOOTH_LINE_AREA, values);
|
||||||
|
#line 85 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_area_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 11 "../src/smooth_line_area.vala"
|
||||||
|
self = (LiveChartSmoothLineArea*) base;
|
||||||
|
#line 11 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 11 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 12 "../src/smooth_line_area.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 12 "../src/smooth_line_area.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 12 "../src/smooth_line_area.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 108 "smooth_line_area.c"
|
||||||
|
LiveChartPoints* points = NULL;
|
||||||
|
LiveChartValues* _tmp2_;
|
||||||
|
LiveChartPoints* _tmp3_;
|
||||||
|
LiveChartPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 13 "../src/smooth_line_area.vala"
|
||||||
|
_tmp2_ = ((LiveChartSerieRenderer*) self)->values;
|
||||||
|
#line 13 "../src/smooth_line_area.vala"
|
||||||
|
_tmp3_ = live_chart_points_create (_tmp2_, config);
|
||||||
|
#line 13 "../src/smooth_line_area.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
_tmp5_ = live_chart_points_get_size (_tmp4_);
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 129 "smooth_line_area.c"
|
||||||
|
cairo_path_t* path = NULL;
|
||||||
|
LiveChartPoints* _tmp7_;
|
||||||
|
cairo_path_t* _tmp8_;
|
||||||
|
LiveChartArea* area = NULL;
|
||||||
|
LiveChartPoints* _tmp9_;
|
||||||
|
GdkRGBA _tmp10_ = {0};
|
||||||
|
GdkRGBA _tmp11_;
|
||||||
|
gdouble _tmp12_;
|
||||||
|
LiveChartArea* _tmp13_;
|
||||||
|
LiveChartArea* _tmp14_;
|
||||||
|
cairo_path_t* _tmp15_;
|
||||||
|
LiveChartArea* _tmp16_;
|
||||||
|
#line 16 "../src/smooth_line_area.vala"
|
||||||
|
cairo_push_group (ctx);
|
||||||
|
#line 17 "../src/smooth_line_area.vala"
|
||||||
|
_tmp7_ = points;
|
||||||
|
#line 17 "../src/smooth_line_area.vala"
|
||||||
|
_tmp8_ = live_chart_smooth_line_draw_smooth_line ((LiveChartSmoothLine*) self, _tmp7_, ctx, config);
|
||||||
|
#line 17 "../src/smooth_line_area.vala"
|
||||||
|
path = _tmp8_;
|
||||||
|
#line 18 "../src/smooth_line_area.vala"
|
||||||
|
cairo_stroke_preserve (ctx);
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
_tmp9_ = points;
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_serie_renderer_get_main_color ((LiveChartSerieRenderer*) self, &_tmp10_);
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
_tmp11_ = _tmp10_;
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
_tmp12_ = self->priv->_area_alpha;
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
_tmp13_ = live_chart_area_new (_tmp9_, &_tmp11_, _tmp12_);
|
||||||
|
#line 20 "../src/smooth_line_area.vala"
|
||||||
|
area = _tmp13_;
|
||||||
|
#line 21 "../src/smooth_line_area.vala"
|
||||||
|
_tmp14_ = area;
|
||||||
|
#line 21 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_drawable_draw ((LiveChartDrawable*) _tmp14_, ctx, config);
|
||||||
|
#line 22 "../src/smooth_line_area.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 24 "../src/smooth_line_area.vala"
|
||||||
|
cairo_set_operator (ctx, CAIRO_OPERATOR_ATOP);
|
||||||
|
#line 25 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_smooth_line_draw_regions_on_line ((LiveChartSmoothLine*) self, ctx, config);
|
||||||
|
#line 26 "../src/smooth_line_area.vala"
|
||||||
|
cairo_fill (ctx);
|
||||||
|
#line 27 "../src/smooth_line_area.vala"
|
||||||
|
cairo_pop_group_to_source (ctx);
|
||||||
|
#line 29 "../src/smooth_line_area.vala"
|
||||||
|
cairo_save (ctx);
|
||||||
|
#line 30 "../src/smooth_line_area.vala"
|
||||||
|
_tmp15_ = path;
|
||||||
|
#line 30 "../src/smooth_line_area.vala"
|
||||||
|
cairo_append_path (ctx, _tmp15_);
|
||||||
|
#line 31 "../src/smooth_line_area.vala"
|
||||||
|
_tmp16_ = area;
|
||||||
|
#line 31 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_drawable_draw ((LiveChartDrawable*) _tmp16_, ctx, config);
|
||||||
|
#line 32 "../src/smooth_line_area.vala"
|
||||||
|
cairo_clip (ctx);
|
||||||
|
#line 34 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_smooth_line_area_draw_regions_on_area (self, ctx, config);
|
||||||
|
#line 35 "../src/smooth_line_area.vala"
|
||||||
|
cairo_restore (ctx);
|
||||||
|
#line 36 "../src/smooth_line_area.vala"
|
||||||
|
cairo_paint (ctx);
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
_g_object_unref0 (area);
|
||||||
|
#line 14 "../src/smooth_line_area.vala"
|
||||||
|
_cairo_path_destroy0 (path);
|
||||||
|
#line 200 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
#line 12 "../src/smooth_line_area.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 204 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_cairo_reference0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
return self ? cairo_reference (self) : NULL;
|
||||||
|
#line 213 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static Block5Data*
|
||||||
|
block5_data_ref (Block5Data* _data5_)
|
||||||
|
{
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
g_atomic_int_inc (&_data5_->_ref_count_);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
return _data5_;
|
||||||
|
#line 223 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
block5_data_unref (void * _userdata_)
|
||||||
|
{
|
||||||
|
Block5Data* _data5_;
|
||||||
|
_data5_ = (Block5Data*) _userdata_;
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
|
||||||
|
#line 233 "smooth_line_area.c"
|
||||||
|
LiveChartSmoothLineArea* self;
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
self = _data5_->self;
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_cairo_destroy0 (_data5_->ctx);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_g_object_unref0 (self);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
g_slice_free (Block5Data, _data5_);
|
||||||
|
#line 243 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
__lambda14_ (Block5Data* _data5_,
|
||||||
|
LiveChartIntersection* intersection)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea* self;
|
||||||
|
gboolean result;
|
||||||
|
#line 44 "../src/smooth_line_area.vala"
|
||||||
|
self = _data5_->self;
|
||||||
|
#line 45 "../src/smooth_line_area.vala"
|
||||||
|
if (intersection != NULL) {
|
||||||
|
#line 257 "smooth_line_area.c"
|
||||||
|
gdouble _tmp0_;
|
||||||
|
gdouble _tmp1_;
|
||||||
|
LiveChartBoundaries _tmp2_;
|
||||||
|
LiveChartBoundary _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
gdouble _tmp5_;
|
||||||
|
gdouble _tmp6_;
|
||||||
|
gdouble _tmp7_;
|
||||||
|
LiveChartBoundaries _tmp8_;
|
||||||
|
LiveChartRegion* _tmp9_;
|
||||||
|
LiveChartRegion* _tmp10_;
|
||||||
|
GdkRGBA _tmp11_ = {0};
|
||||||
|
GdkRGBA _tmp12_;
|
||||||
|
LiveChartRegion* _tmp13_;
|
||||||
|
LiveChartRegion* _tmp14_;
|
||||||
|
GdkRGBA _tmp15_ = {0};
|
||||||
|
GdkRGBA _tmp16_;
|
||||||
|
LiveChartRegion* _tmp17_;
|
||||||
|
LiveChartRegion* _tmp18_;
|
||||||
|
GdkRGBA _tmp19_ = {0};
|
||||||
|
GdkRGBA _tmp20_;
|
||||||
|
LiveChartRegion* _tmp21_;
|
||||||
|
LiveChartRegion* _tmp22_;
|
||||||
|
GdkRGBA _tmp23_ = {0};
|
||||||
|
GdkRGBA _tmp24_;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp0_ = live_chart_intersection_get_start_x (intersection);
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp2_ = _data5_->boundaries;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp3_ = _tmp2_.y;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp4_ = live_chart_intersection_get_end_x (intersection);
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp5_ = _tmp4_;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp6_ = live_chart_intersection_get_start_x (intersection);
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp7_ = _tmp6_;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
_tmp8_ = _data5_->boundaries;
|
||||||
|
#line 46 "../src/smooth_line_area.vala"
|
||||||
|
cairo_rectangle (_data5_->ctx, _tmp1_, (gdouble) _tmp3_.min, _tmp5_ - _tmp7_, (gdouble) _tmp8_.height);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp9_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_region_get_area_color (_tmp10_, &_tmp11_);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp13_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_region_get_area_color (_tmp14_, &_tmp15_);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp16_ = _tmp15_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp17_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp18_ = _tmp17_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_region_get_area_color (_tmp18_, &_tmp19_);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp20_ = _tmp19_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp21_ = live_chart_intersection_get_region (intersection);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp22_ = _tmp21_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_region_get_area_color (_tmp22_, &_tmp23_);
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
_tmp24_ = _tmp23_;
|
||||||
|
#line 47 "../src/smooth_line_area.vala"
|
||||||
|
cairo_set_source_rgba (_data5_->ctx, _tmp12_.red, _tmp16_.green, _tmp20_.blue, _tmp24_.alpha);
|
||||||
|
#line 48 "../src/smooth_line_area.vala"
|
||||||
|
cairo_fill (_data5_->ctx);
|
||||||
|
#line 339 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
#line 50 "../src/smooth_line_area.vala"
|
||||||
|
result = TRUE;
|
||||||
|
#line 50 "../src/smooth_line_area.vala"
|
||||||
|
_g_object_unref0 (intersection);
|
||||||
|
#line 50 "../src/smooth_line_area.vala"
|
||||||
|
return result;
|
||||||
|
#line 347 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
___lambda14__gee_forall_func (gpointer g,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
result = __lambda14_ (self, (LiveChartIntersection*) g);
|
||||||
|
#line 44 "../src/smooth_line_area.vala"
|
||||||
|
return result;
|
||||||
|
#line 358 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_smooth_line_area_draw_regions_on_area (LiveChartSmoothLineArea* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
Block5Data* _data5_;
|
||||||
|
cairo_t* _tmp0_;
|
||||||
|
LiveChartBoundaries _tmp1_ = {0};
|
||||||
|
LiveChartIntersections* _tmp2_;
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_data5_ = g_slice_new0 (Block5Data);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_data5_->_ref_count_ = 1;
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_data5_->self = g_object_ref (self);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_tmp0_ = _cairo_reference0 (ctx);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_cairo_destroy0 (_data5_->ctx);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_data5_->ctx = _tmp0_;
|
||||||
|
#line 43 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp1_);
|
||||||
|
#line 43 "../src/smooth_line_area.vala"
|
||||||
|
_data5_->boundaries = _tmp1_;
|
||||||
|
#line 44 "../src/smooth_line_area.vala"
|
||||||
|
_tmp2_ = ((LiveChartSmoothLine*) self)->intersections;
|
||||||
|
#line 44 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_intersections_foreach (_tmp2_, ___lambda14__gee_forall_func, _data5_);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
block5_data_unref (_data5_);
|
||||||
|
#line 42 "../src/smooth_line_area.vala"
|
||||||
|
_data5_ = NULL;
|
||||||
|
#line 400 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_smooth_line_area_get_area_alpha (LiveChartSmoothLineArea* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
result = self->priv->_area_alpha;
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
return result;
|
||||||
|
#line 413 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_smooth_line_area_set_area_alpha (LiveChartSmoothLineArea* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
old_value = live_chart_smooth_line_area_get_area_alpha (self);
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
self->priv->_area_alpha = value;
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_smooth_line_area_properties[LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY]);
|
||||||
|
#line 431 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_area_class_init (LiveChartSmoothLineAreaClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_smooth_line_area_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartSmoothLineArea_private_offset);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_smooth_line_area_real_draw;
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_smooth_line_area_get_property;
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_smooth_line_area_set_property;
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_smooth_line_area_finalize;
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY, live_chart_smooth_line_area_properties[LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY] = g_param_spec_double ("area-alpha", "area-alpha", "area-alpha", -G_MAXDOUBLE, G_MAXDOUBLE, 0.1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 453 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_area_instance_init (LiveChartSmoothLineArea * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
self->priv = live_chart_smooth_line_area_get_instance_private (self);
|
||||||
|
#line 6 "../src/smooth_line_area.vala"
|
||||||
|
self->priv->_area_alpha = 0.1;
|
||||||
|
#line 464 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_smooth_line_area_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea * self;
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_SMOOTH_LINE_AREA, LiveChartSmoothLineArea);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_smooth_line_area_parent_class)->finalize (obj);
|
||||||
|
#line 475 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_smooth_line_area_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartSmoothLineAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_smooth_line_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartSmoothLineArea), 0, (GInstanceInitFunc) live_chart_smooth_line_area_instance_init, NULL };
|
||||||
|
GType live_chart_smooth_line_area_type_id;
|
||||||
|
live_chart_smooth_line_area_type_id = g_type_register_static (LIVE_CHART_TYPE_SMOOTH_LINE, "LiveChartSmoothLineArea", &g_define_type_info, 0);
|
||||||
|
LiveChartSmoothLineArea_private_offset = g_type_add_instance_private (live_chart_smooth_line_area_type_id, sizeof (LiveChartSmoothLineAreaPrivate));
|
||||||
|
return live_chart_smooth_line_area_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_smooth_line_area_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_smooth_line_area_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_smooth_line_area_type_id__once)) {
|
||||||
|
GType live_chart_smooth_line_area_type_id;
|
||||||
|
live_chart_smooth_line_area_type_id = live_chart_smooth_line_area_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_smooth_line_area_type_id__once, live_chart_smooth_line_area_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_smooth_line_area_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_smooth_line_area_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SMOOTH_LINE_AREA, LiveChartSmoothLineArea);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
case LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY:
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
g_value_set_double (value, live_chart_smooth_line_area_get_area_alpha (self));
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 516 "smooth_line_area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 522 "smooth_line_area.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_smooth_line_area_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartSmoothLineArea * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_SMOOTH_LINE_AREA, LiveChartSmoothLineArea);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
case LIVE_CHART_SMOOTH_LINE_AREA_AREA_ALPHA_PROPERTY:
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
live_chart_smooth_line_area_set_area_alpha (self, g_value_get_double (value));
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 542 "smooth_line_area.c"
|
||||||
|
default:
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 4 "../src/smooth_line_area.vala"
|
||||||
|
break;
|
||||||
|
#line 548 "smooth_line_area.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,672 @@
|
||||||
|
/* static_chart.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_chart.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_CHART_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_CHART_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _live_chart_config_unref0(var) ((var == NULL) ? NULL : (var = (live_chart_config_unref (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticChartPrivate {
|
||||||
|
LiveChartStaticStaticGrid* _grid;
|
||||||
|
LiveChartBackground* _background;
|
||||||
|
LiveChartLegend* _legend;
|
||||||
|
GeeArrayList* categories;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticChart_private_offset;
|
||||||
|
static gpointer live_chart_static_static_chart_parent_class = NULL;
|
||||||
|
|
||||||
|
static void __lambda16_ (LiveChartStaticStaticChart* self,
|
||||||
|
GtkAllocation* allocation);
|
||||||
|
static void ___lambda16__gtk_widget_size_allocate (GtkWidget* _sender,
|
||||||
|
GtkAllocation* allocation,
|
||||||
|
gpointer self);
|
||||||
|
static gboolean live_chart_static_static_chart_render (LiveChartStaticStaticChart* self,
|
||||||
|
GtkWidget* _,
|
||||||
|
cairo_t* ctx);
|
||||||
|
static gboolean _live_chart_static_static_chart_render_gtk_widget_draw (GtkWidget* _sender,
|
||||||
|
cairo_t* cr,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_static_static_chart_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_chart_get_type_once (void);
|
||||||
|
static void _vala_live_chart_static_static_chart_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_static_static_chart_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_chart_get_instance_private (LiveChartStaticStaticChart* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticChart_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_live_chart_config_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 17 "../src/static/static_chart.vala"
|
||||||
|
return self ? live_chart_config_ref (self) : NULL;
|
||||||
|
#line 72 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
__lambda16_ (LiveChartStaticStaticChart* self,
|
||||||
|
GtkAllocation* allocation)
|
||||||
|
{
|
||||||
|
LiveChartConfig* _tmp0_;
|
||||||
|
GtkAllocation _tmp1_;
|
||||||
|
LiveChartConfig* _tmp2_;
|
||||||
|
GtkAllocation _tmp3_;
|
||||||
|
#line 18 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (allocation != NULL);
|
||||||
|
#line 19 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->config;
|
||||||
|
#line 19 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = *allocation;
|
||||||
|
#line 19 "../src/static/static_chart.vala"
|
||||||
|
live_chart_config_set_height (_tmp0_, _tmp1_.height);
|
||||||
|
#line 20 "../src/static/static_chart.vala"
|
||||||
|
_tmp2_ = self->config;
|
||||||
|
#line 20 "../src/static/static_chart.vala"
|
||||||
|
_tmp3_ = *allocation;
|
||||||
|
#line 20 "../src/static/static_chart.vala"
|
||||||
|
live_chart_config_set_width (_tmp2_, _tmp3_.width);
|
||||||
|
#line 97 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
___lambda16__gtk_widget_size_allocate (GtkWidget* _sender,
|
||||||
|
GtkAllocation* allocation,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
#line 18 "../src/static/static_chart.vala"
|
||||||
|
__lambda16_ ((LiveChartStaticStaticChart*) self, allocation);
|
||||||
|
#line 107 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_live_chart_static_static_chart_render_gtk_widget_draw (GtkWidget* _sender,
|
||||||
|
cairo_t* cr,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
result = live_chart_static_static_chart_render ((LiveChartStaticStaticChart*) self, _sender, cr);
|
||||||
|
#line 23 "../src/static/static_chart.vala"
|
||||||
|
return result;
|
||||||
|
#line 119 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticChart*
|
||||||
|
live_chart_static_static_chart_construct (GType object_type,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticChart * self = NULL;
|
||||||
|
LiveChartConfig* _tmp0_;
|
||||||
|
LiveChartStaticStaticSeries* _tmp1_;
|
||||||
|
#line 16 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 16 "../src/static/static_chart.vala"
|
||||||
|
self = (LiveChartStaticStaticChart*) g_object_new (object_type, NULL);
|
||||||
|
#line 17 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = _live_chart_config_ref0 (config);
|
||||||
|
#line 17 "../src/static/static_chart.vala"
|
||||||
|
_live_chart_config_unref0 (self->config);
|
||||||
|
#line 17 "../src/static/static_chart.vala"
|
||||||
|
self->config = _tmp0_;
|
||||||
|
#line 18 "../src/static/static_chart.vala"
|
||||||
|
g_signal_connect_object ((GtkWidget*) self, "size-allocate", (GCallback) ___lambda16__gtk_widget_size_allocate, self, 0);
|
||||||
|
#line 23 "../src/static/static_chart.vala"
|
||||||
|
g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) _live_chart_static_static_chart_render_gtk_widget_draw, self, 0);
|
||||||
|
#line 25 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_series_new (self);
|
||||||
|
#line 25 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->series);
|
||||||
|
#line 25 "../src/static/static_chart.vala"
|
||||||
|
self->series = _tmp1_;
|
||||||
|
#line 16 "../src/static/static_chart.vala"
|
||||||
|
return self;
|
||||||
|
#line 151 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticChart*
|
||||||
|
live_chart_static_static_chart_new (LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
#line 16 "../src/static/static_chart.vala"
|
||||||
|
return live_chart_static_static_chart_construct (LIVE_CHART_STATIC_TYPE_STATIC_CHART, config);
|
||||||
|
#line 159 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 29 "../src/static/static_chart.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 167 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_chart_set_categories (LiveChartStaticStaticChart* self,
|
||||||
|
GeeArrayList* categories)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
LiveChartConfig* _tmp1_;
|
||||||
|
GeeArrayList* _tmp2_;
|
||||||
|
#line 28 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 28 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (categories != NULL);
|
||||||
|
#line 29 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (categories);
|
||||||
|
#line 29 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->categories);
|
||||||
|
#line 29 "../src/static/static_chart.vala"
|
||||||
|
self->priv->categories = _tmp0_;
|
||||||
|
#line 30 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = self->config;
|
||||||
|
#line 30 "../src/static/static_chart.vala"
|
||||||
|
_tmp2_ = _g_object_ref0 (categories);
|
||||||
|
#line 30 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (_tmp1_->categories);
|
||||||
|
#line 30 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_->categories = _tmp2_;
|
||||||
|
#line 195 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_chart_add_serie (LiveChartStaticStaticChart* self,
|
||||||
|
LiveChartStaticStaticSerie* serie)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSeries* _tmp0_;
|
||||||
|
LiveChartStaticStaticSerie* _tmp1_;
|
||||||
|
LiveChartStaticStaticSerie* _tmp2_;
|
||||||
|
#line 33 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 33 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (serie != NULL);
|
||||||
|
#line 34 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->series;
|
||||||
|
#line 34 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_series_register (_tmp0_, serie);
|
||||||
|
#line 34 "../src/static/static_chart.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 34 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 217 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_static_static_chart_render (LiveChartStaticStaticChart* self,
|
||||||
|
GtkWidget* _,
|
||||||
|
cairo_t* ctx)
|
||||||
|
{
|
||||||
|
LiveChartConfig* _tmp0_;
|
||||||
|
LiveChartLegend* _tmp1_;
|
||||||
|
LiveChartBackground* _tmp2_;
|
||||||
|
LiveChartConfig* _tmp3_;
|
||||||
|
LiveChartStaticStaticGrid* _tmp4_;
|
||||||
|
LiveChartConfig* _tmp5_;
|
||||||
|
LiveChartLegend* _tmp6_;
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartConfig* _tmp9_;
|
||||||
|
LiveChartBoundaries _tmp10_ = {0};
|
||||||
|
gboolean result;
|
||||||
|
#line 38 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 38 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (_ != NULL, FALSE);
|
||||||
|
#line 38 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (ctx != NULL, FALSE);
|
||||||
|
#line 40 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->config;
|
||||||
|
#line 40 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = self->priv->_legend;
|
||||||
|
#line 40 "../src/static/static_chart.vala"
|
||||||
|
live_chart_config_configure (_tmp0_, ctx, _tmp1_);
|
||||||
|
#line 42 "../src/static/static_chart.vala"
|
||||||
|
_tmp2_ = self->priv->_background;
|
||||||
|
#line 42 "../src/static/static_chart.vala"
|
||||||
|
_tmp3_ = self->config;
|
||||||
|
#line 42 "../src/static/static_chart.vala"
|
||||||
|
live_chart_drawable_draw ((LiveChartDrawable*) _tmp2_, ctx, _tmp3_);
|
||||||
|
#line 43 "../src/static/static_chart.vala"
|
||||||
|
_tmp4_ = self->priv->_grid;
|
||||||
|
#line 43 "../src/static/static_chart.vala"
|
||||||
|
_tmp5_ = self->config;
|
||||||
|
#line 43 "../src/static/static_chart.vala"
|
||||||
|
live_chart_drawable_draw ((LiveChartDrawable*) _tmp4_, ctx, _tmp5_);
|
||||||
|
#line 44 "../src/static/static_chart.vala"
|
||||||
|
_tmp6_ = self->priv->_legend;
|
||||||
|
#line 44 "../src/static/static_chart.vala"
|
||||||
|
if (_tmp6_ != NULL) {
|
||||||
|
#line 264 "static_chart.c"
|
||||||
|
LiveChartLegend* _tmp7_;
|
||||||
|
LiveChartConfig* _tmp8_;
|
||||||
|
#line 44 "../src/static/static_chart.vala"
|
||||||
|
_tmp7_ = self->priv->_legend;
|
||||||
|
#line 44 "../src/static/static_chart.vala"
|
||||||
|
_tmp8_ = self->config;
|
||||||
|
#line 44 "../src/static/static_chart.vala"
|
||||||
|
live_chart_legend_draw (_tmp7_, ctx, _tmp8_);
|
||||||
|
#line 273 "static_chart.c"
|
||||||
|
}
|
||||||
|
#line 46 "../src/static/static_chart.vala"
|
||||||
|
_tmp9_ = self->config;
|
||||||
|
#line 46 "../src/static/static_chart.vala"
|
||||||
|
live_chart_config_boundaries (_tmp9_, &_tmp10_);
|
||||||
|
#line 46 "../src/static/static_chart.vala"
|
||||||
|
boundaries = _tmp10_;
|
||||||
|
#line 281 "static_chart.c"
|
||||||
|
{
|
||||||
|
GeeIterator* _serie_it = NULL;
|
||||||
|
LiveChartStaticStaticSeries* _tmp11_;
|
||||||
|
GeeIterator* _tmp12_;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_tmp11_ = self->series;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_tmp12_ = live_chart_static_static_series_iterator (_tmp11_);
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_serie_it = _tmp12_;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 294 "static_chart.c"
|
||||||
|
GeeIterator* _tmp13_;
|
||||||
|
LiveChartDrawable* serie = NULL;
|
||||||
|
GeeIterator* _tmp14_;
|
||||||
|
gpointer _tmp15_;
|
||||||
|
LiveChartBoundaries _tmp16_;
|
||||||
|
LiveChartBoundary _tmp17_;
|
||||||
|
LiveChartBoundaries _tmp18_;
|
||||||
|
LiveChartBoundary _tmp19_;
|
||||||
|
LiveChartBoundaries _tmp20_;
|
||||||
|
LiveChartBoundary _tmp21_;
|
||||||
|
LiveChartBoundaries _tmp22_;
|
||||||
|
LiveChartBoundary _tmp23_;
|
||||||
|
LiveChartDrawable* _tmp24_;
|
||||||
|
LiveChartConfig* _tmp25_;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_tmp13_ = _serie_it;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
if (!gee_iterator_next (_tmp13_)) {
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 315 "static_chart.c"
|
||||||
|
}
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_tmp14_ = _serie_it;
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_tmp15_ = gee_iterator_get (_tmp14_);
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
serie = (LiveChartDrawable*) ((LiveChartStaticStaticSerie*) _tmp15_);
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp16_ = boundaries;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp17_ = _tmp16_.x;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp18_ = boundaries;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp19_ = _tmp18_.y;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp20_ = boundaries;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp21_ = _tmp20_.x;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp22_ = boundaries;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
_tmp23_ = _tmp22_.y;
|
||||||
|
#line 48 "../src/static/static_chart.vala"
|
||||||
|
cairo_rectangle (ctx, (gdouble) _tmp17_.min, (gdouble) _tmp19_.min, (gdouble) _tmp21_.max, (gdouble) _tmp23_.max);
|
||||||
|
#line 49 "../src/static/static_chart.vala"
|
||||||
|
cairo_clip (ctx);
|
||||||
|
#line 50 "../src/static/static_chart.vala"
|
||||||
|
_tmp24_ = serie;
|
||||||
|
#line 50 "../src/static/static_chart.vala"
|
||||||
|
_tmp25_ = self->config;
|
||||||
|
#line 50 "../src/static/static_chart.vala"
|
||||||
|
live_chart_drawable_draw (_tmp24_, ctx, _tmp25_);
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (serie);
|
||||||
|
#line 351 "static_chart.c"
|
||||||
|
}
|
||||||
|
#line 47 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (_serie_it);
|
||||||
|
#line 355 "static_chart.c"
|
||||||
|
}
|
||||||
|
#line 53 "../src/static/static_chart.vala"
|
||||||
|
result = TRUE;
|
||||||
|
#line 53 "../src/static/static_chart.vala"
|
||||||
|
return result;
|
||||||
|
#line 361 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticGrid*
|
||||||
|
live_chart_static_static_chart_get_grid (LiveChartStaticStaticChart* self)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticGrid* result;
|
||||||
|
LiveChartStaticStaticGrid* _tmp0_;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->priv->_grid;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
return result;
|
||||||
|
#line 377 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_chart_set_grid (LiveChartStaticStaticChart* self,
|
||||||
|
LiveChartStaticStaticGrid* value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticGrid* old_value;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
old_value = live_chart_static_static_chart_get_grid (self);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 391 "static_chart.c"
|
||||||
|
LiveChartStaticStaticGrid* _tmp0_;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_grid);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_grid = _tmp0_;
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY]);
|
||||||
|
#line 401 "static_chart.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBackground*
|
||||||
|
live_chart_static_static_chart_get_background (LiveChartStaticStaticChart* self)
|
||||||
|
{
|
||||||
|
LiveChartBackground* result;
|
||||||
|
LiveChartBackground* _tmp0_;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->priv->_background;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
return result;
|
||||||
|
#line 418 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_chart_set_background (LiveChartStaticStaticChart* self,
|
||||||
|
LiveChartBackground* value)
|
||||||
|
{
|
||||||
|
LiveChartBackground* old_value;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
old_value = live_chart_static_static_chart_get_background (self);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 432 "static_chart.c"
|
||||||
|
LiveChartBackground* _tmp0_;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_background);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_background = _tmp0_;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY]);
|
||||||
|
#line 442 "static_chart.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartLegend*
|
||||||
|
live_chart_static_static_chart_get_legend (LiveChartStaticStaticChart* self)
|
||||||
|
{
|
||||||
|
LiveChartLegend* result;
|
||||||
|
LiveChartLegend* _tmp0_;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = self->priv->_legend;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
return result;
|
||||||
|
#line 459 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_chart_set_legend (LiveChartStaticStaticChart* self,
|
||||||
|
LiveChartLegend* value)
|
||||||
|
{
|
||||||
|
LiveChartLegend* old_value;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
old_value = live_chart_static_static_chart_get_legend (self);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 473 "static_chart.c"
|
||||||
|
LiveChartLegend* _tmp0_;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_legend);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_legend = _tmp0_;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY]);
|
||||||
|
#line 483 "static_chart.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_chart_class_init (LiveChartStaticStaticChartClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
live_chart_static_static_chart_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticChart_private_offset);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_chart_get_property;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_chart_set_property;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_chart_finalize;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY] = g_param_spec_object ("grid", "grid", "grid", LIVE_CHART_STATIC_TYPE_STATIC_GRID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY] = g_param_spec_object ("background", "background", "background", LIVE_CHART_TYPE_BACKGROUND, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY, live_chart_static_static_chart_properties[LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY] = g_param_spec_object ("legend", "legend", "legend", LIVE_CHART_TYPE_LEGEND, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 507 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_chart_instance_init (LiveChartStaticStaticChart * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticGrid* _tmp0_;
|
||||||
|
LiveChartBackground* _tmp1_;
|
||||||
|
LiveChartHorizontalLegend* _tmp2_;
|
||||||
|
GeeArrayList* _tmp3_;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
self->priv = live_chart_static_static_chart_get_instance_private (self);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
_tmp0_ = live_chart_static_static_grid_new ();
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_grid = _tmp0_;
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
_tmp1_ = live_chart_background_new ();
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_background = _tmp1_;
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
_tmp2_ = live_chart_horizontal_legend_new ();
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
self->priv->_legend = (LiveChartLegend*) _tmp2_;
|
||||||
|
#line 14 "../src/static/static_chart.vala"
|
||||||
|
_tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
|
||||||
|
#line 14 "../src/static/static_chart.vala"
|
||||||
|
self->priv->categories = _tmp3_;
|
||||||
|
#line 536 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_chart_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticChart * self;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_CHART, LiveChartStaticStaticChart);
|
||||||
|
#line 8 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_grid);
|
||||||
|
#line 9 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_background);
|
||||||
|
#line 10 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->_legend);
|
||||||
|
#line 11 "../src/static/static_chart.vala"
|
||||||
|
_live_chart_config_unref0 (self->config);
|
||||||
|
#line 12 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->series);
|
||||||
|
#line 14 "../src/static/static_chart.vala"
|
||||||
|
_g_object_unref0 (self->priv->categories);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_chart_parent_class)->finalize (obj);
|
||||||
|
#line 559 "static_chart.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_chart_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticChartClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_chart_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticChart), 0, (GInstanceInitFunc) live_chart_static_static_chart_instance_init, NULL };
|
||||||
|
GType live_chart_static_static_chart_type_id;
|
||||||
|
live_chart_static_static_chart_type_id = g_type_register_static (gtk_drawing_area_get_type (), "LiveChartStaticStaticChart", &g_define_type_info, 0);
|
||||||
|
LiveChartStaticStaticChart_private_offset = g_type_add_instance_private (live_chart_static_static_chart_type_id, sizeof (LiveChartStaticStaticChartPrivate));
|
||||||
|
return live_chart_static_static_chart_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_chart_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_chart_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_chart_type_id__once)) {
|
||||||
|
GType live_chart_static_static_chart_type_id;
|
||||||
|
live_chart_static_static_chart_type_id = live_chart_static_static_chart_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_chart_type_id__once, live_chart_static_static_chart_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_chart_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_chart_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticChart * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_CHART, LiveChartStaticStaticChart);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_chart_get_grid (self));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_chart_get_background (self));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_chart_get_legend (self));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 612 "static_chart.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 618 "static_chart.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_chart_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticChart * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_CHART, LiveChartStaticStaticChart);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_GRID_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
live_chart_static_static_chart_set_grid (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_BACKGROUND_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
live_chart_static_static_chart_set_background (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_CHART_LEGEND_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
live_chart_static_static_chart_set_legend (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 650 "static_chart.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_chart.vala"
|
||||||
|
break;
|
||||||
|
#line 656 "static_chart.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;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,404 @@
|
||||||
|
/* static_line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_line_properties[LIVE_CHART_STATIC_STATIC_LINE_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
static gpointer live_chart_static_static_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_static_static_line_real_draw (LiveChartStaticStaticSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_static_static_line_update_bounding_box (LiveChartStaticStaticLine* self,
|
||||||
|
LiveChartStaticStaticPoints* points,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static GType live_chart_static_static_line_get_type_once (void);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 9 "../src/static/static_line.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 38 "static_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticLine*
|
||||||
|
live_chart_static_static_line_construct (GType object_type,
|
||||||
|
LiveChartStaticStaticValues* values)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticLine * self = NULL;
|
||||||
|
LiveChartStaticStaticValues* _tmp0_;
|
||||||
|
#line 7 "../src/static/static_line.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 8 "../src/static/static_line.vala"
|
||||||
|
self = (LiveChartStaticStaticLine*) live_chart_static_static_serie_renderer_construct (object_type);
|
||||||
|
#line 9 "../src/static/static_line.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (values);
|
||||||
|
#line 9 "../src/static/static_line.vala"
|
||||||
|
_g_object_unref0 (((LiveChartStaticStaticSerieRenderer*) self)->values);
|
||||||
|
#line 9 "../src/static/static_line.vala"
|
||||||
|
((LiveChartStaticStaticSerieRenderer*) self)->values = _tmp0_;
|
||||||
|
#line 7 "../src/static/static_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 59 "static_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticLine*
|
||||||
|
live_chart_static_static_line_new (LiveChartStaticStaticValues* values)
|
||||||
|
{
|
||||||
|
#line 7 "../src/static/static_line.vala"
|
||||||
|
return live_chart_static_static_line_construct (LIVE_CHART_STATIC_TYPE_STATIC_LINE, values);
|
||||||
|
#line 67 "static_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_line_real_draw (LiveChartStaticStaticSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 12 "../src/static/static_line.vala"
|
||||||
|
self = (LiveChartStaticStaticLine*) base;
|
||||||
|
#line 12 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 12 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 13 "../src/static/static_line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 13 "../src/static/static_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 13 "../src/static/static_line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 90 "static_line.c"
|
||||||
|
LiveChartStaticStaticPoints* points = NULL;
|
||||||
|
LiveChartStaticStaticValues* _tmp2_;
|
||||||
|
LiveChartStaticStaticPoints* _tmp3_;
|
||||||
|
LiveChartStaticStaticPoints* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
#line 14 "../src/static/static_line.vala"
|
||||||
|
_tmp2_ = ((LiveChartStaticStaticSerieRenderer*) self)->values;
|
||||||
|
#line 14 "../src/static/static_line.vala"
|
||||||
|
_tmp3_ = live_chart_static_static_points_create (_tmp2_, config);
|
||||||
|
#line 14 "../src/static/static_line.vala"
|
||||||
|
points = _tmp3_;
|
||||||
|
#line 15 "../src/static/static_line.vala"
|
||||||
|
_tmp4_ = points;
|
||||||
|
#line 15 "../src/static/static_line.vala"
|
||||||
|
_tmp5_ = live_chart_static_static_points_get_size (_tmp4_);
|
||||||
|
#line 15 "../src/static/static_line.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 15 "../src/static/static_line.vala"
|
||||||
|
if (_tmp6_ > 0) {
|
||||||
|
#line 111 "static_line.c"
|
||||||
|
LiveChartStaticStaticPoints* _tmp7_;
|
||||||
|
#line 16 "../src/static/static_line.vala"
|
||||||
|
_tmp7_ = points;
|
||||||
|
#line 16 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_line_draw_line (self, _tmp7_, ctx, config);
|
||||||
|
#line 17 "../src/static/static_line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 119 "static_line.c"
|
||||||
|
}
|
||||||
|
#line 13 "../src/static/static_line.vala"
|
||||||
|
_g_object_unref0 (points);
|
||||||
|
#line 123 "static_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_line_draw_line (LiveChartStaticStaticLine* self,
|
||||||
|
LiveChartStaticStaticPoints* points,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPoint first_point = {0};
|
||||||
|
LiveChartPoint _tmp2_ = {0};
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
LiveChartPoint _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_;
|
||||||
|
LiveChartPoint _tmp6_;
|
||||||
|
gchar* _tmp7_;
|
||||||
|
gchar* _tmp8_;
|
||||||
|
#line 22 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 22 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (points != NULL);
|
||||||
|
#line 22 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 22 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 23 "../src/static/static_line.vala"
|
||||||
|
_tmp0_ = live_chart_static_static_serie_renderer_get_line ((LiveChartStaticStaticSerieRenderer*) self);
|
||||||
|
#line 23 "../src/static/static_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 23 "../src/static/static_line.vala"
|
||||||
|
live_chart_path_configure (_tmp1_, ctx);
|
||||||
|
#line 25 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_first (points, &_tmp2_);
|
||||||
|
#line 25 "../src/static/static_line.vala"
|
||||||
|
first_point = _tmp2_;
|
||||||
|
#line 27 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_line_update_bounding_box (self, points, config);
|
||||||
|
#line 28 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_serie_renderer_debug ((LiveChartStaticStaticSerieRenderer*) self, ctx);
|
||||||
|
#line 30 "../src/static/static_line.vala"
|
||||||
|
_tmp3_ = first_point;
|
||||||
|
#line 30 "../src/static/static_line.vala"
|
||||||
|
_tmp4_ = first_point;
|
||||||
|
#line 30 "../src/static/static_line.vala"
|
||||||
|
cairo_move_to (ctx, _tmp3_.x, _tmp4_.y);
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
_tmp5_ = first_point;
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
_tmp6_ = first_point;
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
_tmp7_ = g_strdup_printf ("Draw point %f, %f", _tmp5_.x, _tmp6_.y);
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
g_message ("static_line.vala:31: %s", _tmp8_);
|
||||||
|
#line 31 "../src/static/static_line.vala"
|
||||||
|
_g_free0 (_tmp8_);
|
||||||
|
#line 183 "static_line.c"
|
||||||
|
{
|
||||||
|
gint pos = 0;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
pos = 0;
|
||||||
|
#line 188 "static_line.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp9_ = FALSE;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
_tmp9_ = TRUE;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 195 "static_line.c"
|
||||||
|
gint _tmp11_;
|
||||||
|
gint _tmp12_;
|
||||||
|
LiveChartPoint current_point = {0};
|
||||||
|
LiveChartPoint _tmp13_ = {0};
|
||||||
|
LiveChartPoint next_point = {0};
|
||||||
|
LiveChartPoint _tmp14_ = {0};
|
||||||
|
LiveChartPoint _tmp15_;
|
||||||
|
LiveChartPoint _tmp18_;
|
||||||
|
LiveChartPoint _tmp19_;
|
||||||
|
gchar* _tmp20_;
|
||||||
|
gchar* _tmp21_;
|
||||||
|
LiveChartPoint _tmp22_;
|
||||||
|
LiveChartPoint _tmp23_;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
if (!_tmp9_) {
|
||||||
|
#line 211 "static_line.c"
|
||||||
|
gint _tmp10_;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
_tmp10_ = pos;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
pos = _tmp10_ + 1;
|
||||||
|
#line 217 "static_line.c"
|
||||||
|
}
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
_tmp9_ = FALSE;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
_tmp11_ = live_chart_static_static_points_get_size (points);
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
if (!(pos < (_tmp12_ - 1))) {
|
||||||
|
#line 32 "../src/static/static_line.vala"
|
||||||
|
break;
|
||||||
|
#line 229 "static_line.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_get (points, pos, &_tmp13_);
|
||||||
|
#line 33 "../src/static/static_line.vala"
|
||||||
|
current_point = _tmp13_;
|
||||||
|
#line 34 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_after (points, pos, &_tmp14_);
|
||||||
|
#line 34 "../src/static/static_line.vala"
|
||||||
|
next_point = _tmp14_;
|
||||||
|
#line 35 "../src/static/static_line.vala"
|
||||||
|
_tmp15_ = current_point;
|
||||||
|
#line 35 "../src/static/static_line.vala"
|
||||||
|
if (live_chart_static_static_serie_renderer_is_out_of_area ((LiveChartStaticStaticSerieRenderer*) self, &_tmp15_)) {
|
||||||
|
#line 243 "static_line.c"
|
||||||
|
LiveChartPoint _tmp16_;
|
||||||
|
LiveChartPoint _tmp17_;
|
||||||
|
#line 36 "../src/static/static_line.vala"
|
||||||
|
g_message ("static_line.vala:36: #########################Out of area");
|
||||||
|
#line 37 "../src/static/static_line.vala"
|
||||||
|
_tmp16_ = current_point;
|
||||||
|
#line 37 "../src/static/static_line.vala"
|
||||||
|
_tmp17_ = current_point;
|
||||||
|
#line 37 "../src/static/static_line.vala"
|
||||||
|
cairo_move_to (ctx, _tmp16_.x, _tmp17_.y);
|
||||||
|
#line 38 "../src/static/static_line.vala"
|
||||||
|
continue;
|
||||||
|
#line 256 "static_line.c"
|
||||||
|
}
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
_tmp18_ = next_point;
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
_tmp19_ = next_point;
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
_tmp20_ = g_strdup_printf ("Draw point %f, %f as pos %d", _tmp18_.x, _tmp19_.y, pos);
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
_tmp21_ = _tmp20_;
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
g_message ("static_line.vala:40: %s", _tmp21_);
|
||||||
|
#line 40 "../src/static/static_line.vala"
|
||||||
|
_g_free0 (_tmp21_);
|
||||||
|
#line 41 "../src/static/static_line.vala"
|
||||||
|
_tmp22_ = next_point;
|
||||||
|
#line 41 "../src/static/static_line.vala"
|
||||||
|
_tmp23_ = next_point;
|
||||||
|
#line 41 "../src/static/static_line.vala"
|
||||||
|
cairo_line_to (ctx, _tmp22_.x, _tmp23_.y);
|
||||||
|
#line 276 "static_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_line_update_bounding_box (LiveChartStaticStaticLine* self,
|
||||||
|
LiveChartStaticStaticPoints* points,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
LiveChartBounds* _tmp2_;
|
||||||
|
gdouble _tmp3_;
|
||||||
|
gdouble _tmp4_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
LiveChartPoint _tmp6_ = {0};
|
||||||
|
LiveChartBounds* _tmp7_;
|
||||||
|
LiveChartBounds* _tmp8_;
|
||||||
|
gdouble _tmp9_;
|
||||||
|
gdouble _tmp10_;
|
||||||
|
LiveChartBounds* _tmp11_;
|
||||||
|
LiveChartBounds* _tmp12_;
|
||||||
|
gdouble _tmp13_;
|
||||||
|
gdouble _tmp14_;
|
||||||
|
LiveChartBoundingBox _tmp15_ = {0};
|
||||||
|
#line 45 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 45 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (points != NULL);
|
||||||
|
#line 45 "../src/static/static_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_first (points, &_tmp0_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_points_get_bounds (points);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp3_ = live_chart_bounds_get_lower (_tmp2_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_last (points, &_tmp5_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_points_first (points, &_tmp6_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp7_ = live_chart_static_static_points_get_bounds (points);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp8_ = _tmp7_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp9_ = live_chart_bounds_get_upper (_tmp8_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp11_ = live_chart_static_static_points_get_bounds (points);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp13_ = live_chart_bounds_get_lower (_tmp12_);
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
memset (&_tmp15_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp15_.x = _tmp0_.x;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp15_.y = _tmp4_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp15_.width = _tmp5_.x - _tmp6_.x;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
_tmp15_.height = _tmp10_ - _tmp14_;
|
||||||
|
#line 46 "../src/static/static_line.vala"
|
||||||
|
((LiveChartStaticStaticSerieRenderer*) self)->bounding_box = _tmp15_;
|
||||||
|
#line 351 "static_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_line_class_init (LiveChartStaticStaticLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/static/static_line.vala"
|
||||||
|
live_chart_static_static_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/static/static_line.vala"
|
||||||
|
((LiveChartStaticStaticSerieRendererClass *) klass)->draw = (void (*) (LiveChartStaticStaticSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_static_static_line_real_draw;
|
||||||
|
#line 362 "static_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_line_instance_init (LiveChartStaticStaticLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticLine), 0, (GInstanceInitFunc) live_chart_static_static_line_instance_init, NULL };
|
||||||
|
GType live_chart_static_static_line_type_id;
|
||||||
|
live_chart_static_static_line_type_id = g_type_register_static (LIVE_CHART_STATIC_TYPE_STATIC_SERIE_RENDERER, "LiveChartStaticStaticLine", &g_define_type_info, 0);
|
||||||
|
return live_chart_static_static_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_line_type_id__once)) {
|
||||||
|
GType live_chart_static_static_line_type_id;
|
||||||
|
live_chart_static_static_line_type_id = live_chart_static_static_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_line_type_id__once, live_chart_static_static_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,821 @@
|
||||||
|
/* static_points.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_points.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_POINTS_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_POINTS_SIZE_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_POINTS_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _live_chart_point_free0(var) ((var == NULL) ? NULL : (var = (live_chart_point_free (var), NULL)))
|
||||||
|
#define _live_chart_static_named_value_free0(var) ((var == NULL) ? NULL : (var = (live_chart_static_named_value_free (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticPointsPrivate {
|
||||||
|
GeeArrayList* points;
|
||||||
|
LiveChartBounds* _bounds;
|
||||||
|
gdouble _realtime_delta;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticPoints_private_offset;
|
||||||
|
static gpointer live_chart_static_static_points_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_static_static_points_value_to_point (LiveChartStaticNamedValue* current_value,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBoundaries* boundaries,
|
||||||
|
LiveChartPoint* result);
|
||||||
|
static void live_chart_static_static_points_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_points_get_type_once (void);
|
||||||
|
static void _vala_live_chart_static_static_points_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_static_static_points_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_points_get_instance_private (LiveChartStaticStaticPoints* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticPoints_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticPoints*
|
||||||
|
live_chart_static_static_points_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticPoints * self = NULL;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
#line 13 "../src/static/static_points.vala"
|
||||||
|
self = (LiveChartStaticStaticPoints*) g_object_new (object_type, NULL);
|
||||||
|
#line 14 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = live_chart_bounds_new (((double) NAN), ((double) NAN));
|
||||||
|
#line 14 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 14 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_set_bounds (self, _tmp1_);
|
||||||
|
#line 14 "../src/static/static_points.vala"
|
||||||
|
_g_object_unref0 (_tmp1_);
|
||||||
|
#line 13 "../src/static/static_points.vala"
|
||||||
|
return self;
|
||||||
|
#line 77 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticPoints*
|
||||||
|
live_chart_static_static_points_new (void)
|
||||||
|
{
|
||||||
|
#line 13 "../src/static/static_points.vala"
|
||||||
|
return live_chart_static_static_points_construct (LIVE_CHART_STATIC_TYPE_STATIC_POINTS);
|
||||||
|
#line 85 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_add (LiveChartStaticStaticPoints* self,
|
||||||
|
LiveChartPoint* point)
|
||||||
|
{
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartPoint _tmp1_;
|
||||||
|
GeeArrayList* _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
#line 17 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 17 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (point != NULL);
|
||||||
|
#line 18 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 18 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = *point;
|
||||||
|
#line 18 "../src/static/static_points.vala"
|
||||||
|
live_chart_bounds_update (_tmp0_, _tmp1_.y);
|
||||||
|
#line 19 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = self->priv->points;
|
||||||
|
#line 19 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = *point;
|
||||||
|
#line 19 "../src/static/static_points.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, &_tmp3_);
|
||||||
|
#line 112 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_get (LiveChartStaticStaticPoints* self,
|
||||||
|
gint at,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gpointer _tmp1_;
|
||||||
|
LiveChartPoint* _tmp2_;
|
||||||
|
LiveChartPoint _tmp3_;
|
||||||
|
#line 32 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = self->priv->points;
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = gee_abstract_list_get ((GeeAbstractList*) _tmp0_, at);
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = (LiveChartPoint*) _tmp1_;
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = *_tmp2_;
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
_live_chart_point_free0 (_tmp2_);
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp3_;
|
||||||
|
#line 33 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 140 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_after (LiveChartStaticStaticPoints* self,
|
||||||
|
gint at,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
LiveChartPoint _tmp5_ = {0};
|
||||||
|
#line 36 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = live_chart_static_static_points_get_size (self);
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
if ((at + 1) >= _tmp1_) {
|
||||||
|
#line 159 "static_points.c"
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
LiveChartPoint _tmp4_ = {0};
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = live_chart_static_static_points_get_size (self);
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_get (self, _tmp3_ - 1, &_tmp4_);
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp4_;
|
||||||
|
#line 37 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 173 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 38 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_get (self, at + 1, &_tmp5_);
|
||||||
|
#line 38 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp5_;
|
||||||
|
#line 38 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 181 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_first (LiveChartStaticStaticPoints* self,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_ = {0};
|
||||||
|
#line 41 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 42 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_get (self, 0, &_tmp0_);
|
||||||
|
#line 42 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 42 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 197 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_last (LiveChartStaticStaticPoints* self,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
LiveChartPoint _tmp2_ = {0};
|
||||||
|
#line 45 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 46 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = live_chart_static_static_points_get_size (self);
|
||||||
|
#line 46 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 46 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_get (self, _tmp1_ - 1, &_tmp2_);
|
||||||
|
#line 46 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp2_;
|
||||||
|
#line 46 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 219 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticPoints*
|
||||||
|
live_chart_static_static_points_create (LiveChartStaticStaticValues* values,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp0_ = {0};
|
||||||
|
LiveChartStaticStaticPoints* points = NULL;
|
||||||
|
LiveChartStaticStaticPoints* _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
LiveChartStaticStaticPoints* result;
|
||||||
|
#line 49 "../src/static/static_points.vala"
|
||||||
|
g_return_val_if_fail (values != NULL, NULL);
|
||||||
|
#line 49 "../src/static/static_points.vala"
|
||||||
|
g_return_val_if_fail (config != NULL, NULL);
|
||||||
|
#line 50 "../src/static/static_points.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp0_);
|
||||||
|
#line 50 "../src/static/static_points.vala"
|
||||||
|
boundaries = _tmp0_;
|
||||||
|
#line 52 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_points_new ();
|
||||||
|
#line 52 "../src/static/static_points.vala"
|
||||||
|
points = _tmp1_;
|
||||||
|
#line 53 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) values);
|
||||||
|
#line 53 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 53 "../src/static/static_points.vala"
|
||||||
|
if (_tmp3_ > 0) {
|
||||||
|
#line 251 "static_points.c"
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues* _value_list = NULL;
|
||||||
|
gint _value_size = 0;
|
||||||
|
LiveChartStaticStaticValues* _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
gint _tmp6_;
|
||||||
|
gint _value_index = 0;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_value_list = values;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp4_ = _value_list;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_value_size = _tmp6_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_value_index = -1;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 273 "static_points.c"
|
||||||
|
gint _tmp7_;
|
||||||
|
gint _tmp8_;
|
||||||
|
LiveChartStaticNamedValue value = {0};
|
||||||
|
LiveChartStaticStaticValues* _tmp9_;
|
||||||
|
gpointer _tmp10_;
|
||||||
|
LiveChartStaticNamedValue* _tmp11_;
|
||||||
|
LiveChartStaticNamedValue _tmp12_;
|
||||||
|
LiveChartStaticNamedValue _tmp13_ = {0};
|
||||||
|
LiveChartStaticNamedValue _tmp14_;
|
||||||
|
LiveChartPoint point = {0};
|
||||||
|
LiveChartStaticNamedValue _tmp15_;
|
||||||
|
LiveChartBoundaries _tmp16_;
|
||||||
|
LiveChartPoint _tmp17_ = {0};
|
||||||
|
LiveChartStaticStaticPoints* _tmp18_;
|
||||||
|
LiveChartPoint _tmp19_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_value_index = _value_index + 1;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp7_ = _value_index;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp8_ = _value_size;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
if (!(_tmp7_ < _tmp8_)) {
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 299 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp9_ = _value_list;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _value_index);
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp11_ = (LiveChartStaticNamedValue*) _tmp10_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp12_ = *_tmp11_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_named_value_copy (&_tmp12_, &_tmp13_);
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
_live_chart_static_named_value_free0 (_tmp11_);
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
value = _tmp14_;
|
||||||
|
#line 55 "../src/static/static_points.vala"
|
||||||
|
_tmp15_ = value;
|
||||||
|
#line 55 "../src/static/static_points.vala"
|
||||||
|
_tmp16_ = boundaries;
|
||||||
|
#line 55 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_value_to_point (&_tmp15_, config, &_tmp16_, &_tmp17_);
|
||||||
|
#line 55 "../src/static/static_points.vala"
|
||||||
|
point = _tmp17_;
|
||||||
|
#line 56 "../src/static/static_points.vala"
|
||||||
|
_tmp18_ = points;
|
||||||
|
#line 56 "../src/static/static_points.vala"
|
||||||
|
_tmp19_ = point;
|
||||||
|
#line 56 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_add (_tmp18_, &_tmp19_);
|
||||||
|
#line 54 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_named_value_destroy (&value);
|
||||||
|
#line 333 "static_points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 60 "../src/static/static_points.vala"
|
||||||
|
result = points;
|
||||||
|
#line 60 "../src/static/static_points.vala"
|
||||||
|
return result;
|
||||||
|
#line 341 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_points_value_to_point (LiveChartStaticNamedValue* current_value,
|
||||||
|
LiveChartConfig* config,
|
||||||
|
LiveChartBoundaries* boundaries,
|
||||||
|
LiveChartPoint* result)
|
||||||
|
{
|
||||||
|
gint category_length = 0;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
guint8 category_pos = 0U;
|
||||||
|
gint width_between_each_points = 0;
|
||||||
|
LiveChartBoundaries _tmp15_;
|
||||||
|
LiveChartBoundary _tmp16_;
|
||||||
|
LiveChartBoundaries _tmp17_;
|
||||||
|
LiveChartBoundary _tmp18_;
|
||||||
|
gint _tmp19_;
|
||||||
|
gint _tmp20_;
|
||||||
|
gchar* _tmp21_;
|
||||||
|
gchar* _tmp22_;
|
||||||
|
gint x = 0;
|
||||||
|
LiveChartBoundaries _tmp23_;
|
||||||
|
LiveChartBoundary _tmp24_;
|
||||||
|
gdouble y = 0.0;
|
||||||
|
LiveChartBoundaries _tmp25_;
|
||||||
|
LiveChartBoundary _tmp26_;
|
||||||
|
LiveChartStaticNamedValue _tmp27_;
|
||||||
|
LiveChartYAxis* _tmp28_;
|
||||||
|
LiveChartStaticNamedValue _tmp29_;
|
||||||
|
const gchar* _tmp30_;
|
||||||
|
LiveChartXAxis* _tmp31_;
|
||||||
|
gchar* _tmp32_;
|
||||||
|
gchar* _tmp33_;
|
||||||
|
LiveChartStaticNamedValue _tmp34_;
|
||||||
|
LiveChartYAxis* _tmp35_;
|
||||||
|
LiveChartPoint _tmp36_ = {0};
|
||||||
|
#line 63 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (current_value != NULL);
|
||||||
|
#line 63 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 63 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (boundaries != NULL);
|
||||||
|
#line 64 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = config->categories;
|
||||||
|
#line 64 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
|
||||||
|
#line 64 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 64 "../src/static/static_points.vala"
|
||||||
|
category_length = _tmp2_;
|
||||||
|
#line 65 "../src/static/static_points.vala"
|
||||||
|
category_pos = (guint8) 0;
|
||||||
|
#line 396 "static_points.c"
|
||||||
|
{
|
||||||
|
guint8 i = 0U;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
i = (guint8) 0;
|
||||||
|
#line 401 "static_points.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp3_ = FALSE;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = TRUE;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 408 "static_points.c"
|
||||||
|
gchar* category = NULL;
|
||||||
|
GeeArrayList* _tmp5_;
|
||||||
|
gpointer _tmp6_;
|
||||||
|
gboolean _tmp7_ = FALSE;
|
||||||
|
const gchar* _tmp8_;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
if (!_tmp3_) {
|
||||||
|
#line 416 "static_points.c"
|
||||||
|
guint8 _tmp4_;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
_tmp4_ = i;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
i = _tmp4_ + 1;
|
||||||
|
#line 422 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
_tmp3_ = FALSE;
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
if (!(((gint) i) < category_length)) {
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 430 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 67 "../src/static/static_points.vala"
|
||||||
|
_tmp5_ = config->categories;
|
||||||
|
#line 67 "../src/static/static_points.vala"
|
||||||
|
_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, (gint) i);
|
||||||
|
#line 67 "../src/static/static_points.vala"
|
||||||
|
category = (gchar*) _tmp6_;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp8_ = category;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
if (_tmp8_ != NULL) {
|
||||||
|
#line 442 "static_points.c"
|
||||||
|
const gchar* _tmp9_;
|
||||||
|
LiveChartStaticNamedValue _tmp10_;
|
||||||
|
const gchar* _tmp11_;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp9_ = category;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp10_ = *current_value;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp11_ = _tmp10_.name;
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp7_ = g_strcmp0 (_tmp9_, _tmp11_) == 0;
|
||||||
|
#line 454 "static_points.c"
|
||||||
|
} else {
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
_tmp7_ = FALSE;
|
||||||
|
#line 458 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 68 "../src/static/static_points.vala"
|
||||||
|
if (_tmp7_) {
|
||||||
|
#line 462 "static_points.c"
|
||||||
|
const gchar* _tmp12_;
|
||||||
|
gchar* _tmp13_;
|
||||||
|
gchar* _tmp14_;
|
||||||
|
#line 69 "../src/static/static_points.vala"
|
||||||
|
category_pos = i;
|
||||||
|
#line 70 "../src/static/static_points.vala"
|
||||||
|
_tmp12_ = category;
|
||||||
|
#line 70 "../src/static/static_points.vala"
|
||||||
|
_tmp13_ = g_strdup_printf ("Found category %s at pos %d", _tmp12_, (gint) i);
|
||||||
|
#line 70 "../src/static/static_points.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 70 "../src/static/static_points.vala"
|
||||||
|
g_message ("static_points.vala:70: %s", _tmp14_);
|
||||||
|
#line 70 "../src/static/static_points.vala"
|
||||||
|
_g_free0 (_tmp14_);
|
||||||
|
#line 71 "../src/static/static_points.vala"
|
||||||
|
_g_free0 (category);
|
||||||
|
#line 71 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 482 "static_points.c"
|
||||||
|
}
|
||||||
|
#line 66 "../src/static/static_points.vala"
|
||||||
|
_g_free0 (category);
|
||||||
|
#line 486 "static_points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 74 "../src/static/static_points.vala"
|
||||||
|
_tmp15_ = *boundaries;
|
||||||
|
#line 74 "../src/static/static_points.vala"
|
||||||
|
_tmp16_ = _tmp15_.x;
|
||||||
|
#line 74 "../src/static/static_points.vala"
|
||||||
|
_tmp17_ = *boundaries;
|
||||||
|
#line 74 "../src/static/static_points.vala"
|
||||||
|
_tmp18_ = _tmp17_.x;
|
||||||
|
#line 74 "../src/static/static_points.vala"
|
||||||
|
width_between_each_points = (_tmp16_.max - _tmp18_.min) / (category_length - 1);
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
_tmp19_ = live_chart_config_get_width (config);
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
_tmp20_ = _tmp19_;
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
_tmp21_ = g_strdup_printf ("WIDTH %d", _tmp20_);
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
_tmp22_ = _tmp21_;
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
g_message ("static_points.vala:75: %s", _tmp22_);
|
||||||
|
#line 75 "../src/static/static_points.vala"
|
||||||
|
_g_free0 (_tmp22_);
|
||||||
|
#line 76 "../src/static/static_points.vala"
|
||||||
|
_tmp23_ = *boundaries;
|
||||||
|
#line 76 "../src/static/static_points.vala"
|
||||||
|
_tmp24_ = _tmp23_.x;
|
||||||
|
#line 76 "../src/static/static_points.vala"
|
||||||
|
x = _tmp24_.min + (category_pos * width_between_each_points);
|
||||||
|
#line 77 "../src/static/static_points.vala"
|
||||||
|
_tmp25_ = *boundaries;
|
||||||
|
#line 77 "../src/static/static_points.vala"
|
||||||
|
_tmp26_ = _tmp25_.y;
|
||||||
|
#line 77 "../src/static/static_points.vala"
|
||||||
|
_tmp27_ = *current_value;
|
||||||
|
#line 77 "../src/static/static_points.vala"
|
||||||
|
_tmp28_ = config->y_axis;
|
||||||
|
#line 77 "../src/static/static_points.vala"
|
||||||
|
y = _tmp26_.max - (_tmp27_.value * live_chart_yaxis_get_ratio (_tmp28_));
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_tmp29_ = *current_value;
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_tmp30_ = _tmp29_.name;
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_tmp31_ = config->x_axis;
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_tmp32_ = g_strdup_printf ("category %s at pos %d (%f,%f) (width_between_each_points = %d) ratio: " \
|
||||||
|
"%f", _tmp30_, (gint) category_pos, (gdouble) x, y, width_between_each_points, live_chart_xaxis_get_ratio (_tmp31_));
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_tmp33_ = _tmp32_;
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
g_message ("static_points.vala:78: %s", _tmp33_);
|
||||||
|
#line 78 "../src/static/static_points.vala"
|
||||||
|
_g_free0 (_tmp33_);
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
_tmp34_ = *current_value;
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
_tmp35_ = config->y_axis;
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
memset (&_tmp36_, 0, sizeof (LiveChartPoint));
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
_tmp36_.x = (gdouble) x;
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
_tmp36_.y = y;
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
_tmp36_.height = _tmp34_.value * live_chart_yaxis_get_ratio (_tmp35_);
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
*result = _tmp36_;
|
||||||
|
#line 79 "../src/static/static_points.vala"
|
||||||
|
return;
|
||||||
|
#line 558 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_static_static_points_get_bounds (LiveChartStaticStaticPoints* self)
|
||||||
|
{
|
||||||
|
LiveChartBounds* result;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
return result;
|
||||||
|
#line 574 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 582 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_set_bounds (LiveChartStaticStaticPoints* self,
|
||||||
|
LiveChartBounds* value)
|
||||||
|
{
|
||||||
|
LiveChartBounds* old_value;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
old_value = live_chart_static_static_points_get_bounds (self);
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 596 "static_points.c"
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
self->priv->_bounds = _tmp0_;
|
||||||
|
#line 10 "../src/static/static_points.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY]);
|
||||||
|
#line 606 "static_points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
live_chart_static_static_points_get_size (LiveChartStaticStaticPoints* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
#line 23 "../src/static/static_points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
#line 24 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = self->priv->points;
|
||||||
|
#line 24 "../src/static/static_points.vala"
|
||||||
|
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
|
||||||
|
#line 24 "../src/static/static_points.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 24 "../src/static/static_points.vala"
|
||||||
|
result = _tmp2_;
|
||||||
|
#line 24 "../src/static/static_points.vala"
|
||||||
|
return result;
|
||||||
|
#line 629 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_static_static_points_get_realtime_delta (LiveChartStaticStaticPoints* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
result = self->priv->_realtime_delta;
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
return result;
|
||||||
|
#line 642 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_points_set_realtime_delta (LiveChartStaticStaticPoints* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
old_value = live_chart_static_static_points_get_realtime_delta (self);
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
self->priv->_realtime_delta = value;
|
||||||
|
#line 29 "../src/static/static_points.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY]);
|
||||||
|
#line 660 "static_points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_points_class_init (LiveChartStaticStaticPointsClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticPoints_private_offset);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_points_get_property;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_points_set_property;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_points_finalize;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY, live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY] = g_param_spec_object ("bounds", "bounds", "bounds", LIVE_CHART_TYPE_BOUNDS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_POINTS_SIZE_PROPERTY, live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY, live_chart_static_static_points_properties[LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY] = g_param_spec_double ("realtime-delta", "realtime-delta", "realtime-delta", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 684 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_points_instance_init (LiveChartStaticStaticPoints * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
self->priv = live_chart_static_static_points_get_instance_private (self);
|
||||||
|
#line 8 "../src/static/static_points.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (LIVE_CHART_TYPE_POINT, (GBoxedCopyFunc) live_chart_point_dup, (GDestroyNotify) live_chart_point_free, NULL, NULL, NULL);
|
||||||
|
#line 8 "../src/static/static_points.vala"
|
||||||
|
self->priv->points = _tmp0_;
|
||||||
|
#line 698 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_points_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticPoints * self;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_POINTS, LiveChartStaticStaticPoints);
|
||||||
|
#line 8 "../src/static/static_points.vala"
|
||||||
|
_g_object_unref0 (self->priv->points);
|
||||||
|
#line 9 "../src/static/static_points.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_points_parent_class)->finalize (obj);
|
||||||
|
#line 713 "static_points.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_points_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticPointsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_points_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticPoints), 0, (GInstanceInitFunc) live_chart_static_static_points_instance_init, NULL };
|
||||||
|
GType live_chart_static_static_points_type_id;
|
||||||
|
live_chart_static_static_points_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartStaticStaticPoints", &g_define_type_info, 0);
|
||||||
|
LiveChartStaticStaticPoints_private_offset = g_type_add_instance_private (live_chart_static_static_points_type_id, sizeof (LiveChartStaticStaticPointsPrivate));
|
||||||
|
return live_chart_static_static_points_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_points_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_points_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_points_type_id__once)) {
|
||||||
|
GType live_chart_static_static_points_type_id;
|
||||||
|
live_chart_static_static_points_type_id = live_chart_static_static_points_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_points_type_id__once, live_chart_static_static_points_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_points_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_points_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticPoints * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_POINTS, LiveChartStaticStaticPoints);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_points_get_bounds (self));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_POINTS_SIZE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_value_set_int (value, live_chart_static_static_points_get_size (self));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
g_value_set_double (value, live_chart_static_static_points_get_realtime_delta (self));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 766 "static_points.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 772 "static_points.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_points_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticPoints * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_POINTS, LiveChartStaticStaticPoints);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_POINTS_BOUNDS_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_set_bounds (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_POINTS_REALTIME_DELTA_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
live_chart_static_static_points_set_realtime_delta (self, g_value_get_double (value));
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 798 "static_points.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_points.vala"
|
||||||
|
break;
|
||||||
|
#line 804 "static_points.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,619 @@
|
||||||
|
/* static_serie.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_serie.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.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 <gee.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_MAIN_COLOR_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_LINE_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_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_STATIC_STATIC_SERIE_VALUE_ADDED_SIGNAL,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_NUM_SIGNALS
|
||||||
|
};
|
||||||
|
static guint live_chart_static_static_serie_signals[LIVE_CHART_STATIC_STATIC_SERIE_NUM_SIGNALS] = {0};
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticSeriePrivate {
|
||||||
|
gchar* _name;
|
||||||
|
gboolean _visible;
|
||||||
|
LiveChartStaticStaticSerieRenderer* renderer;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticSerie_private_offset;
|
||||||
|
static gpointer live_chart_static_static_serie_parent_class = NULL;
|
||||||
|
static LiveChartColorableIface * live_chart_static_static_serie_live_chart_colorable_parent_iface = NULL;
|
||||||
|
static LiveChartDrawableIface * live_chart_static_static_serie_live_chart_drawable_parent_iface = NULL;
|
||||||
|
|
||||||
|
static void live_chart_static_static_serie_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_static_static_serie_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result);
|
||||||
|
static void live_chart_static_static_serie_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_serie_get_type_once (void);
|
||||||
|
static void _vala_live_chart_static_static_serie_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_static_static_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_static_static_serie_get_instance_private (LiveChartStaticStaticSerie* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticSerie_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 39 "../src/static/static_serie.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 73 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerie*
|
||||||
|
live_chart_static_static_serie_construct (GType object_type,
|
||||||
|
const gchar* name,
|
||||||
|
LiveChartStaticStaticSerieRenderer* renderer)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self = NULL;
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
#line 37 "../src/static/static_serie.vala"
|
||||||
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
#line 37 "../src/static/static_serie.vala"
|
||||||
|
g_return_val_if_fail (renderer != NULL, NULL);
|
||||||
|
#line 37 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) g_object_new (object_type, NULL);
|
||||||
|
#line 38 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_set_name (self, name);
|
||||||
|
#line 39 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (renderer);
|
||||||
|
#line 39 "../src/static/static_serie.vala"
|
||||||
|
_g_object_unref0 (self->priv->renderer);
|
||||||
|
#line 39 "../src/static/static_serie.vala"
|
||||||
|
self->priv->renderer = _tmp0_;
|
||||||
|
#line 37 "../src/static/static_serie.vala"
|
||||||
|
return self;
|
||||||
|
#line 99 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerie*
|
||||||
|
live_chart_static_static_serie_new (const gchar* name,
|
||||||
|
LiveChartStaticStaticSerieRenderer* renderer)
|
||||||
|
{
|
||||||
|
#line 37 "../src/static/static_serie.vala"
|
||||||
|
return live_chart_static_static_serie_construct (LIVE_CHART_STATIC_TYPE_STATIC_SERIE, name, renderer);
|
||||||
|
#line 108 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_real_draw (LiveChartDrawable* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 42 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 42 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 42 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 43 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 43 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 43 "../src/static/static_serie.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 131 "static_serie.c"
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp2_;
|
||||||
|
#line 44 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = self->priv->renderer;
|
||||||
|
#line 44 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_renderer_draw (_tmp2_, ctx, config);
|
||||||
|
#line 137 "static_serie.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_add (LiveChartStaticStaticSerie* self,
|
||||||
|
const gchar* name,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartStaticStaticValues* _tmp1_;
|
||||||
|
LiveChartStaticStaticValues* _tmp2_;
|
||||||
|
LiveChartStaticNamedValue _tmp3_ = {0};
|
||||||
|
#line 48 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 48 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (name != NULL);
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_values (_tmp0_);
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_g_free0 (_tmp3_.name);
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_tmp3_.name = name;
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_tmp3_.value = value;
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_values_add (_tmp2_, &_tmp3_);
|
||||||
|
#line 49 "../src/static/static_serie.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 50 "../src/static/static_serie.vala"
|
||||||
|
g_signal_emit (self, live_chart_static_static_serie_signals[LIVE_CHART_STATIC_STATIC_SERIE_VALUE_ADDED_SIGNAL], 0, value);
|
||||||
|
#line 172 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticValues*
|
||||||
|
live_chart_static_static_serie_get_values (LiveChartStaticStaticSerie* self)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartStaticStaticValues* _tmp1_;
|
||||||
|
LiveChartStaticStaticValues* result;
|
||||||
|
#line 53 "../src/static/static_serie.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 54 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 54 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_values (_tmp0_);
|
||||||
|
#line 54 "../src/static/static_serie.vala"
|
||||||
|
result = _tmp1_;
|
||||||
|
#line 54 "../src/static/static_serie.vala"
|
||||||
|
return result;
|
||||||
|
#line 191 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_clear (LiveChartStaticStaticSerie* self)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartStaticStaticValues* _tmp1_;
|
||||||
|
LiveChartStaticStaticValues* _tmp2_;
|
||||||
|
#line 57 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 58 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 58 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_values (_tmp0_);
|
||||||
|
#line 58 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 58 "../src/static/static_serie.vala"
|
||||||
|
gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp2_);
|
||||||
|
#line 58 "../src/static/static_serie.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 212 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self;
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartBoundingBox _tmp1_ = {0};
|
||||||
|
#line 61 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 62 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 62 "../src/static/static_serie.vala"
|
||||||
|
live_chart_drawable_get_bounding_box ((LiveChartDrawable*) _tmp0_, &_tmp1_);
|
||||||
|
#line 62 "../src/static/static_serie.vala"
|
||||||
|
*result = _tmp1_;
|
||||||
|
#line 62 "../src/static/static_serie.vala"
|
||||||
|
return;
|
||||||
|
#line 232 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
live_chart_static_static_serie_get_name (LiveChartStaticStaticSerie* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->_name;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
return result;
|
||||||
|
#line 248 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_set_name (LiveChartStaticStaticSerie* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
gchar* old_value;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
old_value = live_chart_static_static_serie_get_name (self);
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
if (g_strcmp0 (value, old_value) != 0) {
|
||||||
|
#line 262 "static_serie.c"
|
||||||
|
gchar* _tmp0_;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
_g_free0 (self->priv->_name);
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
self->priv->_name = _tmp0_;
|
||||||
|
#line 9 "../src/static/static_serie.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY]);
|
||||||
|
#line 272 "static_serie.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_real_get_main_color (LiveChartColorable* base,
|
||||||
|
GdkRGBA * result)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie* self;
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPath* _tmp2_;
|
||||||
|
GdkRGBA _tmp3_ = {0};
|
||||||
|
GdkRGBA _tmp4_;
|
||||||
|
#line 13 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_line (_tmp0_);
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
live_chart_path_get_color (_tmp2_, &_tmp3_);
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
*result = _tmp4_;
|
||||||
|
#line 14 "../src/static/static_serie.vala"
|
||||||
|
return;
|
||||||
|
#line 302 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_real_set_main_color (LiveChartColorable* base,
|
||||||
|
GdkRGBA * value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie* self;
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPath* _tmp2_;
|
||||||
|
GdkRGBA _tmp3_;
|
||||||
|
#line 17 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 18 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 18 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_line (_tmp0_);
|
||||||
|
#line 18 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 18 "../src/static/static_serie.vala"
|
||||||
|
_tmp3_ = *value;
|
||||||
|
#line 18 "../src/static/static_serie.vala"
|
||||||
|
live_chart_path_set_color (_tmp2_, &_tmp3_);
|
||||||
|
#line 17 "../src/static/static_serie.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_MAIN_COLOR_PROPERTY]);
|
||||||
|
#line 328 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPath*
|
||||||
|
live_chart_static_static_serie_get_line (LiveChartStaticStaticSerie* self)
|
||||||
|
{
|
||||||
|
LiveChartPath* result;
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPath* _tmp2_;
|
||||||
|
#line 22 "../src/static/static_serie.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 23 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 23 "../src/static/static_serie.vala"
|
||||||
|
_tmp1_ = live_chart_static_static_serie_renderer_get_line (_tmp0_);
|
||||||
|
#line 23 "../src/static/static_serie.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 23 "../src/static/static_serie.vala"
|
||||||
|
result = _tmp2_;
|
||||||
|
#line 23 "../src/static/static_serie.vala"
|
||||||
|
return result;
|
||||||
|
#line 350 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_set_line (LiveChartStaticStaticSerie* self,
|
||||||
|
LiveChartPath* value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer* _tmp0_;
|
||||||
|
#line 26 "../src/static/static_serie.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 27 "../src/static/static_serie.vala"
|
||||||
|
_tmp0_ = self->priv->renderer;
|
||||||
|
#line 27 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_renderer_set_line (_tmp0_, value);
|
||||||
|
#line 26 "../src/static/static_serie.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_LINE_PROPERTY]);
|
||||||
|
#line 366 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_static_static_serie_real_get_visible (LiveChartDrawable* base)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
LiveChartStaticStaticSerie* self;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
return result;
|
||||||
|
#line 380 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_real_set_visible (LiveChartDrawable* base,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie* self;
|
||||||
|
gboolean old_value;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
self = (LiveChartStaticStaticSerie*) base;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
old_value = live_chart_static_static_serie_real_get_visible (base);
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_VISIBLE_PROPERTY]);
|
||||||
|
#line 399 "static_serie.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_class_init (LiveChartStaticStaticSerieClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticSerie_private_offset);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_serie_get_property;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_serie_set_property;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_serie_finalize;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_MAIN_COLOR_PROPERTY, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_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 6 "../src/static/static_serie.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_LINE_PROPERTY, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_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 6 "../src/static/static_serie.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_VISIBLE_PROPERTY, live_chart_static_static_serie_properties[LIVE_CHART_STATIC_STATIC_SERIE_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_serie.vala"
|
||||||
|
live_chart_static_static_serie_signals[LIVE_CHART_STATIC_STATIC_SERIE_VALUE_ADDED_SIGNAL] = g_signal_new ("value-added", LIVE_CHART_STATIC_TYPE_STATIC_SERIE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE);
|
||||||
|
#line 427 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_live_chart_colorable_interface_init (LiveChartColorableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_live_chart_colorable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->get_main_color = live_chart_static_static_serie_real_get_main_color;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->set_main_color = live_chart_static_static_serie_real_set_main_color;
|
||||||
|
#line 440 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_static_static_serie_real_draw;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_static_static_serie_real_get_bounding_box;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->get_visible = live_chart_static_static_serie_real_get_visible;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
iface->set_visible = live_chart_static_static_serie_real_set_visible;
|
||||||
|
#line 457 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_instance_init (LiveChartStaticStaticSerie * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
self->priv = live_chart_static_static_serie_get_instance_private (self);
|
||||||
|
#line 31 "../src/static/static_serie.vala"
|
||||||
|
self->priv->_visible = TRUE;
|
||||||
|
#line 468 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_SERIE, LiveChartStaticStaticSerie);
|
||||||
|
#line 8 "../src/static/static_serie.vala"
|
||||||
|
_g_free0 (self->priv->_name);
|
||||||
|
#line 35 "../src/static/static_serie.vala"
|
||||||
|
_g_object_unref0 (self->priv->renderer);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_serie_parent_class)->finalize (obj);
|
||||||
|
#line 483 "static_serie.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_serie_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticSerieClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_serie_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticSerie), 0, (GInstanceInitFunc) live_chart_static_static_serie_instance_init, NULL };
|
||||||
|
static const GInterfaceInfo live_chart_colorable_info = { (GInterfaceInitFunc) live_chart_static_static_serie_live_chart_colorable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_static_static_serie_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_static_static_serie_type_id;
|
||||||
|
live_chart_static_static_serie_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartStaticStaticSerie", &g_define_type_info, 0);
|
||||||
|
g_type_add_interface_static (live_chart_static_static_serie_type_id, LIVE_CHART_TYPE_COLORABLE, &live_chart_colorable_info);
|
||||||
|
g_type_add_interface_static (live_chart_static_static_serie_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||||||
|
LiveChartStaticStaticSerie_private_offset = g_type_add_instance_private (live_chart_static_static_serie_type_id, sizeof (LiveChartStaticStaticSeriePrivate));
|
||||||
|
return live_chart_static_static_serie_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_serie_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_serie_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_serie_type_id__once)) {
|
||||||
|
GType live_chart_static_static_serie_type_id;
|
||||||
|
live_chart_static_static_serie_type_id = live_chart_static_static_serie_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_serie_type_id__once, live_chart_static_static_serie_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_serie_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_serie_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_SERIE, LiveChartStaticStaticSerie);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_value_set_string (value, live_chart_static_static_serie_get_name (self));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_MAIN_COLOR_PROPERTY:
|
||||||
|
#line 530 "static_serie.c"
|
||||||
|
{
|
||||||
|
GdkRGBA boxed;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_colorable_get_main_color ((LiveChartColorable*) self, &boxed);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_value_set_boxed (value, &boxed);
|
||||||
|
#line 537 "static_serie.c"
|
||||||
|
}
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_LINE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_serie_get_line (self));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_VISIBLE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 553 "static_serie.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 559 "static_serie.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_serie_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerie * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_SERIE, LiveChartStaticStaticSerie);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_NAME_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_set_name (self, g_value_get_string (value));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_MAIN_COLOR_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_colorable_set_main_color ((LiveChartColorable*) self, g_value_get_boxed (value));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_LINE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_static_static_serie_set_line (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_VISIBLE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 597 "static_serie.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_serie.vala"
|
||||||
|
break;
|
||||||
|
#line 603 "static_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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,483 @@
|
||||||
|
/* static_serie_renderer.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_serie_renderer.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VIRTUAL_LEFT_PADDING -200
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VISIBLE_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_serie_renderer_properties[LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticSerieRendererPrivate {
|
||||||
|
gboolean _visible;
|
||||||
|
LiveChartPath* _line;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticSerieRenderer_private_offset;
|
||||||
|
static gpointer live_chart_static_static_serie_renderer_parent_class = NULL;
|
||||||
|
static LiveChartDrawableIface * live_chart_static_static_serie_renderer_live_chart_drawable_parent_iface = NULL;
|
||||||
|
|
||||||
|
static void live_chart_static_static_serie_renderer_real_draw (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_static_static_serie_renderer_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result);
|
||||||
|
static void live_chart_static_static_serie_renderer_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_serie_renderer_get_type_once (void);
|
||||||
|
static void _vala_live_chart_static_static_serie_renderer_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_static_static_serie_renderer_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_serie_renderer_get_instance_private (LiveChartStaticStaticSerieRenderer* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticSerieRenderer_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerieRenderer*
|
||||||
|
live_chart_static_static_serie_renderer_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer * self = NULL;
|
||||||
|
GdkRGBA _tmp0_ = {0};
|
||||||
|
LiveChartPath* _tmp1_;
|
||||||
|
LiveChartPath* _tmp2_;
|
||||||
|
#line 14 "../src/static/static_serie_renderer.vala"
|
||||||
|
self = (LiveChartStaticStaticSerieRenderer*) g_object_new (object_type, NULL);
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.red = 1.0;
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.green = 1.0;
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.blue = 1.0;
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.alpha = 1.0;
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp1_ = live_chart_path_new ((gdouble) 1, &_tmp0_, TRUE, NULL);
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
live_chart_static_static_serie_renderer_set_line (self, _tmp2_);
|
||||||
|
#line 15 "../src/static/static_serie_renderer.vala"
|
||||||
|
_g_object_unref0 (_tmp2_);
|
||||||
|
#line 14 "../src/static/static_serie_renderer.vala"
|
||||||
|
return self;
|
||||||
|
#line 87 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 27 "../src/static/static_serie_renderer.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 95 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticValues*
|
||||||
|
live_chart_static_static_serie_renderer_get_values (LiveChartStaticStaticSerieRenderer* self)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues* _tmp0_;
|
||||||
|
LiveChartStaticStaticValues* _tmp1_;
|
||||||
|
LiveChartStaticStaticValues* result;
|
||||||
|
#line 26 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 27 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = self->values;
|
||||||
|
#line 27 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp1_ = _g_object_ref0 (_tmp0_);
|
||||||
|
#line 27 "../src/static/static_serie_renderer.vala"
|
||||||
|
result = _tmp1_;
|
||||||
|
#line 27 "../src/static/static_serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 114 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_real_draw (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_critical ("Type `%s' does not implement abstract method `live_chart_static_static_serie_renderer_draw'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
return;
|
||||||
|
#line 126 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_renderer_draw (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRendererClass* _klass_;
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
_klass_ = LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_GET_CLASS (self);
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
if (_klass_->draw) {
|
||||||
|
#line 30 "../src/static/static_serie_renderer.vala"
|
||||||
|
_klass_->draw (self, ctx, config);
|
||||||
|
#line 143 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_real_get_bounding_box (LiveChartDrawable* base,
|
||||||
|
LiveChartBoundingBox* result)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer * self;
|
||||||
|
LiveChartBoundingBox _tmp0_;
|
||||||
|
#line 31 "../src/static/static_serie_renderer.vala"
|
||||||
|
self = (LiveChartStaticStaticSerieRenderer*) base;
|
||||||
|
#line 32 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = self->bounding_box;
|
||||||
|
#line 32 "../src/static/static_serie_renderer.vala"
|
||||||
|
*result = _tmp0_;
|
||||||
|
#line 32 "../src/static/static_serie_renderer.vala"
|
||||||
|
return;
|
||||||
|
#line 161 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_renderer_debug (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
cairo_t* ctx)
|
||||||
|
{
|
||||||
|
gchar* debug = NULL;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
gchar* _tmp1_;
|
||||||
|
const gchar* _tmp2_;
|
||||||
|
#line 35 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 35 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 36 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = g_getenv ("LIVE_CHART_DEBUG");
|
||||||
|
#line 36 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp1_ = g_strdup (_tmp0_);
|
||||||
|
#line 36 "../src/static/static_serie_renderer.vala"
|
||||||
|
debug = _tmp1_;
|
||||||
|
#line 37 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp2_ = debug;
|
||||||
|
#line 37 "../src/static/static_serie_renderer.vala"
|
||||||
|
if (_tmp2_ != NULL) {
|
||||||
|
#line 186 "static_serie_renderer.c"
|
||||||
|
LiveChartBoundingBox _tmp3_;
|
||||||
|
LiveChartBoundingBox _tmp4_;
|
||||||
|
LiveChartBoundingBox _tmp5_;
|
||||||
|
LiveChartBoundingBox _tmp6_;
|
||||||
|
#line 38 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp3_ = self->bounding_box;
|
||||||
|
#line 38 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp4_ = self->bounding_box;
|
||||||
|
#line 38 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp5_ = self->bounding_box;
|
||||||
|
#line 38 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp6_ = self->bounding_box;
|
||||||
|
#line 38 "../src/static/static_serie_renderer.vala"
|
||||||
|
cairo_rectangle (ctx, _tmp3_.x, _tmp4_.y, _tmp5_.width, _tmp6_.height);
|
||||||
|
#line 39 "../src/static/static_serie_renderer.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 203 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
#line 35 "../src/static/static_serie_renderer.vala"
|
||||||
|
_g_free0 (debug);
|
||||||
|
#line 207 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_static_static_serie_renderer_is_out_of_area (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
LiveChartPoint* point)
|
||||||
|
{
|
||||||
|
LiveChartPoint _tmp0_;
|
||||||
|
gboolean result;
|
||||||
|
#line 43 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, FALSE);
|
||||||
|
#line 43 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (point != NULL, FALSE);
|
||||||
|
#line 44 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = *point;
|
||||||
|
#line 44 "../src/static/static_serie_renderer.vala"
|
||||||
|
result = _tmp0_.x < ((gdouble) LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VIRTUAL_LEFT_PADDING);
|
||||||
|
#line 44 "../src/static/static_serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 226 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
live_chart_static_static_serie_renderer_real_get_visible (LiveChartDrawable* base)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
LiveChartStaticStaticSerieRenderer* self;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
self = (LiveChartStaticStaticSerieRenderer*) base;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
result = self->priv->_visible;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 240 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_real_set_visible (LiveChartDrawable* base,
|
||||||
|
gboolean value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer* self;
|
||||||
|
gboolean old_value;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
self = (LiveChartStaticStaticSerieRenderer*) base;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
old_value = live_chart_static_static_serie_renderer_real_get_visible (base);
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
self->priv->_visible = value;
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_renderer_properties[LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VISIBLE_PROPERTY]);
|
||||||
|
#line 259 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartPath*
|
||||||
|
live_chart_static_static_serie_renderer_get_line (LiveChartStaticStaticSerieRenderer* self)
|
||||||
|
{
|
||||||
|
LiveChartPath* result;
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = self->priv->_line;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
return result;
|
||||||
|
#line 276 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_serie_renderer_set_line (LiveChartStaticStaticSerieRenderer* self,
|
||||||
|
LiveChartPath* value)
|
||||||
|
{
|
||||||
|
LiveChartPath* old_value;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
old_value = live_chart_static_static_serie_renderer_get_line (self);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 290 "static_serie_renderer.c"
|
||||||
|
LiveChartPath* _tmp0_;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->priv->_line);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
self->priv->_line = _tmp0_;
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_serie_renderer_properties[LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY]);
|
||||||
|
#line 300 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_class_init (LiveChartStaticStaticSerieRendererClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
live_chart_static_static_serie_renderer_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticSerieRenderer_private_offset);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
((LiveChartStaticStaticSerieRendererClass *) klass)->draw = (void (*) (LiveChartStaticStaticSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_static_static_serie_renderer_real_draw;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_serie_renderer_get_property;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_serie_renderer_set_property;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_serie_renderer_finalize;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VISIBLE_PROPERTY, live_chart_static_static_serie_renderer_properties[LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_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_serie_renderer.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY, live_chart_static_static_serie_renderer_properties[LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY] = g_param_spec_object ("line", "line", "line", LIVE_CHART_TYPE_PATH, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 324 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_live_chart_drawable_interface_init (LiveChartDrawableIface * iface,
|
||||||
|
gpointer iface_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
live_chart_static_static_serie_renderer_live_chart_drawable_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
iface->draw = (void (*) (LiveChartDrawable*, cairo_t*, LiveChartConfig*)) live_chart_static_static_serie_renderer_draw;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
iface->get_bounding_box = (void (*) (LiveChartDrawable*, LiveChartBoundingBox*)) live_chart_static_static_serie_renderer_real_get_bounding_box;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
iface->get_visible = live_chart_static_static_serie_renderer_real_get_visible;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
iface->set_visible = live_chart_static_static_serie_renderer_real_set_visible;
|
||||||
|
#line 341 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_instance_init (LiveChartStaticStaticSerieRenderer * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
LiveChartBoundingBox _tmp0_ = {0};
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
self->priv = live_chart_static_static_serie_renderer_get_instance_private (self);
|
||||||
|
#line 10 "../src/static/static_serie_renderer.vala"
|
||||||
|
self->priv->_visible = TRUE;
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
memset (&_tmp0_, 0, sizeof (LiveChartBoundingBox));
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.x = (gdouble) 0;
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.y = (gdouble) 0;
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.width = (gdouble) 0;
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
_tmp0_.height = (gdouble) 0;
|
||||||
|
#line 18 "../src/static/static_serie_renderer.vala"
|
||||||
|
self->bounding_box = _tmp0_;
|
||||||
|
#line 365 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_serie_renderer_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer * self;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_SERIE_RENDERER, LiveChartStaticStaticSerieRenderer);
|
||||||
|
#line 12 "../src/static/static_serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->priv->_line);
|
||||||
|
#line 25 "../src/static/static_serie_renderer.vala"
|
||||||
|
_g_object_unref0 (self->values);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_serie_renderer_parent_class)->finalize (obj);
|
||||||
|
#line 380 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_serie_renderer_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticSerieRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_serie_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticSerieRenderer), 0, (GInstanceInitFunc) live_chart_static_static_serie_renderer_instance_init, NULL };
|
||||||
|
static const GInterfaceInfo live_chart_drawable_info = { (GInterfaceInitFunc) live_chart_static_static_serie_renderer_live_chart_drawable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
|
||||||
|
GType live_chart_static_static_serie_renderer_type_id;
|
||||||
|
live_chart_static_static_serie_renderer_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartStaticStaticSerieRenderer", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
|
||||||
|
g_type_add_interface_static (live_chart_static_static_serie_renderer_type_id, LIVE_CHART_TYPE_DRAWABLE, &live_chart_drawable_info);
|
||||||
|
LiveChartStaticStaticSerieRenderer_private_offset = g_type_add_instance_private (live_chart_static_static_serie_renderer_type_id, sizeof (LiveChartStaticStaticSerieRendererPrivate));
|
||||||
|
return live_chart_static_static_serie_renderer_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_serie_renderer_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_serie_renderer_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_serie_renderer_type_id__once)) {
|
||||||
|
GType live_chart_static_static_serie_renderer_type_id;
|
||||||
|
live_chart_static_static_serie_renderer_type_id = live_chart_static_static_serie_renderer_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_serie_renderer_type_id__once, live_chart_static_static_serie_renderer_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_serie_renderer_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_serie_renderer_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_SERIE_RENDERER, LiveChartStaticStaticSerieRenderer);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VISIBLE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_value_set_boolean (value, live_chart_drawable_get_visible ((LiveChartDrawable*) self));
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_serie_renderer_get_line (self));
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 429 "static_serie_renderer.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 435 "static_serie_renderer.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_serie_renderer_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSerieRenderer * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_SERIE_RENDERER, LiveChartStaticStaticSerieRenderer);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_VISIBLE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
live_chart_drawable_set_visible ((LiveChartDrawable*) self, g_value_get_boolean (value));
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_SERIE_RENDERER_LINE_PROPERTY:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
live_chart_static_static_serie_renderer_set_line (self, g_value_get_object (value));
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 461 "static_serie_renderer.c"
|
||||||
|
default:
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 6 "../src/static/static_serie_renderer.vala"
|
||||||
|
break;
|
||||||
|
#line 467 "static_serie_renderer.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,415 @@
|
||||||
|
/* static_series.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_series.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIES_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_SERIES_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_series_properties[LIVE_CHART_STATIC_STATIC_SERIES_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticSeriesPrivate {
|
||||||
|
GeeArrayList* series;
|
||||||
|
LiveChartStaticStaticChart* chart;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticSeries_private_offset;
|
||||||
|
static gpointer live_chart_static_static_series_parent_class = NULL;
|
||||||
|
|
||||||
|
static void __lambda15_ (LiveChartStaticStaticSeries* self,
|
||||||
|
gdouble value);
|
||||||
|
static void ___lambda15__live_chart_static_static_serie_value_added (LiveChartStaticStaticSerie* _sender,
|
||||||
|
gdouble value,
|
||||||
|
gpointer self);
|
||||||
|
static void live_chart_static_static_series_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_series_get_type_once (void);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_static_static_series_get_instance_private (LiveChartStaticStaticSeries* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticSeries_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 12 "../src/static/static_series.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 51 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSeries*
|
||||||
|
live_chart_static_static_series_construct (GType object_type,
|
||||||
|
LiveChartStaticStaticChart* chart)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSeries * self = NULL;
|
||||||
|
LiveChartStaticStaticChart* _tmp0_;
|
||||||
|
#line 11 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (chart != NULL, NULL);
|
||||||
|
#line 11 "../src/static/static_series.vala"
|
||||||
|
self = (LiveChartStaticStaticSeries*) g_object_new (object_type, NULL);
|
||||||
|
#line 12 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (chart);
|
||||||
|
#line 12 "../src/static/static_series.vala"
|
||||||
|
_g_object_unref0 (self->priv->chart);
|
||||||
|
#line 12 "../src/static/static_series.vala"
|
||||||
|
self->priv->chart = _tmp0_;
|
||||||
|
#line 11 "../src/static/static_series.vala"
|
||||||
|
return self;
|
||||||
|
#line 72 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSeries*
|
||||||
|
live_chart_static_static_series_new (LiveChartStaticStaticChart* chart)
|
||||||
|
{
|
||||||
|
#line 11 "../src/static/static_series.vala"
|
||||||
|
return live_chart_static_static_series_construct (LIVE_CHART_STATIC_TYPE_STATIC_SERIES, chart);
|
||||||
|
#line 80 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
__lambda15_ (LiveChartStaticStaticSeries* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticChart* _tmp0_;
|
||||||
|
LiveChartConfig* _tmp1_;
|
||||||
|
LiveChartYAxis* _tmp2_;
|
||||||
|
#line 20 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = self->priv->chart;
|
||||||
|
#line 20 "../src/static/static_series.vala"
|
||||||
|
_tmp1_ = _tmp0_->config;
|
||||||
|
#line 20 "../src/static/static_series.vala"
|
||||||
|
_tmp2_ = _tmp1_->y_axis;
|
||||||
|
#line 20 "../src/static/static_series.vala"
|
||||||
|
live_chart_yaxis_update_bounds (_tmp2_, value);
|
||||||
|
#line 98 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
___lambda15__live_chart_static_static_serie_value_added (LiveChartStaticStaticSerie* _sender,
|
||||||
|
gdouble value,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
#line 18 "../src/static/static_series.vala"
|
||||||
|
__lambda15_ ((LiveChartStaticStaticSeries*) self, value);
|
||||||
|
#line 108 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerie*
|
||||||
|
live_chart_static_static_series_register (LiveChartStaticStaticSeries* self,
|
||||||
|
LiveChartStaticStaticSerie* serie)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
LiveChartStaticStaticSerie* _tmp1_;
|
||||||
|
LiveChartStaticStaticSerie* result;
|
||||||
|
#line 15 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 15 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (serie != NULL, NULL);
|
||||||
|
#line 16 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 16 "../src/static/static_series.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, serie);
|
||||||
|
#line 18 "../src/static/static_series.vala"
|
||||||
|
g_signal_connect_object (serie, "value-added", (GCallback) ___lambda15__live_chart_static_static_serie_value_added, self, 0);
|
||||||
|
#line 22 "../src/static/static_series.vala"
|
||||||
|
_tmp1_ = _g_object_ref0 (serie);
|
||||||
|
#line 22 "../src/static/static_series.vala"
|
||||||
|
result = _tmp1_;
|
||||||
|
#line 22 "../src/static/static_series.vala"
|
||||||
|
return result;
|
||||||
|
#line 134 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerie*
|
||||||
|
live_chart_static_static_series_get (LiveChartStaticStaticSeries* self,
|
||||||
|
gint index,
|
||||||
|
GError** error)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
GeeArrayList* _tmp7_;
|
||||||
|
gpointer _tmp8_;
|
||||||
|
GError* _inner_error0_ = NULL;
|
||||||
|
LiveChartStaticStaticSerie* result;
|
||||||
|
#line 25 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 26 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 26 "../src/static/static_series.vala"
|
||||||
|
_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
|
||||||
|
#line 26 "../src/static/static_series.vala"
|
||||||
|
_tmp2_ = _tmp1_;
|
||||||
|
#line 26 "../src/static/static_series.vala"
|
||||||
|
if (index > (_tmp2_ - 1)) {
|
||||||
|
#line 159 "static_series.c"
|
||||||
|
gchar* _tmp3_;
|
||||||
|
gchar* _tmp4_;
|
||||||
|
GError* _tmp5_;
|
||||||
|
GError* _tmp6_;
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_tmp3_ = g_strdup_printf ("Serie at index %d not found", index);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_tmp5_ = g_error_new_literal (LIVE_CHART_CHART_ERROR, LIVE_CHART_CHART_ERROR_SERIE_NOT_FOUND, _tmp4_);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_tmp6_ = _tmp5_;
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_g_free0 (_tmp4_);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
_inner_error0_ = _tmp6_;
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
if (_inner_error0_->domain == LIVE_CHART_CHART_ERROR) {
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
g_propagate_error (error, _inner_error0_);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 182 "static_series.c"
|
||||||
|
} else {
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
g_clear_error (&_inner_error0_);
|
||||||
|
#line 27 "../src/static/static_series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 190 "static_series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 29 "../src/static/static_series.vala"
|
||||||
|
_tmp7_ = self->priv->series;
|
||||||
|
#line 29 "../src/static/static_series.vala"
|
||||||
|
_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, index);
|
||||||
|
#line 29 "../src/static/static_series.vala"
|
||||||
|
result = (LiveChartStaticStaticSerie*) _tmp8_;
|
||||||
|
#line 29 "../src/static/static_series.vala"
|
||||||
|
return result;
|
||||||
|
#line 201 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticSerie*
|
||||||
|
live_chart_static_static_series_get_by_name (LiveChartStaticStaticSeries* self,
|
||||||
|
const gchar* name,
|
||||||
|
GError** error)
|
||||||
|
{
|
||||||
|
gchar* _tmp11_;
|
||||||
|
gchar* _tmp12_;
|
||||||
|
GError* _tmp13_;
|
||||||
|
GError* _tmp14_;
|
||||||
|
GError* _inner_error0_ = NULL;
|
||||||
|
LiveChartStaticStaticSerie* result;
|
||||||
|
#line 32 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 32 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
#line 219 "static_series.c"
|
||||||
|
{
|
||||||
|
GeeArrayList* _serie_list = NULL;
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
gint _serie_size = 0;
|
||||||
|
GeeArrayList* _tmp1_;
|
||||||
|
gint _tmp2_;
|
||||||
|
gint _tmp3_;
|
||||||
|
gint _serie_index = 0;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_serie_list = _tmp0_;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp1_ = _serie_list;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp3_ = _tmp2_;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_serie_size = _tmp3_;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_serie_index = -1;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 244 "static_series.c"
|
||||||
|
gint _tmp4_;
|
||||||
|
gint _tmp5_;
|
||||||
|
LiveChartStaticStaticSerie* serie = NULL;
|
||||||
|
GeeArrayList* _tmp6_;
|
||||||
|
gpointer _tmp7_;
|
||||||
|
LiveChartStaticStaticSerie* _tmp8_;
|
||||||
|
const gchar* _tmp9_;
|
||||||
|
const gchar* _tmp10_;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_serie_index = _serie_index + 1;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp4_ = _serie_index;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp5_ = _serie_size;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
if (!(_tmp4_ < _tmp5_)) {
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
break;
|
||||||
|
#line 263 "static_series.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp6_ = _serie_list;
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _serie_index);
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
serie = (LiveChartStaticStaticSerie*) _tmp7_;
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
_tmp8_ = serie;
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
_tmp9_ = live_chart_static_static_serie_get_name (_tmp8_);
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
_tmp10_ = _tmp9_;
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
if (g_strcmp0 (_tmp10_, name) == 0) {
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
result = serie;
|
||||||
|
#line 34 "../src/static/static_series.vala"
|
||||||
|
return result;
|
||||||
|
#line 283 "static_series.c"
|
||||||
|
}
|
||||||
|
#line 33 "../src/static/static_series.vala"
|
||||||
|
_g_object_unref0 (serie);
|
||||||
|
#line 287 "static_series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_tmp11_ = g_strdup_printf ("Serie with name %s not found", name);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_tmp12_ = _tmp11_;
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_tmp13_ = g_error_new_literal (LIVE_CHART_CHART_ERROR, LIVE_CHART_CHART_ERROR_SERIE_NOT_FOUND, _tmp12_);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_tmp14_ = _tmp13_;
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_g_free0 (_tmp12_);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
_inner_error0_ = _tmp14_;
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
if (_inner_error0_->domain == LIVE_CHART_CHART_ERROR) {
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
g_propagate_error (error, _inner_error0_);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 308 "static_series.c"
|
||||||
|
} else {
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
g_clear_error (&_inner_error0_);
|
||||||
|
#line 36 "../src/static/static_series.vala"
|
||||||
|
return NULL;
|
||||||
|
#line 316 "static_series.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GeeIterator*
|
||||||
|
live_chart_static_static_series_iterator (LiveChartStaticStaticSeries* self)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
GeeListIterator* _tmp1_;
|
||||||
|
GeeIterator* result;
|
||||||
|
#line 39 "../src/static/static_series.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 40 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = self->priv->series;
|
||||||
|
#line 40 "../src/static/static_series.vala"
|
||||||
|
_tmp1_ = gee_abstract_list_list_iterator ((GeeAbstractList*) _tmp0_);
|
||||||
|
#line 40 "../src/static/static_series.vala"
|
||||||
|
result = (GeeIterator*) _tmp1_;
|
||||||
|
#line 40 "../src/static/static_series.vala"
|
||||||
|
return result;
|
||||||
|
#line 336 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_series_class_init (LiveChartStaticStaticSeriesClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
live_chart_static_static_series_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticSeries_private_offset);
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_series_finalize;
|
||||||
|
#line 349 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_series_instance_init (LiveChartStaticStaticSeries * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
self->priv = live_chart_static_static_series_get_instance_private (self);
|
||||||
|
#line 8 "../src/static/static_series.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (LIVE_CHART_STATIC_TYPE_STATIC_SERIE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
|
||||||
|
#line 8 "../src/static/static_series.vala"
|
||||||
|
self->priv->series = _tmp0_;
|
||||||
|
#line 363 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_series_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticSeries * self;
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_SERIES, LiveChartStaticStaticSeries);
|
||||||
|
#line 8 "../src/static/static_series.vala"
|
||||||
|
_g_object_unref0 (self->priv->series);
|
||||||
|
#line 9 "../src/static/static_series.vala"
|
||||||
|
_g_object_unref0 (self->priv->chart);
|
||||||
|
#line 6 "../src/static/static_series.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_series_parent_class)->finalize (obj);
|
||||||
|
#line 378 "static_series.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_series_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticSeriesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_series_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticSeries), 0, (GInstanceInitFunc) live_chart_static_static_series_instance_init, NULL };
|
||||||
|
GType live_chart_static_static_series_type_id;
|
||||||
|
live_chart_static_static_series_type_id = g_type_register_static (G_TYPE_OBJECT, "LiveChartStaticStaticSeries", &g_define_type_info, 0);
|
||||||
|
LiveChartStaticStaticSeries_private_offset = g_type_add_instance_private (live_chart_static_static_series_type_id, sizeof (LiveChartStaticStaticSeriesPrivate));
|
||||||
|
return live_chart_static_static_series_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_series_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_series_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_series_type_id__once)) {
|
||||||
|
GType live_chart_static_static_series_type_id;
|
||||||
|
live_chart_static_static_series_type_id = live_chart_static_static_series_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_series_type_id__once, live_chart_static_static_series_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_series_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,348 @@
|
||||||
|
/* static_values.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from static_values.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_STATIC_STATIC_VALUES_0_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY,
|
||||||
|
LIVE_CHART_STATIC_STATIC_VALUES_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_static_static_values_properties[LIVE_CHART_STATIC_STATIC_VALUES_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartStaticStaticValuesPrivate {
|
||||||
|
LiveChartBounds* _bounds;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartStaticStaticValues_private_offset;
|
||||||
|
static gpointer live_chart_static_static_values_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_static_static_values_finalize (GObject * obj);
|
||||||
|
static GType live_chart_static_static_values_get_type_once (void);
|
||||||
|
static void _vala_live_chart_static_static_values_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_static_static_values_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_named_value_copy (const LiveChartStaticNamedValue* self,
|
||||||
|
LiveChartStaticNamedValue* dest)
|
||||||
|
{
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
gchar* _tmp1_;
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
_tmp0_ = (*self).name;
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
_tmp1_ = g_strdup (_tmp0_);
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
_g_free0 ((*dest).name);
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
(*dest).name = _tmp1_;
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
(*dest).value = (*self).value;
|
||||||
|
#line 59 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_named_value_destroy (LiveChartStaticNamedValue* self)
|
||||||
|
{
|
||||||
|
#line 7 "../src/static/static_values.vala"
|
||||||
|
_g_free0 ((*self).name);
|
||||||
|
#line 67 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticNamedValue*
|
||||||
|
live_chart_static_named_value_dup (const LiveChartStaticNamedValue* self)
|
||||||
|
{
|
||||||
|
LiveChartStaticNamedValue* dup;
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
dup = g_new0 (LiveChartStaticNamedValue, 1);
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
live_chart_static_named_value_copy (self, dup);
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
return dup;
|
||||||
|
#line 80 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_named_value_free (LiveChartStaticNamedValue* self)
|
||||||
|
{
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
live_chart_static_named_value_destroy (self);
|
||||||
|
#line 6 "../src/static/static_values.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 90 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_named_value_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_static_named_value_type_id;
|
||||||
|
live_chart_static_named_value_type_id = g_boxed_type_register_static ("LiveChartStaticNamedValue", (GBoxedCopyFunc) live_chart_static_named_value_dup, (GBoxedFreeFunc) live_chart_static_named_value_free);
|
||||||
|
return live_chart_static_named_value_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_named_value_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_named_value_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_named_value_type_id__once)) {
|
||||||
|
GType live_chart_static_named_value_type_id;
|
||||||
|
live_chart_static_named_value_type_id = live_chart_static_named_value_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_named_value_type_id__once, live_chart_static_named_value_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_named_value_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_static_static_values_get_instance_private (LiveChartStaticStaticValues* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartStaticStaticValues_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticValues*
|
||||||
|
live_chart_static_static_values_construct (GType object_type)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues * self = NULL;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
#line 17 "../src/static/static_values.vala"
|
||||||
|
self = (LiveChartStaticStaticValues*) gee_linked_list_construct (object_type, LIVE_CHART_STATIC_TYPE_NAMED_VALUE, (GBoxedCopyFunc) live_chart_static_named_value_dup, (GDestroyNotify) live_chart_static_named_value_free, NULL, NULL, NULL);
|
||||||
|
#line 18 "../src/static/static_values.vala"
|
||||||
|
_tmp0_ = live_chart_bounds_new (((double) NAN), ((double) NAN));
|
||||||
|
#line 18 "../src/static/static_values.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 18 "../src/static/static_values.vala"
|
||||||
|
live_chart_static_static_values_set_bounds (self, _tmp1_);
|
||||||
|
#line 18 "../src/static/static_values.vala"
|
||||||
|
_g_object_unref0 (_tmp1_);
|
||||||
|
#line 17 "../src/static/static_values.vala"
|
||||||
|
return self;
|
||||||
|
#line 137 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartStaticStaticValues*
|
||||||
|
live_chart_static_static_values_new (void)
|
||||||
|
{
|
||||||
|
#line 17 "../src/static/static_values.vala"
|
||||||
|
return live_chart_static_static_values_construct (LIVE_CHART_STATIC_TYPE_STATIC_VALUES);
|
||||||
|
#line 145 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_values_add (LiveChartStaticStaticValues* self,
|
||||||
|
LiveChartStaticNamedValue* value)
|
||||||
|
{
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartStaticNamedValue _tmp1_;
|
||||||
|
LiveChartStaticNamedValue _tmp2_;
|
||||||
|
#line 21 "../src/static/static_values.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 21 "../src/static/static_values.vala"
|
||||||
|
g_return_if_fail (value != NULL);
|
||||||
|
#line 22 "../src/static/static_values.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 22 "../src/static/static_values.vala"
|
||||||
|
_tmp1_ = *value;
|
||||||
|
#line 22 "../src/static/static_values.vala"
|
||||||
|
live_chart_bounds_update (_tmp0_, _tmp1_.value);
|
||||||
|
#line 23 "../src/static/static_values.vala"
|
||||||
|
_tmp2_ = *value;
|
||||||
|
#line 23 "../src/static/static_values.vala"
|
||||||
|
GEE_ABSTRACT_COLLECTION_CLASS (live_chart_static_static_values_parent_class)->add ((GeeAbstractCollection*) G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_LINKED_LIST, GeeLinkedList), &_tmp2_);
|
||||||
|
#line 169 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_static_static_values_get_bounds (LiveChartStaticStaticValues* self)
|
||||||
|
{
|
||||||
|
LiveChartBounds* result;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
return result;
|
||||||
|
#line 185 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 193 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_static_static_values_set_bounds (LiveChartStaticStaticValues* self,
|
||||||
|
LiveChartBounds* value)
|
||||||
|
{
|
||||||
|
LiveChartBounds* old_value;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
old_value = live_chart_static_static_values_get_bounds (self);
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 207 "static_values.c"
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
self->priv->_bounds = _tmp0_;
|
||||||
|
#line 14 "../src/static/static_values.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_static_static_values_properties[LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY]);
|
||||||
|
#line 217 "static_values.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_values_class_init (LiveChartStaticStaticValuesClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
live_chart_static_static_values_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartStaticStaticValues_private_offset);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_static_static_values_get_property;
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_static_static_values_set_property;
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_static_static_values_finalize;
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY, live_chart_static_static_values_properties[LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY] = g_param_spec_object ("bounds", "bounds", "bounds", LIVE_CHART_TYPE_BOUNDS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||||
|
#line 237 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_values_instance_init (LiveChartStaticStaticValues * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
self->priv = live_chart_static_static_values_get_instance_private (self);
|
||||||
|
#line 246 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_static_static_values_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues * self;
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_STATIC_TYPE_STATIC_VALUES, LiveChartStaticStaticValues);
|
||||||
|
#line 13 "../src/static/static_values.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_static_static_values_parent_class)->finalize (obj);
|
||||||
|
#line 259 "static_values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_static_static_values_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartStaticStaticValuesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_static_static_values_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartStaticStaticValues), 0, (GInstanceInitFunc) live_chart_static_static_values_instance_init, NULL };
|
||||||
|
GType live_chart_static_static_values_type_id;
|
||||||
|
live_chart_static_static_values_type_id = g_type_register_static (GEE_TYPE_LINKED_LIST, "LiveChartStaticStaticValues", &g_define_type_info, 0);
|
||||||
|
LiveChartStaticStaticValues_private_offset = g_type_add_instance_private (live_chart_static_static_values_type_id, sizeof (LiveChartStaticStaticValuesPrivate));
|
||||||
|
return live_chart_static_static_values_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_static_static_values_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_static_static_values_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_static_static_values_type_id__once)) {
|
||||||
|
GType live_chart_static_static_values_type_id;
|
||||||
|
live_chart_static_static_values_type_id = live_chart_static_static_values_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_static_static_values_type_id__once, live_chart_static_static_values_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_static_static_values_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_values_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_VALUES, LiveChartStaticStaticValues);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY:
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
g_value_set_object (value, live_chart_static_static_values_get_bounds (self));
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
break;
|
||||||
|
#line 300 "static_values.c"
|
||||||
|
default:
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
break;
|
||||||
|
#line 306 "static_values.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_static_static_values_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartStaticStaticValues * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_STATIC_TYPE_STATIC_VALUES, LiveChartStaticStaticValues);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
case LIVE_CHART_STATIC_STATIC_VALUES_BOUNDS_PROPERTY:
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
live_chart_static_static_values_set_bounds (self, g_value_get_object (value));
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
break;
|
||||||
|
#line 326 "static_values.c"
|
||||||
|
default:
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 11 "../src/static/static_values.vala"
|
||||||
|
break;
|
||||||
|
#line 332 "static_values.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,303 @@
|
||||||
|
/* threshold_line.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from threshold_line.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <cairo-gobject.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_THRESHOLD_LINE_0_PROPERTY,
|
||||||
|
LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY,
|
||||||
|
LIVE_CHART_THRESHOLD_LINE_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_threshold_line_properties[LIVE_CHART_THRESHOLD_LINE_NUM_PROPERTIES];
|
||||||
|
|
||||||
|
struct _LiveChartThresholdLinePrivate {
|
||||||
|
gdouble _value;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartThresholdLine_private_offset;
|
||||||
|
static gpointer live_chart_threshold_line_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_threshold_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config);
|
||||||
|
static void live_chart_threshold_line_finalize (GObject * obj);
|
||||||
|
static GType live_chart_threshold_line_get_type_once (void);
|
||||||
|
static void _vala_live_chart_threshold_line_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_threshold_line_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_threshold_line_get_instance_private (LiveChartThresholdLine* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartThresholdLine_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartThresholdLine*
|
||||||
|
live_chart_threshold_line_construct (GType object_type,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
LiveChartThresholdLine * self = NULL;
|
||||||
|
#line 10 "../src/threshold_line.vala"
|
||||||
|
self = (LiveChartThresholdLine*) live_chart_serie_renderer_construct (object_type);
|
||||||
|
#line 11 "../src/threshold_line.vala"
|
||||||
|
live_chart_threshold_line_set_value (self, value);
|
||||||
|
#line 9 "../src/threshold_line.vala"
|
||||||
|
return self;
|
||||||
|
#line 59 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartThresholdLine*
|
||||||
|
live_chart_threshold_line_new (gdouble value)
|
||||||
|
{
|
||||||
|
#line 9 "../src/threshold_line.vala"
|
||||||
|
return live_chart_threshold_line_construct (LIVE_CHART_TYPE_THRESHOLD_LINE, value);
|
||||||
|
#line 67 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_threshold_line_real_draw (LiveChartSerieRenderer* base,
|
||||||
|
cairo_t* ctx,
|
||||||
|
LiveChartConfig* config)
|
||||||
|
{
|
||||||
|
LiveChartThresholdLine * self;
|
||||||
|
gboolean _tmp0_;
|
||||||
|
gboolean _tmp1_;
|
||||||
|
#line 14 "../src/threshold_line.vala"
|
||||||
|
self = (LiveChartThresholdLine*) base;
|
||||||
|
#line 14 "../src/threshold_line.vala"
|
||||||
|
g_return_if_fail (ctx != NULL);
|
||||||
|
#line 14 "../src/threshold_line.vala"
|
||||||
|
g_return_if_fail (config != NULL);
|
||||||
|
#line 15 "../src/threshold_line.vala"
|
||||||
|
_tmp0_ = live_chart_drawable_get_visible ((LiveChartDrawable*) self);
|
||||||
|
#line 15 "../src/threshold_line.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 15 "../src/threshold_line.vala"
|
||||||
|
if (_tmp1_) {
|
||||||
|
#line 90 "threshold_line.c"
|
||||||
|
LiveChartBoundaries boundaries = {0};
|
||||||
|
LiveChartBoundaries _tmp2_ = {0};
|
||||||
|
LiveChartPath* _tmp3_;
|
||||||
|
LiveChartPath* _tmp4_;
|
||||||
|
gdouble y = 0.0;
|
||||||
|
LiveChartBoundaries _tmp5_;
|
||||||
|
LiveChartBoundary _tmp6_;
|
||||||
|
gdouble _tmp7_;
|
||||||
|
LiveChartYAxis* _tmp8_;
|
||||||
|
LiveChartBoundaries _tmp9_;
|
||||||
|
LiveChartBoundary _tmp10_;
|
||||||
|
LiveChartBoundaries _tmp11_;
|
||||||
|
LiveChartBoundary _tmp12_;
|
||||||
|
#line 16 "../src/threshold_line.vala"
|
||||||
|
live_chart_config_boundaries (config, &_tmp2_);
|
||||||
|
#line 16 "../src/threshold_line.vala"
|
||||||
|
boundaries = _tmp2_;
|
||||||
|
#line 17 "../src/threshold_line.vala"
|
||||||
|
_tmp3_ = live_chart_serie_renderer_get_line ((LiveChartSerieRenderer*) self);
|
||||||
|
#line 17 "../src/threshold_line.vala"
|
||||||
|
_tmp4_ = _tmp3_;
|
||||||
|
#line 17 "../src/threshold_line.vala"
|
||||||
|
live_chart_path_configure (_tmp4_, ctx);
|
||||||
|
#line 18 "../src/threshold_line.vala"
|
||||||
|
_tmp5_ = boundaries;
|
||||||
|
#line 18 "../src/threshold_line.vala"
|
||||||
|
_tmp6_ = _tmp5_.y;
|
||||||
|
#line 18 "../src/threshold_line.vala"
|
||||||
|
_tmp7_ = self->priv->_value;
|
||||||
|
#line 18 "../src/threshold_line.vala"
|
||||||
|
_tmp8_ = config->y_axis;
|
||||||
|
#line 18 "../src/threshold_line.vala"
|
||||||
|
y = _tmp6_.max - (_tmp7_ * live_chart_yaxis_get_ratio (_tmp8_));
|
||||||
|
#line 19 "../src/threshold_line.vala"
|
||||||
|
_tmp9_ = boundaries;
|
||||||
|
#line 19 "../src/threshold_line.vala"
|
||||||
|
_tmp10_ = _tmp9_.x;
|
||||||
|
#line 19 "../src/threshold_line.vala"
|
||||||
|
cairo_move_to (ctx, (gdouble) _tmp10_.min, y);
|
||||||
|
#line 20 "../src/threshold_line.vala"
|
||||||
|
_tmp11_ = boundaries;
|
||||||
|
#line 20 "../src/threshold_line.vala"
|
||||||
|
_tmp12_ = _tmp11_.x;
|
||||||
|
#line 20 "../src/threshold_line.vala"
|
||||||
|
cairo_line_to (ctx, (gdouble) _tmp12_.max, y);
|
||||||
|
#line 21 "../src/threshold_line.vala"
|
||||||
|
cairo_stroke (ctx);
|
||||||
|
#line 138 "threshold_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
live_chart_threshold_line_get_value (LiveChartThresholdLine* self)
|
||||||
|
{
|
||||||
|
gdouble result;
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, 0.0);
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
result = self->priv->_value;
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
return result;
|
||||||
|
#line 152 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_threshold_line_set_value (LiveChartThresholdLine* self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
gdouble old_value;
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
old_value = live_chart_threshold_line_get_value (self);
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
self->priv->_value = value;
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_threshold_line_properties[LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY]);
|
||||||
|
#line 170 "threshold_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_threshold_line_class_init (LiveChartThresholdLineClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
live_chart_threshold_line_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartThresholdLine_private_offset);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
((LiveChartSerieRendererClass *) klass)->draw = (void (*) (LiveChartSerieRenderer*, cairo_t*, LiveChartConfig*)) live_chart_threshold_line_real_draw;
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_threshold_line_get_property;
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_threshold_line_set_property;
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_threshold_line_finalize;
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY, live_chart_threshold_line_properties[LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY] = g_param_spec_double ("value", "value", "value", -G_MAXDOUBLE, G_MAXDOUBLE, (gdouble) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
#line 192 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_threshold_line_instance_init (LiveChartThresholdLine * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
self->priv = live_chart_threshold_line_get_instance_private (self);
|
||||||
|
#line 7 "../src/threshold_line.vala"
|
||||||
|
self->priv->_value = (gdouble) 0;
|
||||||
|
#line 203 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_threshold_line_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartThresholdLine * self;
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_THRESHOLD_LINE, LiveChartThresholdLine);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_threshold_line_parent_class)->finalize (obj);
|
||||||
|
#line 214 "threshold_line.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_threshold_line_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartThresholdLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_threshold_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartThresholdLine), 0, (GInstanceInitFunc) live_chart_threshold_line_instance_init, NULL };
|
||||||
|
GType live_chart_threshold_line_type_id;
|
||||||
|
live_chart_threshold_line_type_id = g_type_register_static (LIVE_CHART_TYPE_SERIE_RENDERER, "LiveChartThresholdLine", &g_define_type_info, 0);
|
||||||
|
LiveChartThresholdLine_private_offset = g_type_add_instance_private (live_chart_threshold_line_type_id, sizeof (LiveChartThresholdLinePrivate));
|
||||||
|
return live_chart_threshold_line_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_threshold_line_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_threshold_line_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_threshold_line_type_id__once)) {
|
||||||
|
GType live_chart_threshold_line_type_id;
|
||||||
|
live_chart_threshold_line_type_id = live_chart_threshold_line_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_threshold_line_type_id__once, live_chart_threshold_line_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_threshold_line_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_threshold_line_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartThresholdLine * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_THRESHOLD_LINE, LiveChartThresholdLine);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
case LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY:
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
g_value_set_double (value, live_chart_threshold_line_get_value (self));
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
break;
|
||||||
|
#line 255 "threshold_line.c"
|
||||||
|
default:
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
break;
|
||||||
|
#line 261 "threshold_line.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_threshold_line_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartThresholdLine * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_THRESHOLD_LINE, LiveChartThresholdLine);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
case LIVE_CHART_THRESHOLD_LINE_VALUE_PROPERTY:
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
live_chart_threshold_line_set_value (self, g_value_get_double (value));
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
break;
|
||||||
|
#line 281 "threshold_line.c"
|
||||||
|
default:
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 5 "../src/threshold_line.vala"
|
||||||
|
break;
|
||||||
|
#line 287 "threshold_line.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,392 @@
|
||||||
|
/* utils.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from utils.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
|
||||||
|
VALA_EXTERN gint live_chart_num_of_digits (gint value);
|
||||||
|
static gfloat* _float_dup (gfloat* self);
|
||||||
|
static gint __lambda4_ (gint a,
|
||||||
|
gint b);
|
||||||
|
static gint ___lambda4__gcompare_data_func (gconstpointer a,
|
||||||
|
gconstpointer b,
|
||||||
|
gpointer self);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
gfloat
|
||||||
|
live_chart_cap (gfloat value)
|
||||||
|
{
|
||||||
|
gint num_digits = 0;
|
||||||
|
gdouble size = 0.0;
|
||||||
|
gdouble integer_part = 0.0;
|
||||||
|
gdouble fractional_part = 0.0;
|
||||||
|
gdouble _tmp0_ = 0.0;
|
||||||
|
gdouble _tmp1_;
|
||||||
|
gdouble delta = 0.0;
|
||||||
|
gfloat result;
|
||||||
|
#line 6 "../src/utils.vala"
|
||||||
|
num_digits = live_chart_num_of_digits ((gint) value);
|
||||||
|
#line 8 "../src/utils.vala"
|
||||||
|
size = pow ((gdouble) 10, ((gdouble) num_digits) - 1);
|
||||||
|
#line 10 "../src/utils.vala"
|
||||||
|
if (fmod (value, size) == ((gdouble) 0)) {
|
||||||
|
#line 11 "../src/utils.vala"
|
||||||
|
result = value;
|
||||||
|
#line 11 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 48 "utils.c"
|
||||||
|
}
|
||||||
|
#line 15 "../src/utils.vala"
|
||||||
|
_tmp1_ = modf (value / size, &_tmp0_);
|
||||||
|
#line 15 "../src/utils.vala"
|
||||||
|
integer_part = _tmp0_;
|
||||||
|
#line 15 "../src/utils.vala"
|
||||||
|
fractional_part = _tmp1_ * size;
|
||||||
|
#line 17 "../src/utils.vala"
|
||||||
|
delta = size - fractional_part;
|
||||||
|
#line 19 "../src/utils.vala"
|
||||||
|
result = (gfloat) (value + delta);
|
||||||
|
#line 19 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 62 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
live_chart_has_fractional_part (gfloat value)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
#line 23 "../src/utils.vala"
|
||||||
|
result = value != ((gfloat) ((gint) value));
|
||||||
|
#line 23 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 73 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gchar*
|
||||||
|
live_chart_format_for_y_axis (const gchar* unit,
|
||||||
|
gfloat value)
|
||||||
|
{
|
||||||
|
gchar* pattern = NULL;
|
||||||
|
gchar* _tmp0_;
|
||||||
|
const gchar* _tmp2_;
|
||||||
|
gchar* _tmp3_;
|
||||||
|
gchar* result;
|
||||||
|
#line 26 "../src/utils.vala"
|
||||||
|
g_return_val_if_fail (unit != NULL, NULL);
|
||||||
|
#line 27 "../src/utils.vala"
|
||||||
|
_tmp0_ = g_strdup ("%0.0f%s");
|
||||||
|
#line 27 "../src/utils.vala"
|
||||||
|
pattern = _tmp0_;
|
||||||
|
#line 28 "../src/utils.vala"
|
||||||
|
if (live_chart_has_fractional_part (value)) {
|
||||||
|
#line 93 "utils.c"
|
||||||
|
gchar* _tmp1_;
|
||||||
|
#line 29 "../src/utils.vala"
|
||||||
|
_tmp1_ = g_strdup ("%0.2f%s");
|
||||||
|
#line 29 "../src/utils.vala"
|
||||||
|
_g_free0 (pattern);
|
||||||
|
#line 29 "../src/utils.vala"
|
||||||
|
pattern = _tmp1_;
|
||||||
|
#line 101 "utils.c"
|
||||||
|
}
|
||||||
|
#line 31 "../src/utils.vala"
|
||||||
|
_tmp2_ = pattern;
|
||||||
|
#line 31 "../src/utils.vala"
|
||||||
|
_tmp3_ = g_strdup_printf (_tmp2_, value, unit);
|
||||||
|
#line 31 "../src/utils.vala"
|
||||||
|
result = _tmp3_;
|
||||||
|
#line 31 "../src/utils.vala"
|
||||||
|
_g_free0 (pattern);
|
||||||
|
#line 31 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 113 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gfloat*
|
||||||
|
_float_dup (gfloat* self)
|
||||||
|
{
|
||||||
|
gfloat* dup;
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
dup = g_new0 (gfloat, 1);
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
memcpy (dup, self, sizeof (gfloat));
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
return dup;
|
||||||
|
#line 126 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
__lambda4_ (gint a,
|
||||||
|
gint b)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
#line 57 "../src/utils.vala"
|
||||||
|
result = a - b;
|
||||||
|
#line 57 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 138 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
___lambda4__gcompare_data_func (gconstpointer a,
|
||||||
|
gconstpointer b,
|
||||||
|
gpointer self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
result = __lambda4_ ((gint) ((gintptr) a), (gint) ((gintptr) b));
|
||||||
|
#line 56 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 150 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
GeeList*
|
||||||
|
live_chart_golden_divisors (gfloat value)
|
||||||
|
{
|
||||||
|
gfloat _tmp1_ = 0.0F;
|
||||||
|
gfloat factor = 0.0F;
|
||||||
|
gfloat working_value = 0.0F;
|
||||||
|
gfloat sqrt = 0.0F;
|
||||||
|
GeeArrayList* divs = NULL;
|
||||||
|
GeeArrayList* _tmp2_;
|
||||||
|
GeeArrayList* _tmp7_;
|
||||||
|
GeeArrayList* ndivs = NULL;
|
||||||
|
GeeArrayList* _tmp8_;
|
||||||
|
gint last_div = 0;
|
||||||
|
GeeArrayList* _tmp9_;
|
||||||
|
gpointer _tmp10_;
|
||||||
|
GeeList* result;
|
||||||
|
#line 36 "../src/utils.vala"
|
||||||
|
if (value == ((gfloat) 0)) {
|
||||||
|
#line 171 "utils.c"
|
||||||
|
GeeArrayList* _tmp0_;
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
_tmp0_ = gee_array_list_new (G_TYPE_FLOAT, (GBoxedCopyFunc) _float_dup, (GDestroyNotify) g_free, NULL, NULL, NULL);
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
result = (GeeList*) _tmp0_;
|
||||||
|
#line 37 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 179 "utils.c"
|
||||||
|
}
|
||||||
|
#line 41 "../src/utils.vala"
|
||||||
|
if (value < ((gfloat) 10)) {
|
||||||
|
#line 41 "../src/utils.vala"
|
||||||
|
_tmp1_ = live_chart_cap (100 / value);
|
||||||
|
#line 185 "utils.c"
|
||||||
|
} else {
|
||||||
|
#line 41 "../src/utils.vala"
|
||||||
|
_tmp1_ = 1.f;
|
||||||
|
#line 189 "utils.c"
|
||||||
|
}
|
||||||
|
#line 41 "../src/utils.vala"
|
||||||
|
factor = _tmp1_;
|
||||||
|
#line 42 "../src/utils.vala"
|
||||||
|
working_value = value * factor;
|
||||||
|
#line 44 "../src/utils.vala"
|
||||||
|
sqrt = sqrtf (working_value);
|
||||||
|
#line 45 "../src/utils.vala"
|
||||||
|
_tmp2_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
#line 45 "../src/utils.vala"
|
||||||
|
divs = _tmp2_;
|
||||||
|
#line 201 "utils.c"
|
||||||
|
{
|
||||||
|
gint i = 0;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
i = 1;
|
||||||
|
#line 206 "utils.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp3_ = FALSE;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
_tmp3_ = TRUE;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
if (!_tmp3_) {
|
||||||
|
#line 215 "utils.c"
|
||||||
|
gint _tmp4_;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
_tmp4_ = i;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
i = _tmp4_ + 1;
|
||||||
|
#line 221 "utils.c"
|
||||||
|
}
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
_tmp3_ = FALSE;
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
if (!(((gfloat) i) <= sqrt)) {
|
||||||
|
#line 47 "../src/utils.vala"
|
||||||
|
break;
|
||||||
|
#line 229 "utils.c"
|
||||||
|
}
|
||||||
|
#line 48 "../src/utils.vala"
|
||||||
|
if (fmodf (working_value, i) == ((gfloat) 0)) {
|
||||||
|
#line 233 "utils.c"
|
||||||
|
GeeArrayList* _tmp5_;
|
||||||
|
gfloat tmp = 0.0F;
|
||||||
|
#line 49 "../src/utils.vala"
|
||||||
|
_tmp5_ = divs;
|
||||||
|
#line 49 "../src/utils.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, (gpointer) ((gintptr) i));
|
||||||
|
#line 50 "../src/utils.vala"
|
||||||
|
tmp = working_value / i;
|
||||||
|
#line 51 "../src/utils.vala"
|
||||||
|
if (tmp != ((gfloat) i)) {
|
||||||
|
#line 244 "utils.c"
|
||||||
|
GeeArrayList* _tmp6_;
|
||||||
|
#line 52 "../src/utils.vala"
|
||||||
|
_tmp6_ = divs;
|
||||||
|
#line 52 "../src/utils.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, (gpointer) ((gintptr) tmp));
|
||||||
|
#line 250 "utils.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 56 "../src/utils.vala"
|
||||||
|
_tmp7_ = divs;
|
||||||
|
#line 56 "../src/utils.vala"
|
||||||
|
gee_list_sort ((GeeList*) _tmp7_, ___lambda4__gcompare_data_func, NULL, NULL);
|
||||||
|
#line 60 "../src/utils.vala"
|
||||||
|
_tmp8_ = gee_array_list_new (G_TYPE_FLOAT, (GBoxedCopyFunc) _float_dup, (GDestroyNotify) g_free, NULL, NULL, NULL);
|
||||||
|
#line 60 "../src/utils.vala"
|
||||||
|
ndivs = _tmp8_;
|
||||||
|
#line 61 "../src/utils.vala"
|
||||||
|
_tmp9_ = divs;
|
||||||
|
#line 61 "../src/utils.vala"
|
||||||
|
_tmp10_ = gee_list_last ((GeeList*) _tmp9_);
|
||||||
|
#line 61 "../src/utils.vala"
|
||||||
|
last_div = (gint) ((gintptr) _tmp10_);
|
||||||
|
#line 270 "utils.c"
|
||||||
|
{
|
||||||
|
gint i = 0;
|
||||||
|
GeeArrayList* _tmp11_;
|
||||||
|
gint _tmp12_;
|
||||||
|
gint _tmp13_;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp11_ = divs;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp13_ = _tmp12_;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
i = _tmp13_ - 1;
|
||||||
|
#line 284 "utils.c"
|
||||||
|
{
|
||||||
|
gboolean _tmp14_ = FALSE;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp14_ = TRUE;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 291 "utils.c"
|
||||||
|
gint current = 0;
|
||||||
|
GeeArrayList* _tmp16_;
|
||||||
|
gpointer _tmp17_;
|
||||||
|
GeeArrayList* _tmp18_;
|
||||||
|
gfloat _tmp19_;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
if (!_tmp14_) {
|
||||||
|
#line 299 "utils.c"
|
||||||
|
gint _tmp15_;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp15_ = i;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
i = _tmp15_ - 1;
|
||||||
|
#line 305 "utils.c"
|
||||||
|
}
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
_tmp14_ = FALSE;
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
if (!(i >= 0)) {
|
||||||
|
#line 62 "../src/utils.vala"
|
||||||
|
break;
|
||||||
|
#line 313 "utils.c"
|
||||||
|
}
|
||||||
|
#line 63 "../src/utils.vala"
|
||||||
|
_tmp16_ = divs;
|
||||||
|
#line 63 "../src/utils.vala"
|
||||||
|
_tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, i);
|
||||||
|
#line 63 "../src/utils.vala"
|
||||||
|
current = (gint) ((gintptr) _tmp17_);
|
||||||
|
#line 64 "../src/utils.vala"
|
||||||
|
if ((last_div / current) != 2) {
|
||||||
|
#line 65 "../src/utils.vala"
|
||||||
|
continue;
|
||||||
|
#line 325 "utils.c"
|
||||||
|
}
|
||||||
|
#line 67 "../src/utils.vala"
|
||||||
|
_tmp18_ = ndivs;
|
||||||
|
#line 67 "../src/utils.vala"
|
||||||
|
_tmp19_ = (gfloat) current;
|
||||||
|
#line 67 "../src/utils.vala"
|
||||||
|
gee_abstract_collection_add ((GeeAbstractCollection*) _tmp18_, &_tmp19_);
|
||||||
|
#line 68 "../src/utils.vala"
|
||||||
|
last_div = current;
|
||||||
|
#line 335 "utils.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#line 71 "../src/utils.vala"
|
||||||
|
result = (GeeList*) ndivs;
|
||||||
|
#line 71 "../src/utils.vala"
|
||||||
|
_g_object_unref0 (divs);
|
||||||
|
#line 71 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 345 "utils.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
live_chart_num_of_digits (gint value)
|
||||||
|
{
|
||||||
|
gint num_digits = 0;
|
||||||
|
gint result;
|
||||||
|
#line 75 "../src/utils.vala"
|
||||||
|
num_digits = 0;
|
||||||
|
#line 76 "../src/utils.vala"
|
||||||
|
while (TRUE) {
|
||||||
|
#line 357 "utils.c"
|
||||||
|
gint _tmp0_;
|
||||||
|
#line 76 "../src/utils.vala"
|
||||||
|
if (!(value != 0)) {
|
||||||
|
#line 76 "../src/utils.vala"
|
||||||
|
break;
|
||||||
|
#line 363 "utils.c"
|
||||||
|
}
|
||||||
|
#line 77 "../src/utils.vala"
|
||||||
|
value = value / 10;
|
||||||
|
#line 78 "../src/utils.vala"
|
||||||
|
num_digits = num_digits + 1;
|
||||||
|
#line 78 "../src/utils.vala"
|
||||||
|
_tmp0_ = num_digits;
|
||||||
|
#line 371 "utils.c"
|
||||||
|
}
|
||||||
|
#line 81 "../src/utils.vala"
|
||||||
|
result = num_digits;
|
||||||
|
#line 81 "../src/utils.vala"
|
||||||
|
return result;
|
||||||
|
#line 377 "utils.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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,341 @@
|
||||||
|
/* values.c generated by valac 0.56.0, the Vala compiler
|
||||||
|
* generated from values.vala, do not modify */
|
||||||
|
|
||||||
|
#include "livechart_static.h"
|
||||||
|
#include <glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gee.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LIVE_CHART_VALUES_0_PROPERTY,
|
||||||
|
LIVE_CHART_VALUES_BOUNDS_PROPERTY,
|
||||||
|
LIVE_CHART_VALUES_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* live_chart_values_properties[LIVE_CHART_VALUES_NUM_PROPERTIES];
|
||||||
|
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
||||||
|
#define _live_chart_timestamped_value_free0(var) ((var == NULL) ? NULL : (var = (live_chart_timestamped_value_free (var), NULL)))
|
||||||
|
|
||||||
|
struct _LiveChartValuesPrivate {
|
||||||
|
LiveChartBounds* _bounds;
|
||||||
|
gint buffer_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint LiveChartValues_private_offset;
|
||||||
|
static gpointer live_chart_values_parent_class = NULL;
|
||||||
|
|
||||||
|
static void live_chart_values_finalize (GObject * obj);
|
||||||
|
static GType live_chart_values_get_type_once (void);
|
||||||
|
static void _vala_live_chart_values_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_live_chart_values_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static inline gpointer _vala_memdup2 (gconstpointer mem,
|
||||||
|
gsize byte_size);
|
||||||
|
|
||||||
|
LiveChartTimestampedValue*
|
||||||
|
live_chart_timestamped_value_dup (const LiveChartTimestampedValue* self)
|
||||||
|
{
|
||||||
|
LiveChartTimestampedValue* dup;
|
||||||
|
#line 5 "../src/values.vala"
|
||||||
|
dup = g_new0 (LiveChartTimestampedValue, 1);
|
||||||
|
#line 5 "../src/values.vala"
|
||||||
|
memcpy (dup, self, sizeof (LiveChartTimestampedValue));
|
||||||
|
#line 5 "../src/values.vala"
|
||||||
|
return dup;
|
||||||
|
#line 53 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_timestamped_value_free (LiveChartTimestampedValue* self)
|
||||||
|
{
|
||||||
|
#line 5 "../src/values.vala"
|
||||||
|
g_free (self);
|
||||||
|
#line 61 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_timestamped_value_get_type_once (void)
|
||||||
|
{
|
||||||
|
GType live_chart_timestamped_value_type_id;
|
||||||
|
live_chart_timestamped_value_type_id = g_boxed_type_register_static ("LiveChartTimestampedValue", (GBoxedCopyFunc) live_chart_timestamped_value_dup, (GBoxedFreeFunc) live_chart_timestamped_value_free);
|
||||||
|
return live_chart_timestamped_value_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_timestamped_value_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_timestamped_value_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_timestamped_value_type_id__once)) {
|
||||||
|
GType live_chart_timestamped_value_type_id;
|
||||||
|
live_chart_timestamped_value_type_id = live_chart_timestamped_value_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_timestamped_value_type_id__once, live_chart_timestamped_value_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_timestamped_value_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
live_chart_values_get_instance_private (LiveChartValues* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, LiveChartValues_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartValues*
|
||||||
|
live_chart_values_construct (GType object_type,
|
||||||
|
gint buffer_size)
|
||||||
|
{
|
||||||
|
LiveChartValues * self = NULL;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
LiveChartBounds* _tmp1_;
|
||||||
|
#line 17 "../src/values.vala"
|
||||||
|
self = (LiveChartValues*) gee_linked_list_construct (object_type, LIVE_CHART_TYPE_TIMESTAMPED_VALUE, (GBoxedCopyFunc) live_chart_timestamped_value_dup, (GDestroyNotify) live_chart_timestamped_value_free, NULL, NULL, NULL);
|
||||||
|
#line 18 "../src/values.vala"
|
||||||
|
_tmp0_ = live_chart_bounds_new (((double) NAN), ((double) NAN));
|
||||||
|
#line 18 "../src/values.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 18 "../src/values.vala"
|
||||||
|
live_chart_values_set_bounds (self, _tmp1_);
|
||||||
|
#line 18 "../src/values.vala"
|
||||||
|
_g_object_unref0 (_tmp1_);
|
||||||
|
#line 19 "../src/values.vala"
|
||||||
|
self->priv->buffer_size = buffer_size;
|
||||||
|
#line 17 "../src/values.vala"
|
||||||
|
return self;
|
||||||
|
#line 111 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartValues*
|
||||||
|
live_chart_values_new (gint buffer_size)
|
||||||
|
{
|
||||||
|
#line 17 "../src/values.vala"
|
||||||
|
return live_chart_values_construct (LIVE_CHART_TYPE_VALUES, buffer_size);
|
||||||
|
#line 119 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_values_add (LiveChartValues* self,
|
||||||
|
LiveChartTimestampedValue* value)
|
||||||
|
{
|
||||||
|
gint _tmp0_;
|
||||||
|
gint _tmp1_;
|
||||||
|
LiveChartBounds* _tmp4_;
|
||||||
|
LiveChartTimestampedValue _tmp5_;
|
||||||
|
LiveChartTimestampedValue _tmp6_;
|
||||||
|
#line 22 "../src/values.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 22 "../src/values.vala"
|
||||||
|
g_return_if_fail (value != NULL);
|
||||||
|
#line 23 "../src/values.vala"
|
||||||
|
_tmp0_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) self);
|
||||||
|
#line 23 "../src/values.vala"
|
||||||
|
_tmp1_ = _tmp0_;
|
||||||
|
#line 23 "../src/values.vala"
|
||||||
|
if (_tmp1_ == self->priv->buffer_size) {
|
||||||
|
#line 141 "values.c"
|
||||||
|
gpointer _tmp2_;
|
||||||
|
LiveChartTimestampedValue* _tmp3_;
|
||||||
|
#line 24 "../src/values.vala"
|
||||||
|
_tmp2_ = gee_abstract_list_remove_at ((GeeAbstractList*) self, 0);
|
||||||
|
#line 24 "../src/values.vala"
|
||||||
|
_tmp3_ = (LiveChartTimestampedValue*) _tmp2_;
|
||||||
|
#line 24 "../src/values.vala"
|
||||||
|
_live_chart_timestamped_value_free0 (_tmp3_);
|
||||||
|
#line 150 "values.c"
|
||||||
|
}
|
||||||
|
#line 26 "../src/values.vala"
|
||||||
|
_tmp4_ = self->priv->_bounds;
|
||||||
|
#line 26 "../src/values.vala"
|
||||||
|
_tmp5_ = *value;
|
||||||
|
#line 26 "../src/values.vala"
|
||||||
|
live_chart_bounds_update (_tmp4_, _tmp5_.value);
|
||||||
|
#line 27 "../src/values.vala"
|
||||||
|
_tmp6_ = *value;
|
||||||
|
#line 27 "../src/values.vala"
|
||||||
|
GEE_ABSTRACT_COLLECTION_CLASS (live_chart_values_parent_class)->add ((GeeAbstractCollection*) G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_LINKED_LIST, GeeLinkedList), &_tmp6_);
|
||||||
|
#line 162 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
LiveChartBounds*
|
||||||
|
live_chart_values_get_bounds (LiveChartValues* self)
|
||||||
|
{
|
||||||
|
LiveChartBounds* result;
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
_tmp0_ = self->priv->_bounds;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
result = _tmp0_;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
return result;
|
||||||
|
#line 178 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
_g_object_ref0 (gpointer self)
|
||||||
|
{
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
return self ? g_object_ref (self) : NULL;
|
||||||
|
#line 186 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
live_chart_values_set_bounds (LiveChartValues* self,
|
||||||
|
LiveChartBounds* value)
|
||||||
|
{
|
||||||
|
LiveChartBounds* old_value;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
old_value = live_chart_values_get_bounds (self);
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
if (old_value != value) {
|
||||||
|
#line 200 "values.c"
|
||||||
|
LiveChartBounds* _tmp0_;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
_tmp0_ = _g_object_ref0 (value);
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
self->priv->_bounds = _tmp0_;
|
||||||
|
#line 12 "../src/values.vala"
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, live_chart_values_properties[LIVE_CHART_VALUES_BOUNDS_PROPERTY]);
|
||||||
|
#line 210 "values.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_values_class_init (LiveChartValuesClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
live_chart_values_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
g_type_class_adjust_private_offset (klass, &LiveChartValues_private_offset);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_live_chart_values_get_property;
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_live_chart_values_set_property;
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = live_chart_values_finalize;
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), LIVE_CHART_VALUES_BOUNDS_PROPERTY, live_chart_values_properties[LIVE_CHART_VALUES_BOUNDS_PROPERTY] = g_param_spec_object ("bounds", "bounds", "bounds", LIVE_CHART_TYPE_BOUNDS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
|
||||||
|
#line 230 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_values_instance_init (LiveChartValues * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
self->priv = live_chart_values_get_instance_private (self);
|
||||||
|
#line 239 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
live_chart_values_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
LiveChartValues * self;
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIVE_CHART_TYPE_VALUES, LiveChartValues);
|
||||||
|
#line 11 "../src/values.vala"
|
||||||
|
_g_object_unref0 (self->priv->_bounds);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_CLASS (live_chart_values_parent_class)->finalize (obj);
|
||||||
|
#line 252 "values.c"
|
||||||
|
}
|
||||||
|
|
||||||
|
static GType
|
||||||
|
live_chart_values_get_type_once (void)
|
||||||
|
{
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (LiveChartValuesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) live_chart_values_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LiveChartValues), 0, (GInstanceInitFunc) live_chart_values_instance_init, NULL };
|
||||||
|
GType live_chart_values_type_id;
|
||||||
|
live_chart_values_type_id = g_type_register_static (GEE_TYPE_LINKED_LIST, "LiveChartValues", &g_define_type_info, 0);
|
||||||
|
LiveChartValues_private_offset = g_type_add_instance_private (live_chart_values_type_id, sizeof (LiveChartValuesPrivate));
|
||||||
|
return live_chart_values_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
live_chart_values_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize live_chart_values_type_id__once = 0;
|
||||||
|
if (g_once_init_enter (&live_chart_values_type_id__once)) {
|
||||||
|
GType live_chart_values_type_id;
|
||||||
|
live_chart_values_type_id = live_chart_values_get_type_once ();
|
||||||
|
g_once_init_leave (&live_chart_values_type_id__once, live_chart_values_type_id);
|
||||||
|
}
|
||||||
|
return live_chart_values_type_id__once;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_values_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartValues * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_VALUES, LiveChartValues);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
case LIVE_CHART_VALUES_BOUNDS_PROPERTY:
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
g_value_set_object (value, live_chart_values_get_bounds (self));
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
break;
|
||||||
|
#line 293 "values.c"
|
||||||
|
default:
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
break;
|
||||||
|
#line 299 "values.c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_live_chart_values_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
LiveChartValues * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, LIVE_CHART_TYPE_VALUES, LiveChartValues);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
switch (property_id) {
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
case LIVE_CHART_VALUES_BOUNDS_PROPERTY:
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
live_chart_values_set_bounds (self, g_value_get_object (value));
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
break;
|
||||||
|
#line 319 "values.c"
|
||||||
|
default:
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
#line 9 "../src/values.vala"
|
||||||
|
break;
|
||||||
|
#line 325 "values.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;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,507 @@
|
||||||
|
/* livechart.vapi generated by valac 0.56.0, do not modify. */
|
||||||
|
|
||||||
|
namespace LiveChart {
|
||||||
|
namespace Static {
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticChart : Gtk.DrawingArea {
|
||||||
|
public LiveChart.Config config;
|
||||||
|
public LiveChart.Static.StaticSeries series;
|
||||||
|
public StaticChart (LiveChart.Config config = new LiveChart.Config ());
|
||||||
|
public void add_serie (LiveChart.Static.StaticSerie serie);
|
||||||
|
public void set_categories (Gee.ArrayList<string> categories);
|
||||||
|
public LiveChart.Background background { get; set; }
|
||||||
|
public LiveChart.Static.StaticGrid grid { get; set; }
|
||||||
|
public LiveChart.Legend legend { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticGrid : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public const int ABSCISSA_TIME_PADDING;
|
||||||
|
public StaticGrid ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
protected void render_abscissa (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_grid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_hgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_ordinate (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_vgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void restore (Cairo.Context ctx);
|
||||||
|
protected void update_bounding_box (LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticLine : LiveChart.Static.StaticSerieRenderer {
|
||||||
|
public StaticLine (LiveChart.Static.StaticValues values = new LiveChart.Static.StaticValues ());
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_line (LiveChart.Static.StaticPoints points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticPoints : GLib.Object {
|
||||||
|
public StaticPoints ();
|
||||||
|
public void add (LiveChart.Point point);
|
||||||
|
public LiveChart.Point after (int at);
|
||||||
|
public static LiveChart.Static.StaticPoints create (LiveChart.Static.StaticValues values, LiveChart.Config config);
|
||||||
|
public LiveChart.Point first ();
|
||||||
|
public new LiveChart.Point @get (int at);
|
||||||
|
public LiveChart.Point last ();
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
public double realtime_delta { get; set; }
|
||||||
|
public int size { get; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticSerie : LiveChart.Colorable, LiveChart.Drawable, GLib.Object {
|
||||||
|
public StaticSerie (string name, LiveChart.Static.StaticSerieRenderer renderer = new LiveChart.Static.StaticLine (new LiveChart.Static.StaticValues ()));
|
||||||
|
public void add (string name, double value);
|
||||||
|
public void clear ();
|
||||||
|
public LiveChart.Static.StaticValues get_values ();
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public signal void value_added (double value);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public abstract class StaticSerieRenderer : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
protected LiveChart.Static.StaticValues values;
|
||||||
|
protected StaticSerieRenderer ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Static.StaticValues get_values ();
|
||||||
|
protected bool is_out_of_area (LiveChart.Point point);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticSeries : GLib.Object {
|
||||||
|
public StaticSeries (LiveChart.Static.StaticChart chart);
|
||||||
|
public new LiveChart.Static.StaticSerie @get (int index) throws LiveChart.ChartError;
|
||||||
|
public LiveChart.Static.StaticSerie get_by_name (string name) throws LiveChart.ChartError;
|
||||||
|
public Gee.Iterator<LiveChart.Static.StaticSerie> iterator ();
|
||||||
|
public LiveChart.Static.StaticSerie register (LiveChart.Static.StaticSerie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class StaticValues : Gee.LinkedList<LiveChart.Static.NamedValue?> {
|
||||||
|
public StaticValues ();
|
||||||
|
public new void add (LiveChart.Static.NamedValue value);
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct NamedValue {
|
||||||
|
public string name;
|
||||||
|
public double value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Area : LiveChart.Drawable, GLib.Object {
|
||||||
|
public Area (LiveChart.Points points, Gdk.RGBA color, double alpha);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Background : LiveChart.Drawable, GLib.Object {
|
||||||
|
public Background ();
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Background.color")]
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Bar : LiveChart.SerieRenderer {
|
||||||
|
public Bar (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class BezierIntersector : LiveChart.Intersector<LiveChart.BezierCurve?> {
|
||||||
|
public BezierIntersector (LiveChart.Region region, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Bounds : GLib.Object {
|
||||||
|
public Bounds (double lower = double.NAN, double upper = double.NAN);
|
||||||
|
public bool has_lower ();
|
||||||
|
public bool has_upper ();
|
||||||
|
public bool update (double value);
|
||||||
|
public double lower { get; private set; }
|
||||||
|
public double upper { get; private set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Chart : Gtk.DrawingArea {
|
||||||
|
public LiveChart.Config config;
|
||||||
|
public LiveChart.Series series;
|
||||||
|
public Chart (LiveChart.Config config = new LiveChart.Config ());
|
||||||
|
public void add_serie (LiveChart.Serie serie);
|
||||||
|
public void add_unaware_timestamp_collection (LiveChart.Serie serie, Gee.Collection<double?> collection, int timespan_between_value);
|
||||||
|
public void add_unaware_timestamp_collection_by_index (int serie_index, Gee.Collection<double?> collection, int timespan_between_value) throws LiveChart.ChartError;
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.0", replacement = "Retrieve the Serie from Chart.series (or from the serie you created) and add the value using serie.add")]
|
||||||
|
public void add_value (LiveChart.Serie serie, double value);
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.0", replacement = "Retrieve the Serie from Chart.series and add the value using serie.add")]
|
||||||
|
public void add_value_by_index (int serie_index, double value) throws LiveChart.ChartError;
|
||||||
|
public void refresh_every (int ms);
|
||||||
|
public void to_png (string filename) throws GLib.Error;
|
||||||
|
public LiveChart.Background background { get; set; }
|
||||||
|
public LiveChart.Grid grid { get; set; }
|
||||||
|
public LiveChart.Legend legend { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Config {
|
||||||
|
public LiveChart.Padding padding;
|
||||||
|
public LiveChart.XAxis x_axis;
|
||||||
|
public LiveChart.YAxis y_axis;
|
||||||
|
public Config ();
|
||||||
|
public LiveChart.Boundaries boundaries ();
|
||||||
|
public void configure (Cairo.Context ctx, LiveChart.Legend? legend);
|
||||||
|
public int height { get; set; }
|
||||||
|
public int width { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Font {
|
||||||
|
public Font ();
|
||||||
|
public void configure (Cairo.Context ctx);
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
public string face { get; set; }
|
||||||
|
public uint8 size { get; set; }
|
||||||
|
public Cairo.FontSlant slant { get; set; }
|
||||||
|
public Cairo.FontWeight weight { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Grid : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public const int ABSCISSA_TIME_PADDING;
|
||||||
|
public Grid ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
protected void render_abscissa (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_grid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_hgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_ordinate (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_vgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void restore (Cairo.Context ctx);
|
||||||
|
protected void update_bounding_box (LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class HorizontalLegend : LiveChart.Legend {
|
||||||
|
public HorizontalLegend ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Intersection : GLib.Object {
|
||||||
|
public double? entered_at;
|
||||||
|
public double? exited_at;
|
||||||
|
public Intersection (LiveChart.Region region, double start_x, double entered_at);
|
||||||
|
public void close (double x, double exited_at);
|
||||||
|
public bool is_closed ();
|
||||||
|
public bool is_open ();
|
||||||
|
public void update (double x);
|
||||||
|
public Intersection.without_entry_point (LiveChart.Region region, double start_x);
|
||||||
|
public double end_x { get; private set; }
|
||||||
|
public LiveChart.Region region { get; set construct; }
|
||||||
|
public double start_x { get; private set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Intersections : GLib.Object {
|
||||||
|
public Intersections ();
|
||||||
|
public void close (double x, double exited_at);
|
||||||
|
public void @foreach (Gee.ForallFunc<LiveChart.Intersection?> f);
|
||||||
|
public new LiveChart.Intersection @get (int index);
|
||||||
|
public LiveChart.Region get_current_region ();
|
||||||
|
public bool has_an_opened_intersection ();
|
||||||
|
public void open (LiveChart.Region region, double x, double entered_at);
|
||||||
|
public void open_without_entrypoint (LiveChart.Region region, double x);
|
||||||
|
public int size ();
|
||||||
|
public void update (double x);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Labels {
|
||||||
|
public Labels ();
|
||||||
|
public Cairo.TextExtents extents { get; set; }
|
||||||
|
public LiveChart.Font font { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public abstract class Legend : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
protected Gee.ArrayList<LiveChart.Serie> series;
|
||||||
|
protected Legend ();
|
||||||
|
public void add_legend (LiveChart.Serie serie);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Line : LiveChart.SerieRenderer {
|
||||||
|
public Line (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected LiveChart.Points draw_line (LiveChart.Points points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class LineArea : LiveChart.Line {
|
||||||
|
public LineArea (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double area_alpha { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class MaxBoundLine : LiveChart.SerieRenderer {
|
||||||
|
public MaxBoundLine ();
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public MaxBoundLine.from_serie (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class MinBoundLine : LiveChart.SerieRenderer {
|
||||||
|
public MinBoundLine (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public MinBoundLine.from_serie (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class NoopLegend : LiveChart.Legend {
|
||||||
|
public NoopLegend ();
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Path : GLib.Object {
|
||||||
|
public LiveChart.Dash? dash;
|
||||||
|
public Path (double width = 0.5, Gdk.RGBA color = { 1.0, 1.0, 1.0, 1.0 }, bool visible = true, LiveChart.Dash? dash = null);
|
||||||
|
public void configure (Cairo.Context ctx);
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
public double width { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Points : GLib.Object {
|
||||||
|
public Points ();
|
||||||
|
public void add (LiveChart.Point point);
|
||||||
|
public LiveChart.Point after (int at);
|
||||||
|
public static LiveChart.Points create (LiveChart.Values values, LiveChart.Config config);
|
||||||
|
public LiveChart.Point first ();
|
||||||
|
public new LiveChart.Point @get (int at);
|
||||||
|
public LiveChart.Point last ();
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
public double realtime_delta { get; set; }
|
||||||
|
public int size { get; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Region {
|
||||||
|
public Region (double floor, double ceil);
|
||||||
|
public Region.between (double above, double below);
|
||||||
|
public void handle (LiveChart.Intersections intersections, LiveChart.Point previous, LiveChart.Point current, LiveChart.GetIntersection get_intersection);
|
||||||
|
public bool has_at_least_one_point_within (LiveChart.Point previous, LiveChart.Point current);
|
||||||
|
public LiveChart.Region with_area_color (Gdk.RGBA color);
|
||||||
|
public LiveChart.Region with_line_color (Gdk.RGBA color);
|
||||||
|
public Gdk.RGBA area_color { get; set; }
|
||||||
|
public Gdk.RGBA line_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Serie : LiveChart.Colorable, LiveChart.Drawable, GLib.Object {
|
||||||
|
public Serie (string name, LiveChart.SerieRenderer renderer = new LiveChart.Line (new LiveChart.Values (1000)));
|
||||||
|
public void add (double value);
|
||||||
|
public void add_with_timestamp (double value, int64 timestamp);
|
||||||
|
public void clear ();
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.1", replacement = "Serie.main_color property instead")]
|
||||||
|
public Gdk.RGBA get_main_color ();
|
||||||
|
public LiveChart.Values get_values ();
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.1", replacement = "Serie.main_color property instead")]
|
||||||
|
public void set_main_color (Gdk.RGBA color);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public signal void value_added (double value);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public abstract class SerieRenderer : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
protected LiveChart.Values values;
|
||||||
|
protected SerieRenderer ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Values get_values ();
|
||||||
|
protected bool is_out_of_area (LiveChart.Point point);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Serie.renderer.line.color")]
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Series : GLib.Object {
|
||||||
|
public Series (LiveChart.Chart chart);
|
||||||
|
public new LiveChart.Serie @get (int index) throws LiveChart.ChartError;
|
||||||
|
public LiveChart.Serie get_by_name (string name) throws LiveChart.ChartError;
|
||||||
|
public Gee.Iterator<LiveChart.Serie> iterator ();
|
||||||
|
public LiveChart.Serie register (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class SmoothLine : LiveChart.SerieRenderer {
|
||||||
|
protected LiveChart.Intersections intersections;
|
||||||
|
public SmoothLine (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_regions_on_line (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public Cairo.Path draw_smooth_line (LiveChart.Points points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Region? region { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class SmoothLineArea : LiveChart.SmoothLine {
|
||||||
|
public SmoothLineArea (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_regions_on_area (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double area_alpha { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class ThresholdLine : LiveChart.SerieRenderer {
|
||||||
|
public ThresholdLine (double value);
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double value { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class Values : Gee.LinkedList<LiveChart.TimestampedValue?> {
|
||||||
|
public Values (int buffer_size = 1000);
|
||||||
|
public new void add (LiveChart.TimestampedValue value);
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class XAxis {
|
||||||
|
public LiveChart.Path axis;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
public LiveChart.Path lines;
|
||||||
|
public XAxis ();
|
||||||
|
public double get_ratio ();
|
||||||
|
public float tick_interval { get; set; }
|
||||||
|
public float tick_length { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public class YAxis {
|
||||||
|
public LiveChart.Path axis;
|
||||||
|
public double? fixed_max;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
public LiveChart.Path lines;
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.0.0b7", replacement = "ratio is always smart ;)")]
|
||||||
|
public bool smart_ratio;
|
||||||
|
public LiveChart.Ticks ticks;
|
||||||
|
public YAxis (string unit = "");
|
||||||
|
public LiveChart.Bounds get_bounds ();
|
||||||
|
public string get_max_displayed_value ();
|
||||||
|
public double get_ratio ();
|
||||||
|
public LiveChart.Ticks get_ticks ();
|
||||||
|
public void update (int area_height);
|
||||||
|
public bool update_bounds (double value);
|
||||||
|
public float ratio_threshold { get; set; }
|
||||||
|
public float tick_interval { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.0.0b7")]
|
||||||
|
public float tick_length { get; set; }
|
||||||
|
public string unit { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public interface Colorable : GLib.Object {
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Serie.line.color")]
|
||||||
|
public abstract Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public interface Drawable : GLib.Object {
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public abstract LiveChart.BoundingBox get_bounding_box ();
|
||||||
|
public abstract bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public interface Intersector<T> {
|
||||||
|
public abstract void intersect (LiveChart.Intersections intersections, LiveChart.Point previous, LiveChart.Point current, T path);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct BezierCurve {
|
||||||
|
public LiveChart.Coord c0;
|
||||||
|
public LiveChart.Coord c1;
|
||||||
|
public LiveChart.Coord c2;
|
||||||
|
public LiveChart.Coord c3;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Boundaries {
|
||||||
|
public LiveChart.Boundary x;
|
||||||
|
public LiveChart.Boundary y;
|
||||||
|
public int width;
|
||||||
|
public int height;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Boundary {
|
||||||
|
public int min;
|
||||||
|
public int max;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct BoundingBox {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
public double width;
|
||||||
|
public double height;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Coord {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Dash {
|
||||||
|
public double[]? dashes;
|
||||||
|
public double offset;
|
||||||
|
public Dash ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Padding {
|
||||||
|
public LiveChart.AutoPadding smart;
|
||||||
|
public int top;
|
||||||
|
public int right;
|
||||||
|
public int bottom;
|
||||||
|
public int left;
|
||||||
|
public Padding ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Point {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
public double height;
|
||||||
|
public LiveChart.TimestampedValue data;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct RegionHandleResult {
|
||||||
|
public LiveChart.RegionHandleStatus status;
|
||||||
|
public double at_value;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Segment {
|
||||||
|
public LiveChart.Coord from;
|
||||||
|
public LiveChart.Coord to;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct Ticks {
|
||||||
|
public Gee.List<float?> values;
|
||||||
|
public Ticks ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public struct TimestampedValue {
|
||||||
|
public double timestamp;
|
||||||
|
public double value;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
[Flags]
|
||||||
|
public enum AutoPadding {
|
||||||
|
NONE,
|
||||||
|
TOP,
|
||||||
|
RIGHT,
|
||||||
|
BOTTOM,
|
||||||
|
LEFT
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public enum RegionHandleStatus {
|
||||||
|
ENTER,
|
||||||
|
EXIT,
|
||||||
|
WITHIN,
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public errordomain ChartError {
|
||||||
|
EXPORT_ERROR,
|
||||||
|
SERIE_NOT_FOUND
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public delegate LiveChart.Coord? GetIntersection (double at_value);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static LiveChart.BezierCurve build_bezier_curve_from_points (LiveChart.Point previous, LiveChart.Point target);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static float cap (float value);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static Gee.List<LiveChart.Coord?> find_intersections_between (LiveChart.Segment segment, LiveChart.BezierCurve bezier);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static string format_for_y_axis (string unit, float value);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static Gee.List<float?> golden_divisors (float value);
|
||||||
|
[CCode (cheader_filename = "livechart.h")]
|
||||||
|
public static bool has_fractional_part (float value);
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,507 @@
|
||||||
|
/* livechart_static.vapi generated by valac 0.56.0, do not modify. */
|
||||||
|
|
||||||
|
namespace LiveChart {
|
||||||
|
namespace Static {
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticChart : Gtk.DrawingArea {
|
||||||
|
public LiveChart.Config config;
|
||||||
|
public LiveChart.Static.StaticSeries series;
|
||||||
|
public StaticChart (LiveChart.Config config = new LiveChart.Config ());
|
||||||
|
public void add_serie (LiveChart.Static.StaticSerie serie);
|
||||||
|
public void set_categories (Gee.ArrayList<string> categories);
|
||||||
|
public LiveChart.Background background { get; set; }
|
||||||
|
public LiveChart.Static.StaticGrid grid { get; set; }
|
||||||
|
public LiveChart.Legend legend { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticGrid : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public const int ABSCISSA_TIME_PADDING;
|
||||||
|
public StaticGrid ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
protected void render_abscissa (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_grid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_hgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_ordinate (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_vgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void restore (Cairo.Context ctx);
|
||||||
|
protected void update_bounding_box (LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticLine : LiveChart.Static.StaticSerieRenderer {
|
||||||
|
public StaticLine (LiveChart.Static.StaticValues values = new LiveChart.Static.StaticValues ());
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_line (LiveChart.Static.StaticPoints points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticPoints : GLib.Object {
|
||||||
|
public StaticPoints ();
|
||||||
|
public void add (LiveChart.Point point);
|
||||||
|
public LiveChart.Point after (int at);
|
||||||
|
public static LiveChart.Static.StaticPoints create (LiveChart.Static.StaticValues values, LiveChart.Config config);
|
||||||
|
public LiveChart.Point first ();
|
||||||
|
public new LiveChart.Point @get (int at);
|
||||||
|
public LiveChart.Point last ();
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
public double realtime_delta { get; set; }
|
||||||
|
public int size { get; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticSerie : LiveChart.Colorable, LiveChart.Drawable, GLib.Object {
|
||||||
|
public StaticSerie (string name, LiveChart.Static.StaticSerieRenderer renderer = new LiveChart.Static.StaticLine (new LiveChart.Static.StaticValues ()));
|
||||||
|
public void add (string name, double value);
|
||||||
|
public void clear ();
|
||||||
|
public LiveChart.Static.StaticValues get_values ();
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public signal void value_added (double value);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public abstract class StaticSerieRenderer : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
protected LiveChart.Static.StaticValues values;
|
||||||
|
protected StaticSerieRenderer ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Static.StaticValues get_values ();
|
||||||
|
protected bool is_out_of_area (LiveChart.Point point);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticSeries : GLib.Object {
|
||||||
|
public StaticSeries (LiveChart.Static.StaticChart chart);
|
||||||
|
public new LiveChart.Static.StaticSerie @get (int index) throws LiveChart.ChartError;
|
||||||
|
public LiveChart.Static.StaticSerie get_by_name (string name) throws LiveChart.ChartError;
|
||||||
|
public Gee.Iterator<LiveChart.Static.StaticSerie> iterator ();
|
||||||
|
public LiveChart.Static.StaticSerie register (LiveChart.Static.StaticSerie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class StaticValues : Gee.LinkedList<LiveChart.Static.NamedValue?> {
|
||||||
|
public StaticValues ();
|
||||||
|
public new void add (LiveChart.Static.NamedValue value);
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct NamedValue {
|
||||||
|
public string name;
|
||||||
|
public double value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Area : LiveChart.Drawable, GLib.Object {
|
||||||
|
public Area (LiveChart.Points points, Gdk.RGBA color, double alpha);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Background : LiveChart.Drawable, GLib.Object {
|
||||||
|
public Background ();
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Background.color")]
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Bar : LiveChart.SerieRenderer {
|
||||||
|
public Bar (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class BezierIntersector : LiveChart.Intersector<LiveChart.BezierCurve?> {
|
||||||
|
public BezierIntersector (LiveChart.Region region, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Bounds : GLib.Object {
|
||||||
|
public Bounds (double lower = double.NAN, double upper = double.NAN);
|
||||||
|
public bool has_lower ();
|
||||||
|
public bool has_upper ();
|
||||||
|
public bool update (double value);
|
||||||
|
public double lower { get; private set; }
|
||||||
|
public double upper { get; private set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Chart : Gtk.DrawingArea {
|
||||||
|
public LiveChart.Config config;
|
||||||
|
public LiveChart.Series series;
|
||||||
|
public Chart (LiveChart.Config config = new LiveChart.Config ());
|
||||||
|
public void add_serie (LiveChart.Serie serie);
|
||||||
|
public void add_unaware_timestamp_collection (LiveChart.Serie serie, Gee.Collection<double?> collection, int timespan_between_value);
|
||||||
|
public void add_unaware_timestamp_collection_by_index (int serie_index, Gee.Collection<double?> collection, int timespan_between_value) throws LiveChart.ChartError;
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.0", replacement = "Retrieve the Serie from Chart.series (or from the serie you created) and add the value using serie.add")]
|
||||||
|
public void add_value (LiveChart.Serie serie, double value);
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.0", replacement = "Retrieve the Serie from Chart.series and add the value using serie.add")]
|
||||||
|
public void add_value_by_index (int serie_index, double value) throws LiveChart.ChartError;
|
||||||
|
public void refresh_every (int ms);
|
||||||
|
public void to_png (string filename) throws GLib.Error;
|
||||||
|
public LiveChart.Background background { get; set; }
|
||||||
|
public LiveChart.Grid grid { get; set; }
|
||||||
|
public LiveChart.Legend legend { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Config {
|
||||||
|
public LiveChart.Padding padding;
|
||||||
|
public LiveChart.XAxis x_axis;
|
||||||
|
public LiveChart.YAxis y_axis;
|
||||||
|
public Config ();
|
||||||
|
public LiveChart.Boundaries boundaries ();
|
||||||
|
public void configure (Cairo.Context ctx, LiveChart.Legend? legend);
|
||||||
|
public int height { get; set; }
|
||||||
|
public int width { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Font {
|
||||||
|
public Font ();
|
||||||
|
public void configure (Cairo.Context ctx);
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
public string face { get; set; }
|
||||||
|
public uint8 size { get; set; }
|
||||||
|
public Cairo.FontSlant slant { get; set; }
|
||||||
|
public Cairo.FontWeight weight { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Grid : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public const int ABSCISSA_TIME_PADDING;
|
||||||
|
public Grid ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
protected void render_abscissa (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_grid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_hgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_ordinate (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void render_vgrid (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void restore (Cairo.Context ctx);
|
||||||
|
protected void update_bounding_box (LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class HorizontalLegend : LiveChart.Legend {
|
||||||
|
public HorizontalLegend ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Intersection : GLib.Object {
|
||||||
|
public double? entered_at;
|
||||||
|
public double? exited_at;
|
||||||
|
public Intersection (LiveChart.Region region, double start_x, double entered_at);
|
||||||
|
public void close (double x, double exited_at);
|
||||||
|
public bool is_closed ();
|
||||||
|
public bool is_open ();
|
||||||
|
public void update (double x);
|
||||||
|
public Intersection.without_entry_point (LiveChart.Region region, double start_x);
|
||||||
|
public double end_x { get; private set; }
|
||||||
|
public LiveChart.Region region { get; set construct; }
|
||||||
|
public double start_x { get; private set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Intersections : GLib.Object {
|
||||||
|
public Intersections ();
|
||||||
|
public void close (double x, double exited_at);
|
||||||
|
public void @foreach (Gee.ForallFunc<LiveChart.Intersection?> f);
|
||||||
|
public new LiveChart.Intersection @get (int index);
|
||||||
|
public LiveChart.Region get_current_region ();
|
||||||
|
public bool has_an_opened_intersection ();
|
||||||
|
public void open (LiveChart.Region region, double x, double entered_at);
|
||||||
|
public void open_without_entrypoint (LiveChart.Region region, double x);
|
||||||
|
public int size ();
|
||||||
|
public void update (double x);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Labels {
|
||||||
|
public Labels ();
|
||||||
|
public Cairo.TextExtents extents { get; set; }
|
||||||
|
public LiveChart.Font font { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public abstract class Legend : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
protected Gee.ArrayList<LiveChart.Serie> series;
|
||||||
|
protected Legend ();
|
||||||
|
public void add_legend (LiveChart.Serie serie);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Line : LiveChart.SerieRenderer {
|
||||||
|
public Line (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected LiveChart.Points draw_line (LiveChart.Points points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class LineArea : LiveChart.Line {
|
||||||
|
public LineArea (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double area_alpha { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class MaxBoundLine : LiveChart.SerieRenderer {
|
||||||
|
public MaxBoundLine ();
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public MaxBoundLine.from_serie (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class MinBoundLine : LiveChart.SerieRenderer {
|
||||||
|
public MinBoundLine (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public MinBoundLine.from_serie (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class NoopLegend : LiveChart.Legend {
|
||||||
|
public NoopLegend ();
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Path : GLib.Object {
|
||||||
|
public LiveChart.Dash? dash;
|
||||||
|
public Path (double width = 0.5, Gdk.RGBA color = { 1.0, 1.0, 1.0, 1.0 }, bool visible = true, LiveChart.Dash? dash = null);
|
||||||
|
public void configure (Cairo.Context ctx);
|
||||||
|
public Gdk.RGBA color { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
public double width { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Points : GLib.Object {
|
||||||
|
public Points ();
|
||||||
|
public void add (LiveChart.Point point);
|
||||||
|
public LiveChart.Point after (int at);
|
||||||
|
public static LiveChart.Points create (LiveChart.Values values, LiveChart.Config config);
|
||||||
|
public LiveChart.Point first ();
|
||||||
|
public new LiveChart.Point @get (int at);
|
||||||
|
public LiveChart.Point last ();
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
public double realtime_delta { get; set; }
|
||||||
|
public int size { get; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Region {
|
||||||
|
public Region (double floor, double ceil);
|
||||||
|
public Region.between (double above, double below);
|
||||||
|
public void handle (LiveChart.Intersections intersections, LiveChart.Point previous, LiveChart.Point current, LiveChart.GetIntersection get_intersection);
|
||||||
|
public bool has_at_least_one_point_within (LiveChart.Point previous, LiveChart.Point current);
|
||||||
|
public LiveChart.Region with_area_color (Gdk.RGBA color);
|
||||||
|
public LiveChart.Region with_line_color (Gdk.RGBA color);
|
||||||
|
public Gdk.RGBA area_color { get; set; }
|
||||||
|
public Gdk.RGBA line_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Serie : LiveChart.Colorable, LiveChart.Drawable, GLib.Object {
|
||||||
|
public Serie (string name, LiveChart.SerieRenderer renderer = new LiveChart.Line (new LiveChart.Values (1000)));
|
||||||
|
public void add (double value);
|
||||||
|
public void add_with_timestamp (double value, int64 timestamp);
|
||||||
|
public void clear ();
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.1", replacement = "Serie.main_color property instead")]
|
||||||
|
public Gdk.RGBA get_main_color ();
|
||||||
|
public LiveChart.Values get_values ();
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.7.1", replacement = "Serie.main_color property instead")]
|
||||||
|
public void set_main_color (Gdk.RGBA color);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public signal void value_added (double value);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public abstract class SerieRenderer : LiveChart.Drawable, GLib.Object {
|
||||||
|
protected LiveChart.BoundingBox bounding_box;
|
||||||
|
protected LiveChart.Values values;
|
||||||
|
protected SerieRenderer ();
|
||||||
|
protected void debug (Cairo.Context ctx);
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Values get_values ();
|
||||||
|
protected bool is_out_of_area (LiveChart.Point point);
|
||||||
|
public LiveChart.Path line { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Serie.renderer.line.color")]
|
||||||
|
public Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Series : GLib.Object {
|
||||||
|
public Series (LiveChart.Chart chart);
|
||||||
|
public new LiveChart.Serie @get (int index) throws LiveChart.ChartError;
|
||||||
|
public LiveChart.Serie get_by_name (string name) throws LiveChart.ChartError;
|
||||||
|
public Gee.Iterator<LiveChart.Serie> iterator ();
|
||||||
|
public LiveChart.Serie register (LiveChart.Serie serie);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class SmoothLine : LiveChart.SerieRenderer {
|
||||||
|
protected LiveChart.Intersections intersections;
|
||||||
|
public SmoothLine (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_regions_on_line (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public Cairo.Path draw_smooth_line (LiveChart.Points points, Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public LiveChart.Region? region { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class SmoothLineArea : LiveChart.SmoothLine {
|
||||||
|
public SmoothLineArea (LiveChart.Values values = new LiveChart.Values (1000));
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
protected void draw_regions_on_area (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double area_alpha { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class ThresholdLine : LiveChart.SerieRenderer {
|
||||||
|
public ThresholdLine (double value);
|
||||||
|
public override void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public double value { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class Values : Gee.LinkedList<LiveChart.TimestampedValue?> {
|
||||||
|
public Values (int buffer_size = 1000);
|
||||||
|
public new void add (LiveChart.TimestampedValue value);
|
||||||
|
public LiveChart.Bounds bounds { get; set construct; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class XAxis {
|
||||||
|
public LiveChart.Path axis;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
public LiveChart.Path lines;
|
||||||
|
public XAxis ();
|
||||||
|
public double get_ratio ();
|
||||||
|
public float tick_interval { get; set; }
|
||||||
|
public float tick_length { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public class YAxis {
|
||||||
|
public LiveChart.Path axis;
|
||||||
|
public double? fixed_max;
|
||||||
|
public LiveChart.Labels labels;
|
||||||
|
public LiveChart.Path lines;
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.0.0b7", replacement = "ratio is always smart ;)")]
|
||||||
|
public bool smart_ratio;
|
||||||
|
public LiveChart.Ticks ticks;
|
||||||
|
public YAxis (string unit = "");
|
||||||
|
public LiveChart.Bounds get_bounds ();
|
||||||
|
public string get_max_displayed_value ();
|
||||||
|
public double get_ratio ();
|
||||||
|
public LiveChart.Ticks get_ticks ();
|
||||||
|
public void update (int area_height);
|
||||||
|
public bool update_bounds (double value);
|
||||||
|
public float ratio_threshold { get; set; }
|
||||||
|
public float tick_interval { get; set; }
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.0.0b7")]
|
||||||
|
public float tick_length { get; set; }
|
||||||
|
public string unit { get; set; }
|
||||||
|
public bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public interface Colorable : GLib.Object {
|
||||||
|
[Version (deprecated = true, deprecated_since = "1.8.0", replacement = "Serie.line.color")]
|
||||||
|
public abstract Gdk.RGBA main_color { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public interface Drawable : GLib.Object {
|
||||||
|
public abstract void draw (Cairo.Context ctx, LiveChart.Config config);
|
||||||
|
public abstract LiveChart.BoundingBox get_bounding_box ();
|
||||||
|
public abstract bool visible { get; set; }
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public interface Intersector<T> {
|
||||||
|
public abstract void intersect (LiveChart.Intersections intersections, LiveChart.Point previous, LiveChart.Point current, T path);
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct BezierCurve {
|
||||||
|
public LiveChart.Coord c0;
|
||||||
|
public LiveChart.Coord c1;
|
||||||
|
public LiveChart.Coord c2;
|
||||||
|
public LiveChart.Coord c3;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Boundaries {
|
||||||
|
public LiveChart.Boundary x;
|
||||||
|
public LiveChart.Boundary y;
|
||||||
|
public int width;
|
||||||
|
public int height;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Boundary {
|
||||||
|
public int min;
|
||||||
|
public int max;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct BoundingBox {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
public double width;
|
||||||
|
public double height;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Coord {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Dash {
|
||||||
|
public double[]? dashes;
|
||||||
|
public double offset;
|
||||||
|
public Dash ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Padding {
|
||||||
|
public LiveChart.AutoPadding smart;
|
||||||
|
public int top;
|
||||||
|
public int right;
|
||||||
|
public int bottom;
|
||||||
|
public int left;
|
||||||
|
public Padding ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Point {
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
public double height;
|
||||||
|
public LiveChart.TimestampedValue data;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct RegionHandleResult {
|
||||||
|
public LiveChart.RegionHandleStatus status;
|
||||||
|
public double at_value;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Segment {
|
||||||
|
public LiveChart.Coord from;
|
||||||
|
public LiveChart.Coord to;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct Ticks {
|
||||||
|
public Gee.List<float?> values;
|
||||||
|
public Ticks ();
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public struct TimestampedValue {
|
||||||
|
public double timestamp;
|
||||||
|
public double value;
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
[Flags]
|
||||||
|
public enum AutoPadding {
|
||||||
|
NONE,
|
||||||
|
TOP,
|
||||||
|
RIGHT,
|
||||||
|
BOTTOM,
|
||||||
|
LEFT
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public enum RegionHandleStatus {
|
||||||
|
ENTER,
|
||||||
|
EXIT,
|
||||||
|
WITHIN,
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public errordomain ChartError {
|
||||||
|
EXPORT_ERROR,
|
||||||
|
SERIE_NOT_FOUND
|
||||||
|
}
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public delegate LiveChart.Coord? GetIntersection (double at_value);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static LiveChart.BezierCurve build_bezier_curve_from_points (LiveChart.Point previous, LiveChart.Point target);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static float cap (float value);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static Gee.List<LiveChart.Coord?> find_intersections_between (LiveChart.Segment segment, LiveChart.BezierCurve bezier);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static string format_for_y_axis (string unit, float value);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static Gee.List<float?> golden_divisors (float value);
|
||||||
|
[CCode (cheader_filename = "livechart_static.h")]
|
||||||
|
public static bool has_fractional_part (float value);
|
||||||
|
}
|
|
@ -673,13 +673,16 @@ int add_pmu_validation (GtkButton *but, gpointer udata)
|
||||||
/* local variables */
|
/* local variables */
|
||||||
int ret;
|
int ret;
|
||||||
char *errmsg1, ip[20], tmp[4];
|
char *errmsg1, ip[20], tmp[4];
|
||||||
const char *text, *text1, *text2, *text3;
|
const char *text, *text1, *text2, *text3, *lattitude, *longitude;
|
||||||
|
|
||||||
/* Get the text entries filled by user */
|
/* Get the text entries filled by user */
|
||||||
text = gtk_entry_get_text(GTK_ENTRY(p_id));
|
text = gtk_entry_get_text(GTK_ENTRY(p_id));
|
||||||
text1 = gtk_entry_get_text(GTK_ENTRY(p_ip));
|
text1 = gtk_entry_get_text(GTK_ENTRY(p_ip));
|
||||||
text2 = gtk_entry_get_text(GTK_ENTRY(p_port));
|
text2 = gtk_entry_get_text(GTK_ENTRY(p_port));
|
||||||
text3 = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX(p_protocol));
|
text3 = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX(p_protocol));
|
||||||
|
lattitude = gtk_entry_get_text(GTK_ENTRY(p_lattitude));
|
||||||
|
longitude = gtk_entry_get_text(GTK_ENTRY(p_longitude));
|
||||||
|
|
||||||
memset(ip,'\0',20);
|
memset(ip,'\0',20);
|
||||||
strcat(ip, text1);
|
strcat(ip, text1);
|
||||||
strcpy (tmp, text3);
|
strcpy (tmp, text3);
|
||||||
|
@ -702,10 +705,22 @@ int add_pmu_validation (GtkButton *but, gpointer udata)
|
||||||
validation_result (errmsg1); /* Show the unsuccess message to user */
|
validation_result (errmsg1); /* Show the unsuccess message to user */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if(atof(lattitude) > 90 || atof(lattitude) < -90)
|
||||||
|
{
|
||||||
|
errmsg1 = " Not a valid Lattitude of Source Device! Try again ";
|
||||||
|
validation_result (errmsg1); /* Show the unsuccess message to user */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if(atof(longitude) > 180 || atof(longitude) < -180)
|
||||||
|
{
|
||||||
|
errmsg1 = " Not a valid Longitude of Source Device! Try again ";
|
||||||
|
validation_result (errmsg1); /* Show the unsuccess message to user */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else /* Only if all the text_box entries were right */
|
else /* Only if all the text_box entries were right */
|
||||||
{
|
{
|
||||||
/* call add_PMU() to actual add pmu/pdc and start communication */
|
/* call add_PMU() to actual add pmu/pdc and start communication */
|
||||||
ret = add_PMU((char *)text, (char *)text1, (char *)text2, (char *)text3);
|
ret = add_PMU((char *)text, (char *)text1, (char *)text2, (char *)text3, (char *)lattitude, (char *)longitude);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
/* Close/destroy the add_pmu_window */
|
/* Close/destroy the add_pmu_window */
|
||||||
|
@ -1256,7 +1271,7 @@ void add_pmu (GtkButton *but, gpointer udata)
|
||||||
gtk_window_set_resizable ( GTK_WINDOW (add_pmu_window), FALSE);
|
gtk_window_set_resizable ( GTK_WINDOW (add_pmu_window), FALSE);
|
||||||
|
|
||||||
/* Create a table of 5 by 2 squares. */
|
/* Create a table of 5 by 2 squares. */
|
||||||
table = gtk_table_new (5, 2, FALSE);
|
table = gtk_table_new (7, 2, FALSE);
|
||||||
|
|
||||||
/* Set the spacing to 20 on x and 30 on y */
|
/* Set the spacing to 20 on x and 30 on y */
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 16);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 16);
|
||||||
|
@ -1300,6 +1315,16 @@ void add_pmu (GtkButton *but, gpointer udata)
|
||||||
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5);
|
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5);
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
|
label = gtk_label_new ("x-co-ordinate");
|
||||||
|
gtk_misc_set_alignment (GTK_MISC(label),0,0);
|
||||||
|
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
|
label = gtk_label_new ("y-co-ordinate");
|
||||||
|
gtk_misc_set_alignment (GTK_MISC(label),0,0);
|
||||||
|
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 6, 7);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
/* Create text boxes for user to enter appropriate values */
|
/* Create text boxes for user to enter appropriate values */
|
||||||
p_id = gtk_entry_new();
|
p_id = gtk_entry_new();
|
||||||
gtk_entry_set_max_length ((GtkEntry *)p_id, 5);
|
gtk_entry_set_max_length ((GtkEntry *)p_id, 5);
|
||||||
|
@ -1316,6 +1341,16 @@ void add_pmu (GtkButton *but, gpointer udata)
|
||||||
gtk_table_attach_defaults (GTK_TABLE (table), p_port, 1, 2, 3, 4);
|
gtk_table_attach_defaults (GTK_TABLE (table), p_port, 1, 2, 3, 4);
|
||||||
gtk_widget_show (p_port);
|
gtk_widget_show (p_port);
|
||||||
|
|
||||||
|
p_lattitude = gtk_entry_new();
|
||||||
|
gtk_entry_set_max_length ((GtkEntry *)p_lattitude, 10);
|
||||||
|
gtk_table_attach_defaults (GTK_TABLE (table), p_lattitude, 1, 2, 5, 6);
|
||||||
|
gtk_widget_show (p_lattitude);
|
||||||
|
|
||||||
|
p_longitude = gtk_entry_new();
|
||||||
|
gtk_entry_set_max_length ((GtkEntry *)p_longitude, 10);
|
||||||
|
gtk_table_attach_defaults (GTK_TABLE (table), p_longitude, 1, 2, 6, 7);
|
||||||
|
gtk_widget_show (p_longitude);
|
||||||
|
|
||||||
/* Create combo boxe for user with some fixed values */
|
/* Create combo boxe for user with some fixed values */
|
||||||
p_protocol = gtk_combo_box_text_new ();
|
p_protocol = gtk_combo_box_text_new ();
|
||||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX(p_protocol), "UDP");
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX(p_protocol), "UDP");
|
||||||
|
|
|
@ -4,33 +4,69 @@
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "osm-gps-map.h"
|
#include "osm-gps-map.h"
|
||||||
#include "Attack_detect.h"
|
#include "Attack_detect.h"
|
||||||
|
#include "connections.h"
|
||||||
|
#include "livechart.h"
|
||||||
|
// #include "utility_tools.h"
|
||||||
|
|
||||||
|
|
||||||
gboolean update_images(gpointer* pars){
|
gboolean update_images(gpointer* pars){
|
||||||
|
int match=0,id;
|
||||||
myParameters* parameters = (myParameters*) pars;
|
myParameters* parameters = (myParameters*) pars;
|
||||||
struct data_frame *df = TSB[0].first_data_frame;
|
struct data_frame *df = TSB[0].first_data_frame;
|
||||||
|
struct Lower_Layer_Details *LLptr;
|
||||||
|
|
||||||
if (df == NULL){
|
if (df == NULL){
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
int freq = to_intconvertor(df->dpmu[0]->freq);
|
// if (curr_measurement==1)
|
||||||
gboolean green =attack_detect(df,&START,&COUNT,&SUM_OF_FREQUENCY);
|
// {
|
||||||
|
while (df != NULL){
|
||||||
|
id = to_intconvertor(df->idcode);
|
||||||
|
printf("id = %d\n",id);
|
||||||
|
|
||||||
|
LLptr = LLfirst;
|
||||||
|
|
||||||
|
while(LLptr != NULL){
|
||||||
|
printf("pmuid = %d\n",LLptr->pmuid);
|
||||||
|
if(LLptr->pmuid == id){
|
||||||
|
match = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
LLptr = LLptr->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(match == 1){
|
||||||
|
float lat = LLptr->latitude;
|
||||||
|
float lon = LLptr->longitude;
|
||||||
|
float freq = to_intconvertor(df->dpmu[0]->freq)*0.001+50;
|
||||||
|
printf("lat = %f, lon = %f, freq = %f\n",lat,lon,freq);
|
||||||
|
// gboolean green =attack_detect(df,&START,&COUNT,&SUM_OF_FREQUENCY);
|
||||||
|
|
||||||
|
if(parameters->g_last_image != 0){
|
||||||
|
osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
||||||
|
}
|
||||||
|
if (freq > 50.300){
|
||||||
|
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_green_image);
|
||||||
|
}else{
|
||||||
|
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_red_image);
|
||||||
|
}
|
||||||
// if(parameters->g_last_image != 0){
|
// if(parameters->g_last_image != 0){
|
||||||
// osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
// osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
||||||
// }
|
// }
|
||||||
// if (freq > 300){
|
// if (green){
|
||||||
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_green_image);
|
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_green_image);
|
||||||
// }else{
|
// }else{
|
||||||
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_red_image);
|
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_red_image);
|
||||||
// }
|
// }
|
||||||
if(parameters->g_last_image != 0){
|
|
||||||
osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
|
||||||
}
|
}
|
||||||
if (green){
|
df = df->dnext;
|
||||||
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_green_image);
|
|
||||||
}else{
|
|
||||||
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_red_image);
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gtk_widget_queue_draw(GTK_WIDGET(parameters->util_map));
|
gtk_widget_queue_draw(GTK_WIDGET(parameters->util_map));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
|
@ -82,7 +82,7 @@
|
||||||
/* created for each added lower layer PMU/PDC accoring to the protcol (TCP/UDP).*/
|
/* created for each added lower layer PMU/PDC accoring to the protcol (TCP/UDP).*/
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int add_PMU(char pmuid[], char ip[], char port[], char protocol[]) {
|
int add_PMU(char pmuid[], char ip[], char port[], char protocol[], char latitude[], char longitude[]) {
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
|
@ -161,6 +161,8 @@ int add_PMU(char pmuid[], char ip[], char port[], char protocol[]) {
|
||||||
temp_pmu->data_transmission_off = 0;
|
temp_pmu->data_transmission_off = 0;
|
||||||
temp_pmu->pmu_remove = 0;
|
temp_pmu->pmu_remove = 0;
|
||||||
temp_pmu->request_cfg_frame = 0;
|
temp_pmu->request_cfg_frame = 0;
|
||||||
|
temp_pmu->latitude = atof(latitude);
|
||||||
|
temp_pmu->longitude = atof(longitude);
|
||||||
temp_pmu->next = NULL;
|
temp_pmu->next = NULL;
|
||||||
temp_pmu->prev = NULL;
|
temp_pmu->prev = NULL;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,9 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <float.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <math.h>
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "dallocate.h"
|
#include "dallocate.h"
|
||||||
|
@ -62,6 +65,58 @@
|
||||||
#include "connections.h"
|
#include "connections.h"
|
||||||
#include "recreate.h"
|
#include "recreate.h"
|
||||||
|
|
||||||
|
|
||||||
|
float decode_ieee_single(const void *v) {
|
||||||
|
|
||||||
|
const unsigned char *data = v;
|
||||||
|
int s, e;
|
||||||
|
unsigned long src;
|
||||||
|
long f;
|
||||||
|
float value;
|
||||||
|
|
||||||
|
src = ((unsigned long)data[0] << 24) |
|
||||||
|
((unsigned long)data[1] << 16) |
|
||||||
|
((unsigned long)data[2] << 8) |
|
||||||
|
((unsigned long)data[3]);
|
||||||
|
|
||||||
|
s = (src & 0x80000000UL) >> 31;
|
||||||
|
e = (src & 0x7F800000UL) >> 23;
|
||||||
|
f = (src & 0x007FFFFFUL);
|
||||||
|
|
||||||
|
if (e == 255 && f != 0) {
|
||||||
|
/* NaN (Not a Number) */
|
||||||
|
value = DBL_MAX;
|
||||||
|
|
||||||
|
} else if (e == 255 && f == 0 && s == 1) {
|
||||||
|
/* Negative infinity */
|
||||||
|
value = -DBL_MAX;
|
||||||
|
} else if (e == 255 && f == 0 && s == 0) {
|
||||||
|
/* Positive infinity */
|
||||||
|
value = DBL_MAX;
|
||||||
|
} else if (e > 0 && e < 255) {
|
||||||
|
/* Normal number */
|
||||||
|
f += 0x00800000UL;
|
||||||
|
if (s) f = -f;
|
||||||
|
value = ldexp(f, e - 150);
|
||||||
|
} else if (e == 0 && f != 0) {
|
||||||
|
/* Denormal number */
|
||||||
|
if (s) f = -f;
|
||||||
|
value = ldexp(f, -149);
|
||||||
|
} else if (e == 0 && f == 0 && s == 1) {
|
||||||
|
/* Negative zero */
|
||||||
|
value = 0;
|
||||||
|
} else if (e == 0 && f == 0 && s == 0) {
|
||||||
|
/* Positive zero */
|
||||||
|
value = 0;
|
||||||
|
} else {
|
||||||
|
/* Never happens */
|
||||||
|
printf("s = %d, e = %d, f = %lu\n", s, e, f);
|
||||||
|
assert(!"Woops, unhandled case in decode_ieee_single()");
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
/* FUNCTION cfgparser(): */
|
/* FUNCTION cfgparser(): */
|
||||||
/* It creates configuration objects for the received configuration frames. */
|
/* It creates configuration objects for the received configuration frames. */
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "osm-gps-map.h"
|
#include "osm-gps-map.h"
|
||||||
#include "map_vis.h"
|
#include "map_vis.h"
|
||||||
|
#include "utility_tools.h"
|
||||||
|
|
||||||
#define UI_fILE "./assets/utility_tools.ui"
|
#define UI_fILE "./assets/utility_tools.ui"
|
||||||
#define RED_IMAGE "./assets/red.png"
|
#define RED_IMAGE "./assets/red.png"
|
||||||
|
@ -24,10 +25,47 @@ void on_window_destroy(GtkWidget *widget, gpointer data)
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// on clicking the button frequency
|
||||||
|
void on_frequency_clicked(GtkButton *but, gpointer udata)
|
||||||
|
{
|
||||||
|
curr_measurement = 1;
|
||||||
|
gtk_widget_hide(utdata->algorithm);
|
||||||
|
gtk_widget_hide(utdata->dimmension);
|
||||||
|
gtk_widget_set_sensitive(utdata->voltage, TRUE);
|
||||||
|
gtk_widget_set_sensitive(utdata->frequency, FALSE);
|
||||||
|
gtk_widget_set_sensitive(utdata->attack_detection, TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
// printf("Frequency\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// on clicking the button attack_detection
|
||||||
|
void on_attack_detection_clicked(GtkButton *but, gpointer udata)
|
||||||
|
{
|
||||||
|
curr_measurement = 2;
|
||||||
|
gtk_widget_set_sensitive(utdata->voltage, TRUE);
|
||||||
|
gtk_widget_set_sensitive(utdata->frequency, TRUE);
|
||||||
|
gtk_widget_set_sensitive(utdata->attack_detection, FALSE);
|
||||||
|
|
||||||
|
gtk_widget_show(utdata->algorithm);
|
||||||
|
gtk_widget_show(utdata->dimmension);
|
||||||
|
// printf("Attack Detection\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// on clicking the button voltage
|
||||||
|
void on_voltage_clicked(GtkButton *but, gpointer udata)
|
||||||
|
{
|
||||||
|
curr_measurement = 0;
|
||||||
|
gtk_widget_hide(utdata->algorithm);
|
||||||
|
gtk_widget_hide(utdata->dimmension);
|
||||||
|
gtk_widget_set_sensitive(utdata->voltage, FALSE);
|
||||||
|
gtk_widget_set_sensitive(utdata->frequency, TRUE);
|
||||||
|
gtk_widget_set_sensitive(utdata->attack_detection, TRUE);
|
||||||
|
// printf("Voltage\n");
|
||||||
|
}
|
||||||
|
|
||||||
void utility_tools(GtkButton *but, gpointer udata)
|
void utility_tools(GtkButton *but, gpointer udata)
|
||||||
{
|
{
|
||||||
OsmGpsMap *util_map;
|
|
||||||
GtkWidget *window;
|
|
||||||
GdkPixbuf *g_red_image;
|
GdkPixbuf *g_red_image;
|
||||||
GdkPixbuf *g_green_image;
|
GdkPixbuf *g_green_image;
|
||||||
OsmGpsMapImage *g_last_image;
|
OsmGpsMapImage *g_last_image;
|
||||||
|
@ -35,35 +73,66 @@ void utility_tools(GtkButton *but, gpointer udata)
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
builder = gtk_builder_new();
|
builder = gtk_builder_new();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!gtk_builder_add_from_file(builder, UI_fILE, &error))
|
if(!gtk_builder_add_from_file(builder, UI_fILE, &error))
|
||||||
{
|
{
|
||||||
g_warning("%s", error->message);
|
g_warning("%s", error->message);
|
||||||
g_free(error);
|
g_free(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utdata = g_slice_new(UtData);
|
||||||
|
utdata->util_window = GTK_WIDGET(gtk_builder_get_object(builder, "util_window"));
|
||||||
|
utdata->voltage = GTK_WIDGET(gtk_builder_get_object(builder, "voltage"));
|
||||||
|
utdata->frequency = GTK_WIDGET(gtk_builder_get_object(builder, "freq"));
|
||||||
|
utdata->attack_detection = GTK_WIDGET(gtk_builder_get_object(builder, "attack_detection"));
|
||||||
|
utdata->algorithm = GTK_WIDGET(gtk_builder_get_object(builder, "algorithm"));
|
||||||
|
utdata->dimmension = GTK_WIDGET(gtk_builder_get_object(builder, "dimmension"));
|
||||||
|
// utdata->util_map = GTK_WIDGET(gtk_builder_get_object(builder, "util_map"));
|
||||||
|
utdata->map_layout = GTK_CONTAINER(gtk_builder_get_object(builder, "map_layout"));
|
||||||
|
|
||||||
|
gtk_widget_set_sensitive(utdata->voltage, FALSE);
|
||||||
|
gtk_widget_set_visible(utdata->algorithm, FALSE);
|
||||||
|
gtk_widget_set_visible(utdata->dimmension, FALSE);
|
||||||
|
|
||||||
|
g_signal_connect(utdata->attack_detection, "clicked", G_CALLBACK(on_attack_detection_clicked), NULL);
|
||||||
|
g_signal_connect(utdata->frequency, "clicked", G_CALLBACK(on_frequency_clicked), NULL);
|
||||||
|
g_signal_connect(utdata->voltage, "clicked", G_CALLBACK(on_voltage_clicked), NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
g_red_image = gdk_pixbuf_new_from_file_at_size (RED_IMAGE, 24,24,NULL);
|
g_red_image = gdk_pixbuf_new_from_file_at_size (RED_IMAGE, 24,24,NULL);
|
||||||
g_green_image = gdk_pixbuf_new_from_file_at_size (GREEN_IMAGE, 24,24,NULL);
|
g_green_image = gdk_pixbuf_new_from_file_at_size (GREEN_IMAGE, 24,24,NULL);
|
||||||
window = GTK_WIDGET(gtk_builder_get_object(builder, "util_window"));
|
|
||||||
GtkContainer *map_container = GTK_CONTAINER(gtk_builder_get_object(builder, "map_layout"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
util_map = g_object_new (OSM_TYPE_GPS_MAP,
|
utdata->util_map = g_object_new (OSM_TYPE_GPS_MAP,
|
||||||
"map-source", OSM_GPS_MAP_SOURCE_OPENSTREETMAP,
|
"map-source", OSM_GPS_MAP_SOURCE_OPENSTREETMAP,
|
||||||
"tile-cache", "/tmp/",
|
"tile-cache", "/tmp/",
|
||||||
NULL);
|
NULL);
|
||||||
osm_gps_map_set_center_and_zoom (util_map, 15.4589, 75.0078, 10);
|
osm_gps_map_set_center_and_zoom (utdata->util_map, 15.4589, 75.0078, 10);
|
||||||
|
|
||||||
g_last_image = osm_gps_map_image_add(util_map,15.4589, 75.0078, g_red_image);
|
// TODO: add the points to window.
|
||||||
g_last_image = osm_gps_map_image_add(util_map,15.518597, 74.925584, g_green_image);
|
g_last_image = osm_gps_map_image_add(utdata->util_map,15.4589, 75.0078, g_red_image);
|
||||||
myParameters parameters = {util_map, g_red_image, g_green_image, g_last_image};
|
g_last_image = osm_gps_map_image_add(utdata->util_map,15.518597, 74.925584, g_green_image);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
myParameters parameters = {utdata->util_map, g_red_image, g_green_image, g_last_image};
|
||||||
gpointer data = (gpointer) ¶meters;
|
gpointer data = (gpointer) ¶meters;
|
||||||
guint pid = g_timeout_add(20, (GSourceFunc) update_images, data);
|
guint pid = g_timeout_add(20, (GSourceFunc) update_images, data);
|
||||||
|
|
||||||
gtk_widget_set_size_request(GTK_WIDGET(util_map), 600, 500);
|
gtk_widget_set_size_request(GTK_WIDGET(utdata->util_map), 600, 500);
|
||||||
|
|
||||||
gtk_container_add(map_container, GTK_WIDGET(util_map));
|
gtk_container_add(utdata->map_layout, GTK_WIDGET(utdata->util_map));
|
||||||
g_signal_connect(window, "destroy", G_CALLBACK(on_window_destroy), GUINT_TO_POINTER(pid));
|
g_signal_connect(utdata->util_window, "destroy", G_CALLBACK(on_window_destroy), GUINT_TO_POINTER(pid));
|
||||||
|
|
||||||
|
gtk_widget_show_all(utdata->util_window);
|
||||||
|
|
||||||
|
gtk_widget_hide(utdata->algorithm);
|
||||||
|
gtk_widget_hide(utdata->dimmension);
|
||||||
|
|
||||||
gtk_widget_show_all(window);
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
}
|
}
|
Loading…
Reference in New Issue