2022-07-05 15:28:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "picopass.h"
|
|
|
|
#include "picopass_worker.h"
|
|
|
|
#include "picopass_device.h"
|
|
|
|
|
2022-09-14 16:11:38 +00:00
|
|
|
#include "rfal_picopass.h"
|
2022-07-05 15:28:27 +00:00
|
|
|
|
|
|
|
#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>
|
2022-08-23 13:19:17 +00:00
|
|
|
#include <gui/modules/loading.h>
|
2022-07-10 12:46:46 +00:00
|
|
|
#include <gui/modules/text_input.h>
|
2022-07-05 15:28:27 +00:00
|
|
|
#include <gui/modules/widget.h>
|
|
|
|
|
|
|
|
#include <input/input.h>
|
|
|
|
|
2022-09-14 16:11:38 +00:00
|
|
|
#include "scenes/picopass_scene.h"
|
2022-07-05 15:28:27 +00:00
|
|
|
|
|
|
|
#include <storage/storage.h>
|
|
|
|
#include <lib/toolbox/path.h>
|
2022-10-28 14:08:50 +00:00
|
|
|
#include <picopass_icons.h>
|
2022-07-05 15:28:27 +00:00
|
|
|
|
2022-07-10 12:46:46 +00:00
|
|
|
#define PICOPASS_TEXT_STORE_SIZE 128
|
|
|
|
|
2022-07-05 15:28:27 +00:00
|
|
|
enum PicopassCustomEvent {
|
|
|
|
// Reserve first 100 events for button types and indexes, starting from 0
|
|
|
|
PicopassCustomEventReserved = 100,
|
|
|
|
|
|
|
|
PicopassCustomEventViewExit,
|
|
|
|
PicopassCustomEventWorkerExit,
|
|
|
|
PicopassCustomEventByteInputDone,
|
|
|
|
PicopassCustomEventTextInputDone,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EventTypeTick,
|
|
|
|
EventTypeKey,
|
|
|
|
} EventType;
|
|
|
|
|
|
|
|
struct Picopass {
|
|
|
|
PicopassWorker* worker;
|
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
Gui* gui;
|
|
|
|
NotificationApp* notifications;
|
|
|
|
SceneManager* scene_manager;
|
|
|
|
PicopassDevice* dev;
|
|
|
|
|
2022-07-10 12:46:46 +00:00
|
|
|
char text_store[PICOPASS_TEXT_STORE_SIZE + 1];
|
2022-10-05 15:15:23 +00:00
|
|
|
FuriString* text_box_store;
|
2022-07-10 12:46:46 +00:00
|
|
|
|
2022-07-05 15:28:27 +00:00
|
|
|
// Common Views
|
|
|
|
Submenu* submenu;
|
|
|
|
Popup* popup;
|
2022-08-23 13:19:17 +00:00
|
|
|
Loading* loading;
|
2022-07-10 12:46:46 +00:00
|
|
|
TextInput* text_input;
|
2022-07-05 15:28:27 +00:00
|
|
|
Widget* widget;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
PicopassViewMenu,
|
|
|
|
PicopassViewPopup,
|
2022-08-23 13:19:17 +00:00
|
|
|
PicopassViewLoading,
|
2022-07-10 12:46:46 +00:00
|
|
|
PicopassViewTextInput,
|
2022-07-05 15:28:27 +00:00
|
|
|
PicopassViewWidget,
|
|
|
|
} PicopassView;
|
|
|
|
|
|
|
|
Picopass* picopass_alloc();
|
|
|
|
|
2022-07-10 12:46:46 +00:00
|
|
|
void picopass_text_store_set(Picopass* picopass, const char* text, ...);
|
|
|
|
|
|
|
|
void picopass_text_store_clear(Picopass* picopass);
|
|
|
|
|
2022-07-05 15:28:27 +00:00
|
|
|
void picopass_blink_start(Picopass* picopass);
|
|
|
|
|
|
|
|
void picopass_blink_stop(Picopass* picopass);
|
2022-08-23 13:19:17 +00:00
|
|
|
|
|
|
|
void picopass_show_loading_popup(void* context, bool show);
|