flipbip.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #pragma once
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <gui/gui.h>
  5. #include <input/input.h>
  6. #include <stdlib.h>
  7. //#include <notification/notification_messages.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/scene_manager.h>
  11. #include <gui/modules/variable_item_list.h>
  12. #include <gui/modules/text_input.h>
  13. #include "scenes/flipbip_scene.h"
  14. #include "views/flipbip_scene_1.h"
  15. #define FLIPBIP_VERSION "v1.13.0"
  16. #define COIN_BTC 0
  17. #define COIN_DOGE 3
  18. #define COIN_ETH 60
  19. #define COIN_ZEC 133
  20. #define TEXT_BUFFER_SIZE 256
  21. typedef struct {
  22. Gui* gui;
  23. // NotificationApp* notification;
  24. ViewDispatcher* view_dispatcher;
  25. Submenu* submenu;
  26. SceneManager* scene_manager;
  27. VariableItemList* variable_item_list;
  28. TextInput* text_input;
  29. FlipBipScene1* flipbip_scene_1;
  30. char* mnemonic_menu_text;
  31. // Settings options
  32. int haptic;
  33. int bip39_strength;
  34. int passphrase;
  35. // Main menu options
  36. int bip44_coin;
  37. int overwrite_saved_seed;
  38. int import_from_mnemonic;
  39. // Text input
  40. int input_state;
  41. char passphrase_text[TEXT_BUFFER_SIZE];
  42. char import_mnemonic_text[TEXT_BUFFER_SIZE];
  43. char input_text[TEXT_BUFFER_SIZE];
  44. } FlipBip;
  45. typedef enum {
  46. FlipBipViewIdStartscreen,
  47. FlipBipViewIdMenu,
  48. FlipBipViewIdScene1,
  49. FlipBipViewIdSettings,
  50. FlipBipViewIdTextInput,
  51. } FlipBipViewId;
  52. typedef enum {
  53. FlipBipHapticOff,
  54. FlipBipHapticOn,
  55. } FlipBipHapticState;
  56. typedef enum {
  57. FlipBipStrength128,
  58. FlipBipStrength192,
  59. FlipBipStrength256,
  60. } FlipBipStrengthState;
  61. typedef enum {
  62. FlipBipPassphraseOff,
  63. FlipBipPassphraseOn,
  64. } FlipBipPassphraseState;
  65. typedef enum {
  66. FlipBipCoinBTC0,
  67. FlipBipCoinETH60,
  68. FlipBipCoinDOGE3,
  69. FlipBipCoinZEC133,
  70. } FlipBipCoin;
  71. typedef enum {
  72. FlipBipTextInputDefault,
  73. FlipBipTextInputPassphrase,
  74. FlipBipTextInputMnemonic
  75. } FlipBipTextInputState;
  76. typedef enum {
  77. FlipBipStatusSuccess = 0,
  78. FlipBipStatusReturn = 10,
  79. FlipBipStatusLoadError = 11,
  80. FlipBipStatusSaveError = 12,
  81. FlipBipStatusMnemonicCheckError = 13,
  82. } FlipBipStatus;