diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libwidget/include/libwidget/core.h | 14 | ||||
-rw-r--r-- | src/lib/libwidget/src/core/widget_core.c | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/libwidget/include/libwidget/core.h b/src/lib/libwidget/include/libwidget/core.h index b02ac99..5a5b891 100644 --- a/src/lib/libwidget/include/libwidget/core.h +++ b/src/lib/libwidget/include/libwidget/core.h @@ -58,11 +58,15 @@ struct bp_color { * * @x: Cartesian X position * @y: Cartesian Y position + * @width: Widget width + * @height: Widget height * @color: Color blueprint */ struct blueprint { uint32_t x; uint32_t y; + uint32_t width; + uint32_t height; struct bp_color color; }; @@ -96,6 +100,16 @@ struct widget { }; /* + * Initialize the library + * + * @lwsp: Libwidget state pointer + * + * Returns zero on success, otherwise a less than zero + * value on failure. + */ +int libwidget_init(struct libwidget_state *lwsp); + +/* * Initialize a widget * * @wp: Widget to initialize diff --git a/src/lib/libwidget/src/core/widget_core.c b/src/lib/libwidget/src/core/widget_core.c index 22f6269..c36d88e 100644 --- a/src/lib/libwidget/src/core/widget_core.c +++ b/src/lib/libwidget/src/core/widget_core.c @@ -64,6 +64,10 @@ widget_init(struct widget *wp, widget_type_t type, struct blueprint *bp) color->bg = 0x282828; color->fg = 0xA89984; + /* Default height */ + bp_dest->width = 50; + bp_dest->height = 50; + if (bp != NULL) { bp_dest->x = bp->x; bp_dest->y = bp->y; |