-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapshup_i.h
124 lines (108 loc) · 2.47 KB
/
shapshup_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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#pragma once
#include <furi.h>
#include <furi_hal.h>
#include <input/input.h>
#include "lib/toolbox/path.h"
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <string.h>
#include <gui/gui.h>
#include <gui/modules/loading.h>
#include <gui/modules/popup.h>
#include <gui/modules/text_input.h>
#include <gui/modules/widget.h>
#include <gui/scene_manager.h>
#include <gui/view_dispatcher.h>
#include <gui/view_stack.h>
#include <dialogs/dialogs.h>
#include <lib/subghz/environment.h>
#include <lib/subghz/protocols/base.h>
#include <lib/subghz/receiver.h>
#include <lib/subghz/transmitter.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <lib/toolbox/stream/stream.h>
#include "helpers/shapshup_files.h"
#include "scenes/shapshup_scene.h"
#include "shapshup.h"
#include "views/shapshup_main_view.h"
/**
* @brief max size of text field
*
*/
#define SHAPSHUP_TEXT_STORE_SIZE 255
/**
* @brief max size of filename
*
*/
#define SHAPSHUP_MAX_LEN_NAME 64
/**
* @brief default directory to show
*
*/
#define SHAPSHUP_PATH EXT_PATH("subghz")
/**
* @brief filename extension to show
*
*/
#define SHAPSHUP_FILE_EXT ".sub"
/**
* @brief used for DEBUG purpose
*
*/
// #define SHAPSHUP_FAST_TRACK false
/**
* @brief view mode
*
*/
typedef enum {
ShapShupViewNone,
ShapShupViewMain,
ShapShupViewTextInput,
ShapShupViewDialogEx,
ShapShupViewPopup,
ShapShupViewLoading,
ShapShupViewWidget,
ShapShupViewStack,
} ShapShupView;
/**
* @brief main state of app
*
*/
struct ShapShupState {
// GUI elements
NotificationApp *notifications;
Gui *gui;
ViewDispatcher *view_dispatcher;
ViewStack *view_stack;
TextInput *text_input;
Popup *popup;
Widget *widget;
DialogsApp *dialogs;
Loading *loading;
char text_store[SHAPSHUP_MAX_LEN_NAME];
FuriString *file_path;
ShapShupMainView *view_main; /** View main, default view*/
ShapShupView current_view; /** @enum ShapShupView for track enums */
SceneManager *scene_manager; /** Scene manager*/
Storage *storage; /** Storage pointer */
};
/**
* @brief shapshup_show_loading_popup
*
* @param context
* @param show
*/
void shapshup_show_loading_popup(void *context, bool show);
/**
* @brief shapshup_text_input_callback
*
* @param context
*/
void shapshup_text_input_callback(void *context);
/**
* @brief shapshup_popup_closed_callback
*
* @param context
*/
void shapshup_popup_closed_callback(void *context);