diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-03-27 22:08:31 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-03-27 22:08:31 +0100 |
commit | daa87d92b3df433578e53284a8c88083e24f8623 (patch) | |
tree | bb061a88510935f7bb91139ae618caaf9b546c96 /fw/fe310/test | |
parent | 72a82b58ba87fe9ecc2718bfcb2b5f0432ffaea9 (diff) |
form/app cleanup; scroll infrastructure
Diffstat (limited to 'fw/fe310/test')
-rw-r--r-- | fw/fe310/test/cell_pdp.c | 11 | ||||
-rw-r--r-- | fw/fe310/test/main.c | 3 | ||||
-rw-r--r-- | fw/fe310/test/modem.c | 11 | ||||
-rw-r--r-- | fw/fe310/test/phone.c | 5 | ||||
-rw-r--r-- | fw/fe310/test/status.c | 9 | ||||
-rw-r--r-- | fw/fe310/test/wifi.c | 14 |
6 files changed, 24 insertions, 29 deletions
diff --git a/fw/fe310/test/cell_pdp.c b/fw/fe310/test/cell_pdp.c index a45adc4..8bc8c41 100644 --- a/fw/fe310/test/cell_pdp.c +++ b/fw/fe310/test/cell_pdp.c @@ -21,7 +21,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "status.h" #include "cell_pdp.h" @@ -92,19 +91,19 @@ void app_cell_pdp(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = app_form_create(window, stack, spec, 3, app_cell_pdp_action, app_cell_pdp_close); + EVEForm *form = eve_form_create(window, stack, spec, 3, app_cell_pdp_action, app_cell_pdp_close); } void app_cell_pdp_action(EVEForm *form) { - EVEStrWidget *apn = (EVEStrWidget *)eve_form_widget(form, 0); - EVEStrWidget *user = (EVEStrWidget *)eve_form_widget(form, 1); - EVEStrWidget *pass = (EVEStrWidget *)eve_form_widget(form, 2); + EVEStrWidget *apn = (EVEStrWidget *)eve_page_widget(&form->p, 0); + EVEStrWidget *user = (EVEStrWidget *)eve_page_widget(&form->p, 1); + EVEStrWidget *pass = (EVEStrWidget *)eve_page_widget(&form->p, 2); cell_pdp_connect(apn->str, user->str, pass->str); } void app_cell_pdp_close(EVEForm *form) { - app_form_destroy(form); + eve_form_destroy(form); } void app_cell_pdp_init(void) { diff --git a/fw/fe310/test/main.c b/fw/fe310/test/main.c index a3af24b..7f0fc43 100644 --- a/fw/fe310/test/main.c +++ b/fw/fe310/test/main.c @@ -21,7 +21,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "status.h" #include "cell_dev.h" @@ -58,7 +57,7 @@ void app_home_page(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = app_form_create(window, stack, spec, 4, NULL, NULL); + EVEForm *form = eve_form_create(window, stack, spec, 4, NULL, NULL); } int main() { diff --git a/fw/fe310/test/modem.c b/fw/fe310/test/modem.c index ec74482..b78a3b4 100644 --- a/fw/fe310/test/modem.c +++ b/fw/fe310/test/modem.c @@ -22,7 +22,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "modem.h" @@ -79,8 +78,8 @@ static void handle_uart(unsigned char type) { } static void handle_cell_msg(unsigned char type, unsigned char *buffer, uint16_t len) { - EVEWindow *root = app_root(); - EVEWindow *window = eve_window_search(root, "main"); + EVEWindowRoot *root = app_root(); + EVEWindow *window = eve_window_search(&root->w, "main"); VParam *param = window->view->param; if (type == EOS_CELL_MTYPE_UART_DATA) { @@ -106,7 +105,7 @@ static uint8_t modem_draw(EVEView *view, uint8_t tag0) { VParam *param = view->param; EVEText *text = ¶m->text; - tag0 = eve_view_clear(view, tag0); + tag0 = eve_view_clear(view, tag0, 0); return eve_text_draw(text, tag0); } @@ -119,7 +118,7 @@ static int modem_touch(EVEView *view, EVETouch *touch, uint16_t evt, uint8_t tag void app_modem(EVEWindow *window, EVEViewStack *stack) { unsigned char *buf; - EVEWindowRoot *root = (EVEWindowRoot *)window->root; + EVEWindowRoot *root = window->root; EVEKbd *kbd = eve_window_kbd(window); EVERect g = {0, 60, 480, 512}; EVEView *view; @@ -150,7 +149,7 @@ void app_modem_close(EVEView *view) { unsigned char *buf = eos_net_alloc(); VParam *param = view->param; EVEWindow *window = view->window; - EVEWindowRoot *root = (EVEWindowRoot *)window->root; + EVEWindowRoot *root = window->root; EVEKbd *kbd = eve_window_kbd(window); EVEViewStack *stack = param->stack; diff --git a/fw/fe310/test/phone.c b/fw/fe310/test/phone.c index de5ed1e..0bf1c04 100644 --- a/fw/fe310/test/phone.c +++ b/fw/fe310/test/phone.c @@ -21,7 +21,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "status.h" #include "phone.h" @@ -93,12 +92,12 @@ void app_phone(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = app_form_create(window, stack, spec, 1, app_phone_action, NULL); + EVEForm *form = eve_form_create(window, stack, spec, 1, app_phone_action, NULL); } void app_phone_action(EVEForm *form) { char msg[128]; - EVEStrWidget *w = (EVEStrWidget *)eve_form_widget(form, 0); + EVEStrWidget *w = (EVEStrWidget *)eve_page_widget(&form->p, 0); unsigned char *buf = eos_net_alloc(); buf[0] = EOS_CELL_MTYPE_VOICE | EOS_CELL_MTYPE_VOICE_DIAL; diff --git a/fw/fe310/test/status.c b/fw/fe310/test/status.c index 4413767..b7307b2 100644 --- a/fw/fe310/test/status.c +++ b/fw/fe310/test/status.c @@ -21,7 +21,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "phone.h" #include "status.h" @@ -58,10 +57,9 @@ static int status_touch(EVEView *view, EVETouch *touch, uint16_t evt, uint8_t ta static uint8_t status_draw(EVEView *view, uint8_t tag0) { uint8_t tag_opt = EVE_TOUCH_OPT_TRACK | EVE_TOUCH_OPT_TRACK_XY; - tag0 = eve_view_clear(view, tag0); - if (view->tag != EVE_TAG_NOTAG) eve_touch_set_opt(view->tag, eve_touch_get_opt(view->tag) | tag_opt); + tag0 = eve_view_clear(view, tag0, tag_opt); - if (tag0 != EVE_TAG_NOTAG) { + if (tag0 != EVE_NOTAG) { eve_touch_set_opt(tag0, eve_touch_get_opt(tag0) | tag_opt); eve_cmd_dl(TAG(tag0)); tag0++; @@ -79,7 +77,8 @@ void app_status_msg_set(char *msg, int refresh) { } void app_status_init(void) { - EVEWindow *status = eve_window_search(app_root(), "status"); + EVEWindowRoot *root = app_root(); + EVEWindow *status = eve_window_search(&root->w, "status"); status->view->touch = status_touch; status->view->draw = status_draw; } diff --git a/fw/fe310/test/wifi.c b/fw/fe310/test/wifi.c index d3c61e4..76e811d 100644 --- a/fw/fe310/test/wifi.c +++ b/fw/fe310/test/wifi.c @@ -21,7 +21,6 @@ #include <eve/widget/widgets.h> #include <app/app_root.h> -#include <app/app_form.h> #include "status.h" #include "wifi.h" @@ -56,9 +55,10 @@ static void wifi_disconnect(void) { } void wifi_scan_handler(unsigned char type, unsigned char *buffer, uint16_t size) { - EVEWindow *window = eve_window_search(app_root(), "main"); + EVEWindowRoot *root = app_root(); + EVEWindow *window = eve_window_search(&root->w, "main"); EVEForm *form = (EVEForm *)window->view; - EVESelectWidget *select = (EVESelectWidget *)eve_form_widget(form, 0); + EVESelectWidget *select = (EVESelectWidget *)eve_page_widget(&form->p, 0); eve_selectw_option_set(select, buffer + 1, size - 1); eos_net_free(buffer, 0); @@ -99,20 +99,20 @@ void app_wifi(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = app_form_create(window, stack, spec, 3, app_wifi_action, app_wifi_close); + EVEForm *form = eve_form_create(window, stack, spec, 3, app_wifi_action, app_wifi_close); wifi_scan(); } void app_wifi_action(EVEForm *form) { - EVESelectWidget *sel = (EVESelectWidget *)eve_form_widget(form, 0); - EVEStrWidget *str = (EVEStrWidget *)eve_form_widget(form, 2); + EVESelectWidget *sel = (EVESelectWidget *)eve_page_widget(&form->p, 0); + EVEStrWidget *str = (EVEStrWidget *)eve_page_widget(&form->p, 2); char *ssid = eve_selectw_option_get_select(sel); if (ssid) wifi_connect(ssid, str->str); } void app_wifi_close(EVEForm *form) { - app_form_destroy(form); + eve_form_destroy(form); } void app_wifi_init(void) { |