flip_store.h 4.7 KB

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