Plumb default_widget_handler and default_user_data for widgets read from JSON/File

This commit is contained in:
Pim van Pelt
2017-11-26 19:06:44 +01:00
parent fda8b332db
commit e826324244
7 changed files with 94 additions and 8 deletions

22
src/widget_default.c Normal file
View File

@ -0,0 +1,22 @@
#include "mgos.h"
#include "tft.h"
#include "mongoose-touch.h"
void widget_default_ev(int ev, struct widget_t *w, void *ev_data) {
if (!w)
return;
LOG(LL_INFO, ("Event %d received for widget '%s'", ev, w->name));
switch(ev) {
case EV_WIDGET_CREATE:
case EV_WIDGET_DRAW:
case EV_WIDGET_REDRAW:
case EV_WIDGET_TIMER:
case EV_WIDGET_TOUCH_UP:
case EV_WIDGET_TOUCH_DOWN:
case EV_WIDGET_DESTROY:
default: // EV_WIDGET_NONE
break;
}
}