MenuFunctions.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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_ARRAY_LEN 5
  20. #define FLASH_BUTTON 0
  21. // Icon definitions
  22. #define ATTACKS 0
  23. #define BEACON_SNIFF 1
  24. #define BLUETOOTH 2
  25. #define BLUETOOTH_SNIFF 3
  26. #define DEAUTH_SNIFF 4
  27. #define DRAW 5
  28. #define PACKET_MONITOR 6
  29. #define PROBE_SNIFF 7
  30. #define SCANNERS 8
  31. #define CC_SKIMMERS 9
  32. #define SNIFFERS 10
  33. #define WIFI 11
  34. #define BEACON_SPAM 12
  35. #define RICK_ROLL 13
  36. #define REBOOT 14
  37. #define GENERAL_APPS 15
  38. #define UPDATE 16
  39. struct Menu;
  40. // Individual Nodes of a menu
  41. struct MenuNode {
  42. String name;
  43. uint16_t color;
  44. int icon;
  45. TFT_eSPI_Button* button;
  46. std::function<void()> callable;
  47. };
  48. // Full Menus
  49. struct Menu {
  50. String name;
  51. SimpleList<MenuNode>* list;
  52. Menu * parentMenu;
  53. uint8_t selected;
  54. };
  55. class MenuFunctions
  56. {
  57. private:
  58. Menu* current_menu;
  59. // Main menu stuff
  60. Menu mainMenu;
  61. Menu wifiMenu;
  62. Menu bluetoothMenu;
  63. Menu generalMenu;
  64. Menu updateMenu;
  65. // WiFi menu stuff
  66. Menu wifiSnifferMenu;
  67. Menu wifiScannerMenu;
  68. Menu wifiAttackMenu;
  69. // Bluetooth menu stuff
  70. Menu bluetoothSnifferMenu;
  71. Menu bluetoothScannerMenu;
  72. // Menu icons
  73. //TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
  74. void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
  75. void showMenuList(Menu* menu, int layer);
  76. void orientDisplay();
  77. public:
  78. MenuFunctions();
  79. uint16_t x = -1, y = -1;
  80. boolean pressed = false;
  81. void buildButtons(Menu* menu);
  82. void changeMenu(Menu* menu);
  83. void displayCurrentMenu();
  84. void main();
  85. void RunSetup();
  86. };
  87. #endif