aboutsummaryrefslogtreecommitdiff
path: root/include/mgui/scrollview.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-12-07 20:20:27 +0100
committerdec05eba <dec05eba@protonmail.com>2021-12-07 20:20:27 +0100
commit864ee5f167d1e2dda9bfce24ef617d71ce49bfd8 (patch)
tree14c3bfe2d9b28dce43be9efae8e18156de7787fc /include/mgui/scrollview.h
parentd3a5b3d579e30ce02afd5e270dfdd511af195c31 (diff)
scrollview
Diffstat (limited to 'include/mgui/scrollview.h')
-rw-r--r--include/mgui/scrollview.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/mgui/scrollview.h b/include/mgui/scrollview.h
new file mode 100644
index 0000000..d394e50
--- /dev/null
+++ b/include/mgui/scrollview.h
@@ -0,0 +1,28 @@
+#ifndef MGUI_SCROLLVIEW_H
+#define MGUI_SCROLLVIEW_H
+
+#include "widget.h"
+
+typedef struct {
+ mgui_widget widget;
+ mgui_widget *child;
+ mgl_vec2i child_size;
+ mgl_vec2i position;
+ mgl_vec2i size;
+ mgl_vec2i scroll;
+ mgl_vec2f mouse_scroll;
+} mgui_scrollview;
+
+mgui_scrollview* mgui_scrollview_create();
+mgui_widget* mgui_scrollview_to_widget(mgui_scrollview *list);
+mgui_scrollview* mgui_widget_to_scrollview(mgui_widget *widget);
+
+void mgui_scrollview_set_child(mgui_scrollview *self, mgui_widget *child);
+void mgui_scrollview_set_position(mgui_scrollview *self, mgl_vec2i position);
+void mgui_scrollview_set_size(mgui_scrollview *self, mgl_vec2i size);
+void mgui_scrollview_set_width(mgui_scrollview *self, int width);
+void mgui_scrollview_on_event(mgui_scrollview *self, mgl_window *window, mgl_event *event);
+/* Returns the size of the widget */
+mgl_vec2i mgui_scrollview_draw(mgui_scrollview *self, mgl_window *window);
+
+#endif /* MGUI_SCROLLVIEW_H */