-
Notifications
You must be signed in to change notification settings - Fork 4
/
eth_view_process.h
59 lines (50 loc) · 1.53 KB
/
eth_view_process.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include "eth_worker.h"
#include "eth_save_process.h"
#include <gui/gui.h>
#define SCREEN_SYMBOLS_WIDTH 30
EthViewProcess* ethernet_view_process_malloc(EthWorkerProcess type, EthernetSaveConfig* config);
void ethernet_view_process_free(EthViewProcess* evp);
void ethernet_view_process_draw(EthViewProcess* process, Canvas* canvas);
void ethernet_view_process_keyevent(EthViewProcess* process, InputKey key);
void ethernet_view_process_print(EthViewProcess* process, const char* str);
void ethernet_view_process_move(EthViewProcess* process, int8_t shift);
void evp_printf(EthViewProcess* process, const char* format, ...);
typedef struct EthViewProcessLine {
char data[SCREEN_SYMBOLS_WIDTH];
} EthViewProcessLine;
struct EthViewProcess {
EthViewProcessLine* fifo;
EthWorkerProcess type;
uint8_t strings_cnt;
uint8_t carriage;
uint8_t position;
uint8_t autofill;
uint8_t editing;
uint8_t x;
uint8_t y;
void* draw_struct;
};
typedef struct EthViewDrawInit {
uint8_t* mac;
uint8_t current_octet;
} EthViewDrawInit;
typedef enum {
EthViewDrawStaticModeIp,
EthViewDrawStaticModeMask,
EthViewDrawStaticModeGateway,
EthViewDrawStaticModeDNS
} EthViewDrawStaticMode;
typedef struct EthViewDrawStatic {
EthViewDrawStaticMode current_mode;
uint8_t* ip;
uint8_t* mask;
uint8_t* gateway;
uint8_t* dns;
uint8_t current_digit;
uint8_t editing;
} EthViewDrawStatic;
typedef struct EthViewDrawPing {
uint8_t current_digit;
uint8_t* ip;
} EthViewDrawPing;