e: Remove BlueZ module

Kind of broken, with almost no functionality. Don't risk someone
releasing E17 with this thing. Hopefully I'll be able to rewrite it (or
find someone to do) before release.



SVN revision: 77156
This commit is contained in:
Lucas De Marchi 2012-09-27 17:07:44 +00:00
parent 7c4fa48ab6
commit da40a35d52
14 changed files with 1 additions and 2122 deletions

1
.gitignore vendored
View File

@ -114,7 +114,6 @@ src/bin/enlightenment_open
src/modules/access/module.desktop
src/modules/backlight/module.desktop
src/modules/battery/module.desktop
src/modules/bluez/module.desktop
src/modules/clock/module.desktop
src/modules/comp/module.desktop
src/modules/conf/module.desktop

View File

@ -804,14 +804,6 @@ dnl AC_E_CHECK_PKG(DUMMY, [ connman >= 1.0 ], [], [CONNMAN=false])
AC_SUBST(ECONNMAN_CFLAGS)
AC_SUBST(ECONNMAN_LIBS)
AM_CONDITIONAL(HAVE_EBLUEZ, false)
define([CHECK_MODULE_BLUEZ],
[
AC_E_CHECK_PKG(EBLUEZ, [ edbus >= 1.2.0 ebluez >= 1.2.0 ], [], [BLUEZ=false])
])
AC_SUBST(EBLUEZ_CFLAGS)
AC_SUBST(EBLUEZ_LIBS)
AM_CONDITIONAL(HAVE_EOFONO, false)
define([CHECK_MODULE_OFONO],
[
@ -877,7 +869,6 @@ AC_E_OPTIONAL_MODULE([conf_interaction], true)
AC_E_OPTIONAL_MODULE([gadman], true)
AC_E_OPTIONAL_MODULE([mixer], true, [CHECK_MODULE_MIXER])
AC_E_OPTIONAL_MODULE([connman], true, [CHECK_MODULE_CONNMAN])
AC_E_OPTIONAL_MODULE([bluez], true, [CHECK_MODULE_BLUEZ])
AC_E_OPTIONAL_MODULE([ofono], true, [CHECK_MODULE_OFONO])
AC_E_OPTIONAL_MODULE([illume2], true)
AC_E_OPTIONAL_MODULE([syscon], true)
@ -1010,8 +1001,6 @@ src/modules/mixer/Makefile
src/modules/mixer/module.desktop
src/modules/connman/Makefile
src/modules/connman/module.desktop
src/modules/bluez/Makefile
src/modules/bluez/module.desktop
src/modules/ofono/Makefile
src/modules/ofono/module.desktop
src/modules/illume2/Makefile

View File

@ -8333,273 +8333,7 @@ CONNMAN_ICON(ethernet)
#undef CONNMAN_STATE_PART_ADD
#undef CONNMAN_IMAGES_SET
/////////////////////////////////////////////////////////////////////////////
/*** MOD: BLUEZ ***/
group {
name: "e/modules/bluez/main";
images {
image: "bluetooth-powered.png" COMP;
image: "bluetooth-inactive.png" COMP;
image: "bluetooth-hidden.png" COMP;
}
//max: 128 128;
min: 16 16;
parts {
part {
name: "eventarea";
type: RECT;
mouse_events: 1;
description {
state: "default" 0.0;
color: 255 255 255 0;
}
}
part {
name: "state-clipper";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
color: 255 255 255 255;
}
}
part {
name: "state";
type: IMAGE;
mouse_events: 0;
clip_to: "state-clipper";
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
fixed: 1 1;
image.normal: "bluetooth-inactive.png";
}
description {
state: "powered" 0.0;
inherit: "default" 0.0;
image.normal: "bluetooth-powered.png";
}
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
image.normal: "bluetooth-hidden.png";
}
}
programs {
program {
signal: "e,changed,service,none";
source: "e";
action: STATE_SET "default" 0.0;
target: "state";
}
program {
signal: "e,changed,off";
source: "e";
action: STATE_SET "default" 0.0;
target: "state";
}
program {
signal: "e,changed,powered";
source: "e";
action: STATE_SET "powered" 0.0;
target: "state";
}
program {
signal: "e,changed,hidden";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "state";
}
}
part {
name: "e.text.name";
type: TEXT;
mouse_events: 0;
effect: SOFT_SHADOW;
description {
state: "default" 0.0;
color: 224 224 224 255;
color3: 0 0 0 64;
align: 0.5 1.0;
rel1 {
relative: 0.0 1.0;
offset: 0 -20;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
text {
font: "Sans";
size: 8;
align: 0.5 1.0;
text: "";
min: 1 1;
}
}
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
programs {
program {
name: "resize";
signal: "resize";
script {
new x, y, w, h, tx, ty, tw, th;
get_geometry(PART:"eventarea", x, y, w, h);
get_geometry(PART:"e.text.name", tx, ty, tw, th);
if ((w <= 32) || (tw >= w))
set_state(PART:"e.text.name", "hidden", 0.0);
else
set_state(PART:"e.text.name", "default", 0.0);
}
}
program {
signal: "e,changed,name";
source: "e";
action: STATE_SET "default" 0.0;
// show so calcs take effect!
target: "e.text.name";
after: "resize";
}
}
}
}
group {
name: "e/modules/bluez/tip";
images {
image: "bluetooth-powered.png" COMP;
image: "bluetooth-inactive.png" COMP;
image: "bluetooth-hidden.png" COMP;
}
min: 200 84;
parts {
part {
name: "state-clipper";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
color: 255 255 255 255;
}
}
part {
name: "state";
type: IMAGE;
mouse_events: 0;
clip_to: "state-clipper";
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
fixed: 1 1;
rel1 {
relative: 0.0 0.0;
offset: 10 10;
}
rel2 {
relative: 0.0 0.0;
offset: 73 73;
}
image.normal: "bluetooth-inactive.png";
}
description {
state: "powered" 0.0;
inherit: "default" 0.0;
image.normal: "bluetooth-powered.png";
}
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
image.normal: "bluetooth-hidden.png";
}
}
programs {
program {
signal: "e,changed,off";
source: "e";
action: STATE_SET "default" 0.0;
target: "state";
}
program {
signal: "e,changed,powered";
source: "e";
action: STATE_SET "powered" 0.0;
target: "state";
}
program {
signal: "e,changed,hidden";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "state";
}
}
part {
name: "e.text.name";
type: TEXT;
mouse_events: 0;
effect: SOFT_SHADOW;
description {
state: "default" 0.0;
color: 240 240 240 255;
color3: 0 0 0 64;
align: 0.0 0.0;
rel1 {
to_x: "state";
relative: 1.0 0.0;
offset: 10 20;
}
rel2 {
relative: 1.0 0.0;
offset: -10 40;
}
text {
font: "Sans:style=Bold";
size: 16;
align: 0.0 0.0;
text: "Bluetooth Manager";
min: 1 0;
}
}
}
part {
name: "e.text.status";
type: TEXT;
mouse_events: 0;
clip_to: "state-clipper";
description {
state: "default" 0.0;
color: 16 16 16 255;
rel1 {
to_y: "e.text.name";
to_x: "state";
relative: 1.0 1.0;
offset: 10 10;
}
rel2 {
to_y: "e.text.name";
relative: 1.0 1.0;
offset: -10 25;
}
text {
font: "Sans";
size: 10;
align: 0.0 0.0;
text: "";
min: 1 0;
}
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/*** MOD: OFONO ***/
// GADGET and TIP all have the same parts and signals:

View File

@ -25,9 +25,6 @@ bd_top_hilight.png \
bd_top.png \
big_arrow_down.png \
big_arrow_up.png \
bluetooth-powered.png \
bluetooth-inactive.png \
bluetooth-hidden.png \
bnw.png \
bt_base1.png \
bt_base2.png \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -142,10 +142,6 @@ if USE_MODULE_CONNMAN
SUBDIRS += connman
endif
if USE_MODULE_BLUEZ
SUBDIRS += bluez
endif
if USE_MODULE_ILLUME2
SUBDIRS += \
illume2 \

View File

@ -1,33 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
MODULE = bluez
# 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_builddir)/src/bin \
-I$(top_srcdir)/src/modules \
@e_cflags@ @EBLUEZ_CFLAGS@
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = e_mod_main.h \
e_mod_main.c \
e_mod_config.c
module_la_LIBADD = @e_libs@ @dlopen_libs@ @EBLUEZ_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.

View File

@ -1,188 +0,0 @@
#include "e_mod_main.h"
extern const char _e_bluez_Name[];
struct _E_Config_Dialog_Data
{
E_Bluez_Instance *inst;
const char *name;
Eina_Bool mode;
unsigned int timeout;
struct
{
Evas_Object *label;
Evas_Object *slider;
Evas_Object *help;
} gui;
};
/* Local Function Prototypes */
static void *_create_data(E_Config_Dialog *dialog);
static void _free_data(E_Config_Dialog *dialog,
E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *dialog,
Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _basic_apply(E_Config_Dialog *dialog,
E_Config_Dialog_Data *cfdata);
E_Config_Dialog *
e_bluez_config_dialog_new(E_Container *con,
E_Bluez_Instance *inst)
{
E_Config_Dialog *dialog;
E_Config_Dialog_View *view;
if (inst->conf_dialog)
return inst->conf_dialog;
view = E_NEW(E_Config_Dialog_View, 1);
if (!view)
return NULL;
view->create_cfdata = _create_data;
view->free_cfdata = _free_data;
view->basic.create_widgets = _basic_create;
view->basic.apply_cfdata = _basic_apply;
dialog = e_config_dialog_new(con, _("Bluetooth Settings"),
_e_bluez_Name, "e_bluez_config_dialog_new",
e_bluez_theme_path(), 0, view, inst);
return dialog;
}
static void *
_create_data(E_Config_Dialog *dialog)
{
E_Config_Dialog_Data *cfdata;
E_Bluez_Instance *inst;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
if (!cfdata)
return NULL;
cfdata->inst = dialog->data;
inst = cfdata->inst;
if (!e_bluez_adapter_discoverable_get(inst->adapter, &cfdata->mode))
cfdata->mode = 0;
if (!e_bluez_adapter_discoverable_timeout_get
(inst->adapter, &cfdata->timeout))
cfdata->timeout = 0;
cfdata->timeout /= 60;
if (!e_bluez_adapter_name_get(inst->adapter, &cfdata->name))
cfdata->name = NULL;
else
cfdata->name = strdup(cfdata->name);
return cfdata;
}
static void
_free_data(E_Config_Dialog *dialog,
E_Config_Dialog_Data *cfdata)
{
E_Bluez_Instance *inst = dialog->data;
inst->conf_dialog = NULL;
E_FREE(cfdata);
}
static void
_cb_disable_timeout(void *data,
Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
Eina_Bool disable = !cfdata->mode;
e_widget_disabled_set(cfdata->gui.label, disable);
e_widget_disabled_set(cfdata->gui.slider, disable);
e_widget_disabled_set(cfdata->gui.help, disable);
}
static Evas_Object *
_basic_create(E_Config_Dialog *dialog __UNUSED__,
Evas *evas,
E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *ob;
Evas_Object *check;
char buf[48];
const char *address;
o = e_widget_list_add(evas, 0, 0);
if (!e_bluez_adapter_address_get(cfdata->inst->adapter, &address))
address = NULL;
ob = e_widget_label_add(evas, _("Name"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_entry_add(evas, (char **)&cfdata->name, NULL, NULL, NULL);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
check = e_widget_check_add
(evas, _("Discoverable mode"), (int *)&cfdata->mode);
e_widget_list_object_append(o, check, 1, 1, 0.5);
ob = e_widget_label_add(evas, _("Discovarable Timeout"));
cfdata->gui.label = ob;
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 0, 30, 1, 0,
NULL, (int *)&cfdata->timeout, 100);
e_widget_slider_special_value_add(ob, 0.0, 0.0, _("Forever"));
cfdata->gui.slider = ob;
e_widget_list_object_append(o, ob, 1, 1, 0.5);
e_widget_on_change_hook_set(check, _cb_disable_timeout, cfdata);
_cb_disable_timeout(cfdata, NULL);
snprintf(buf, sizeof(buf), _("MAC Address: %s"), address);
ob = e_widget_label_add(evas, buf);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
return o;
}
static void
_method_success_check(void *data,
DBusMessage *msg __UNUSED__,
DBusError *error)
{
const char *name = data;
if ((!error) || (!dbus_error_is_set(error)))
return;
ERR("method %s() finished with error: %s %s\n",
name, error->name, error->message);
dbus_error_free(error);
}
static int
_basic_apply(E_Config_Dialog *dialog __UNUSED__,
E_Config_Dialog_Data *cfdata)
{
E_Bluez_Instance *inst = cfdata->inst;
if (!e_bluez_adapter_discoverable_set
(inst->adapter, cfdata->mode,
_method_success_check, "e_bluez_adapter_discoverable_get"))
ERR("Can't set Discoverable on adapter");
if (!e_bluez_adapter_discoverable_timeout_set
(inst->adapter, cfdata->timeout * 60,
_method_success_check, "e_bluez_adapter_discoverable_timeout_get"))
ERR("Can't set DiscoverableTimeout on adapter");
if (!e_bluez_adapter_name_set
(inst->adapter, cfdata->name,
_method_success_check, "e_bluez_adapter_name_get"))
ERR("Can't set Name on adapter");
return 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,159 +0,0 @@
#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H
#include "config.h"
#include <e.h>
#include <E_Bluez.h>
#include <eina_log.h>
#define MOD_CONF_VERSION 2
extern int _e_bluez_log_dom;
#undef DBG
#undef WRN
#undef ERR
#define DBG(...) EINA_LOG_DOM_DBG(_e_bluez_log_dom, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_e_bluez_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_e_bluez_log_dom, __VA_ARGS__)
typedef struct E_Bluez_Instance E_Bluez_Instance;
typedef struct E_Bluez_Instance_Device E_Bluez_Instance_Device;
typedef struct E_Bluez_Module_Context E_Bluez_Module_Context;
struct E_Bluez_Instance
{
E_Bluez_Module_Context *ctxt;
E_Gadcon_Client *gcc;
E_Gadcon_Popup *popup;
/* used by popup */
int powered;
Eina_Bool first_selection;
const char *address;
const char *alias;
Eina_List *devices;
E_Bluez_Element *adapter;
double last_scan;
Eina_Bool discovering : 1;
Eina_Bool powered_pending : 1;
Eina_Bool discoverable : 1;
struct
{
Evas_Object *gadget;
Evas_Object *list;
Evas_Object *powered;
Evas_Object *button;
Evas_Object *control;
struct
{
Ecore_X_Window win;
Ecore_Event_Handler *mouse_up;
Ecore_Event_Handler *key_down;
} input;
} ui;
E_Gadcon_Popup *tip;
Evas_Object *o_tip;
E_Config_Dialog *conf_dialog;
};
struct E_Bluez_Instance_Device
{
const char *address;
const char *alias;
// TODO (and also show list icon!): Eina_Bool paired:1;
// TODO (and also show list icon!): Eina_Bool trusted:1;
// TODO (and also show list icon!): Eina_Bool connected:1;
// TODO ... class, icon
};
struct E_Bluez_Module_Context
{
Eina_List *instances;
const char *default_adapter;
struct
{
E_DBus_Connection *conn;
E_DBus_Interface *iface;
E_DBus_Object *obj;
Eina_List *pending;
} agent;
struct
{
E_Action *toggle_powered;
} actions;
struct
{
Ecore_Event_Handler *manager_in;
Ecore_Event_Handler *manager_out;
Ecore_Event_Handler *device_found;
Ecore_Event_Handler *element_updated;
} event;
struct
{
Ecore_Poller *manager_changed;
} poller;
Eina_Bool has_manager : 1;
};
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);
const char *e_bluez_theme_path(void);
E_Config_Dialog *e_bluez_config_dialog_new(E_Container *con,
E_Bluez_Instance *inst);
void _bluez_toggle_powered(E_Bluez_Instance *inst);
static inline void
_bluez_dbus_error_show(const char *msg,
const DBusError *error)
{
const char *name;
if ((!error) || (!dbus_error_is_set(error)))
return;
name = error->name;
if (strncmp(name, "org.bluez.Error.",
sizeof("org.bluez.Error.") - 1) == 0)
name += sizeof("org.bluez.Error.") - 1;
e_util_dialog_show(_("Bluez Server Operation Failed"),
_("Could not execute remote operation:<br>"
"%s<br>"
"Server Error <hilight>%s:</hilight> %s"),
msg, name, error->message);
}
static inline void
_bluez_operation_error_show(const char *msg)
{
e_util_dialog_show(_("Bluez Operation Failed"),
_("Could not execute local operation:<br>%s"),
msg);
}
/**
* @addtogroup Optional_Devices
* @{
*
* @defgroup Module_Bluez BlueZ (Bluetooth)
*
* Controls bluetooth visibility, scan and pair devices.
*
* @see http://www.bluez.org/
* @}
*/
#endif

View File

@ -1,17 +0,0 @@
[Desktop Entry]
Type=Link
Name=Bluetooth Manager
Name[ru]=Менеджер Bluetooth
Name[de]=Bluetooth-Manager
Name[fr]=Gestionnaire Bluetooth
Name[it]=Gestore Bluetooth
Name[pt]=Gestor de bluetooth
Name[tr]=Bluetooth Yöneticisi
Icon=e-module-bluez
Comment=Configure Bluetooth devices.
Comment[ru]=Управление Bluetooth устройствами.
Comment[de]=Bluetooth-Verbindungen verwalten
Comment[fr]=Configure les périphériques Bluetooth.
Comment[it]=Configura i dispositivi Bluetooth.
Comment[pt]=Configuração dos dispositivos Bluetooth
X-Enlightenment-ModuleType=system