Separate illume mode toggle into it's own gadget. This makes illume2 that

much cleaner.
Remove mode icon from illume2 edj.
Remove gadcon files from illume2 (in own gadget now).
Modify illume2 e.cfg to include illume-mode-toggle gadget and reorder gadgets.



SVN revision: 44671
devs/princeamd/enlightenment-0.17-elive
Christopher Michael 13 years ago
parent e7cb1a5f48
commit 8ff96c07d1
  1. 78
      config/illume-home/e.src
  2. 2
      configure.ac
  3. 3
      src/modules/Makefile.am
  4. 29
      src/modules/illume-mode-toggle/Makefile.am
  5. BIN
      src/modules/illume-mode-toggle/e-module-illume-mode-toggle.edj
  6. 72
      src/modules/illume-mode-toggle/e_mod_main.c
  7. 10
      src/modules/illume-mode-toggle/e_mod_main.h
  8. 6
      src/modules/illume-mode-toggle/module.desktop.in
  9. 4
      src/modules/illume2/Makefile.am
  10. BIN
      src/modules/illume2/e-module-illume2.edj
  11. 7
      src/modules/illume2/e_mod_gadcon.h
  12. 8
      src/modules/illume2/e_mod_main.c
  13. 6
      x-ui.sh

@ -32,6 +32,14 @@ group "E_Config" struct {
value "evas_engine_zone" int: 0;
value "use_composite" int: 0;
value "language" string: "en_US.UTF-8";
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "illume-mode-toggle";
value "enabled" uchar: 1;
value "delayed" uchar: 0;
value "priority" int: 0;
}
}
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "illume-indicator";
@ -1695,17 +1703,10 @@ group "E_Config" struct {
value "resizable" uchar: 0;
}
}
}
}
group "gadcons" list {
group "E_Config_Gadcon" struct {
value "name" string: "illume-indicator";
value "id" int: 2;
value "zone" int: 1;
group "clients" list {
group "E_Config_Gadcon_Client" struct {
value "name" string: "illume-home";
value "id" string: "illume-home.0";
value "name" string: "illume-mode-toggle";
value "id" string: "illume-mode-toggle.0";
value "geom.pos" int: 0;
value "geom.size" int: 32;
value "geom.res" int: 800;
@ -1713,64 +1714,7 @@ group "E_Config" struct {
value "geom.pos_y" double: 0.0000000000000000000000000;
value "geom.size_w" double: 0.0000000000000000000000000;
value "geom.size_h" double: 0.0000000000000000000000000;
value "state_info.seq" int: 1;
value "state_info.flags" int: 0;
value "style" string: "plain";
value "orient" int: 0;
value "autoscroll" uchar: 0;
value "resizable" uchar: 0;
}
}
group "clients" list {
group "E_Config_Gadcon_Client" struct {
value "name" string: "battery";
value "id" string: "battery";
value "geom.pos" int: 800;
value "geom.size" int: 80;
value "geom.res" int: 800;
value "geom.pos_x" double: 0.0000000000000000000000000;
value "geom.pos_y" double: 0.0000000000000000000000000;
value "geom.size_w" double: 0.0000000000000000000000000;
value "geom.size_h" double: 0.0000000000000000000000000;
value "state_info.seq" int: 4;
value "state_info.flags" int: 0;
value "style" string: "plain";
value "orient" int: 0;
value "autoscroll" uchar: 0;
value "resizable" uchar: 0;
}
}
group "clients" list {
group "E_Config_Gadcon_Client" struct {
value "name" string: "configuration";
value "id" string: "configuration";
value "geom.pos" int: 800;
value "geom.size" int: 80;
value "geom.res" int: 800;
value "geom.pos_x" double: 0.0000000000000000000000000;
value "geom.pos_y" double: 0.0000000000000000000000000;
value "geom.size_w" double: 0.0000000000000000000000000;
value "geom.size_h" double: 0.0000000000000000000000000;
value "state_info.seq" int: 5;
value "state_info.flags" int: 0;
value "style" string: "plain";
value "orient" int: 0;
value "autoscroll" uchar: 0;
value "resizable" uchar: 0;
}
}
group "clients" list {
group "E_Config_Gadcon_Client" struct {
value "name" string: "illume-kbd-toggle";
value "id" string: "illume-kbd-toggle.0";
value "geom.pos" int: 0;
value "geom.size" int: 32;
value "geom.res" int: 800;
value "geom.pos_x" double: 0.0000000000000000000000000;
value "geom.pos_y" double: 0.0000000000000000000000000;
value "geom.size_w" double: 0.0000000000000000000000000;
value "geom.size_h" double: 0.0000000000000000000000000;
value "state_info.seq" int: 3;
value "state_info.seq" int: 2;
value "state_info.flags" int: 0;
value "style" string: "plain";
value "orient" int: 0;

@ -619,6 +619,8 @@ src/modules/illume-indicator/Makefile
src/modules/illume-indicator/module.desktop
src/modules/illume-kbd-toggle/Makefile
src/modules/illume-kbd-toggle/module.desktop
src/modules/illume-mode-toggle/Makefile
src/modules/illume-mode-toggle/module.desktop
src/modules/syscon/Makefile
src/modules/syscon/module.desktop
src/modules/everything/Makefile

@ -239,7 +239,7 @@ SUBDIRS += connman
endif
if USE_MODULE_ILLUME
SUBDIRS += illume illume2 illume-home illume-softkey illume-keyboard illume-indicator illume-kbd-toggle
SUBDIRS += illume illume2 illume-home illume-softkey illume-keyboard illume-indicator illume-kbd-toggle illume-mode-toggle
endif
if USE_MODULE_SYSCON
@ -322,6 +322,7 @@ illume-softkey \
illume-keyboard \
illume-indicator \
illume-kbd-toggle \
illume-mode-toggle \
syscon \
everything \
systray

@ -0,0 +1,29 @@
MAINTAINERCLEANFILES = Makefile.in
MODULE = illume-mode-toggle
# 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.c \
e_mod_main.h
module_la_LIBADD = @e_libs@ @dlopen_libs@
module_la_LDFLAGS = -module -avoid-version
module_la_DEPENDENCIES = $(top_builddir)/config.h
uninstall:
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)

@ -1,6 +1,5 @@
#include "e.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
/* local structures */
typedef struct _Instance Instance;
@ -17,19 +16,46 @@ static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label(E_Gadcon_Client_Class *cc);
static Evas_Object *_gc_icon(E_Gadcon_Client_Class *cc, Evas *evas);
static const char *_gc_id_new(E_Gadcon_Client_Class *cc);
static void _btn_cb_click(void *data, void *data2);
static void _cb_btn_click(void *data, void *data2);
/* local variables */
static Eina_List *instances = NULL;
static const char *mod_dir = NULL;
static const E_Gadcon_Client_Class _gc_class =
{
GADCON_CLIENT_CLASS_VERSION, "illume2",
GADCON_CLIENT_CLASS_VERSION, "illume-mode-toggle",
{ _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
e_gadcon_site_is_not_toolbar
e_gadcon_site_is_not_toolbar
}, E_GADCON_CLIENT_STYLE_PLAIN
};
/* public functions */
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Mode Toggle" };
EAPI void *
e_modapi_init(E_Module *m)
{
mod_dir = eina_stringshare_add(m->dir);
e_gadcon_provider_register(&_gc_class);
return m;
}
EAPI int
e_modapi_shutdown(E_Module *m)
{
e_gadcon_provider_unregister(&_gc_class);
if (mod_dir) eina_stringshare_del(mod_dir);
mod_dir = NULL;
return 1;
}
EAPI int
e_modapi_save(E_Module *m)
{
return 1;
}
/* local functions */
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
@ -38,13 +64,12 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
Evas_Object *icon;
char buff[PATH_MAX];
snprintf(buff, sizeof(buff), "%s/e-module-illume2.edj", il_cfg->mod_dir);
snprintf(buff, sizeof(buff), "%s/e-module-illume-mode-toggle.edj", mod_dir);
inst = E_NEW(Instance, 1);
inst->o_btn = e_widget_button_add(gc->evas, NULL, NULL,
_btn_cb_click, inst, NULL);
_cb_btn_click, inst, NULL);
icon = e_icon_add(evas_object_evas_get(inst->o_btn));
e_icon_file_edje_set(icon, buff, "btn_icon");
e_icon_file_edje_set(icon, buff, "icon");
e_widget_button_icon_set(inst->o_btn, icon);
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_btn);
@ -75,7 +100,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
static char *
_gc_label(E_Gadcon_Client_Class *cc)
{
return _("Illume2");
return _("Illume-Mode-Toggle");
}
static Evas_Object *
@ -84,7 +109,7 @@ _gc_icon(E_Gadcon_Client_Class *cc, Evas *evas)
Evas_Object *o;
char buff[PATH_MAX];
snprintf(buff, sizeof(buff), "%s/e-module-illume2.edj", il_cfg->mod_dir);
snprintf(buff, sizeof(buff), "%s/e-module-illume-mode-toggle.edj", mod_dir);
o = edje_object_add(evas);
edje_object_file_set(o, buff, "icon");
return o;
@ -101,32 +126,17 @@ _gc_id_new(E_Gadcon_Client_Class *cc)
}
static void
_btn_cb_click(void *data, void *data2)
_cb_btn_click(void *data, void *data2)
{
Ecore_X_Window xwin;
Ecore_X_Illume_Mode mode;
if (il_cfg->policy.mode.dual)
mode = ECORE_X_ILLUME_MODE_SINGLE;
else
mode = ECORE_X_ILLUME_MODE_DUAL;
xwin = ecore_x_window_root_first_get();
mode = ecore_x_e_illume_mode_get(xwin);
if (mode <= ECORE_X_ILLUME_MODE_SINGLE)
mode = ECORE_X_ILLUME_MODE_DUAL;
else
mode = ECORE_X_ILLUME_MODE_SINGLE;
ecore_x_e_illume_mode_set(xwin, mode);
ecore_x_e_illume_mode_send(xwin, mode);
}
/* public functions */
int
e_mod_gadcon_init(void)
{
e_gadcon_provider_register(&_gc_class);
return 1;
}
int
e_mod_gadcon_shutdown(void)
{
e_gadcon_provider_unregister(&_gc_class);
return 1;
}

@ -0,0 +1,10 @@
#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=Illume-Mode-Toggle
Icon=e-module-illume-mode-toggle
X-Enlightenment-ModuleType=system
Comment=<title>Illume Mode Toggle for Embedded</title>

@ -38,9 +38,7 @@ module_la_SOURCES = e_mod_main.h \
e_mod_policy.h \
e_mod_policy.c \
e_mod_policy_settings.h \
e_mod_policy_settings.c \
e_mod_gadcon.h \
e_mod_gadcon.c
e_mod_policy_settings.c
module_la_LIBADD = @e_libs@ @dlopen_libs@
module_la_LDFLAGS = -module -avoid-version

@ -1,7 +0,0 @@
#ifndef E_MOD_GADCON_H
#define E_MOD_GADCON_H
int e_mod_gadcon_init(void);
int e_mod_gadcon_shutdown(void);
#endif

@ -3,7 +3,6 @@
#include "e_mod_config.h"
#include "e_mod_layout.h"
#include "e_kbd.h"
#include "e_mod_gadcon.h"
/* local variables */
static E_Kbd *kbd = NULL;
@ -23,10 +22,6 @@ e_modapi_init(E_Module *m)
/* init the config subsystem */
if (!il_config_init(m)) return NULL;
/* init the gadcon subsystem for adding a "button" to any gadget container
* which will allow easy switching between policy app modes */
e_mod_gadcon_init();
/* set up the virtual keyboard */
e_kbd_init(m);
@ -60,9 +55,6 @@ e_modapi_shutdown(E_Module *m)
/* shutdown the kbd subsystem */
e_kbd_shutdown();
/* shutdown the gadget subsystem */
e_mod_gadcon_shutdown();
/* shutdown the config subsystem */
il_config_shutdown();

@ -5,8 +5,8 @@
#Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480x16 &
#Xephyr :1 -noreset -ac -br -dpi 186 -screen 480x272x16 &
#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 &
Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor &
#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor &
#Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor &
Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor &
#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x800x16 &
#Xephyr :1 -noreset -ac -br -dpi 183 -screen 800x480x16 &
#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 &
@ -25,3 +25,5 @@ enlightenment_start \
-no-precache \
-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it \
-profile illume-home
#-fake-xinerama-screen 480x320+0+0 \
#-fake-xinerama-screen 480x320+480+0

Loading…
Cancel
Save