diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-18 10:57:35 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-18 10:57:35 +0200 |
commit | c6cdddeff0cb0437b1d54520d99460a58db39fdc (patch) | |
tree | 97ce8da5314293a7465e21e63d69904d82fa43af /src/gui/widget.c | |
parent | eace3b5f238e5e4eaf4c2ffcbf741616a0d6a25f (diff) | |
download | abaos-c6cdddeff0cb0437b1d54520d99460a58db39fdc.tar.gz abaos-c6cdddeff0cb0437b1d54520d99460a58db39fdc.tar.bz2 |
started the widget framework
Diffstat (limited to 'src/gui/widget.c')
-rw-r--r-- | src/gui/widget.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gui/widget.c b/src/gui/widget.c new file mode 100644 index 0000000..313fd49 --- /dev/null +++ b/src/gui/widget.c @@ -0,0 +1,35 @@ +#include "widget.h" + +#include "string.h" +#include "stddef.h" + +static widget_vtable_t widget_vtable = { + widget_draw, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h ) +{ + memset( widget, 0, sizeof( widget_t ) ); + + widget->parent = parent; + widget->x = x; + widget->y = y; + widget->w = w; + widget->h = h; + + widget->vtable = &widget_vtable; +} + +void widget_draw( void *obj, graphics_context_t *context ) +{ + widget_t *widget = obj; + + vga_draw_rectangle( context, widget->x, widget->y, widget->w, widget->h, + vga_make_RGB( 0xFF, 0xFF, 0xFF ) ); +} |