From b9eb5de878c93fe5bbb92b2ab7825dab29248326 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 8 Apr 2026 22:33:58 +0700 Subject: [PATCH] Phase 0: scaffold e_iwd Enlightenment module Meson build, module entry points, and stub layout for the iwd backend (D-Bus client, gadget, popup, config, UI widgets). Bodies are TODOs; this compiles against EFL/E headers but performs no D-Bus work yet. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 36 ++++++++++++++++++++++++++++ LICENSE | 33 +++++++++++++++++++++++++ README.md | 30 +++++++++++++++++++++++ data/meson.build | 2 ++ data/module.desktop | 6 +++++ meson.build | 21 ++++++++++++++++ src/e_mod_config.c | 26 ++++++++++++++++++++ src/e_mod_config.h | 20 ++++++++++++++++ src/e_mod_gadget.c | 23 ++++++++++++++++++ src/e_mod_gadget.h | 8 +++++++ src/e_mod_main.c | 56 +++++++++++++++++++++++++++++++++++++++++++ src/e_mod_main.h | 27 +++++++++++++++++++++ src/e_mod_popup.c | 11 +++++++++ src/e_mod_popup.h | 10 ++++++++ src/iwd/iwd_dbus.c | 32 +++++++++++++++++++++++++ src/iwd/iwd_dbus.h | 20 ++++++++++++++++ src/iwd/iwd_device.c | 26 ++++++++++++++++++++ src/iwd/iwd_device.h | 22 +++++++++++++++++ src/iwd/iwd_manager.c | 44 ++++++++++++++++++++++++++++++++++ src/iwd/iwd_manager.h | 32 +++++++++++++++++++++++++ src/iwd/iwd_network.c | 22 +++++++++++++++++ src/iwd/iwd_network.h | 32 +++++++++++++++++++++++++ src/meson.build | 23 ++++++++++++++++++ src/ui/wifi_auth.c | 12 ++++++++++ src/ui/wifi_auth.h | 11 +++++++++ src/ui/wifi_list.c | 13 ++++++++++ src/ui/wifi_list.h | 9 +++++++ src/ui/wifi_status.c | 12 ++++++++++ src/ui/wifi_status.h | 9 +++++++ 29 files changed, 628 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 data/meson.build create mode 100644 data/module.desktop create mode 100644 meson.build create mode 100644 src/e_mod_config.c create mode 100644 src/e_mod_config.h create mode 100644 src/e_mod_gadget.c create mode 100644 src/e_mod_gadget.h create mode 100644 src/e_mod_main.c create mode 100644 src/e_mod_main.h create mode 100644 src/e_mod_popup.c create mode 100644 src/e_mod_popup.h create mode 100644 src/iwd/iwd_dbus.c create mode 100644 src/iwd/iwd_dbus.h create mode 100644 src/iwd/iwd_device.c create mode 100644 src/iwd/iwd_device.h create mode 100644 src/iwd/iwd_manager.c create mode 100644 src/iwd/iwd_manager.h create mode 100644 src/iwd/iwd_network.c create mode 100644 src/iwd/iwd_network.h create mode 100644 src/meson.build create mode 100644 src/ui/wifi_auth.c create mode 100644 src/ui/wifi_auth.h create mode 100644 src/ui/wifi_list.c create mode 100644 src/ui/wifi_list.h create mode 100644 src/ui/wifi_status.c create mode 100644 src/ui/wifi_status.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19e58af --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Build directories +.cache/ +build/ +builddir/ + +# Meson files +.mesonpy* +compile_commands.json + +# Compiled files +*.o +*.so +*.a +*.la +*.lo + +# Editor files +*~ +*.swp +*.swo +.*.sw? +*.bak +.vscode/ +.idea/ +# System files +.DS_Store +Thumbs.db + +# Generated files +config.h +*.edj + +# Core dumps +core +core.* +vgcore.* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fe0e975 --- /dev/null +++ b/LICENSE @@ -0,0 +1,33 @@ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies of the Software and its Copyright notices. In addition publicly +documented acknowledgment must be given that this software has been used if no +source code of this software is made available publicly. Making the source +available publicly means including the source for this software with the +distribution, or a method to get this software via some reasonable mechanism +(electronic transfer via a network or media) as well as making an offer to +supply the source on request. This Copyright notice serves as an offer to +supply the source on on request as well. Instead of this, supplying +acknowledgments of use of this software in either Copyright notices, Manuals, +Publicity and Marketing documents or any documentation provided with any +product containing this software. This License does not apply to any software +that links to the libraries provided by this software (statically or +dynamically), but only to the software provided. + +Please see the COPYING-PLAIN for a plain-english explanation of this notice +and its intent. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3079ea8 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# e_iwd + +Enlightenment module for Wi-Fi management via [iwd](https://iwd.wiki.kernel.org/), +a native replacement for the ConnMan-based econnman gadget. + +See `CLAUDE.md` for the full PRD and implementation plan. + +## Status + +Phase 0 — scaffolding only. Nothing connects to D-Bus yet. + +## Build + + meson setup build + ninja -C build + sudo ninja -C build install + +Requires: `enlightenment`, `elementary`, `eldbus` (pkg-config). + +## Layout + + src/ + e_mod_main.c module entry points + e_mod_gadget.c shelf gadget + e_mod_popup.c popup UI + e_mod_config.c persistent settings + iwd/ D-Bus client to net.connman.iwd + ui/ reusable EFL widgets + data/ + module.desktop diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..70c2ac4 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,2 @@ +install_data('module.desktop', install_dir : module_dir) +# TODO: build and install e-module-iwd.edj theme diff --git a/data/module.desktop b/data/module.desktop new file mode 100644 index 0000000..bb7c103 --- /dev/null +++ b/data/module.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Link +Name=iwd +Icon=e-module-iwd +Comment=Wi-Fi management via iwd +X-Enlightenment-ModuleType=utils diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..718947c --- /dev/null +++ b/meson.build @@ -0,0 +1,21 @@ +project('e_iwd', 'c', + version : '0.1.0', + license : 'MIT', + default_options : ['c_std=gnu99', 'warning_level=2']) + +cc = meson.get_compiler('c') + +eldbus = dependency('eldbus') +elementary = dependency('elementary') +enlightenment = dependency('enlightenment') + +module_arch = enlightenment.get_variable(pkgconfig: 'module_arch', + default_value: 'linux-gnu-@0@'.format(host_machine.cpu())) +module_dir = join_paths(get_option('libdir'), 'enlightenment', 'modules', 'iwd') + +add_project_arguments('-DPACKAGE="e_iwd"', + '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), + language : 'c') + +subdir('src') +subdir('data') diff --git a/src/e_mod_config.c b/src/e_mod_config.c new file mode 100644 index 0000000..2d0b590 --- /dev/null +++ b/src/e_mod_config.c @@ -0,0 +1,26 @@ +#include "e_mod_main.h" +#include "e_mod_config.h" + +E_Iwd_Config *e_iwd_config = NULL; + +void +e_iwd_config_load(void) +{ + /* TODO: register E_Config_DD and load saved config */ + e_iwd_config = E_NEW(E_Iwd_Config, 1); + e_iwd_config->auto_connect = 1; + e_iwd_config->show_hidden = 0; + e_iwd_config->refresh_interval = 5; +} + +void +e_iwd_config_save(void) +{ + /* TODO: e_config_domain_save */ +} + +void +e_iwd_config_dialog_show(void) +{ + /* TODO: build E_Config_Dialog */ +} diff --git a/src/e_mod_config.h b/src/e_mod_config.h new file mode 100644 index 0000000..64ea1e7 --- /dev/null +++ b/src/e_mod_config.h @@ -0,0 +1,20 @@ +#ifndef E_MOD_CONFIG_H +#define E_MOD_CONFIG_H + +typedef struct _E_Iwd_Config E_Iwd_Config; + +struct _E_Iwd_Config +{ + int auto_connect; + int show_hidden; + int refresh_interval; + char *preferred_adapter; +}; + +extern E_Iwd_Config *e_iwd_config; + +void e_iwd_config_load(void); +void e_iwd_config_save(void); +void e_iwd_config_dialog_show(void); + +#endif diff --git a/src/e_mod_gadget.c b/src/e_mod_gadget.c new file mode 100644 index 0000000..f3d991e --- /dev/null +++ b/src/e_mod_gadget.c @@ -0,0 +1,23 @@ +#include "e_mod_main.h" +#include "e_mod_gadget.h" +#include "e_mod_popup.h" + +/* TODO: register with E gadget system, draw status icon, handle clicks */ + +void +e_iwd_gadget_init(void) +{ + /* TODO: e_gadget_type_add("iwd", _create_cb, NULL); */ +} + +void +e_iwd_gadget_shutdown(void) +{ + /* TODO: e_gadget_type_del("iwd"); */ +} + +void +e_iwd_gadget_update(void) +{ + /* TODO: refresh icon/tooltip from current iwd_manager state */ +} diff --git a/src/e_mod_gadget.h b/src/e_mod_gadget.h new file mode 100644 index 0000000..4b7dcf6 --- /dev/null +++ b/src/e_mod_gadget.h @@ -0,0 +1,8 @@ +#ifndef E_MOD_GADGET_H +#define E_MOD_GADGET_H + +void e_iwd_gadget_init(void); +void e_iwd_gadget_shutdown(void); +void e_iwd_gadget_update(void); + +#endif diff --git a/src/e_mod_main.c b/src/e_mod_main.c new file mode 100644 index 0000000..dd38818 --- /dev/null +++ b/src/e_mod_main.c @@ -0,0 +1,56 @@ +#include "e_mod_main.h" +#include "iwd/iwd_manager.h" +#include "e_mod_gadget.h" +#include "e_mod_config.h" + +E_Iwd_Module *e_iwd = NULL; + +EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "iwd" }; + +EAPI void * +e_modapi_init(E_Module *m) +{ + e_iwd = E_NEW(E_Iwd_Module, 1); + e_iwd->module = m; + + if (!eldbus_init()) + { + E_FREE(e_iwd); + return NULL; + } + + e_iwd->conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); + if (!e_iwd->conn) + { + eldbus_shutdown(); + E_FREE(e_iwd); + return NULL; + } + + e_iwd_config_load(); + e_iwd->manager = iwd_manager_new(e_iwd->conn); + e_iwd_gadget_init(); + + return m; +} + +EAPI int +e_modapi_shutdown(E_Module *m EINA_UNUSED) +{ + if (!e_iwd) return 1; + + e_iwd_gadget_shutdown(); + if (e_iwd->manager) iwd_manager_free(e_iwd->manager); + e_iwd_config_save(); + if (e_iwd->conn) eldbus_connection_unref(e_iwd->conn); + eldbus_shutdown(); + E_FREE(e_iwd); + return 1; +} + +EAPI int +e_modapi_save(E_Module *m EINA_UNUSED) +{ + e_iwd_config_save(); + return 1; +} diff --git a/src/e_mod_main.h b/src/e_mod_main.h new file mode 100644 index 0000000..1cb3c7a --- /dev/null +++ b/src/e_mod_main.h @@ -0,0 +1,27 @@ +#ifndef E_MOD_MAIN_H +#define E_MOD_MAIN_H + +#include +#include +#include + +typedef struct _E_Iwd_Module E_Iwd_Module; + +struct _E_Iwd_Module +{ + E_Module *module; + Eldbus_Connection *conn; + void *manager; /* Iwd_Manager * */ + void *gadget; /* gadget instance */ + void *config; /* E_Config_Dialog data */ +}; + +extern E_Iwd_Module *e_iwd; + +EAPI extern E_Module_Api e_modapi; + +EAPI void *e_modapi_init (E_Module *m); +EAPI int e_modapi_shutdown (E_Module *m); +EAPI int e_modapi_save (E_Module *m); + +#endif diff --git a/src/e_mod_popup.c b/src/e_mod_popup.c new file mode 100644 index 0000000..3327976 --- /dev/null +++ b/src/e_mod_popup.c @@ -0,0 +1,11 @@ +#include "e_mod_main.h" +#include "e_mod_popup.h" +#include "ui/wifi_list.h" +#include "ui/wifi_status.h" + +/* TODO: build the popup window with current connection panel, + * network list, and action buttons. */ + +void e_iwd_popup_toggle(Evas_Object *anchor EINA_UNUSED) { } +void e_iwd_popup_close(void) { } +void e_iwd_popup_refresh(void) { } diff --git a/src/e_mod_popup.h b/src/e_mod_popup.h new file mode 100644 index 0000000..5eda845 --- /dev/null +++ b/src/e_mod_popup.h @@ -0,0 +1,10 @@ +#ifndef E_MOD_POPUP_H +#define E_MOD_POPUP_H + +#include + +void e_iwd_popup_toggle(Evas_Object *anchor); +void e_iwd_popup_close(void); +void e_iwd_popup_refresh(void); + +#endif diff --git a/src/iwd/iwd_dbus.c b/src/iwd/iwd_dbus.c new file mode 100644 index 0000000..fd7ce53 --- /dev/null +++ b/src/iwd/iwd_dbus.c @@ -0,0 +1,32 @@ +#include "iwd_dbus.h" +#include + +struct _Iwd_Dbus +{ + Eldbus_Connection *conn; + Eldbus_Object *root; + Eldbus_Proxy *object_manager; + Eldbus_Signal_Handler *name_owner_sh; +}; + +/* TODO: + * - watch IWD_BUS_NAME owner (NameOwnerChanged) for restart handling + * - call org.freedesktop.DBus.ObjectManager.GetManagedObjects on "/" + * - listen for InterfacesAdded / InterfacesRemoved + * - dispatch new objects to iwd_manager + */ + +Iwd_Dbus * +iwd_dbus_new(Eldbus_Connection *conn) +{ + Iwd_Dbus *d = calloc(1, sizeof(*d)); + d->conn = conn; + return d; +} + +void +iwd_dbus_free(Iwd_Dbus *d) +{ + if (!d) return; + free(d); +} diff --git a/src/iwd/iwd_dbus.h b/src/iwd/iwd_dbus.h new file mode 100644 index 0000000..133b782 --- /dev/null +++ b/src/iwd/iwd_dbus.h @@ -0,0 +1,20 @@ +#ifndef IWD_DBUS_H +#define IWD_DBUS_H + +#include + +#define IWD_BUS_NAME "net.connman.iwd" +#define IWD_IFACE_ADAPTER "net.connman.iwd.Adapter" +#define IWD_IFACE_DEVICE "net.connman.iwd.Device" +#define IWD_IFACE_STATION "net.connman.iwd.Station" +#define IWD_IFACE_NETWORK "net.connman.iwd.Network" +#define IWD_IFACE_KNOWN_NETWORK "net.connman.iwd.KnownNetwork" +#define IWD_IFACE_AGENT_MANAGER "net.connman.iwd.AgentManager" +#define IWD_IFACE_AGENT "net.connman.iwd.Agent" + +typedef struct _Iwd_Dbus Iwd_Dbus; + +Iwd_Dbus *iwd_dbus_new (Eldbus_Connection *conn); +void iwd_dbus_free(Iwd_Dbus *d); + +#endif diff --git a/src/iwd/iwd_device.c b/src/iwd/iwd_device.c new file mode 100644 index 0000000..544e58d --- /dev/null +++ b/src/iwd/iwd_device.c @@ -0,0 +1,26 @@ +#include "iwd_device.h" + +Iwd_Device * +iwd_device_new(Eldbus_Connection *conn EINA_UNUSED, const char *path) +{ + Iwd_Device *d = calloc(1, sizeof(*d)); + if (path) d->path = strdup(path); + /* TODO: build proxies for Device + Station; subscribe to PropertiesChanged */ + return d; +} + +void +iwd_device_free(Iwd_Device *d) +{ + if (!d) return; + free(d->path); + free(d->name); + free(d->address); + free(d); +} + +void +iwd_device_set_powered(Iwd_Device *d EINA_UNUSED, Eina_Bool on EINA_UNUSED) +{ + /* TODO: Set("Powered") on Device interface */ +} diff --git a/src/iwd/iwd_device.h b/src/iwd/iwd_device.h new file mode 100644 index 0000000..e9ef0d3 --- /dev/null +++ b/src/iwd/iwd_device.h @@ -0,0 +1,22 @@ +#ifndef IWD_DEVICE_H +#define IWD_DEVICE_H + +#include +#include + +typedef struct _Iwd_Device Iwd_Device; + +struct _Iwd_Device +{ + char *path; /* D-Bus object path */ + char *name; + char *address; + Eina_Bool powered; + Eldbus_Proxy *station; /* may be NULL */ +}; + +Iwd_Device *iwd_device_new (Eldbus_Connection *conn, const char *path); +void iwd_device_free(Iwd_Device *d); +void iwd_device_set_powered(Iwd_Device *d, Eina_Bool on); + +#endif diff --git a/src/iwd/iwd_manager.c b/src/iwd/iwd_manager.c new file mode 100644 index 0000000..7a33e0c --- /dev/null +++ b/src/iwd/iwd_manager.c @@ -0,0 +1,44 @@ +#include "iwd_manager.h" +#include "iwd_dbus.h" + +struct _Iwd_Manager +{ + Iwd_Dbus *dbus; + Eina_List *devices; /* Iwd_Device * */ + Eina_List *listeners; + Iwd_State state; +}; + +/* TODO: + * - Build the device/station/network tree from iwd_dbus events + * - Aggregate state from active station + * - Notify listeners on any change + */ + +Iwd_Manager * +iwd_manager_new(Eldbus_Connection *conn) +{ + Iwd_Manager *m = calloc(1, sizeof(*m)); + m->dbus = iwd_dbus_new(conn); + m->state = IWD_STATE_OFF; + return m; +} + +void +iwd_manager_free(Iwd_Manager *m) +{ + if (!m) return; + iwd_dbus_free(m->dbus); + eina_list_free(m->devices); + eina_list_free(m->listeners); + free(m); +} + +Iwd_State iwd_manager_state(const Iwd_Manager *m) { return m ? m->state : IWD_STATE_OFF; } +const Eina_List *iwd_manager_devices(const Iwd_Manager *m) { return m ? m->devices : NULL; } + +void iwd_manager_scan_request(Iwd_Manager *m EINA_UNUSED) { /* TODO */ } +void iwd_manager_set_powered (Iwd_Manager *m EINA_UNUSED, Eina_Bool on EINA_UNUSED) { /* TODO */ } + +void iwd_manager_listener_add(Iwd_Manager *m EINA_UNUSED, Iwd_Manager_Cb cb EINA_UNUSED, void *data EINA_UNUSED) { /* TODO */ } +void iwd_manager_listener_del(Iwd_Manager *m EINA_UNUSED, Iwd_Manager_Cb cb EINA_UNUSED, void *data EINA_UNUSED) { /* TODO */ } diff --git a/src/iwd/iwd_manager.h b/src/iwd/iwd_manager.h new file mode 100644 index 0000000..cc89950 --- /dev/null +++ b/src/iwd/iwd_manager.h @@ -0,0 +1,32 @@ +#ifndef IWD_MANAGER_H +#define IWD_MANAGER_H + +#include +#include + +typedef enum { + IWD_STATE_OFF, + IWD_STATE_IDLE, + IWD_STATE_SCANNING, + IWD_STATE_CONNECTING, + IWD_STATE_CONNECTED, + IWD_STATE_ERROR, +} Iwd_State; + +typedef struct _Iwd_Manager Iwd_Manager; + +Iwd_Manager *iwd_manager_new (Eldbus_Connection *conn); +void iwd_manager_free(Iwd_Manager *m); + +Iwd_State iwd_manager_state (const Iwd_Manager *m); +const Eina_List *iwd_manager_devices (const Iwd_Manager *m); + +void iwd_manager_scan_request (Iwd_Manager *m); +void iwd_manager_set_powered (Iwd_Manager *m, Eina_Bool on); + +/* Event callback signature for UI layer */ +typedef void (*Iwd_Manager_Cb)(void *data, Iwd_Manager *m); +void iwd_manager_listener_add (Iwd_Manager *m, Iwd_Manager_Cb cb, void *data); +void iwd_manager_listener_del (Iwd_Manager *m, Iwd_Manager_Cb cb, void *data); + +#endif diff --git a/src/iwd/iwd_network.c b/src/iwd/iwd_network.c new file mode 100644 index 0000000..3a2ce4f --- /dev/null +++ b/src/iwd/iwd_network.c @@ -0,0 +1,22 @@ +#include "iwd_network.h" + +Iwd_Network * +iwd_network_new(Eldbus_Connection *conn EINA_UNUSED, const char *path) +{ + Iwd_Network *n = calloc(1, sizeof(*n)); + if (path) n->path = strdup(path); + /* TODO: read Name, Type, KnownNetwork properties */ + return n; +} + +void +iwd_network_free(Iwd_Network *n) +{ + if (!n) return; + free(n->path); + free(n->ssid); + free(n); +} + +void iwd_network_connect(Iwd_Network *n EINA_UNUSED) { /* TODO: Network.Connect() */ } +void iwd_network_forget (Iwd_Network *n EINA_UNUSED) { /* TODO: KnownNetwork.Forget() */ } diff --git a/src/iwd/iwd_network.h b/src/iwd/iwd_network.h new file mode 100644 index 0000000..52ef650 --- /dev/null +++ b/src/iwd/iwd_network.h @@ -0,0 +1,32 @@ +#ifndef IWD_NETWORK_H +#define IWD_NETWORK_H + +#include +#include + +typedef enum { + IWD_SEC_OPEN, + IWD_SEC_PSK, + IWD_SEC_8021X, + IWD_SEC_WEP, +} Iwd_Security; + +typedef struct _Iwd_Network Iwd_Network; + +struct _Iwd_Network +{ + char *path; + char *ssid; + Iwd_Security security; + int signal; /* 0..100 */ + Eina_Bool known; + Eina_Bool connected; +}; + +Iwd_Network *iwd_network_new (Eldbus_Connection *conn, const char *path); +void iwd_network_free(Iwd_Network *n); + +void iwd_network_connect (Iwd_Network *n); +void iwd_network_forget (Iwd_Network *n); + +#endif diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..09d74d9 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,23 @@ +e_iwd_sources = [ + 'e_mod_main.c', + 'e_mod_config.c', + 'e_mod_gadget.c', + 'e_mod_popup.c', + 'iwd/iwd_dbus.c', + 'iwd/iwd_manager.c', + 'iwd/iwd_device.c', + 'iwd/iwd_network.c', + 'ui/wifi_list.c', + 'ui/wifi_auth.c', + 'ui/wifi_status.c', +] + +shared_module('module', + e_iwd_sources, + name_prefix : '', + name_suffix : 'so', + dependencies : [eldbus, elementary, enlightenment], + include_directories : include_directories('.', 'iwd', 'ui'), + install : true, + install_dir : join_paths(module_dir, module_arch), +) diff --git a/src/ui/wifi_auth.c b/src/ui/wifi_auth.c new file mode 100644 index 0000000..5bb42c8 --- /dev/null +++ b/src/ui/wifi_auth.c @@ -0,0 +1,12 @@ +#include "wifi_auth.h" + +/* TODO: modal dialog with password entry + "remember" checkbox. + * Bound to the iwd Agent's RequestPassphrase reply. */ + +void +wifi_auth_prompt(Evas_Object *parent EINA_UNUSED, + const char *ssid EINA_UNUSED, + Wifi_Auth_Cb cb EINA_UNUSED, + void *data EINA_UNUSED) +{ +} diff --git a/src/ui/wifi_auth.h b/src/ui/wifi_auth.h new file mode 100644 index 0000000..3a8e488 --- /dev/null +++ b/src/ui/wifi_auth.h @@ -0,0 +1,11 @@ +#ifndef WIFI_AUTH_H +#define WIFI_AUTH_H + +#include + +typedef void (*Wifi_Auth_Cb)(void *data, const char *passphrase, Eina_Bool remember); + +void wifi_auth_prompt(Evas_Object *parent, const char *ssid, + Wifi_Auth_Cb cb, void *data); + +#endif diff --git a/src/ui/wifi_list.c b/src/ui/wifi_list.c new file mode 100644 index 0000000..2717a01 --- /dev/null +++ b/src/ui/wifi_list.c @@ -0,0 +1,13 @@ +#include "wifi_list.h" + +/* TODO: Genlist of networks, sorted (known first, then signal desc), + * with security icon, signal bars, and click → connect/auth flow. */ + +Evas_Object * +wifi_list_add(Evas_Object *parent) +{ + Evas_Object *gl = elm_genlist_add(parent); + return gl; +} + +void wifi_list_refresh(Evas_Object *list EINA_UNUSED) { /* TODO */ } diff --git a/src/ui/wifi_list.h b/src/ui/wifi_list.h new file mode 100644 index 0000000..cfc0bcf --- /dev/null +++ b/src/ui/wifi_list.h @@ -0,0 +1,9 @@ +#ifndef WIFI_LIST_H +#define WIFI_LIST_H + +#include + +Evas_Object *wifi_list_add(Evas_Object *parent); +void wifi_list_refresh(Evas_Object *list); + +#endif diff --git a/src/ui/wifi_status.c b/src/ui/wifi_status.c new file mode 100644 index 0000000..1f61cfe --- /dev/null +++ b/src/ui/wifi_status.c @@ -0,0 +1,12 @@ +#include "wifi_status.h" + +/* TODO: current connection summary widget (SSID, signal, IP, Disconnect). */ + +Evas_Object * +wifi_status_add(Evas_Object *parent) +{ + Evas_Object *box = elm_box_add(parent); + return box; +} + +void wifi_status_refresh(Evas_Object *o EINA_UNUSED) { /* TODO */ } diff --git a/src/ui/wifi_status.h b/src/ui/wifi_status.h new file mode 100644 index 0000000..857f386 --- /dev/null +++ b/src/ui/wifi_status.h @@ -0,0 +1,9 @@ +#ifndef WIFI_STATUS_H +#define WIFI_STATUS_H + +#include + +Evas_Object *wifi_status_add(Evas_Object *parent); +void wifi_status_refresh(Evas_Object *o); + +#endif