flip_downloader.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef FLIP_STORE_E_H
  2. #define FLIP_STORE_E_H
  3. #include <flipper_http/flipper_http.h>
  4. #include <easy_flipper/easy_flipper.h>
  5. #include <furi.h>
  6. #include <furi_hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <notification/notification.h>
  12. #include <dialogs/dialogs.h>
  13. #include <jsmn/jsmn.h>
  14. #include <jsmn/jsmn_furi.h>
  15. #include <flip_downloader_icons.h>
  16. #define TAG "FlipDownloader"
  17. #define VERSION_TAG "FlipDownloader v1.0"
  18. // 1 for Black Magic, 1 for FlipperHTTP, 1 for Marauder
  19. #define FIRMWARE_COUNT 3
  20. #define FIRMWARE_LINKS 3
  21. // 1 for FlipperHTTP, 6 for VGM-Library screensavers, 13 for VGM-Library games
  22. #define VGM_FIRMWARE_COUNT 20
  23. #define VGM_FIRMWARE_LINKS 20
  24. #define MAX_GITHUB_FILES 30
  25. // Define the submenu items for our FlipStore application
  26. typedef enum
  27. {
  28. FlipStoreSubmenuIndexMain, // Click to start downloading the selected app
  29. FlipStoreSubmenuIndexAbout,
  30. FlipStoreSubmenuIndexSettings,
  31. //
  32. FlipStoreSubmenuIndexOptions, // Click to view the options
  33. //
  34. FlipStoreSubmenuIndexAppList, // Click to view the app list
  35. FlipStoreSubmenuIndexFirmwares, // Click to view the ESP32 firmwares
  36. FlipStoreSubmenuIndexVGMFirmwares, // Click to view the VGM firmwares
  37. FlipStoreSubmenuIndexGitHub, // Click to view the GitHub repository view
  38. //
  39. FlipStoreSubmenuIndexAppListBluetooth,
  40. FlipStoreSubmenuIndexAppListGames,
  41. FlipStoreSubmenuIndexAppListGPIO,
  42. FlipStoreSubmenuIndexAppListInfrared,
  43. FlipStoreSubmenuIndexAppListiButton,
  44. FlipStoreSubmenuIndexAppListMedia,
  45. FlipStoreSubmenuIndexAppListNFC,
  46. FlipStoreSubmenuIndexAppListRFID,
  47. FlipStoreSubmenuIndexAppListSubGHz,
  48. FlipStoreSubmenuIndexAppListTools,
  49. FlipStoreSubmenuIndexAppListUSB,
  50. //
  51. FlipStoreSubmenuIndexStartFirmwares = 50,
  52. FlipStoreSubmenuIndexStartVGMFirmwares = 60,
  53. //
  54. FlipStoreSubmenuIndexStartAppList = 100,
  55. } FlipStoreSubmenuIndex;
  56. // Define a single view for our FlipStore application
  57. typedef enum
  58. {
  59. //
  60. FlipStoreViewSubmenu, // The submenu
  61. FlipStoreViewSubmenuOptions, // The submenu options
  62. //
  63. FlipStoreViewAbout, // The about screen
  64. FlipStoreViewSettings, // The settings screen
  65. FlipStoreViewTextInput, // The text input screen
  66. //
  67. FlipStoreViewAppList, // The app list screen
  68. FlipStoreViewFirmwares, // The firmwares screen (submenu)
  69. FlipStoreViewVGMFirmwares, // The VGM firmwares screen (submenu)
  70. FlipStoreViewAGithub, // The GitHub repository screen
  71. //
  72. FlipStoreViewFirmwareDialog, // The firmware view (DialogEx) of the selected firmware
  73. //
  74. FlipStoreViewAppInfo, // The app info screen (widget) of the selected app
  75. FlipStoreViewAppDownload, // The app download screen (widget) of the selected app
  76. FlipStoreViewAppDelete, // The app delete screen (DialogEx) of the selected app
  77. //
  78. FlipStoreViewAppListCategory, // the app list screen for each category
  79. //
  80. //
  81. FlipStoreViewWidgetResult, // The text box that displays the random fact
  82. FlipStoreViewLoader, // The loader screen retrieves data from the internet
  83. } FlipStoreView;
  84. // Each screen will have its own view
  85. typedef struct
  86. {
  87. View *view_loader;
  88. Widget *widget_result;
  89. //
  90. ViewDispatcher *view_dispatcher; // Switches between our views
  91. View *view_app_info; // The app info screen (view) of the selected app
  92. //
  93. DialogEx *dialog_firmware; // The dialog for installing a firmware
  94. //
  95. Submenu *submenu_main; // The submenu (main)
  96. //
  97. Submenu *submenu_options; // The submenu (options)
  98. Submenu *submenu_app_list; // The submenu (app list) for the selected category
  99. Submenu *submenu_firmwares; // The submenu (firmwares)
  100. Submenu *submenu_vgm_firmwares; // The submenu (VGM firmwares)
  101. Submenu *submenu_app_list_category; // The submenu (app list) for each category
  102. Widget *widget_about; // The widget
  103. VariableItemList *variable_item_list; // The variable item list (settngs)
  104. VariableItem *variable_item_ssid; // The variable item
  105. VariableItem *variable_item_pass; // The variable item
  106. //
  107. TextInput *uart_text_input; // The text input
  108. char *uart_text_input_buffer; // Buffer for the text input
  109. char *uart_text_input_temp_buffer; // Temporary buffer for the text input
  110. uint32_t uart_text_input_buffer_size; // Size of the text input buffer
  111. } FlipStoreApp;
  112. void flip_store_app_free(FlipStoreApp *app);
  113. #endif // FLIP_STORE_E_H