factor out application widgets from widget.h -- add new include/mongoose-touch.h instead
This commit is contained in:
18
include/mongoose-touch.h
Normal file
18
include/mongoose-touch.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef __MONGOOSE_TOUCH_H
|
||||
#define __MONGOOSE_TOUCH_H
|
||||
|
||||
#include "widget.h"
|
||||
|
||||
void widget_time_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_wifi_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_network_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
void widget_network_send();
|
||||
void widget_network_recv();
|
||||
|
||||
void widget_topbar_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_name_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
#endif // __MONGOOSE_TOUCH_H
|
@ -30,16 +30,4 @@ struct widget_t *widget_add_from_file(const char *fn, uint32_t timer_msec, widge
|
||||
struct widget_t *widget_find(uint16_t x, uint16_t y);
|
||||
void widget_remove(struct widget_t *widget);
|
||||
|
||||
void widget_time_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_wifi_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_network_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
void widget_network_send();
|
||||
void widget_network_recv();
|
||||
|
||||
void widget_topbar_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
void widget_name_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
#endif // __WIDGET_H
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "mgos.h"
|
||||
#include "tft.h"
|
||||
#include "stmpe610.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
|
||||
static long map(long x, long in_min, long in_max, long out_min, long out_max) {
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "mgos_wifi.h"
|
||||
#include "mgos_net.h"
|
||||
#include "tft.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
|
||||
#define WIDGET_NAME_NAME 0
|
||||
#define WIDGET_NAME_IPADDR 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "mgos.h"
|
||||
#include "mgos_timers.h"
|
||||
#include "tft.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
|
||||
static mgos_timer_id send_timer = 0;
|
||||
static mgos_timer_id recv_timer = 0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "mgos.h"
|
||||
#include "tft.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
|
||||
static void widget_time_render(struct widget_t *w, void *ev_data) {
|
||||
char tmp_buff[32];
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "mgos.h"
|
||||
#include "tft.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
|
||||
static void widget_topbar_render(struct widget_t *w, void *ev_data) {
|
||||
if (!w)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "mgos.h"
|
||||
#include "tft.h"
|
||||
#include "widget.h"
|
||||
#include "mongoose-touch.h"
|
||||
#include <esp_wifi.h>
|
||||
|
||||
static long map(long x, long in_min, long in_max, long out_min, long out_max)
|
||||
|
Reference in New Issue
Block a user