From 3f913efda03fd840cd526ef72e6f397c7da61bd7 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 9 Aug 2022 22:23:08 +0200 Subject: code layout --- fw/fe310/eos/eve/widget/widgets.h | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'fw/fe310/eos/eve/widget/widgets.h') diff --git a/fw/fe310/eos/eve/widget/widgets.h b/fw/fe310/eos/eve/widget/widgets.h index 2f8d3ca..9c96d8c 100644 --- a/fw/fe310/eos/eve/widget/widgets.h +++ b/fw/fe310/eos/eve/widget/widgets.h @@ -1,39 +1,24 @@ -#include "label.h" -#include "widget.h" - #include "freew.h" #include "spacerw.h" #include "pagew.h" #include "strw.h" #include "textw.h" #include "selectw.h" +#include "togglew.h" + +#define EVE_WIDGET_TYPE_FREE 1 +#define EVE_WIDGET_TYPE_SPACER 2 +#define EVE_WIDGET_TYPE_PAGE 3 +#define EVE_WIDGET_TYPE_TOGGLE 4 +#define EVE_WIDGET_TYPE_STR 5 +#define EVE_WIDGET_TYPE_TEXT 6 +#define EVE_WIDGET_TYPE_SELECT 7 typedef union EVEWidgetSpecT { EVEFreeSpec free; - EVESpacerSpec spacer; EVEPageSpec page; + EVEToggleSpec toggle; EVEStrSpec str; EVETextSpec text; EVESelectSpec select; } EVEWidgetSpecT; - -typedef struct EVELabelSpec { - EVERect g; - EVEFont *font; - char *title; -} APPLabelSpec; - -typedef struct EVEWidgetSpec { - APPLabelSpec label; - struct { - EVERect g; - EVEWidgetSpecT spec; - uint8_t type; - } widget; -} EVEWidgetSpec; - -typedef int (*eve_widget_create_t) (EVEWidget *, EVERect *, EVEPage *, EVEWidgetSpecT *); -typedef void (*eve_widget_destroy_t) (EVEWidget *); - -int eve_widget_create(EVEWidget *widget, uint8_t type, EVERect *g, EVEPage *page, EVEWidgetSpecT *spec); -void eve_widget_destroy(EVEWidget *widget); -- cgit v1.2.3