MenuFunctions.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef MenuFunctions_h
  2. #define MenuFunctions_h
  3. #include "WiFiScan.h"
  4. #include "Display.h"
  5. #include "Web.h"
  6. extern Display display_obj;
  7. extern WiFiScan wifi_scan_obj;
  8. extern Web web_obj;
  9. // Keypad start position, key sizes and spacing
  10. #define KEY_X 120 // Centre of key
  11. #define KEY_Y 50
  12. #define KEY_W 240 // Width and height
  13. #define KEY_H 22
  14. #define KEY_SPACING_X 0 // X and Y gap
  15. #define KEY_SPACING_Y 1
  16. #define KEY_TEXTSIZE 1 // Font size multiplier
  17. #define ICON_W 22
  18. #define ICON_H 22
  19. #define BUTTON_PADDING 22
  20. //#define BUTTON_ARRAY_LEN 5
  21. #define FLASH_BUTTON 0
  22. // Icon definitions
  23. #define ATTACKS 0
  24. #define BEACON_SNIFF 1
  25. #define BLUETOOTH 2
  26. #define BLUETOOTH_SNIFF 3
  27. #define DEAUTH_SNIFF 4
  28. #define DRAW 5
  29. #define PACKET_MONITOR 6
  30. #define PROBE_SNIFF 7
  31. #define SCANNERS 8
  32. #define CC_SKIMMERS 9
  33. #define SNIFFERS 10
  34. #define WIFI 11
  35. #define BEACON_SPAM 12
  36. #define RICK_ROLL 13
  37. #define REBOOT 14
  38. #define GENERAL_APPS 15
  39. #define UPDATE 16
  40. #define DEVICE 17
  41. #define DEVICE_INFO 18
  42. struct Menu;
  43. // Individual Nodes of a menu
  44. struct MenuNode {
  45. String name;
  46. uint16_t color;
  47. int icon;
  48. TFT_eSPI_Button* button;
  49. std::function<void()> callable;
  50. };
  51. // Full Menus
  52. struct Menu {
  53. String name;
  54. LinkedList<MenuNode>* list;
  55. Menu * parentMenu;
  56. uint8_t selected;
  57. };
  58. class MenuFunctions
  59. {
  60. private:
  61. Menu* current_menu;
  62. // Main menu stuff
  63. Menu mainMenu;
  64. Menu wifiMenu;
  65. Menu bluetoothMenu;
  66. Menu generalMenu;
  67. Menu deviceMenu;
  68. // Device menu stuff
  69. Menu updateMenu;
  70. Menu infoMenu;
  71. // WiFi menu stuff
  72. Menu wifiSnifferMenu;
  73. Menu wifiScannerMenu;
  74. Menu wifiAttackMenu;
  75. // Bluetooth menu stuff
  76. Menu bluetoothSnifferMenu;
  77. Menu bluetoothScannerMenu;
  78. // Menu icons
  79. //TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
  80. void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
  81. void showMenuList(Menu* menu, int layer);
  82. void orientDisplay();
  83. public:
  84. MenuFunctions();
  85. uint16_t x = -1, y = -1;
  86. boolean pressed = false;
  87. void buildButtons(Menu* menu);
  88. void changeMenu(Menu* menu);
  89. void displayCurrentMenu();
  90. void main();
  91. void RunSetup();
  92. };
  93. #endif