summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget/freew.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve/widget/freew.c')
-rw-r--r--fw/fe310/eos/eve/widget/freew.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/fw/fe310/eos/eve/widget/freew.c b/fw/fe310/eos/eve/widget/freew.c
index f129af0..1a55ea9 100644
--- a/fw/fe310/eos/eve/widget/freew.c
+++ b/fw/fe310/eos/eve/widget/freew.c
@@ -1,8 +1,6 @@
#include <stdlib.h>
#include <string.h>
-#include "unicode.h"
-
#include "eve.h"
#include "eve_kbd.h"
#include "eve_font.h"
@@ -14,23 +12,23 @@
#include "widget.h"
#include "freew.h"
-int eve_freew_create(EVEFreeWidget *widget, EVERect *g, EVEFont *font, EVEFreeSpec *spec) {
- eve_freew_init(widget, g, font, spec->touch, spec->draw, spec->putc);
+int eve_freew_create(EVEFreeWidget *widget, EVERect *g, EVEPage *page, EVEFreeSpec *spec) {
+ eve_freew_init(widget, g, page, spec->draw, spec->touch, spec->putc);
return EVE_OK;
}
-void eve_freew_init(EVEFreeWidget *widget, EVERect *g, EVEFont *font, eve_freew_touch_t touch, eve_freew_draw_t draw, eve_kbd_input_handler_t putc) {
+void eve_freew_init(EVEFreeWidget *widget, EVERect *g, EVEPage *page, eve_freew_draw_t draw, eve_freew_touch_t touch, eve_kbd_input_handler_t putc) {
EVEWidget *_widget = &widget->w;
memset(widget, 0, sizeof(EVEFreeWidget));
- eve_widget_init(_widget, EVE_WIDGET_TYPE_FREE, g, font, eve_freew_touch, eve_freew_draw, putc);
- eve_freew_update(widget, touch, draw, NULL);
+ eve_widget_init(_widget, EVE_WIDGET_TYPE_FREE, g, page, eve_freew_draw, eve_freew_touch, putc);
+ eve_freew_update(widget, draw, touch, NULL);
}
-void eve_freew_update(EVEFreeWidget *widget, eve_freew_touch_t touch, eve_freew_draw_t draw, eve_kbd_input_handler_t putc) {
- if (touch) widget->_touch = touch;
+void eve_freew_update(EVEFreeWidget *widget, eve_freew_draw_t draw, eve_freew_touch_t touch, eve_kbd_input_handler_t putc) {
if (draw) widget->_draw = draw;
+ if (touch) widget->_touch = touch;
if (putc) widget->w.putc = putc;
}
@@ -43,18 +41,18 @@ void eve_freew_tag(EVEFreeWidget *widget) {
}
}
-int eve_freew_touch(EVEWidget *_widget, EVEPage *page, EVETouch *t, uint16_t evt) {
- EVEFreeWidget *widget = (EVEFreeWidget *)_widget;
-
- return widget->_touch(widget, page, t, evt);
-}
-
-uint8_t eve_freew_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
+uint8_t eve_freew_draw(EVEWidget *_widget, uint8_t tag0) {
EVEFreeWidget *widget = (EVEFreeWidget *)_widget;
_widget->tag0 = tag0;
_widget->tagN = tag0;
- widget->_draw(widget, page);
+ widget->_draw(widget);
return _widget->tagN;
}
+
+int eve_freew_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt) {
+ EVEFreeWidget *widget = (EVEFreeWidget *)_widget;
+
+ return widget->_touch(widget, touch, evt);
+}