weebo_i.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <gui/gui.h>
  5. #include <gui/view_dispatcher.h>
  6. #include <gui/scene_manager.h>
  7. #include <notification/notification_messages.h>
  8. #include <storage/storage.h>
  9. #include <dialogs/dialogs.h>
  10. #include <gui/modules/submenu.h>
  11. #include <gui/modules/popup.h>
  12. #include <gui/modules/loading.h>
  13. #include <gui/modules/text_input.h>
  14. #include <gui/modules/number_input.h>
  15. #include <gui/modules/text_box.h>
  16. #include <gui/modules/widget.h>
  17. #include <input/input.h>
  18. #include <lib/flipper_format/flipper_format.h>
  19. #include <lib/nfc/nfc.h>
  20. #include <nfc/nfc_poller.h>
  21. #include <nfc/nfc_device.h>
  22. /* generated by fbt from .png files in images folder */
  23. #include <weebo_icons.h>
  24. #include <amiibo.h>
  25. #include "weebo.h"
  26. #include "scenes/weebo_scene.h"
  27. #define WEEBO_TEXT_STORE_SIZE 128
  28. #define WEEBO_FILE_NAME_MAX_LENGTH 64
  29. #define NTAG215_SIZE 540
  30. #define NFC3D_UID_OFFSET 0x1D4
  31. #define PAGE_SIZE 4
  32. enum WeeboCustomEvent {
  33. // Reserve first 100 events for button types and indexes, starting from 0
  34. WeeboCustomEventReserved = 100,
  35. WeeboCustomEventViewExit,
  36. WeeboCustomEventTextInputDone,
  37. WeeboCustomEventNumberInputDone,
  38. };
  39. struct Weebo {
  40. ViewDispatcher* view_dispatcher;
  41. Gui* gui;
  42. NotificationApp* notifications;
  43. SceneManager* scene_manager;
  44. Storage* storage;
  45. char text_store[WEEBO_TEXT_STORE_SIZE + 1];
  46. FuriString* text_box_store;
  47. // Common Views
  48. Submenu* submenu;
  49. Popup* popup;
  50. Loading* loading;
  51. TextInput* text_input;
  52. NumberInput* number_input;
  53. TextBox* text_box;
  54. Widget* widget;
  55. DialogsApp* dialogs;
  56. Nfc* nfc;
  57. NfcPoller* poller;
  58. NfcDevice* nfc_device;
  59. FuriString* load_path;
  60. char file_name[WEEBO_FILE_NAME_MAX_LENGTH + 1];
  61. nfc3d_amiibo_keys amiiboKeys;
  62. };
  63. typedef enum {
  64. WeeboViewMenu,
  65. WeeboViewPopup,
  66. WeeboViewLoading,
  67. WeeboViewTextInput,
  68. WeeboViewNumberInput,
  69. WeeboViewTextBox,
  70. WeeboViewWidget,
  71. } WeeboView;
  72. void weebo_text_store_set(Weebo* weebo, const char* text, ...);
  73. void weebo_text_store_clear(Weebo* weebo);
  74. void weebo_blink_start(Weebo* weebo);
  75. void weebo_blink_stop(Weebo* weebo);
  76. void weebo_show_loading_popup(void* context, bool show);