#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 */