]> git.scottworley.com Git - batteryviewer/blobdiff - chart.h
Start on chart GTK widget
[batteryviewer] / chart.h
diff --git a/chart.h b/chart.h
new file mode 100644 (file)
index 0000000..7cda505
--- /dev/null
+++ b/chart.h
@@ -0,0 +1,39 @@
+#ifndef BV_CHART_H
+#define BV_CHART_H
+
+/*
+ * h/t https://ptomato.name/advanced-gtk-techniques/html/custom-container.html
+ * for examples of how to make GTK widgets
+ */
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define BV_CHART_TYPE (bv_chart_get_type())
+#define BV_CHART(obj)                                                          \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), BV_CHART_TYPE, BVChart))
+#define BV_CHART_CLASS(klass)                                                  \
+  (G_TYPE_CHECK_CLASS_CAST((klass), BV_CHART_TYPE, BVChartClass))
+#define BV_IS_CHART(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BV_CHART_TYPE))
+#define BV_IS_CHART_CLASS(klass)                                               \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), BV_CHART_TYPE))
+
+typedef struct _BVChart BVChart;
+typedef struct _BVChartClass BVChartClass;
+
+struct _BVChart {
+  GtkDrawingArea parent_instance;
+};
+
+struct _BVChartClass {
+  GtkDrawingAreaClass parent_class;
+};
+
+GType bv_chart_get_type(void) G_GNUC_CONST;
+GtkWidget *bv_chart_new(void);
+
+G_END_DECLS
+
+#endif /* BV_CHART_H */