(well working up to the point whre you can select a network - at that point connman itself just stares dumbly at you and does nothing - so right now it's some form of connman bug i suspect). it doesnt save config or load - so you need to re-init each time and the graphcis are... let's just say.. sucky. for now theyare test graphics only. suto-connect if network found etc. doesnt work as well.. can't even connect first time... i can clean the rest up so in theory it works - but in practice, won't be useful until connmand (back end) works properly. SVN revision: 35755devs/princeamd/enlightenment-0.17-elive
parent
7d1f2a0174
commit
9d7329da99
16 changed files with 3361 additions and 4 deletions
@ -0,0 +1,3 @@ |
||||
Makefile |
||||
Makefile.in |
||||
*.cfg |
@ -0,0 +1,3 @@ |
||||
Makefile |
||||
Makefile.in |
||||
*.cfg |
@ -0,0 +1,412 @@ |
||||
images { |
||||
image: "e17_mixer_base.png" COMP; |
||||
image: "e17_mixer_mute.png" COMP; |
||||
image: "e17_mixer_left_low.png" COMP; |
||||
image: "e17_mixer_left_medium.png" COMP; |
||||
image: "e17_mixer_left_high.png" COMP; |
||||
image: "e17_mixer_right_low.png" COMP; |
||||
image: "e17_mixer_right_medium.png" COMP; |
||||
image: "e17_mixer_right_high.png" COMP; |
||||
} |
||||
|
||||
group { |
||||
name: "e/modules/connman/main"; |
||||
max: 128 128; |
||||
min: 1 1; |
||||
|
||||
script { |
||||
public message(Msg_Type:type, id, ...) { |
||||
if ((type == MSG_INT_SET) && (id == 0)) { |
||||
new sig; |
||||
|
||||
sig = getarg(2); |
||||
|
||||
if (sig <= 0) |
||||
run_program(PROGRAM:"right_none"); |
||||
else if (sig < 33) |
||||
run_program(PROGRAM:"right_low"); |
||||
else if (sig < 66) |
||||
run_program(PROGRAM:"right_medium"); |
||||
else if (sig >= 66) |
||||
run_program(PROGRAM:"right_high"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
parts { |
||||
part { |
||||
name: "base"; |
||||
mouse_events: 0; |
||||
type: RECT; |
||||
description { |
||||
state: "default" 0.0; |
||||
color: 0 0 0 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "speaker"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_base.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "left"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
visible: 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_left_low.png"; |
||||
} |
||||
description { |
||||
state: "low" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
description { |
||||
state: "medium" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_left_medium.png"; |
||||
} |
||||
description { |
||||
state: "high" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_left_high.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "right"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
visible: 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_right_low.png"; |
||||
} |
||||
description { |
||||
state: "low" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
description { |
||||
state: "medium" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_right_medium.png"; |
||||
} |
||||
description { |
||||
state: "high" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_right_high.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "mute"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
visible: 0; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_mute.png"; |
||||
} |
||||
description { |
||||
state: "active" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "over"; |
||||
type: RECT; |
||||
description { |
||||
state: "default" 0.0; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
color: 255 255 255 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
programs { |
||||
program { |
||||
name: "right_none"; |
||||
action: STATE_SET "default" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { |
||||
name: "right_low"; |
||||
action: STATE_SET "low" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { |
||||
name: "right_medium"; |
||||
action: STATE_SET "medium" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { |
||||
name: "right_high"; |
||||
action: STATE_SET "high" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
} |
||||
} |
||||
|
||||
group { |
||||
name: "e/modules/connman/network"; |
||||
max: 128 128; |
||||
min: 1 1; |
||||
|
||||
script { |
||||
public message(Msg_Type:type, id, ...) { |
||||
if ((type == MSG_INT_SET) && (id == 1)) { |
||||
new sig; |
||||
|
||||
sig = getarg(2); |
||||
|
||||
if (sig <= 0) |
||||
run_program(PROGRAM:"right_none"); |
||||
else if (sig < 33) |
||||
run_program(PROGRAM:"right_low"); |
||||
else if (sig < 66) |
||||
run_program(PROGRAM:"right_medium"); |
||||
else if (sig >= 66) |
||||
run_program(PROGRAM:"right_high"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
parts { |
||||
part { |
||||
name: "base"; |
||||
mouse_events: 0; |
||||
type: RECT; |
||||
description { |
||||
state: "default" 0.0; |
||||
color: 0 0 0 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
} |
||||
} |
||||
part { |
||||
name: "sec"; |
||||
mouse_events: 0; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 128; |
||||
rel2.relative: 0.5 0.5; |
||||
} |
||||
description { state: "wep" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 0 128; |
||||
} |
||||
description { state: "wpa" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 128 0 128; |
||||
} |
||||
description { state: "rsn" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 0 0 128; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "speaker"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_base.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "left"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
visible: 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_left_low.png"; |
||||
} |
||||
description { |
||||
state: "low" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
description { |
||||
state: "medium" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_left_medium.png"; |
||||
} |
||||
description { |
||||
state: "high" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_left_high.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "right"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
visible: 0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_right_low.png"; |
||||
} |
||||
description { |
||||
state: "low" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
description { |
||||
state: "medium" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_right_medium.png"; |
||||
} |
||||
description { |
||||
state: "high" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
image.normal: "e17_mixer_right_high.png"; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "mute"; |
||||
mouse_events: 0; |
||||
type: IMAGE; |
||||
description { |
||||
state: "default" 0.0; |
||||
aspect: 1 1; |
||||
aspect_preference: BOTH; |
||||
visible: 0; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
image.normal: "e17_mixer_mute.png"; |
||||
} |
||||
description { |
||||
state: "active" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "over"; |
||||
type: RECT; |
||||
description { |
||||
state: "default" 0.0; |
||||
rel1.to: "base"; |
||||
rel2.to: "base"; |
||||
color: 255 255 255 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
programs { |
||||
program { |
||||
name: "right_none"; |
||||
action: STATE_SET "default" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
|
||||
} |
||||
program { |
||||
name: "right_low"; |
||||
action: STATE_SET "low" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { |
||||
name: "right_medium"; |
||||
action: STATE_SET "medium" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { |
||||
name: "right_high"; |
||||
action: STATE_SET "high" 0.0; |
||||
transition: LINEAR 0.1; |
||||
target: "right"; |
||||
} |
||||
|
||||
program { name: "sec0"; |
||||
signal: "s,state,security,open"; |
||||
source: "e"; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "sec"; |
||||
} |
||||
program { name: "sec1"; |
||||
signal: "s,state,security,wep"; |
||||
source: "e"; |
||||
action: STATE_SET "wep" 0.0; |
||||
target: "sec"; |
||||
} |
||||
program { name: "sec2"; |
||||
signal: "s,state,security,wpa"; |
||||
source: "e"; |
||||
action: STATE_SET "wpa" 0.0; |
||||
target: "sec"; |
||||
} |
||||
program { name: "sec3"; |
||||
signal: "s,state,security,rsn"; |
||||
source: "e"; |
||||
action: STATE_SET "rsn" 0.0; |
||||
target: "sec"; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,9 @@ |
||||
.deps |
||||
.libs |
||||
Makefile |
||||
Makefile.in |
||||
e_mod_main.lo |
||||
module.la |
||||
*.lo |
||||
*.la |
||||
module.desktop |
@ -0,0 +1,33 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MODULE = connman
|
||||
|
||||
# data files for the module
|
||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||
files_DATA = \
|
||||
e-module-$(MODULE).edj module.desktop |
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I. \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
|
||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||
pkg_LTLIBRARIES = module.la
|
||||
|
||||
module_la_SOURCES = e_mod_main.h \
|
||||
e_mod_main.c \
|
||||
e_iface.h \
|
||||
e_iface.c
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@ @E_DBUS_LIBS@
|
||||
module_la_LDFLAGS = -module -avoid-version
|
||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
uninstall: |
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,116 @@ |
||||
#ifndef E_IFACE_H |
||||
#define E_IFACE_H |
||||
|
||||
#include <Ecore.h> |
||||
#include <E_DBus.h> |
||||
#include <Evas.h> |
||||
#include <string.h> |
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
#include <unistd.h> |
||||
|
||||
/* IFACE HEADER */ |
||||
typedef enum _Interface_Event |
||||
{ |
||||
IFACE_EVENT_ADD, |
||||
IFACE_EVENT_DEL, |
||||
IFACE_EVENT_IPV4_CHANGE, |
||||
IFACE_EVENT_NETWORK_SELECTION_CHANGE, |
||||
IFACE_EVENT_SCAN_NETWORK_ADD, |
||||
IFACE_EVENT_SCAN_NETWORK_DEL, |
||||
IFACE_EVENT_SCAN_NETWORK_CHANGE, |
||||
IFACE_EVENT_SIGNAL_CHANGE, |
||||
IFACE_EVENT_STATE_CHANGE, |
||||
IFACE_EVENT_POLICY_CHANGE, |
||||
} Interface_Event; |
||||
|
||||
typedef struct _Interface_Network Interface_Network; |
||||
typedef struct _Interface_Properties Interface_Properties; |
||||
typedef struct _Interface_IPv4 Interface_IPv4; |
||||
typedef struct _Interface_Network_Selection Interface_Network_Selection; |
||||
typedef struct _Interface_Callback Interface_Callback; |
||||
typedef struct _Interface Interface; |
||||
|
||||
struct _Interface_Network |
||||
{ |
||||
const char *essid; |
||||
const char *bssid; |
||||
const char *security; |
||||
int signal_strength; |
||||
double last_seen_time; |
||||
}; |
||||
|
||||
struct _Interface_Properties |
||||
{ |
||||
const char *product; |
||||
const char *vendor; |
||||
int signal_strength; |
||||
const char *driver; |
||||
const char *state; |
||||
const char *policy; |
||||
const char *type; |
||||
}; |
||||
|
||||
struct _Interface_IPv4 |
||||
{ |
||||
const char *method; |
||||
const char *address; |
||||
const char *gateway; |
||||
const char *netmask; |
||||
}; |
||||
|
||||
struct _Interface_Network_Selection |
||||
{ |
||||
const char *id; |
||||
const char *pass; |
||||
}; |
||||
|
||||
struct _Interface_Callback |
||||
{ |
||||
Interface_Event event; |
||||
void (*func) (void *data, Interface *iface, Interface_Network *ifnet); |
||||
void *data; |
||||
unsigned char delete_me : 1; |
||||
}; |
||||
|
||||
struct _Interface |
||||
{ |
||||
/* public - read-only. look but don't touch */ |
||||
const char *ifpath; |
||||
Interface_Properties prop; |
||||
Interface_IPv4 ipv4; |
||||
Interface_Network_Selection network_selection; |
||||
Evas_List *networks; |
||||
int signal_strength; |
||||
|
||||
/* private - don't touch */ |
||||
Evas_List *callbacks; |
||||
struct { |
||||
E_DBus_Signal_Handler *network_found; |
||||
E_DBus_Signal_Handler *signal_changed; |
||||
E_DBus_Signal_Handler *state_changed; |
||||
E_DBus_Signal_Handler *policy_changed; |
||||
E_DBus_Signal_Handler *network_changed; |
||||
E_DBus_Signal_Handler *ipv4_changed; |
||||
} sigh; |
||||
Ecore_Timer *network_timeout; |
||||
int ref; |
||||
unsigned char newif : 1; |
||||
}; |
||||
|
||||
/* IFACE PUBLIC API */ |
||||
Interface *iface_add (const char *ifpath); |
||||
void iface_ref (Interface *iface); |
||||
void iface_unref (Interface *iface); |
||||
Interface *iface_find (const char *ifpath); |
||||
void iface_network_set (Interface *iface, const char *ssid, const char *pass); |
||||
void iface_policy_set (Interface *iface, const char *policy); |
||||
void iface_scan (Interface *iface, const char *policy); |
||||
void iface_ipv4_set (Interface *iface, const char *method, const char *address, const char *gateway, const char *netmask); |
||||
void iface_callback_add(Interface *iface, Interface_Event event, void (*func) (void *data, Interface *iface, Interface_Network *ifnet), void *data); |
||||
void iface_callback_del(Interface *iface, Interface_Event event, void (*func) (void *data, Interface *iface, Interface_Network *ifnet), void *data); |
||||
|
||||
void iface_system_init (E_DBus_Connection *edbus_conn); |
||||
void iface_system_callback_add (Interface_Event event, void (*func) (void *data, Interface *iface, Interface_Network *ifnet), void *data); |
||||
void iface_system_callback_del (Interface_Event event, void (*func) (void *data, Interface *iface, Interface_Network *ifnet), void *data); |
||||
#endif |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@ |
||||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 |
||||
*/ |
||||
#ifndef E_MOD_MAIN_H |
||||
#define E_MOD_MAIN_H |
||||
|
||||
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 |
@ -0,0 +1,6 @@ |
||||
[Desktop Entry] |
||||
Type=Link |
||||
Name=Connection Manager |
||||
Icon=e-module-connman |
||||
Comment=<hilight>Network Connection Manager Gadget</hilight><br><br>Control Wifi and wired networks as a user. |
||||
X-Enlightenment-ModuleType=system |
Loading…
Reference in new issue