]> git.scottworley.com Git - batteryviewer/blob - chart.h
Drop NaNs
[batteryviewer] / chart.h
1 #ifndef BV_CHART_H
2 #define BV_CHART_H
3
4 /*
5 * h/t https://ptomato.name/advanced-gtk-techniques/html/custom-container.html
6 * for examples of how to make GTK widgets
7 */
8
9 #include <glib-object.h>
10 #include <gtk/gtk.h>
11
12 G_BEGIN_DECLS
13
14 #define BV_CHART_TYPE (bv_chart_get_type())
15 #define BV_CHART(obj) \
16 (G_TYPE_CHECK_INSTANCE_CAST((obj), BV_CHART_TYPE, BVChart))
17 #define BV_CHART_CLASS(klass) \
18 (G_TYPE_CHECK_CLASS_CAST((klass), BV_CHART_TYPE, BVChartClass))
19 #define BV_IS_CHART(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BV_CHART_TYPE))
20 #define BV_IS_CHART_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_TYPE((klass), BV_CHART_TYPE))
22
23 typedef struct _BVChart BVChart;
24 typedef struct _BVChartClass BVChartClass;
25
26 struct _BVChart {
27 GtkDrawingArea parent_instance;
28 };
29
30 struct _BVChartClass {
31 GtkDrawingAreaClass parent_class;
32 };
33
34 GType bv_chart_get_type(void) G_GNUC_CONST;
35 GtkWidget *bv_chart_new(void);
36 void bv_chart_add_point(BVChart *chart, float x, float y);
37
38 G_END_DECLS
39
40 #endif /* BV_CHART_H */