flipbip.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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"
  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 bip39_strength;
  33. int passphrase;
  34. // Main menu options
  35. int bip44_coin;
  36. int overwrite_saved_seed;
  37. int import_from_mnemonic;
  38. // Text input
  39. int input_state;
  40. char passphrase_text[TEXT_BUFFER_SIZE];
  41. char import_mnemonic_text[TEXT_BUFFER_SIZE];
  42. char input_text[TEXT_BUFFER_SIZE];
  43. } FlipBip;
  44. typedef enum {
  45. FlipBipViewIdStartscreen,
  46. FlipBipViewIdMenu,
  47. FlipBipViewIdScene1,
  48. FlipBipViewIdSettings,
  49. FlipBipViewIdTextInput,
  50. } FlipBipViewId;
  51. typedef enum {
  52. FlipBipStrength128,
  53. FlipBipStrength192,
  54. FlipBipStrength256,
  55. } FlipBipStrengthState;
  56. typedef enum {
  57. FlipBipPassphraseOff,
  58. FlipBipPassphraseOn,
  59. } FlipBipPassphraseState;
  60. typedef enum {
  61. FlipBipCoinBTC0,
  62. FlipBipCoinETH60,
  63. FlipBipCoinDOGE3,
  64. FlipBipCoinZEC133,
  65. } FlipBipCoin;
  66. typedef enum {
  67. FlipBipTextInputDefault,
  68. FlipBipTextInputPassphrase,
  69. FlipBipTextInputMnemonic
  70. } FlipBipTextInputState;
  71. typedef enum {
  72. FlipBipStatusSuccess = 0,
  73. FlipBipStatusReturn = 10,
  74. FlipBipStatusLoadError = 11,
  75. FlipBipStatusSaveError = 12,
  76. FlipBipStatusMnemonicCheckError = 13,
  77. } FlipBipStatus;