#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* generated by fbt from .png files in images folder */ #include #include #include "weebo.h" #include "weebo_common.h" #include "scenes/weebo_scene.h" #define WEEBO_TEXT_STORE_SIZE 128 #define WEEBO_FILE_NAME_MAX_LENGTH 64 #define NTAG215_SIZE 540 #define NFC3D_UID_OFFSET 0x1D4 #define PAGE_SIZE 4 enum WeeboCustomEvent { // Reserve first 100 events for button types and indexes, starting from 0 WeeboCustomEventReserved = 100, WeeboCustomEventViewExit, WeeboCustomEventTextInputDone, WeeboCustomEventNumberInputDone, // Card writing WeeboCustomEventCardDetected, WeeboCustomEventWritingUserData, WeeboCustomEventWritingConfigData, WeeboCustomEventWriteSuccess, WeeboCustomEventWriteFailure, WeeboCustomEventWrongCard, }; typedef void (*WeeboLoadingCallback)(void* context, bool state); struct Weebo { ViewDispatcher* view_dispatcher; Gui* gui; NotificationApp* notifications; SceneManager* scene_manager; Storage* storage; char text_store[WEEBO_TEXT_STORE_SIZE + 1]; FuriString* text_box_store; // Common Views Submenu* submenu; Popup* popup; Loading* loading; TextInput* text_input; NumberInput* number_input; TextBox* text_box; Widget* widget; DialogsApp* dialogs; Nfc* nfc; NfcPoller* poller; NfcListener* listener; NfcDevice* nfc_device; FuriString* load_path; char file_name[WEEBO_FILE_NAME_MAX_LENGTH + 1]; bool keys_loaded; nfc3d_amiibo_keys keys; WeeboLoadingCallback loading_cb; void* loading_cb_ctx; uint8_t figure[NFC3D_AMIIBO_SIZE]; }; typedef enum { WeeboViewMenu, WeeboViewPopup, WeeboViewLoading, WeeboViewTextInput, WeeboViewNumberInput, WeeboViewTextBox, WeeboViewWidget, } WeeboView; void weebo_text_store_set(Weebo* weebo, const char* text, ...); void weebo_text_store_clear(Weebo* weebo); void weebo_blink_start(Weebo* weebo); void weebo_blink_stop(Weebo* weebo); void weebo_show_loading_popup(void* context, bool show); void weebo_set_loading_callback(Weebo* weebo, WeeboLoadingCallback callback, void* context); bool weebo_file_select(Weebo* weebo);