MenuFunctions.h 2.0 KB

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