feat: wi-fi - expand support and fix issues, add GUI components
This commit is contained in:
@@ -15,9 +15,8 @@
|
||||
|
||||
namespace gui {
|
||||
|
||||
static constexpr int MAX_WINDOWS = 8;
|
||||
static constexpr int MAX_WINDOWS = 32;
|
||||
static constexpr int PANEL_HEIGHT = 32;
|
||||
static constexpr int MAX_LAUNCHER_ITEMS = 64;
|
||||
|
||||
enum DesktopItemSection : uint8_t {
|
||||
DESKTOP_ITEM_SECTION_HIDDEN = 0,
|
||||
@@ -111,9 +110,10 @@ struct DesktopState {
|
||||
bool launcher_open;
|
||||
char launcher_query[64];
|
||||
int launcher_query_len;
|
||||
LauncherItem launcher_items[MAX_LAUNCHER_ITEMS];
|
||||
LauncherItem* launcher_items; // dynamically grown
|
||||
int launcher_item_count;
|
||||
int launcher_results[MAX_LAUNCHER_ITEMS];
|
||||
int launcher_item_capacity;
|
||||
int* launcher_results; // indices into launcher_items, same capacity
|
||||
int launcher_result_count;
|
||||
int launcher_selected;
|
||||
int launcher_scroll;
|
||||
@@ -122,7 +122,6 @@ struct DesktopState {
|
||||
|
||||
SvgIcon icon_terminal;
|
||||
SvgIcon icon_filemanager;
|
||||
SvgIcon icon_sysinfo;
|
||||
SvgIcon icon_appmenu;
|
||||
SvgIcon icon_folder;
|
||||
SvgIcon icon_file;
|
||||
@@ -181,6 +180,48 @@ struct DesktopState {
|
||||
uint64_t net_cfg_last_poll;
|
||||
Rect net_icon_rect;
|
||||
|
||||
// Registered link-layer interfaces. The IP configuration is global to the
|
||||
// stack, so the wired and wireless popups use `active` to decide which of
|
||||
// them owns the address currently on screen.
|
||||
static constexpr int MAX_NETIFS = 4;
|
||||
montauk::abi::NetIfInfo netifs[MAX_NETIFS];
|
||||
int netif_count;
|
||||
bool eth_present;
|
||||
|
||||
// ---- Wi-Fi -------------------------------------------------------------
|
||||
// The panel entry exists only when a supported adapter is present.
|
||||
static constexpr int MAX_WIFI_NETWORKS = 32;
|
||||
static constexpr int WIFI_SSID_CAP = 36;
|
||||
static constexpr int WIFI_PSK_CAP = 72;
|
||||
|
||||
SvgIcon icon_wifi;
|
||||
bool wifi_present;
|
||||
bool wifi_popup_open;
|
||||
Rect wifi_icon_rect;
|
||||
montauk::abi::WifiInfo wifi_info;
|
||||
montauk::abi::WifiNetwork wifi_networks[MAX_WIFI_NETWORKS];
|
||||
int wifi_network_count;
|
||||
uint64_t wifi_last_poll;
|
||||
uint32_t wifi_scan_generation;
|
||||
bool wifi_scanning;
|
||||
int wifi_scroll; // first visible row of the list
|
||||
bool wifi_boot_scan_started; // the automatic scan at startup
|
||||
bool wifi_autoconnect_done; // saved-network join already tried
|
||||
bool wifi_joining; // a join we started is in flight
|
||||
bool wifi_dhcp_pending; // ask for a lease once the link is up
|
||||
char wifi_joining_ssid[WIFI_SSID_CAP];
|
||||
char wifi_status[96]; // last result line in the popup
|
||||
uint64_t wifi_status_time;
|
||||
|
||||
// Passphrase prompt, shown when a selected network needs a key.
|
||||
bool wifi_prompt_open;
|
||||
char wifi_prompt_ssid[WIFI_SSID_CAP];
|
||||
char wifi_prompt_password[WIFI_PSK_CAP];
|
||||
int wifi_prompt_len;
|
||||
bool wifi_prompt_reveal;
|
||||
bool wifi_prompt_remember;
|
||||
uint8_t wifi_prompt_security;
|
||||
|
||||
bool vol_popup_open;
|
||||
Rect vol_icon_rect;
|
||||
int vol_level; // 0-100
|
||||
@@ -207,7 +248,7 @@ struct DesktopState {
|
||||
// IDs of external windows we've sent a close event to but that haven't
|
||||
// been destroyed yet by their owning process. Prevents the poll loop
|
||||
// from re-creating them at the default position (visible flicker).
|
||||
static constexpr int MAX_CLOSING = 8;
|
||||
static constexpr int MAX_CLOSING = MAX_WINDOWS;
|
||||
int closing_ext_ids[MAX_CLOSING];
|
||||
int closing_ext_count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user