-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.h
More file actions
60 lines (51 loc) · 1.26 KB
/
main.h
File metadata and controls
60 lines (51 loc) · 1.26 KB
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
#pragma once
#include <gui/gui.h>
#include <gui/view_port.h>
#include <furi.h>
#include <gui/gui.h>
#include <gui/elements.h>
#include <gui/view_port.h>
#include <gui/view.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/text_input.h>
#include <gui/modules/dialog_ex.h>
#include <input/input.h>
#include <stdlib.h>
#include <string.h>
// TODO: VOID HARDCODED STUFF
#define MENU_ITEMS 3
// Define view IDs
typedef enum {
ViewMainMenu,
ViewSavedPasswords,
ViewDeletePassword,
ViewTextInputCredentialName,
ViewTextInputUsername,
ViewTextInputPassword
} ViewID;
typedef struct {
char name[100];
char username[100];
char password[100];
} Credential;
typedef struct {
const char* items[MENU_ITEMS];
size_t selected;
size_t scroll_offset;
bool running;
// For view management
Gui* gui;
ViewDispatcher* view_dispatcher;
View* main_menu_view;
View* saved_passwords_view;
View* delete_password_view;
Credential credentials[100];
size_t credentials_number;
char tmp_credential_name[100];
char tmp_username[100];
char tmp_password[100];
TextInput* textInput_credential_name;
TextInput* textInput_username;
TextInput* textInput_password;
bool confirm_delete;
} AppContext;