-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnfc_magic_gen4_i.h
85 lines (64 loc) · 1.98 KB
/
nfc_magic_gen4_i.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
#include "nfc_magic_gen4.h"
#include "nfc_magic_gen4_worker.h"
#include "lib/magic_gen4/magic_gen4.h"
#include <furi.h>
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include <notification/notification_messages.h>
#include <gui/modules/submenu.h>
#include <gui/modules/popup.h>
#include <gui/modules/loading.h>
#include <gui/modules/text_input.h>
#include <gui/modules/widget.h>
#include <gui/modules/byte_input.h>
#include <input/input.h>
#include "scenes/nfc_magic_gen4_scene.h"
#include "persisted.h"
#include <storage/storage.h>
#include <lib/toolbox/path.h>
#include <lib/nfc/nfc_device.h>
#include "nfc_magic_gen4_icons.h"
#define NFC_APP_FOLDER ANY_PATH("nfc")
typedef unsigned char byte;
enum NfcMagicCustomEvent {
// Reserve first 100 events for button types and indexes, starting from 0
NfcMagicCustomEventReserved = 100,
NfcMagicCustomEventViewExit,
NfcMagicCustomEventWorkerExit,
NfcMagicCustomEventByteInputDone,
NfcMagicCustomEventTextInputDone,
};
struct NfcMagic {
NfcMagicWorker* worker;
ViewDispatcher* view_dispatcher;
Gui* gui;
NotificationApp* notifications;
SceneManager* scene_manager;
// NfcMagicDevice* dev;
NfcDevice* nfc_dev;
FuriString* text_box_store;
// Common Views
Submenu* submenu;
Popup* popup;
Loading* loading;
TextInput* text_input;
Widget* widget;
ByteInput* byte_input;
NfcMagic4State* persisted_state;
};
typedef enum {
NfcMagicViewMenu,
NfcMagicViewPopup,
NfcMagicViewLoading,
NfcMagicViewTextInput,
NfcMagicViewByteInput,
NfcMagicViewWidget,
} NfcMagicView;
NfcMagic* nfc_magic_gen4_alloc();
void nfc_magic_gen4_text_store_set(NfcMagic* nfc_magic, const char* text, ...);
void nfc_magic_gen4_text_store_clear(NfcMagic* nfc_magic);
void nfc_magic_gen4_blink_start(NfcMagic* nfc_magic);
void nfc_magic_gen4_blink_stop(NfcMagic* nfc_magic);
void nfc_magic_gen4_show_loading_popup(void* context, bool show);