MenuFunctions.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. struct Menu;
  41. // Individual Nodes of a menu
  42. struct MenuNode {
  43. String name;
  44. uint16_t color;
  45. int icon;
  46. TFT_eSPI_Button* button;
  47. std::function<void()> callable;
  48. };
  49. // Full Menus
  50. struct Menu {
  51. String name;
  52. SimpleList<MenuNode>* list;
  53. Menu * parentMenu;
  54. uint8_t selected;
  55. };
  56. class MenuFunctions
  57. {
  58. private:
  59. Menu* current_menu;
  60. // Main menu stuff
  61. Menu mainMenu;
  62. Menu wifiMenu;
  63. Menu bluetoothMenu;
  64. Menu generalMenu;
  65. Menu updateMenu;
  66. // WiFi menu stuff
  67. Menu wifiSnifferMenu;
  68. Menu wifiScannerMenu;
  69. Menu wifiAttackMenu;
  70. // Bluetooth menu stuff
  71. Menu bluetoothSnifferMenu;
  72. Menu bluetoothScannerMenu;
  73. // Menu icons
  74. //TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
  75. void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
  76. void showMenuList(Menu* menu, int layer);
  77. void orientDisplay();
  78. public:
  79. MenuFunctions();
  80. uint16_t x = -1, y = -1;
  81. boolean pressed = false;
  82. void buildButtons(Menu* menu);
  83. void changeMenu(Menu* menu);
  84. void displayCurrentMenu();
  85. void main();
  86. void RunSetup();
  87. };
  88. #endif