From 340e841772eb13d9087235b8707c1cfeff8710cb Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 1 Jul 2021 14:43:53 +0200 Subject: Math improvements and basic plotting --- libs/libgui/widgets.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libs/libgui/widgets.h') diff --git a/libs/libgui/widgets.h b/libs/libgui/widgets.h index 4028af6..64bf6a8 100644 --- a/libs/libgui/widgets.h +++ b/libs/libgui/widgets.h @@ -6,9 +6,31 @@ #include #include +/** + * Button + */ + void gui_button_custom(u32 window, u32 widget, enum font_type font_type, u32 bg, u32 fg, void (*click)(struct gui_event_mouse *event), const char *text); void gui_button(u32 window, u32 widget, void (*click)(struct gui_event_mouse *event), const char *text); +/** + * Plot + */ + +struct gui_plot { + f64 *data; + u32 current; + u32 count; + struct gfx_context *ctx; +}; + +void gui_plot_iterate(struct gui_plot *plot); +void gui_plot_destroy(struct gui_plot *plot); +void gui_plot_draw(struct gui_plot *plot); +struct gui_plot *gui_plot_data(u32 window, u32 widget, const f64 *data, u32 count); +struct gui_plot *gui_plot_cubic(u32 window, u32 widget, f64 delta, s32 x_min, s32 x_max, f64 a, + f64 b, f64 c, f64 d); + #endif -- cgit v1.2.3