aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2010-01-13 01:10:39 +0000
committerChristopher Michael <cpmichael1@comcast.net>2010-01-13 01:10:39 +0000
commit07666b495202f548d02ac3260f6fcd414adcdb40 (patch)
tree9019cbaa65f7d8436a2e6d41a7e1e79b91c4a633 /src
parent37a3a938bcc66809b264022984094541d00a967f (diff)
downloadenlightenment-07666b495202f548d02ac3260f6fcd414adcdb40.tar.gz
enlightenment-07666b495202f548d02ac3260f6fcd414adcdb40.tar.xz
enlightenment-07666b495202f548d02ac3260f6fcd414adcdb40.zip
Add illume2 module...oops :(
SVN revision: 45073
Diffstat (limited to 'src')
-rw-r--r--src/modules/Makefile.am2
-rw-r--r--src/modules/illume2/E_Illume.h140
-rw-r--r--src/modules/illume2/E_Illume.pc.in12
-rw-r--r--src/modules/illume2/Makefile.am61
-rw-r--r--src/modules/illume2/e-module-illume2.edjbin0 -> 10097 bytes
-rw-r--r--src/modules/illume2/e_illume_border.c457
-rw-r--r--src/modules/illume2/e_kbd.c668
-rw-r--r--src/modules/illume2/e_kbd.h56
-rw-r--r--src/modules/illume2/e_kbd_dbus.c269
-rw-r--r--src/modules/illume2/e_kbd_dbus.h7
-rw-r--r--src/modules/illume2/e_mod_animation.c121
-rw-r--r--src/modules/illume2/e_mod_animation.h6
-rw-r--r--src/modules/illume2/e_mod_border.c476
-rw-r--r--src/modules/illume2/e_mod_config.c239
-rw-r--r--src/modules/illume2/e_mod_config.h11
-rw-r--r--src/modules/illume2/e_mod_layout.c536
-rw-r--r--src/modules/illume2/e_mod_layout.h7
-rw-r--r--src/modules/illume2/e_mod_main.c132
-rw-r--r--src/modules/illume2/e_mod_main.h36
-rw-r--r--src/modules/illume2/e_mod_policy.c113
-rw-r--r--src/modules/illume2/e_mod_policy.h6
-rw-r--r--src/modules/illume2/e_mod_policy_settings.c120
-rw-r--r--src/modules/illume2/e_mod_policy_settings.h6
-rw-r--r--src/modules/illume2/e_mod_select_window.c269
-rw-r--r--src/modules/illume2/e_mod_select_window.h15
-rw-r--r--src/modules/illume2/e_mod_windows.c217
-rw-r--r--src/modules/illume2/e_mod_windows.h6
-rw-r--r--src/modules/illume2/e_quickpanel.c421
-rw-r--r--src/modules/illume2/e_quickpanel.h29
-rw-r--r--src/modules/illume2/keyboards/Makefile.am11
-rw-r--r--src/modules/illume2/keyboards/ignore_built_in_keyboards1
-rw-r--r--src/modules/illume2/module.desktop.in8
-rw-r--r--src/modules/illume2/policies/Makefile.am2
-rw-r--r--src/modules/illume2/policies/illume/Makefile.am20
-rw-r--r--src/modules/illume2/policies/illume/illume.c44
-rw-r--r--src/modules/illume2/policies/illume/illume.h10
-rw-r--r--src/modules/illume2/policies/illume/layout.c561
-rw-r--r--src/modules/illume2/policies/illume/layout.h25
38 files changed, 5119 insertions, 1 deletions
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index 124e20347..6fa0457da 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -243,7 +243,7 @@ SUBDIRS += illume
endif
if USE_MODULE_ILLUME2
-SUBDIRS += illume-home illume-softkey illume-keyboard illume-indicator illume-kbd-toggle illume-mode-toggle
+SUBDIRS += illume2 illume-home illume-softkey illume-keyboard illume-indicator illume-kbd-toggle illume-mode-toggle
endif
if USE_MODULE_SYSCON
diff --git a/src/modules/illume2/E_Illume.h b/src/modules/illume2/E_Illume.h
new file mode 100644
index 000000000..dbc606ac7
--- /dev/null
+++ b/src/modules/illume2/E_Illume.h
@@ -0,0 +1,140 @@
+#ifndef E_ILLUME_H
+# define E_ILLUME_H
+
+# include "e.h"
+
+# define E_ILLUME_LAYOUT_API_VERSION 1
+# define E_ILLUME_LAYOUT_POLICY_TYPE 0xE0b200b
+
+typedef enum _E_Illume_Animation_Class
+{
+ E_ILLUME_ANIM_APP,
+ E_ILLUME_ANIM_KEYBOARD,
+ E_ILLUME_ANIM_TOP_SHELF,
+ E_ILLUME_ANIM_BOTTOM_PANEL,
+ E_ILLUME_ANIM_DIALOG,
+ E_ILLUME_ANIM_QUICKPANEL,
+ E_ILLUME_ANIM_OTHER
+} E_Illume_Animation_Class;
+
+typedef struct _E_Illume_Layout_Api E_Illume_Layout_Api;
+typedef struct _E_Illume_Layout_Policy E_Illume_Layout_Policy;
+typedef struct _E_Illume_Config E_Illume_Config;
+typedef struct _E_Illume_Config_Zone E_Illume_Config_Zone;
+
+struct _E_Illume_Layout_Api
+{
+ int version;
+ const char *label, *name;
+};
+
+struct _E_Illume_Layout_Policy
+{
+ E_Object e_obj_inherit;
+
+ E_Illume_Layout_Api *api;
+
+ void *handle;
+
+ struct
+ {
+ void *(*init) (E_Illume_Layout_Policy *p);
+ int (*shutdown) (E_Illume_Layout_Policy *p);
+ void (*config) (E_Container *con, const char *params);
+
+ void (*border_add) (E_Border *bd);
+ void (*border_del) (E_Border *bd);
+ void (*border_focus_in) (E_Border *bd);
+ void (*border_focus_out) (E_Border *bd);
+ void (*border_activate) (E_Border *bd);
+ void (*zone_layout) (E_Zone *zone);
+ void (*zone_move_resize) (E_Zone *zone);
+ void (*drag_start) (E_Border *bd);
+ void (*drag_end) (E_Border *bd);
+ } funcs;
+};
+
+struct _E_Illume_Config
+{
+ int version;
+
+ struct
+ {
+ struct
+ {
+ int duration;
+ } kbd, softkey, quickpanel;
+ } sliding;
+
+ struct
+ {
+ const char *name;
+ struct
+ {
+ const char *class;
+ const char *name;
+ const char *title;
+ int win_type;
+ struct
+ {
+ int class, name, title, win_type;
+ } match;
+ } vkbd, softkey, home, indicator;
+ Eina_List *zones;
+ } policy;
+
+ // Not User Configurable. Placeholders
+ const char *mod_dir;
+ E_Config_Dialog *cfd;
+};
+
+struct _E_Illume_Config_Zone
+{
+ int id;
+ struct
+ {
+ int dual, side;
+ } mode;
+};
+
+EAPI Eina_List *e_illume_layout_policies_get(void);
+EAPI E_Illume_Config_Zone *e_illume_zone_config_get(int id);
+
+EAPI int e_illume_border_is_dialog(E_Border *bd);
+EAPI int e_illume_border_is_keyboard(E_Border *bd);
+EAPI int e_illume_border_is_bottom_panel(E_Border *bd);
+EAPI int e_illume_border_is_top_shelf(E_Border *bd);
+EAPI int e_illume_border_is_home(E_Border *bd);
+EAPI int e_illume_border_is_conformant(E_Border *bd);
+EAPI int e_illume_border_is_quickpanel(E_Border *bd);
+EAPI int e_illume_border_is_valid(E_Border *bd);
+
+EAPI Eina_List *e_illume_border_valid_borders_get(E_Zone *zone);
+EAPI E_Border *e_illume_border_valid_border_get(E_Zone *zone);
+EAPI int e_illume_border_valid_count_get(E_Zone *zone);
+EAPI Eina_List *e_illume_border_quickpanel_borders_get(E_Zone *zone);
+EAPI int e_illume_border_quickpanel_count_get(E_Zone *zone);
+
+EAPI E_Border *e_illume_border_at_xy_get(E_Zone *zone, int x, int y);
+EAPI E_Border *e_illume_border_in_region_get(E_Zone *zone, int x, int y, int w, int h);
+EAPI E_Border *e_illume_border_keyboard_get(E_Zone *zone);
+EAPI E_Border *e_illume_border_top_shelf_get(E_Zone *zone);
+EAPI E_Border *e_illume_border_bottom_panel_get(E_Zone *zone);
+
+EAPI void e_illume_border_top_shelf_pos_get(E_Zone *zone, int *x, int *y);
+EAPI void e_illume_border_top_shelf_size_get(E_Zone *zone, int *w, int *h);
+EAPI void e_illume_border_bottom_panel_pos_get(E_Zone *zone, int *x, int *y);
+EAPI void e_illume_border_bottom_panel_size_get(E_Zone *zone, int *w, int *h);
+
+EAPI void e_illume_border_slide_to(E_Border *bd, int x, int y, E_Illume_Animation_Class aclass);
+EAPI void e_illume_border_min_get(E_Border *bd, int *mw, int *mh);
+EAPI void e_illume_border_max_get(E_Border *bd, int *mw, int *mh);
+
+EAPI void e_illume_border_app1_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h);
+EAPI void e_illume_border_app2_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h);
+EAPI void e_illume_kbd_safe_app_region_get(E_Zone *zone, int *x, int *y, int *w, int *h);
+
+extern EAPI E_Illume_Config *il_cfg;
+extern EAPI int E_ILLUME_EVENT_POLICY_CHANGE;
+
+#endif
diff --git a/src/modules/illume2/E_Illume.pc.in b/src/modules/illume2/E_Illume.pc.in
new file mode 100644
index 000000000..87f1d0774
--- /dev/null
+++ b/src/modules/illume2/E_Illume.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/@PACKAGE@
+
+Name: e17-illume2
+Description: Illume2 Module for E17
+Requires: enlightenment
+Version: @VERSION@
+Libs: -L${libdir}
+Libs.private:
+Cflags: -I${includedir}
diff --git a/src/modules/illume2/Makefile.am b/src/modules/illume2/Makefile.am
new file mode 100644
index 000000000..8dc63fd4d
--- /dev/null
+++ b/src/modules/illume2/Makefile.am
@@ -0,0 +1,61 @@
+MAINTAINERCLEANFILES = Makefile.in E_Illume.pc module.desktop
+MODULE = illume2
+SUBDIRS = keyboards policies
+
+# 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
+
+EILLUMEHEADERS = E_Illume.h
+
+module_la_SOURCES = $(EILLUMEHEADERS) \
+ e_mod_main.h \
+ e_mod_main.c \
+ e_mod_config.h \
+ e_mod_config.c \
+ e_mod_layout.h \
+ e_mod_layout.c \
+ e_mod_policy.h \
+ e_mod_policy.c \
+ e_mod_animation.h \
+ e_mod_animation.c \
+ e_mod_windows.h \
+ e_mod_windows.c \
+ e_mod_select_window.h \
+ e_mod_select_window.c \
+ e_kbd.h \
+ e_kbd.c \
+ e_kbd_dbus.h \
+ e_kbd_dbus.c \
+ e_quickpanel.h \
+ e_quickpanel.c \
+ e_illume_border.c
+
+module_la_LIBADD = @e_libs@ @dlopen_libs@
+module_la_LDFLAGS = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
+
+installed_headersdir = $(prefix)/include/@PACKAGE@
+installed_headers_DATA = $(EILLUMEHEADERS)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = E_Illume.pc
+
+uninstall:
+ rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
+ rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)/policies
+
diff --git a/src/modules/illume2/e-module-illume2.edj b/src/modules/illume2/e-module-illume2.edj
new file mode 100644
index 000000000..d95843739
--- /dev/null
+++ b/src/modules/illume2/e-module-illume2.edj
Binary files differ
diff --git a/src/modules/illume2/e_illume_border.c b/src/modules/illume2/e_illume_border.c
new file mode 100644
index 000000000..47b7edea3
--- /dev/null
+++ b/src/modules/illume2/e_illume_border.c
@@ -0,0 +1,457 @@
+#include "E_Illume.h"
+#include "e_kbd.h"
+
+EAPI int
+e_illume_border_is_dialog(E_Border *bd)
+{
+ int isdialog = 0, i;
+
+ if (bd->client.icccm.transient_for != 0) isdialog = 1;
+ if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)
+ {
+ isdialog = 1;
+ if (bd->client.netwm.extra_types)
+ {
+ for (i = 0; i < bd->client.netwm.extra_types_num; i++)
+ {
+ if (bd->client.netwm.extra_types[i] ==
+ ECORE_X_WINDOW_TYPE_UNKNOWN) continue;
+ if ((bd->client.netwm.extra_types[i] !=
+ ECORE_X_WINDOW_TYPE_DIALOG) &&
+ (bd->client.netwm.extra_types[i] !=
+ ECORE_X_WINDOW_TYPE_SPLASH))
+ {
+ return 0;
+ }
+ }
+ }
+ }
+ return isdialog;
+}
+
+EAPI int
+e_illume_border_is_keyboard(E_Border *bd)
+{
+ if (bd->client.vkbd.vkbd) return 1;
+ if (il_cfg->policy.vkbd.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.vkbd.title)))
+ return 1;
+ }
+ if (il_cfg->policy.vkbd.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.vkbd.name)))
+ return 1;
+ }
+ if (il_cfg->policy.vkbd.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.vkbd.class)))
+ return 1;
+ }
+ if ((bd->client.icccm.name) &&
+ ((!strcmp(bd->client.icccm.name, "multitap-pad")))
+ && (bd->client.netwm.state.skip_taskbar)
+ && (bd->client.netwm.state.skip_pager))
+ return 1;
+ return 0;
+}
+
+EAPI int
+e_illume_border_is_bottom_panel(E_Border *bd)
+{
+ if (il_cfg->policy.softkey.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.softkey.title)))
+ return 1;
+ }
+ if (il_cfg->policy.softkey.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.softkey.name)))
+ return 1;
+ }
+ if (il_cfg->policy.softkey.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.softkey.class)))
+ return 1;
+ }
+ if (((bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK) ||
+ (bd->client.qtopia.soft_menu)))
+ return 1;
+ return 0;
+}
+
+EAPI int
+e_illume_border_is_top_shelf(E_Border *bd)
+{
+ if (il_cfg->policy.indicator.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.indicator.title)))
+ return 1;
+ }
+ if (il_cfg->policy.indicator.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.indicator.name)))
+ return 1;
+ }
+ if (il_cfg->policy.indicator.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.indicator.class)))
+ return 1;
+ }
+ return 0;
+}
+
+EAPI int
+e_illume_border_is_home(E_Border *bd)
+{
+ if (il_cfg->policy.home.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.home.title)))
+ return 1;
+ }
+ if (il_cfg->policy.home.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.home.name)))
+ return 1;
+ }
+ if (il_cfg->policy.home.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.home.class)))
+ return 1;
+ }
+ return 0;
+}
+
+EAPI int
+e_illume_border_is_conformant(E_Border *bd)
+{
+ if ((bd->client.icccm.class) &&
+ (strstr(bd->client.icccm.class, "config")))
+ return EINA_FALSE;
+ return bd->client.illume.conformant.conformant;
+}
+
+EAPI int
+e_illume_border_is_quickpanel(E_Border *bd)
+{
+ if ((bd->client.icccm.class) &&
+ (strstr(bd->client.icccm.class, "config")))
+ return EINA_FALSE;
+ return bd->client.illume.quickpanel.quickpanel;
+}
+
+EAPI int
+e_illume_border_is_valid(E_Border *bd)
+{
+ if (!bd) return EINA_FALSE;
+ if (e_illume_border_is_dialog(bd)) return EINA_FALSE;
+ if (e_illume_border_is_keyboard(bd)) return EINA_FALSE;
+ if (e_illume_border_is_bottom_panel(bd)) return EINA_FALSE;
+ if (e_illume_border_is_top_shelf(bd)) return EINA_FALSE;
+ if (e_illume_border_is_quickpanel(bd)) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+EAPI Eina_List *
+e_illume_border_valid_borders_get(E_Zone *zone)
+{
+ Eina_List *bds, *l, *ret = NULL;
+ E_Border *bd;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (e_illume_border_is_top_shelf(bd)) continue;
+ if (e_illume_border_is_bottom_panel(bd)) continue;
+ if (e_illume_border_is_keyboard(bd)) continue;
+ if (e_illume_border_is_dialog(bd)) continue;
+ if (e_illume_border_is_quickpanel(bd)) continue;
+ ret = eina_list_append(ret, bd);
+ }
+ return ret;
+}
+
+EAPI E_Border *
+e_illume_border_valid_border_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *ret = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (e_illume_border_is_top_shelf(bd)) continue;
+ if (e_illume_border_is_bottom_panel(bd)) continue;
+ if (e_illume_border_is_keyboard(bd)) continue;
+ if (e_illume_border_is_dialog(bd)) continue;
+ if (e_illume_border_is_quickpanel(bd)) continue;
+ ret = bd;
+ break;
+ }
+ return ret;
+}
+
+EAPI int
+e_illume_border_valid_count_get(E_Zone *zone)
+{
+ Eina_List *l;
+ int count;
+
+ l = e_illume_border_valid_borders_get(zone);
+ count = eina_list_count(l);
+ eina_list_free(l);
+ return count;
+}
+
+EAPI Eina_List *
+e_illume_border_quickpanel_borders_get(E_Zone *zone)
+{
+ Eina_List *bds, *l, *ret = NULL;
+ E_Border *bd;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_quickpanel(bd)) continue;
+ ret = eina_list_append(ret, bd);
+ }
+ return ret;
+}
+
+EAPI int
+e_illume_border_quickpanel_count_get(E_Zone *zone)
+{
+ Eina_List *l;
+ int count;
+
+ l = e_illume_border_quickpanel_borders_get(zone);
+ count = eina_list_count(l);
+ eina_list_free(l);
+ return count;
+}
+
+EAPI E_Border *
+e_illume_border_at_xy_get(E_Zone *zone, int x, int y)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_illume_border_valid_borders_get(zone);
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (((bd->fx.x == x) && (bd->fx.y == y)) ||
+ ((bd->x == x) && (bd->y == y)))
+ {
+ b = bd;
+ break;
+ }
+ }
+ eina_list_free(bds);
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_in_region_get(E_Zone *zone, int x, int y, int w, int h)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_illume_border_valid_borders_get(zone);
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (E_INSIDE(bd->x, bd->fx.y, x, y, w, h))
+ {
+ b = bd;
+ break;
+ }
+ }
+ eina_list_free(bds);
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_keyboard_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_keyboard(bd)) continue;
+ b = bd;
+ break;
+ }
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_top_shelf_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_top_shelf(bd)) continue;
+ b = bd;
+ break;
+ }
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_bottom_panel_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_bottom_panel(bd)) continue;
+ b = bd;
+ break;
+ }
+ return b;
+}
+
+EAPI void
+e_illume_border_top_shelf_pos_get(E_Zone *zone, int *x, int *y)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_top_shelf_get(zone))) return;
+ if (x) *x = bd->x;
+ if (y) *y = bd->y;
+}
+
+EAPI void
+e_illume_border_top_shelf_size_get(E_Zone *zone, int *w, int *h)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_top_shelf_get(zone))) return;
+ if (w) *w = bd->w;
+ if (h) *h = bd->h;
+}
+
+EAPI void
+e_illume_border_bottom_panel_pos_get(E_Zone *zone, int *x, int *y)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_bottom_panel_get(zone))) return;
+ if (x) *x = bd->x;
+ if (y) *y = bd->y;
+}
+
+EAPI void
+e_illume_border_bottom_panel_size_get(E_Zone *zone, int *w, int *h)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_bottom_panel_get(zone))) return;
+ if (w) *w = bd->w;
+ if (h) *h = bd->h;
+}
+
+EAPI void
+e_illume_border_slide_to(E_Border *bd, int x, int y, E_Illume_Animation_Class aclass)
+{
+
+}
+
+EAPI void
+e_illume_border_min_get(E_Border *bd, int *mw, int *mh)
+{
+ if (mw)
+ {
+ if (bd->client.icccm.base_w > bd->client.icccm.min_w)
+ *mw = bd->client.icccm.base_w;
+ else
+ *mw = bd->client.icccm.min_w;
+ }
+ if (mh)
+ {
+ if (bd->client.icccm.base_h > bd->client.icccm.min_h)
+ *mh = bd->client.icccm.base_h;
+ else
+ *mh = bd->client.icccm.min_h;
+ }
+}
+
+EAPI void
+e_illume_border_max_get(E_Border *bd, int *mw, int *mh)
+{
+ if (mw)
+ {
+ if (bd->client.icccm.base_w > bd->client.icccm.max_w)
+ *mw = bd->client.icccm.base_w;
+ else
+ *mw = bd->client.icccm.max_w;
+ }
+ if (mh)
+ {
+ if (bd->client.icccm.base_h > bd->client.icccm.max_h)
+ *mh = bd->client.icccm.base_h;
+ else
+ *mh = bd->client.icccm.max_h;
+ }
+}
+
+EAPI void
+e_illume_border_app1_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
+{
+ int ty, nx, ny, nw, nh;
+
+ if (!zone) return;
+ e_illume_kbd_safe_app_region_get(zone, &nx, &ny, &nw, &nh);
+ e_illume_border_top_shelf_pos_get(zone, NULL, &ty);
+ if (nh >= zone->h) nh = (ny + ty);
+ if (x) *x = nx;
+ if (y) *y = ny;
+ if (w) *w = nw;
+ if (h) *h = nh;
+}
+
+EAPI void
+e_illume_border_app2_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
+{
+ int ty, th, bh;
+ int nx, ny, nw, nh;
+
+ if (!zone) return;
+ e_illume_kbd_safe_app_region_get(zone, &nx, NULL, &nw, &nh);
+ e_illume_border_top_shelf_pos_get(zone, NULL, &ty);
+ e_illume_border_top_shelf_size_get(zone, NULL, &th);
+ e_illume_border_bottom_panel_size_get(zone, NULL, &bh);
+ ny = (ty + th);
+ nh = (nh - ny - bh);
+ if (x) *x = nx;
+ if (y) *y = ny;
+ if (w) *w = nw;
+ if (h) *h = nh;
+}
diff --git a/src/modules/illume2/e_kbd.c b/src/modules/illume2/e_kbd.c
new file mode 100644
index 000000000..aa444fd30
--- /dev/null
+++ b/src/modules/illume2/e_kbd.c
@@ -0,0 +1,668 @@
+#include "E_Illume.h"
+#include "e_kbd.h"
+#include "e_kbd_dbus.h"
+
+#define ICONIFY_TO_HIDE 0
+
+/* local function prototypes */
+static void _e_kbd_cb_free(E_Kbd *kbd);
+static int _e_kbd_cb_delayed_hide(void *data);
+static int _e_kbd_cb_animate(void *data);
+static E_Kbd *_e_kbd_by_border_get(E_Border *bd);
+static void _e_kbd_layout_send(E_Kbd *kbd);
+static void _e_kbd_border_show(E_Border *bd);
+static void _e_kbd_border_hide(E_Border *bd);
+static void _e_kbd_border_adopt(E_Kbd *kbd, E_Border *bd);
+static int _e_kbd_border_is_keyboard(E_Border *bd);
+static void _e_kbd_hide(E_Kbd *kbd);
+static void _e_kbd_slide(E_Kbd *kbd, int visible, double len);
+static void _e_kbd_all_show(void);
+static void _e_kbd_all_hide(void);
+static void _e_kbd_all_toggle(void);
+static void _e_kbd_all_layout_set(E_Kbd_Layout layout);
+
+/* handlers */
+static int _e_kbd_cb_client_message(void *data, int type, void *event);
+static int _e_kbd_cb_border_remove(void *data, int type, void *event);
+static int _e_kbd_cb_border_focus_in(void *data, int type, void *event);
+static int _e_kbd_cb_border_focus_out(void *data, int type, void *event);
+static int _e_kbd_cb_border_property(void *data, int type, void *event);
+
+/* hooks */
+static void _e_kbd_cb_border_pre_post_fetch(void *data, void *data2);
+
+/* local variables */
+static Eina_List *kbds = NULL, *handlers = NULL, *hooks = NULL;
+static E_Border *focused_border = NULL;
+static Ecore_X_Atom focused_vkbd_state = 0;
+
+/* public functions */
+int
+e_kbd_init(void)
+{
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
+ _e_kbd_cb_client_message, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_REMOVE,
+ _e_kbd_cb_border_remove, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN,
+ _e_kbd_cb_border_focus_in, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT,
+ _e_kbd_cb_border_focus_out, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_PROPERTY,
+ _e_kbd_cb_border_property, NULL));
+
+ hooks =
+ eina_list_append(hooks,
+ e_border_hook_add(E_BORDER_HOOK_EVAL_PRE_POST_FETCH,
+ _e_kbd_cb_border_pre_post_fetch, NULL));
+
+ e_kbd_dbus_init();
+
+ return 1;
+}
+
+int
+e_kbd_shutdown(void)
+{
+ E_Kbd *kbd;
+ Ecore_Event_Handler *handler;
+ E_Border_Hook *hook;
+
+ e_kbd_dbus_shutdown();
+
+ EINA_LIST_FREE(handlers, handler)
+ ecore_event_handler_del(handler);
+
+ EINA_LIST_FREE(hooks, hook)
+ e_border_hook_del(hook);
+
+ EINA_LIST_FREE(kbds, kbd)
+ e_object_del(E_OBJECT(kbd));
+
+ return 1;
+}
+
+E_Kbd *
+e_kbd_new(void)
+{
+ E_Kbd *kbd;
+
+ kbd = E_OBJECT_ALLOC(E_Kbd, E_KBD_TYPE, _e_kbd_cb_free);
+ if (!kbd) return NULL;
+ kbd->layout = E_KBD_LAYOUT_ALPHA;
+ kbds = eina_list_append(kbds, kbd);
+ return kbd;
+}
+
+void
+e_kbd_all_enable(void)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ e_kbd_enable(kbd);
+}
+
+void
+e_kbd_all_disable(void)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ e_kbd_disable(kbd);
+}
+
+void
+e_kbd_show(E_Kbd *kbd)
+{
+ if (kbd->timer) ecore_timer_del(kbd->timer);
+ kbd->timer = NULL;
+ if (kbd->disabled) return;
+ if (focused_border)
+ {
+ if (kbd->border->zone != focused_border->zone)
+ e_border_zone_set(kbd->border, focused_border->zone);
+ e_border_move(kbd->border, focused_border->zone->x, kbd->border->y);
+ }
+ if ((kbd->visible) || (kbd->disabled)) return;
+ _e_kbd_layout_send(kbd);
+ if (il_cfg->sliding.kbd.duration <= 0)
+ {
+ if (kbd->border)
+ {
+ e_border_fx_offset(kbd->border, 0, 0);
+ _e_kbd_border_show(kbd->border);
+ }
+ kbd->visible = 1;
+ }
+ else
+ {
+ if (kbd->border) _e_kbd_border_show(kbd->border);
+ _e_kbd_slide(kbd, 1, (double)il_cfg->sliding.kbd.duration / 1000.0);
+ }
+}
+
+void
+e_kbd_hide(E_Kbd *kbd)
+{
+ if (!kbd->visible) return;
+ if (!kbd->timer)
+ kbd->timer = ecore_timer_add(0.2, _e_kbd_cb_delayed_hide, kbd);
+}
+
+void
+e_kbd_enable(E_Kbd *kbd)
+{
+ if (!kbd->disabled) return;
+ kbd->disabled = 0;
+ if (!kbd->visible) e_kbd_show(kbd);
+}
+
+void
+e_kbd_disable(E_Kbd *kbd)
+{
+ if (kbd->disabled) return;
+ if (kbd->visible) e_kbd_hide(kbd);
+ kbd->disabled = 1;
+}
+
+void
+e_kbd_layout_set(E_Kbd *kbd, E_Kbd_Layout layout)
+{
+ kbd->layout = layout;
+ _e_kbd_layout_send(kbd);
+}
+
+void
+e_kbd_fullscreen_set(E_Zone *zone, int fullscreen)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ {
+ if (!kbd->border) continue;
+ if (kbd->border->zone != zone) continue;
+ if ((!!fullscreen) != kbd->fullscreen)
+ {
+ kbd->fullscreen = fullscreen;
+ if (kbd->fullscreen)
+ e_border_layer_set(kbd->border, 250);
+ else
+ e_border_layer_set(kbd->border, 100);
+ }
+ }
+}
+
+EAPI void
+e_illume_kbd_safe_app_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ if (x) *x = zone->x;
+ if (y) *y = zone->y;
+ if (w) *w = zone->w;
+ if (h) *h = zone->h;
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ {
+ if (!kbd->border) continue;
+ if (kbd->border->zone != zone) continue;
+ if ((kbd->visible) && (!kbd->animator) && (!kbd->disabled))
+ {
+ if (h)
+ {
+ *h -= kbd->border->h;
+ if (*h < 0) *h = 0;
+ }
+ }
+ return;
+ }
+}
+
+/* local functions */
+static void
+_e_kbd_cb_free(E_Kbd *kbd)
+{
+ E_Border *bd;
+
+ if (kbd->animator) ecore_animator_del(kbd->animator);
+ kbd->animator = NULL;
+ if (kbd->timer) ecore_timer_del(kbd->timer);
+ kbd->timer = NULL;
+ EINA_LIST_FREE(kbd->waiting_borders, bd)
+ bd->stolen = 0;
+ E_FREE(kbd);
+}
+
+static int
+_e_kbd_cb_delayed_hide(void *data)
+{
+ E_Kbd *kbd;
+
+ if (!(kbd = data)) return 0;
+ _e_kbd_hide(kbd);
+ kbd->timer = NULL;
+ return 0;
+}
+
+static int
+_e_kbd_cb_animate(void *data)
+{
+ E_Kbd *kbd;
+ double t, v;
+
+ kbd = data;
+ t = ecore_loop_time_get() - kbd->start;
+ if (t > kbd->len) t = kbd->len;
+ if (kbd->len > 0.0)
+ {
+ v = t / kbd->len;
+ v = 1.0 - v;
+ v = v * v * v * v;
+ v = 1.0 - v;
+ }
+ else
+ {
+ t = kbd->len;
+ v = 1.0;
+ }
+ kbd->adjust = (kbd->adjust_end * v) + (kbd->adjust_start * (1.0 - v));
+ if (kbd->border)
+ e_border_fx_offset(kbd->border, 0, kbd->border->h - kbd->adjust);
+ if (t == kbd->len)
+ {
+ kbd->animator = NULL;
+ if (kbd->visible)
+ {
+ _e_kbd_border_hide(kbd->border);
+ kbd->visible = 0;
+ }
+ else
+ kbd->visible = 1;
+ _e_kbd_layout_send(kbd);
+ return 0;
+ }
+ return 1;
+}
+
+static E_Kbd *
+_e_kbd_by_border_get(E_Border *bd)
+{
+ Eina_List *l, *ll;
+ E_Border *over;
+ E_Kbd *kbd;
+
+ if (!bd->stolen) return NULL;
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ {
+ if (kbd->border == bd) return kbd;
+ EINA_LIST_FOREACH(kbd->waiting_borders, ll, over)
+ if (over == bd) return kbd;
+ }
+ return NULL;
+}
+
+static void
+_e_kbd_layout_send(E_Kbd *kbd)
+{
+ Ecore_X_Virtual_Keyboard_State type;
+
+ if ((kbd->visible) && (!kbd->disabled))
+ {
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_ON;
+ if (kbd->layout == E_KBD_LAYOUT_DEFAULT)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_ON;
+ else if (kbd->layout == E_KBD_LAYOUT_ALPHA)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA;
+ else if (kbd->layout == E_KBD_LAYOUT_NUMERIC)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC;
+ else if (kbd->layout == E_KBD_LAYOUT_PIN)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN;
+ else if (kbd->layout == E_KBD_LAYOUT_PHONE_NUMBER)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER;
+ else if (kbd->layout == E_KBD_LAYOUT_HEX)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX;
+ else if (kbd->layout == E_KBD_LAYOUT_TERMINAL)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL;
+ else if (kbd->layout == E_KBD_LAYOUT_PASSWORD)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD;
+ else if (kbd->layout == E_KBD_LAYOUT_NONE)
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
+ }
+ else
+ type = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
+ if (kbd->border)
+ ecore_x_e_virtual_keyboard_state_send(kbd->border->client.win, type);
+}
+
+static void
+_e_kbd_border_show(E_Border *bd)
+{
+ if (!bd) return;
+#ifdef ICONIFY_TO_HIDE
+ e_border_uniconify(bd);
+#endif
+ e_border_show(bd);
+ e_border_raise(bd);
+}
+
+static void
+_e_kbd_border_hide(E_Border *bd)
+{
+ if (!bd) return;
+#ifdef ICONIFY_TO_HIDE
+ e_border_iconify(bd);
+#else
+ e_border_hide(bd, 2);
+#endif
+}
+
+static void
+_e_kbd_border_adopt(E_Kbd *kbd, E_Border *bd)
+{
+ kbd->border = bd;
+ bd->sticky = 1;
+ if (kbd->fullscreen)
+ e_border_layer_set(kbd->border, 250);
+ else
+ e_border_layer_set(kbd->border, 100);
+ if (!kbd->visible)
+ {
+ e_border_fx_offset(kbd->border, 0, kbd->border->h);
+ _e_kbd_layout_send(kbd);
+ }
+ kbd->h = kbd->border->h;
+}
+
+static int
+_e_kbd_border_is_keyboard(E_Border *bd)
+{
+ if ((bd->client.vkbd.vkbd) || /* explicit hint that its a virtual keyboard */
+ /* legacy */
+ ( /* trap the matchbox qwerty and multitap kbd's */
+ (((bd->client.icccm.title) && (!strcmp(bd->client.icccm.title, "Keyboard"))) ||
+ ((bd->client.icccm.name) && ((!strcmp(bd->client.icccm.name, "multitap-pad")))))
+ && (bd->client.netwm.state.skip_taskbar)
+ && (bd->client.netwm.state.skip_pager)))
+ return 1;
+ return 0;
+}
+
+static void
+_e_kbd_hide(E_Kbd *kbd)
+{
+ if (kbd->timer) ecore_timer_del(kbd->timer);
+ kbd->timer = NULL;
+ if ((!kbd->visible) || (kbd->disabled)) return;
+ _e_kbd_layout_send(kbd);
+ if (il_cfg->sliding.kbd.duration <= 0)
+ {
+ if (kbd->border)
+ {
+ e_border_fx_offset(kbd->border, 0, kbd->border->h);
+ _e_kbd_border_hide(kbd->border);
+ }
+ kbd->visible = 0;
+ }
+ else
+ _e_kbd_slide(kbd, 0, (double)il_cfg->sliding.kbd.duration / 1000.0);
+}
+
+static void
+_e_kbd_slide(E_Kbd *kbd, int visible, double len)
+{
+ kbd->start = ecore_loop_time_get();
+ kbd->len = len;
+ kbd->adjust_start = kbd->adjust;
+ kbd->adjust_end = 0;
+ if ((visible) && (kbd->border))
+ kbd->adjust_end = kbd->border->h;
+ if (!kbd->animator)
+ kbd->animator = ecore_animator_add(_e_kbd_cb_animate, kbd);
+}
+
+static void
+_e_kbd_all_show(void)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ e_kbd_show(kbd);
+}
+
+static void
+_e_kbd_all_hide(void)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ e_kbd_hide(kbd);
+}
+
+static void
+_e_kbd_all_toggle(void)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ {
+ if (kbd->visible) e_kbd_hide(kbd);
+ else e_kbd_show(kbd);
+ }
+}
+
+static void
+_e_kbd_all_layout_set(E_Kbd_Layout layout)
+{
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ e_kbd_layout_set(kbd, layout);
+}
+
+/* handlers */
+static int
+_e_kbd_cb_client_message(void *data, int type, void *event)
+{
+ Ecore_X_Event_Client_Message *ev;
+
+ ev = event;
+ if (ev->win != ecore_x_window_root_first_get()) return 1;
+ if ((ev->message_type == ecore_x_atom_get("_MB_IM_INVOKER_COMMAND")) ||
+ (ev->message_type == ecore_x_atom_get("_MTP_IM_INVOKER_COMMAND")))
+ {
+ if (ev->data.l[0] == 1) _e_kbd_all_show();
+ else if (ev->data.l[0] == 2) _e_kbd_all_hide();
+ else if (ev->data.l[0] == 3) _e_kbd_all_toggle();
+ }
+ return 1;
+}
+
+static int
+_e_kbd_cb_border_remove(void *data, int type, void *event)
+{
+ E_Event_Border_Remove *ev;
+ E_Kbd *kbd;
+
+ ev = event;
+ if (ev->border == focused_border)
+ {
+ focused_border = NULL;
+ focused_vkbd_state = 0;
+ return 1;
+ }
+ if (!(kbd = _e_kbd_by_border_get(ev->border))) return 1;
+ if (kbd->border == ev->border)
+ {
+ kbd->border = NULL;
+ if (kbd->waiting_borders)
+ {
+ E_Border *bd;
+
+ bd = kbd->waiting_borders->data;
+ kbd->waiting_borders =
+ eina_list_remove_list(kbd->waiting_borders, kbd->waiting_borders);
+ _e_kbd_border_adopt(kbd, bd);
+ }
+ if (kbd->visible)
+ {
+ _e_kbd_border_hide(ev->border);
+ e_kbd_hide(kbd);
+ }
+ }
+ else
+ kbd->waiting_borders = eina_list_remove(kbd->waiting_borders, ev->border);
+ return 1;
+}
+
+static int
+_e_kbd_cb_border_focus_in(void *data, int type, void *event)
+{
+ E_Event_Border_Focus_In *ev;
+
+ ev = event;
+ if (_e_kbd_by_border_get(ev->border)) return 1;
+ focused_border = ev->border;
+ focused_vkbd_state = ev->border->client.vkbd.state;
+ if (focused_vkbd_state == 0) return 1;
+ if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ {
+ _e_kbd_all_hide();
+ return 1;
+ }
+ else
+ {
+ if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_ALPHA);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_NUMERIC);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PIN);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PHONE_NUMBER);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_HEX);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_TERMINAL);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PASSWORD);
+ else
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_DEFAULT);
+
+ _e_kbd_all_show();
+ }
+ return 1;
+}
+
+static int
+_e_kbd_cb_border_focus_out(void *data, int type, void *event)
+{
+ E_Event_Border_Focus_Out *ev;
+
+ ev = event;
+ if (_e_kbd_by_border_get(ev->border)) return 1;
+ _e_kbd_all_hide();
+ focused_border = NULL;
+ focused_vkbd_state = 0;
+ return 1;
+}
+
+static int
+_e_kbd_cb_border_property(void *data, int type, void *event)
+{
+ E_Event_Border_Property *ev;
+
+ ev = event;
+ if (!ev->border->focused) return 1;
+ if (_e_kbd_by_border_get(ev->border)) return 1;
+ if ((ev->border == focused_border) &&
+ (ev->border->client.vkbd.state == focused_vkbd_state)) return 1;
+ focused_vkbd_state = ev->border->client.vkbd.state;
+ if (focused_vkbd_state == 0) return 1;
+
+ if ((ev->border->need_fullscreen) || (ev->border->fullscreen))
+ e_kbd_fullscreen_set(ev->border->zone, 1);
+ else
+ e_kbd_fullscreen_set(ev->border->zone, 0);
+
+ /* app wants kbd off - then kbd off it is */
+ if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ _e_kbd_all_hide();
+ /* app wants something other than off... */
+ else
+ {
+ if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_ALPHA);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_NUMERIC);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PIN);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PHONE_NUMBER);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_HEX);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_TERMINAL);
+ else if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD)
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_PASSWORD);
+ else
+ _e_kbd_all_layout_set(E_KBD_LAYOUT_DEFAULT);
+ _e_kbd_all_show();
+ }
+ return 1;
+}
+
+/* hooks */
+static void
+_e_kbd_cb_border_pre_post_fetch(void *data, void *data2)
+{
+ E_Border *bd;
+
+ if (!(bd = data2)) return;
+ if (!bd->new_client) return;
+ if (_e_kbd_by_border_get(bd)) return;
+ if (_e_kbd_border_is_keyboard(bd))
+ {
+ Eina_List *l;
+ E_Kbd *kbd;
+
+ EINA_LIST_FOREACH(kbds, l, kbd)
+ {
+ if (!kbd->border)
+ _e_kbd_border_adopt(kbd, bd);
+ else
+ kbd->waiting_borders = eina_list_append(kbd->waiting_borders, bd);
+ bd->stolen = 1;
+ if (bd->remember)
+ {
+ if (bd->bordername)
+ {
+ eina_stringshare_del(bd->bordername);
+ bd->bordername = NULL;
+ }
+ e_remember_unuse(bd->remember);
+ bd->remember = NULL;
+ }
+ eina_stringshare_replace(&bd->bordername, "borderless");
+ bd->client.border.changed = 1;
+ return;
+ }
+ }
+}
diff --git a/src/modules/illume2/e_kbd.h b/src/modules/illume2/e_kbd.h
new file mode 100644
index 000000000..bfd18e19f
--- /dev/null
+++ b/src/modules/illume2/e_kbd.h
@@ -0,0 +1,56 @@
+#ifndef E_KBD_H
+#define E_KBD_H
+
+#define E_KBD_TYPE 0xE1b0988
+
+typedef enum _E_Kbd_Layout E_Kbd_Layout;
+enum _E_Kbd_Layout
+{
+ E_KBD_LAYOUT_NONE,
+ E_KBD_LAYOUT_DEFAULT,
+ E_KBD_LAYOUT_ALPHA,
+ E_KBD_LAYOUT_NUMERIC,
+ E_KBD_LAYOUT_PIN,
+ E_KBD_LAYOUT_PHONE_NUMBER,
+ E_KBD_LAYOUT_HEX,
+ E_KBD_LAYOUT_TERMINAL,
+ E_KBD_LAYOUT_PASSWORD,
+ E_KBD_LAYOUT_IP,
+ E_KBD_LAYOUT_HOST,
+ E_KBD_LAYOUT_FILE,
+ E_KBD_LAYOUT_URL,
+ E_KBD_LAYOUT_KEYPAD,
+ E_KBD_LAYOUT_J2ME
+};
+
+typedef struct _E_Kbd E_Kbd;
+struct _E_Kbd
+{
+ E_Object e_obj_inherit;
+ E_Border *border;
+ Ecore_Timer *timer;
+ Ecore_Animator *animator;
+ E_Kbd_Layout layout;
+ Eina_List *waiting_borders;
+
+ double start, len;
+ int h, adjust, adjust_start, adjust_end;
+ unsigned char visible : 1;
+ unsigned char disabled : 1;
+ unsigned char fullscreen : 1;
+};
+
+int e_kbd_init(void);
+int e_kbd_shutdown(void);
+
+E_Kbd *e_kbd_new(void);
+void e_kbd_all_enable(void);
+void e_kbd_all_disable(void);
+void e_kbd_show(E_Kbd *kbd);
+void e_kbd_hide(E_Kbd *kbd);
+void e_kbd_enable(E_Kbd *kbd);
+void e_kbd_disable(E_Kbd *kbd);
+void e_kbd_layout_set(E_Kbd *kbd, E_Kbd_Layout layout);
+void e_kbd_fullscreen_set(E_Zone *zone, int fullscreen);
+
+#endif
diff --git a/src/modules/illume2/e_kbd_dbus.c b/src/modules/illume2/e_kbd_dbus.c
new file mode 100644
index 000000000..ea91ba0e8
--- /dev/null
+++ b/src/modules/illume2/e_kbd_dbus.c
@@ -0,0 +1,269 @@
+#include "E_Illume.h"
+#include "e_kbd.h"
+#include "e_kbd_dbus.h"
+
+/* local variables */
+static int have_real_kbd = 0;
+static E_DBus_Connection *dbus_conn = NULL;
+static E_DBus_Signal_Handler *dbus_dev_add = NULL;
+static E_DBus_Signal_Handler *dbus_dev_del = NULL;
+static E_DBus_Signal_Handler *dbus_dev_chg = NULL;
+static Eina_List *dbus_kbds = NULL, *ignore_kbds = NULL;
+
+/* local function prototypes */
+static void _e_kbd_dbus_cb_input_kbd(void *data, void *reply, DBusError *err);
+static void _e_kbd_dbus_cb_input_kbd_is(void *data, void *reply, DBusError *err);
+static void _e_kbd_dbus_ignore_kbds_load(void);
+static void _e_kbd_dbus_ignore_kbds_file_load(const char *file);
+static void _e_kbd_dbus_kbd_add(const char *udi);
+static void _e_kbd_dbus_kbd_del(const char *udi);
+static void _e_kbd_dbus_kbd_eval(void);
+static void _e_kbd_dbus_dev_add(void *data, DBusMessage *msg);
+static void _e_kbd_dbus_dev_del(void *data, DBusMessage *msg);
+static void _e_kbd_dbus_dev_chg(void *data, DBusMessage *msg);
+
+/* public functions */
+void
+e_kbd_dbus_init(void)
+{
+ /* load the 'ignore' keyboard files */
+ _e_kbd_dbus_ignore_kbds_load();
+
+ /* attempt to connect to the system dbus */
+ if (!(dbus_conn = e_dbus_bus_get(DBUS_BUS_SYSTEM))) return;
+
+ /* ask HAL for any input keyboards */
+ e_hal_manager_find_device_by_capability(dbus_conn, "input.keyboard",
+ _e_kbd_dbus_cb_input_kbd, NULL);
+
+ /* setup dbus signal handlers for when a device gets added/removed/changed */
+ dbus_dev_add =
+ e_dbus_signal_handler_add(dbus_conn, "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/Manager",
+ "org.freedesktop.Hal.Manager",
+ "DeviceAdded", _e_kbd_dbus_dev_add, NULL);
+ dbus_dev_del =
+ e_dbus_signal_handler_add(dbus_conn, "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/Manager",
+ "org.freedesktop.Hal.Manager",
+ "DeviceRemoved", _e_kbd_dbus_dev_del, NULL);
+ dbus_dev_chg =
+ e_dbus_signal_handler_add(dbus_conn, "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/Manager",
+ "org.freedesktop.Hal.Manager",
+ "NewCapability", _e_kbd_dbus_dev_chg, NULL);
+}
+
+void
+e_kbd_dbus_shutdown(void)
+{
+ char *str;
+
+ /* remove the dbus signal handlers if we can */
+ if (dbus_conn)
+ {
+ e_dbus_signal_handler_del(dbus_conn, dbus_dev_add);
+ e_dbus_signal_handler_del(dbus_conn, dbus_dev_del);
+ e_dbus_signal_handler_del(dbus_conn, dbus_dev_chg);
+ }
+
+ /* free the list of ignored keyboards */
+ EINA_LIST_FREE(ignore_kbds, str)
+ eina_stringshare_del(str);
+
+ /* free the list of keyboards */
+ EINA_LIST_FREE(dbus_kbds, str)
+ eina_stringshare_del(str);
+}
+
+/* local functions */
+static void
+_e_kbd_dbus_cb_input_kbd(void *data, void *reply, DBusError *err)
+{
+ E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply;
+ Eina_List *l;
+ char *dev;
+
+ if ((!ret) || (!ret->strings)) return;
+
+ /* if dbus errored then cleanup and get out */
+ if (dbus_error_is_set(err))
+ {
+ dbus_error_free(err);
+ return;
+ }
+
+ /* for each returned keyboard, add it and evaluate it */
+ EINA_LIST_FOREACH(ret->strings, l, dev)
+ {
+ _e_kbd_dbus_kbd_add(dev);
+ _e_kbd_dbus_kbd_eval();
+ }
+}
+
+static void
+_e_kbd_dbus_cb_input_kbd_is(void *data, void *reply, DBusError *err)
+{
+ E_Hal_Device_Query_Capability_Return *ret = reply;
+ char *udi = data;
+
+ /* if dbus errored then cleanup and get out */
+ if (dbus_error_is_set(err))
+ {
+ dbus_error_free(err);
+ if (udi) free(udi);
+ return;
+ }
+
+ /* if it's an input keyboard, than add it and eval */
+ if ((ret) && (ret->boolean))
+ {
+ _e_kbd_dbus_kbd_add(udi);
+ _e_kbd_dbus_kbd_eval();
+ }
+}
+
+static void
+_e_kbd_dbus_ignore_kbds_load(void)
+{
+ char buff[PATH_MAX];
+
+ /* load the 'ignore' file from the user's home dir */
+ e_user_dir_concat_static(buff, "keyboards/ignore_built_in_keyboards");
+ _e_kbd_dbus_ignore_kbds_file_load(buff);
+
+ /* load the 'ignore' file from the system/module dir */
+ snprintf(buff, sizeof(buff),
+ "%s/keyboards/ignore_built_in_keyboards", il_cfg->mod_dir);
+ _e_kbd_dbus_ignore_kbds_file_load(buff);
+}
+
+static void
+_e_kbd_dbus_ignore_kbds_file_load(const char *file)
+{
+ char buf[PATH_MAX];
+ FILE *f;
+
+ /* can this file be opened */
+ if (!(f = fopen(file, "r"))) return;
+
+ /* parse out the info in the ignore file */
+ while (fgets(buf, sizeof(buf), f))
+ {
+ char *p;
+ int len;
+
+ if (buf[0] == '#') continue;
+ len = strlen(buf);
+ if (len > 0)
+ {
+ if (buf[len - 1] == '\n') buf[len - 1] = 0;
+ }
+ p = buf;
+ while (isspace(*p)) p++;
+
+ /* append this kbd to the ignore list */
+ if (*p)
+ ignore_kbds = eina_list_append(ignore_kbds, eina_stringshare_add(p));
+ }
+ fclose(f);
+}
+
+static void
+_e_kbd_dbus_kbd_add(const char *udi)
+{
+ const char *str;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(dbus_kbds, l, str)
+ if (!strcmp(str, udi)) return;
+ dbus_kbds = eina_list_append(dbus_kbds, eina_stringshare_add(udi));
+}
+
+static void
+_e_kbd_dbus_kbd_del(const char *udi)
+{
+ const char *str;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(dbus_kbds, l, str)
+ if (!strcmp(str, udi))
+ {
+ eina_stringshare_del(str);
+ dbus_kbds = eina_list_remove_list(dbus_kbds, l);
+ return;
+ }
+}
+
+static void
+_e_kbd_dbus_kbd_eval(void)
+{
+ Eina_List *l, *ll;
+ const char *g, *gg;
+ int have_real = 0;
+
+ have_real = eina_list_count(dbus_kbds);
+ EINA_LIST_FOREACH(dbus_kbds, l, g)
+ EINA_LIST_FOREACH(ignore_kbds, ll, gg)
+ if (e_util_glob_match(g, gg))
+ {
+ have_real--;
+ break;
+ }
+ if (have_real != have_real_kbd)
+ {
+ have_real_kbd = have_real;
+#if 0
+ if (have_real_kbd) e_kbd_all_disable();
+ else
+#endif
+ e_kbd_all_enable();
+ }
+}
+
+static void
+_e_kbd_dbus_dev_add(void *data, DBusMessage *msg)
+{
+ DBusError err;
+ char *udi;
+ int ret;
+
+ dbus_error_init(&err);
+ dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &udi, DBUS_TYPE_INVALID);
+ ret = e_hal_device_query_capability(dbus_conn, udi, "input.keyboard",
+ _e_kbd_dbus_cb_input_kbd_is, udi);
+}
+
+static void
+_e_kbd_dbus_dev_del(void *data, DBusMessage *msg)
+{
+ DBusError err;
+ char *udi;
+
+ dbus_error_init(&err);
+ dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &udi, DBUS_TYPE_INVALID);
+ if (udi)
+ {
+ _e_kbd_dbus_kbd_del(udi);
+ _e_kbd_dbus_kbd_eval();
+ free(udi);
+ }
+}
+
+static void
+_e_kbd_dbus_dev_chg(void *data, DBusMessage *msg)
+{
+ DBusError err;
+ char *udi, *cap;
+
+ dbus_error_init(&err);
+ dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &udi,
+ DBUS_TYPE_STRING, &cap, DBUS_TYPE_INVALID);
+ if (!strcmp(cap, "input.keyboard"))
+ {
+ _e_kbd_dbus_kbd_add(udi);
+ _e_kbd_dbus_kbd_eval();
+ }
+ if (cap) free(cap);
+ if (udi) free(udi);
+}
diff --git a/src/modules/illume2/e_kbd_dbus.h b/src/modules/illume2/e_kbd_dbus.h
new file mode 100644
index 000000000..c863c27da
--- /dev/null
+++ b/src/modules/illume2/e_kbd_dbus.h
@@ -0,0 +1,7 @@
+#ifndef E_KBD_DBUS_H
+#define E_KBD_DBUS_H
+
+void e_kbd_dbus_init(void);
+void e_kbd_dbus_shutdown(void);
+
+#endif
diff --git a/src/modules/illume2/e_mod_animation.c b/src/modules/illume2/e_mod_animation.c
new file mode 100644
index 000000000..414b117c2
--- /dev/null
+++ b/src/modules/illume2/e_mod_animation.c
@@ -0,0 +1,121 @@
+#include "E_Illume.h"
+#include "e_mod_animation.h"
+
+/* local function prototypes */
+static void *_il_config_animation_create(E_Config_Dialog *cfd);
+static void _il_config_animation_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_il_config_animation_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static void _il_config_animation_change(void *data, Evas_Object *obj, void *event);
+static int _il_config_animation_change_timeout(void *data);
+
+/* local variables */
+Ecore_Timer *_anim_change_timer = NULL;
+
+/* public functions */
+void
+il_config_animation_show(E_Container *con, const char *params)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_illume_animation_settings")) return;
+ v = E_NEW(E_Config_Dialog_View, 1);
+ v->create_cfdata = _il_config_animation_create;
+ v->free_cfdata = _il_config_animation_free;
+ v->basic.create_widgets = _il_config_animation_ui;
+ v->basic_only = 1;
+ v->normal_win = 1;
+ v->scroll = 1;
+ cfd = e_config_dialog_new(con, _("Animation Settings"), "E",
+ "_config_illume_animation_settings",
+ "enlightenment/animation_settings", 0, v, NULL);
+ e_dialog_resizable_set(cfd->dia, 1);
+}
+
+/* local function prototypes */
+static void *
+_il_config_animation_create(E_Config_Dialog *cfd)
+{
+ return NULL;
+}
+
+static void
+_il_config_animation_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ if (_anim_change_timer) ecore_timer_del(_anim_change_timer);
+}
+
+static Evas_Object *
+_il_config_animation_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *list, *of, *ow;
+ E_Radio_Group *rg;
+
+ list = e_widget_list_add(evas, 0, 0);
+
+ of = e_widget_framelist_add(evas, _("Keyboard"), 0);
+ rg = e_widget_radio_group_new(&(il_cfg->sliding.kbd.duration));
+ ow = e_widget_radio_add(evas, _("Slow"), 2000, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Medium"), 1000, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Fast"), 500, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Very Fast"), 250, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Off"), 0, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ of = e_widget_framelist_add(evas, _("Quickpanel"), 0);
+ rg = e_widget_radio_group_new(&(il_cfg->sliding.quickpanel.duration));
+ ow = e_widget_radio_add(evas, _("Slow"), 2000, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Medium"), 1000, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Fast"), 500, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Very Fast"), 250, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ ow = e_widget_radio_add(evas, _("Off"), 0, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_animation_change, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ return list;
+}
+
+static void
+_il_config_animation_change(void *data, Evas_Object *obj, void *event)
+{
+ if (_anim_change_timer) ecore_timer_del(_anim_change_timer);
+ _anim_change_timer =
+ ecore_timer_add(0.5, _il_config_animation_change_timeout, data);
+}
+
+static int
+_il_config_animation_change_timeout(void *data)
+{
+ e_config_save_queue();
+ _anim_change_timer = NULL;
+ return 0;
+}
diff --git a/src/modules/illume2/e_mod_animation.h b/src/modules/illume2/e_mod_animation.h
new file mode 100644
index 000000000..cf8a36ee0
--- /dev/null
+++ b/src/modules/illume2/e_mod_animation.h
@@ -0,0 +1,6 @@
+#ifndef E_MOD_ANIM_H
+#define E_MOD_ANIM_H
+
+void il_config_animation_show(E_Container *con, const char *params);
+
+#endif
diff --git a/src/modules/illume2/e_mod_border.c b/src/modules/illume2/e_mod_border.c
new file mode 100644
index 000000000..314312691
--- /dev/null
+++ b/src/modules/illume2/e_mod_border.c
@@ -0,0 +1,476 @@
+#include "E_Illume.h"
+#include "e_kbd.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// :: Convenience routines to make it easy to write layout logic code ::
+
+// activate a window - meant for main app and home app windows
+void
+e_illume_border_activate(E_Border *bd)
+{
+ e_desk_show(bd->desk);
+ e_border_uniconify(bd);
+ e_border_raise(bd);
+ e_border_show(bd);
+ e_border_focus_set(bd, 1, 1);
+}
+
+// activate a window that isnt meant to get the focus - like panels, kbd etc.
+void
+e_illume_border_show(E_Border *bd)
+{
+ e_desk_show(bd->desk);
+ e_border_uniconify(bd);
+ e_border_raise(bd);
+ e_border_show(bd);
+}
+
+// get a window away from being visile (but maintain it)
+void
+e_illume_border_deactivate(E_Border *bd)
+{
+ e_border_iconify(bd);
+}
+
+// get window info - is this one a dialog?
+EAPI int
+e_illume_border_is_dialog(E_Border *bd)
+{
+ int isdialog = 0, i;
+
+ if (bd->client.icccm.transient_for != 0) isdialog = 1;
+ if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)
+ {
+ isdialog = 1;
+ if (bd->client.netwm.extra_types)
+ {
+ for (i = 0; i < bd->client.netwm.extra_types_num; i++)
+ {
+ if (bd->client.netwm.extra_types[i] ==
+ ECORE_X_WINDOW_TYPE_UNKNOWN) continue;
+ if ((bd->client.netwm.extra_types[i] !=
+ ECORE_X_WINDOW_TYPE_DIALOG) &&
+ (bd->client.netwm.extra_types[i] !=
+ ECORE_X_WINDOW_TYPE_SPLASH))
+ {
+ return 0;
+ }
+ }
+ }
+ }
+ return isdialog;
+}
+
+// get window info - is this a vkbd window
+EAPI int
+e_illume_border_is_keyboard(E_Border *bd)
+{
+ if (bd->client.vkbd.vkbd) return 1;
+ if (il_cfg->policy.vkbd.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.vkbd.title)))
+ return 1;
+ }
+ if (il_cfg->policy.vkbd.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.vkbd.name)))
+ return 1;
+ }
+ if (il_cfg->policy.vkbd.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.vkbd.class)))
+ return 1;
+ }
+ if ((bd->client.icccm.name) &&
+ ((!strcmp(bd->client.icccm.name, "multitap-pad")))
+ && (bd->client.netwm.state.skip_taskbar)
+ && (bd->client.netwm.state.skip_pager))
+ return 1;
+ return 0;
+}
+
+// get window info - is it a bottom app panel window (eg qtopia softmenu)
+EAPI int
+e_illume_border_is_bottom_panel(E_Border *bd)
+{
+ if (il_cfg->policy.softkey.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.softkey.title)))
+ return 1;
+ }
+ if (il_cfg->policy.softkey.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.softkey.name)))
+ return 1;
+ }
+ if (il_cfg->policy.softkey.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.softkey.class)))
+ return 1;
+ }
+ if (((bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK) ||
+ (bd->client.qtopia.soft_menu)))
+ return 1;
+ return 0;
+}
+
+// get window info - is it a top shelf window
+EAPI int
+e_illume_border_is_top_shelf(E_Border *bd)
+{
+ if (il_cfg->policy.indicator.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.indicator.title)))
+ return 1;
+ }
+ if (il_cfg->policy.indicator.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.indicator.name)))
+ return 1;
+ }
+ if (il_cfg->policy.indicator.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.indicator.class)))
+ return 1;
+ }
+ return 0;
+}
+
+// get window info - is it a home window
+EAPI int
+e_illume_border_is_home(E_Border *bd)
+{
+ if (il_cfg->policy.home.match.title)
+ {
+ if ((bd->client.icccm.title) &&
+ (!strcmp(bd->client.icccm.title, il_cfg->policy.home.title)))
+ return 1;
+ }
+ if (il_cfg->policy.home.match.name)
+ {
+ if ((bd->client.icccm.name) &&
+ (!strcmp(bd->client.icccm.name, il_cfg->policy.home.name)))
+ return 1;
+ }
+ if (il_cfg->policy.home.match.class)
+ {
+ if ((bd->client.icccm.class) &&
+ (!strcmp(bd->client.icccm.class, il_cfg->policy.home.class)))
+ return 1;
+ }
+ return 0;
+}
+
+EAPI int
+e_illume_border_is_conformant(E_Border *bd)
+{
+ if ((bd->client.icccm.class) &&
+ (strstr(bd->client.icccm.class, "config"))) return EINA_FALSE;
+ return bd->client.illume.conformant.conformant;
+}
+
+EAPI int
+e_illume_border_is_quickpanel(E_Border *bd)
+{
+ if ((bd->client.icccm.class) &&
+ (strstr(bd->client.icccm.class, "config"))) return EINA_FALSE;
+ return bd->client.illume.quickpanel.quickpanel;
+// return ecore_x_e_illume_quickpanel_get(bd->client.win);
+}
+
+EAPI int
+e_illume_border_is_valid(E_Border *bd)
+{
+ if (!bd) return EINA_FALSE;
+ if (e_illume_border_is_dialog(bd)) return EINA_FALSE;
+ if (e_illume_border_is_keyboard(bd)) return EINA_FALSE;
+ if (e_illume_border_is_bottom_panel(bd)) return EINA_FALSE;
+ if (e_illume_border_is_top_shelf(bd)) return EINA_FALSE;
+ if (e_illume_border_is_quickpanel(bd)) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+EAPI Eina_List *
+e_illume_border_valid_borders_get(E_Zone *zone)
+{
+ Eina_List *bds, *l, *ret = NULL;
+ E_Border *bd;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (e_illume_border_is_top_shelf(bd)) continue;
+ if (e_illume_border_is_bottom_panel(bd)) continue;
+ if (e_illume_border_is_keyboard(bd)) continue;
+ if (e_illume_border_is_dialog(bd)) continue;
+ if (e_illume_border_is_quickpanel(bd)) continue;
+ ret = eina_list_append(ret, bd);
+ }
+ return ret;
+}
+
+EAPI E_Border *
+e_illume_border_valid_border_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *ret = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (e_illume_border_is_top_shelf(bd)) continue;
+ if (e_illume_border_is_bottom_panel(bd)) continue;
+ if (e_illume_border_is_keyboard(bd)) continue;
+ if (e_illume_border_is_dialog(bd)) continue;
+ if (e_illume_border_is_quickpanel(bd)) continue;
+ ret = bd;
+ break;
+ }
+ return ret;
+}
+
+EAPI int
+e_illume_border_valid_count_get(E_Zone *zone)
+{
+ Eina_List *l;
+ int count;
+
+ l = e_illume_border_valid_borders_get(zone);
+ count = eina_list_count(l);
+ eina_list_free(l);
+ return count;
+}
+
+EAPI Eina_List *
+e_illume_border_quickpanel_borders_get(E_Zone *zone)
+{
+ Eina_List *bds, *l, *ret = NULL;
+ E_Border *bd;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (!bd) continue;
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_quickpanel(bd)) continue;
+ ret = eina_list_append(ret, bd);
+ }
+ return ret;
+}
+
+EAPI int
+e_illume_border_quickpanel_count_get(E_Zone *zone)
+{
+ Eina_List *l;
+ int count;
+
+ l = e_illume_border_quickpanel_borders_get(zone);
+ count = eina_list_count(l);
+ eina_list_free(l);
+ return count;
+}
+
+EAPI E_Border *
+e_illume_border_at_xy_get(E_Zone *zone, int x, int y)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_illume_border_valid_borders_get(zone);
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (((bd->fx.x == x) && (bd->fx.y == y)) ||
+ ((bd->x == x) && (bd->y == y)))
+ {
+ b = bd;
+ break;
+ }
+ }
+ eina_list_free(bds);
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_in_region_get(E_Zone *zone, int x, int y, int w, int h)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_illume_border_valid_borders_get(zone);
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (E_INSIDE(bd->x, bd->fx.y, x, y, w, h))
+ {
+ b = bd;
+ break;
+ }
+ }
+ eina_list_free(bds);
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_top_shelf_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_top_shelf(bd)) continue;
+ b = bd;
+ break;
+ }
+ return b;
+}
+
+EAPI E_Border *
+e_illume_border_bottom_panel_get(E_Zone *zone)
+{
+ Eina_List *bds, *l;
+ E_Border *bd, *b = NULL;
+
+ bds = e_border_client_list();
+ EINA_LIST_FOREACH(bds, l, bd)
+ {
+ if (bd->zone != zone) continue;
+ if (!e_illume_border_is_bottom_panel(bd)) continue;
+ b = bd;
+ break;
+ }
+ return b;
+}
+
+EAPI void
+e_illume_border_top_shelf_pos_get(E_Zone *zone, int *x, int *y)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_top_shelf_get(zone))) return;
+ if (x) *x = bd->x;
+ if (y) *y = bd->y;
+}
+
+EAPI void
+e_illume_border_top_shelf_size_get(E_Zone *zone, int *w, int *h)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_top_shelf_get(zone))) return;
+ if (w) *w = bd->w;
+ if (h) *h = bd->h;
+}
+
+EAPI void
+e_illume_border_bottom_panel_pos_get(E_Zone *zone, int *x, int *y)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_bottom_panel_get(zone))) return;
+ if (x) *x = bd->x;
+ if (y) *y = bd->y;
+}
+
+EAPI void
+e_illume_border_bottom_panel_size_get(E_Zone *zone, int *w, int *h)
+{
+ E_Border *bd;
+
+ if (!(bd = e_illume_border_bottom_panel_get(zone))) return;
+ if (w) *w = bd->w;
+ if (h) *h = bd->h;
+}
+
+EAPI void
+e_illume_border_slide_to(E_Border *bd, int x, int y, E_Illume_Animation_Class aclass)
+{
+ // FIXME: do
+ // 1. if an existing slide exists, use is current offset x,y as current border pos, new x,y as new pos and start slide again
+}
+
+EAPI void
+e_illume_border_min_get(E_Border *bd, int *mw, int *mh)
+{
+ if (mw)
+ {
+ if (bd->client.icccm.base_w > bd->client.icccm.min_w)
+ *mw = bd->client.icccm.base_w;
+ else
+ *mw = bd->client.icccm.min_w;
+ }
+ if (mh)
+ {
+ if (bd->client.icccm.base_h > bd->client.icccm.min_h)
+ *mh = bd->client.icccm.base_h;
+ else
+ *mh = bd->client.icccm.min_h;
+ }
+}
+
+EAPI void
+e_illume_border_max_get(E_Border *bd, int *mw, int *mh)
+{
+ if (mw)
+ {
+ if (bd->client.icccm.base_w > bd->client.icccm.max_w)
+ *mw = bd->client.icccm.base_w;
+ else
+ *mw = bd->client.icccm.max_w;
+ }
+ if (mh)
+ {
+ if (bd->client.icccm.base_h > bd->client.icccm.max_h)
+ *mh = bd->client.icccm.base_h;
+ else
+ *mh = bd->client.icccm.max_h;
+ }
+}
+
+EAPI void
+e_illume_border_app1_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
+{
+ int ty, nx, ny, nw, nh;
+
+ if (!zone) return;
+ e_illume_kbd_safe_app_region_get(zone, &nx, &ny, &nw, &nh);
+ e_illume_border_top_shelf_pos_get(zone, NULL, &ty);
+ if (nh >= zone->h) nh = (ny + ty);
+ if (x) *x = nx;
+ if (y) *y = ny;
+ if (w) *w = nw;
+ if (h) *h = nh;
+}
+
+EAPI void
+e_illume_border_app2_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
+{
+ int ty, th, bh;
+ int nx, ny, nw, nh;
+
+ if (!zone) return;
+ e_illume_kbd_safe_app_region_get(zone, &nx, NULL, &nw, &nh);
+ e_illume_border_top_shelf_pos_get(zone, NULL, &ty);
+ e_illume_border_top_shelf_size_get(zone, NULL, &th);
+ e_illume_border_bottom_panel_size_get(zone, NULL, &bh);
+ ny = (ty + th);
+ nh = (nh - ny - bh);
+ if (x) *x = nx;
+ if (y) *y = ny;
+ if (w) *w = nw;
+ if (h) *h = nh;
+}
diff --git a/src/modules/illume2/e_mod_config.c b/src/modules/illume2/e_mod_config.c
new file mode 100644
index 000000000..193a249e8
--- /dev/null
+++ b/src/modules/illume2/e_mod_config.c
@@ -0,0 +1,239 @@
+#include "E_Illume.h"
+#include "e_mod_config.h"
+#include "e_mod_policy.h"
+#include "e_mod_animation.h"
+#include "e_mod_windows.h"
+
+/* local variables */
+static E_Config_DD *conf_edd = NULL;
+static E_Config_DD *conf_zone_edd = NULL;
+
+/* public variables */
+EAPI E_Illume_Config*il_cfg = NULL;
+
+int
+e_mod_config_init(E_Module *m)
+{
+ conf_zone_edd = E_CONFIG_DD_NEW("Illume_Cfg_Zone", E_Illume_Config_Zone);
+ E_CONFIG_VAL(conf_zone_edd, E_Illume_Config_Zone, id, INT);
+ E_CONFIG_VAL(conf_zone_edd, E_Illume_Config_Zone, mode.dual, INT);
+ E_CONFIG_VAL(conf_zone_edd, E_Illume_Config_Zone, mode.side, INT);
+
+ conf_edd = E_CONFIG_DD_NEW("Illume_Cfg", E_Illume_Config);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, version, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, sliding.kbd.duration, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, sliding.softkey.duration, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, sliding.quickpanel.duration, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.name, STR);
+
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.class, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.name, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.title, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.win_type, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.match.class, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.match.name, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.match.title, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.vkbd.match.win_type, INT);
+
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.class, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.name, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.title, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.win_type, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.match.class, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.match.name, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.match.title, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.softkey.match.win_type, INT);
+
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.class, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.name, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.title, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.win_type, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.match.class, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.match.name, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.match.title, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.home.match.win_type, INT);
+
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.class, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.name, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.title, STR);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.win_type, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.match.class, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.match.name, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.match.title, INT);
+ E_CONFIG_VAL(conf_edd, E_Illume_Config, policy.indicator.match.win_type, INT);
+
+ E_CONFIG_LIST(conf_edd, E_Illume_Config, policy.zones, conf_zone_edd);
+
+ /* load the config */
+ il_cfg = e_config_domain_load("module.illume2", conf_edd);
+ if ((il_cfg) && ((il_cfg->version >> 16) < IL_CONFIG_MAJ))
+ {
+ E_FREE(il_cfg);
+ il_cfg = NULL;
+ }
+ if (!il_cfg)
+ {
+ E_Illume_Config_Zone *cz;
+
+ cz = E_NEW(E_Illume_Config_Zone, 1);
+ cz->id = 0;
+ cz->mode.dual = 0;
+ cz->mode.side = 0;
+
+ il_cfg = E_NEW(E_Illume_Config, 1);
+ il_cfg->version = 0;
+ il_cfg->sliding.kbd.duration = 1000;
+ il_cfg->sliding.softkey.duration = 1000;
+ il_cfg->sliding.quickpanel.duration = 1000;
+ il_cfg->policy.name = eina_stringshare_add("illume");
+ il_cfg->policy.vkbd.class =
+ eina_stringshare_add("Virtual-Keyboard");
+ il_cfg->policy.vkbd.name =
+ eina_stringshare_add("Virtual-Keyboard");
+ il_cfg->policy.vkbd.title =
+ eina_stringshare_add("Virtual Keyboard");
+ il_cfg->policy.vkbd.win_type = ECORE_X_WINDOW_TYPE_NORMAL;
+ il_cfg->policy.vkbd.match.class = 0;
+ il_cfg->policy.vkbd.match.name = 1;
+ il_cfg->policy.vkbd.match.title = 1;
+ il_cfg->policy.vkbd.match.win_type = 0;
+ il_cfg->policy.softkey.class =
+ eina_stringshare_add("Illume-Softkey");
+ il_cfg->policy.softkey.name =
+ eina_stringshare_add("Illume-Softkey");
+ il_cfg->policy.softkey.title =
+ eina_stringshare_add("Illume Softkey");
+ il_cfg->policy.softkey.win_type = ECORE_X_WINDOW_TYPE_DOCK;
+ il_cfg->policy.softkey.match.class = 0;
+ il_cfg->policy.softkey.match.name = 1;
+ il_cfg->policy.softkey.match.title = 1;
+ il_cfg->policy.softkey.match.win_type = 0;
+ il_cfg->policy.home.class =
+ eina_stringshare_add("Illume-Home");
+ il_cfg->policy.home.name =
+ eina_stringshare_add("Illume-Home");
+ il_cfg->policy.home.title =
+ eina_stringshare_add("Illume Home");
+ il_cfg->policy.home.win_type = ECORE_X_WINDOW_TYPE_NORMAL;
+ il_cfg->policy.home.match.class = 0;
+ il_cfg->policy.home.match.name = 1;
+ il_cfg->policy.home.match.title = 1;
+ il_cfg->policy.home.match.win_type = 0;
+ il_cfg->policy.indicator.class =
+ eina_stringshare_add("Illume-Indicator");
+ il_cfg->policy.indicator.name =
+ eina_stringshare_add("Illume-Indicator");
+ il_cfg->policy.indicator.title =
+ eina_stringshare_add("Illume Indicator");
+ il_cfg->policy.indicator.win_type = ECORE_X_WINDOW_TYPE_DOCK;
+ il_cfg->policy.indicator.match.class = 0;
+ il_cfg->policy.indicator.match.name = 1;
+ il_cfg->policy.indicator.match.title = 1;
+ il_cfg->policy.indicator.match.win_type = 0;
+ il_cfg->policy.zones = eina_list_append(il_cfg->policy.zones, cz);
+ }
+ if (il_cfg)
+ {
+ /* Add new config variables here */
+ /* if ((il_cfg->version & 0xffff) < 1) */
+ il_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
+ }
+ il_cfg->mod_dir = eina_stringshare_add(m->dir);
+
+ e_configure_registry_category_add("illume", 0, _("Illume"),
+ NULL, "enlightenment/display");
+ e_configure_registry_generic_item_add("illume/animation", 0, _("Animation"),
+ NULL, "enlightenment/animation",
+ il_config_animation_show);
+ e_configure_registry_generic_item_add("illume/policy", 0, _("Policy"),
+ NULL, "enlightenment/policy",
+ il_config_policy_show);
+ e_configure_registry_generic_item_add("illume/windows", 0, _("Windows"),
+ NULL, "enlightenment/windows",
+ il_config_windows_show);
+
+ return 1;
+}
+
+int
+e_mod_config_shutdown(void)
+{
+ E_Illume_Config_Zone *cz;
+
+ e_configure_registry_item_del("illume/windows");
+ e_configure_registry_item_del("illume/policy");
+ e_configure_registry_item_del("illume/animation");
+ e_configure_registry_category_del("illume");
+
+ if (il_cfg->mod_dir) eina_stringshare_del(il_cfg->mod_dir);
+ il_cfg->mod_dir = NULL;
+
+ if (il_cfg->policy.name) eina_stringshare_del(il_cfg->policy.name);
+
+ if (il_cfg->policy.vkbd.class)
+ eina_stringshare_del(il_cfg->policy.vkbd.class);
+ if (il_cfg->policy.vkbd.name)
+ eina_stringshare_del(il_cfg->policy.vkbd.name);
+ if (il_cfg->policy.vkbd.title)
+ eina_stringshare_del(il_cfg->policy.vkbd.title);
+
+ if (il_cfg->policy.softkey.class)
+ eina_stringshare_del(il_cfg->policy.softkey.class);
+ if (il_cfg->policy.softkey.name)
+ eina_stringshare_del(il_cfg->policy.softkey.name);
+ if (il_cfg->policy.softkey.title)
+ eina_stringshare_del(il_cfg->policy.softkey.title);
+
+ if (il_cfg->policy.home.class)
+ eina_stringshare_del(il_cfg->policy.home.class);
+ if (il_cfg->policy.home.name)
+ eina_stringshare_del(il_cfg->policy.home.name);
+ if (il_cfg->policy.home.title)
+ eina_stringshare_del(il_cfg->policy.home.title);
+
+ if (il_cfg->policy.indicator.class)
+ eina_stringshare_del(il_cfg->policy.indicator.class);
+ if (il_cfg->policy.indicator.name)
+ eina_stringshare_del(il_cfg->policy.indicator.name);
+ if (il_cfg->policy.indicator.title)
+ eina_stringshare_del(il_cfg->policy.indicator.title);
+
+ EINA_LIST_FREE(il_cfg->policy.zones, cz)
+ E_FREE(cz);
+
+ E_FREE(il_cfg);
+ il_cfg = NULL;
+
+ E_CONFIG_DD_FREE(conf_zone_edd);
+ E_CONFIG_DD_FREE(conf_edd);
+
+ return 1;
+}
+
+int
+e_mod_config_save(void)
+{
+ e_config_domain_save("module.illume2", conf_edd, il_cfg);
+ return 1;
+}
+
+EAPI E_Illume_Config_Zone *
+e_illume_zone_config_get(int id)
+{
+ Eina_List *l;
+ E_Illume_Config_Zone *cz = NULL;
+
+ EINA_LIST_FOREACH(il_cfg->policy.zones, l, cz)
+ {
+ if (cz->id != id) continue;
+ return cz;
+ }
+
+ /* didn't find any existing config. Create new one as fallback */
+ cz = E_NEW(E_Illume_Config_Zone, 1);
+ cz->id = id;
+ cz->mode.dual = 0;
+ cz->mode.side = 0;
+ il_cfg->policy.zones = eina_list_append(il_cfg->policy.zones, cz);
+ e_mod_config_save();
+}
diff --git a/src/modules/illume2/e_mod_config.h b/src/modules/illume2/e_mod_config.h
new file mode 100644
index 000000000..062f95e17
--- /dev/null
+++ b/src/modules/illume2/e_mod_config.h
@@ -0,0 +1,11 @@
+#ifndef E_MOD_CONFIG_H
+# define E_MOD_CONFIG_H
+
+# define IL_CONFIG_MIN 1
+# define IL_CONFIG_MAJ 0
+
+int e_mod_config_init(E_Module *m);
+int e_mod_config_shutdown(void);
+int e_mod_config_save(void);
+
+#endif
diff --git a/src/modules/illume2/e_mod_layout.c b/src/modules/illume2/e_mod_layout.c
new file mode 100644
index 000000000..2a58509b4
--- /dev/null
+++ b/src/modules/illume2/e_mod_layout.c
@@ -0,0 +1,536 @@
+#include "E_Illume.h"
+#include "e_mod_layout.h"
+#include "e_mod_main.h" // For logging functions
+
+/* local function prototypes */
+static const char *_e_mod_layout_policy_find(void);
+static int _e_mod_layout_policy_load(const char *dir);
+static void _e_mod_layout_policy_free(E_Illume_Layout_Policy *p);
+static void _e_mod_layout_hooks_add(void);
+static void _e_mod_layout_handlers_add(void);
+static void _e_mod_layout_cb_hook_post_fetch(void *data, void *data2);
+static void _e_mod_layout_cb_hook_post_assign(void *data, void *data2);
+static void _e_mod_layout_cb_hook_layout(void *data, void *data2);
+static int _e_mod_layout_cb_policy_change(void *data, int type, void *event);
+static int _e_mod_layout_cb_border_add(void *data, int type, void *event);
+static int _e_mod_layout_cb_border_del(void *data, int type, void *event);
+static int _e_mod_layout_cb_border_focus_in(void *data, int type, void *event);
+static int _e_mod_layout_cb_border_focus_out(void *data, int type, void *event);
+static int _e_mod_layout_cb_zone_move_resize(void *data, int type, void *event);
+static int _e_mod_layout_cb_client_message(void *data, int type, void *event);
+
+/* local variables */
+static E_Illume_Layout_Policy *policy = NULL;
+static Eina_List *hooks = NULL, *handlers = NULL;
+
+/* public variables */
+EAPI int E_ILLUME_EVENT_POLICY_CHANGE = 0;
+
+int
+e_mod_layout_init(void)
+{
+ const char *file;
+
+ /* find the policy specified in config */
+ file = _e_mod_layout_policy_find();
+ if (!file) return 0;
+
+ /* try to load the policy */
+ if (!_e_mod_layout_policy_load(file)) return 0;
+
+ /* add our border hooks */
+ _e_mod_layout_hooks_add();
+
+ /* add our event handlers */
+ _e_mod_layout_handlers_add();
+
+ E_ILLUME_EVENT_POLICY_CHANGE = ecore_event_type_new();
+
+ return 1;
+}
+
+int
+e_mod_layout_shutdown(void)
+{
+ Ecore_Event_Handler *handler;
+ E_Border_Hook *hook;
+
+ E_ILLUME_EVENT_POLICY_CHANGE = 0;
+
+ /* remove the ecore event handlers */
+ EINA_LIST_FREE(handlers, handler)
+ ecore_event_handler_del(handler);
+
+ /* remove the border hooks */
+ EINA_LIST_FREE(hooks, hook)
+ e_border_hook_del(hook);
+
+ /* destroy the policy if it exists */
+ if (policy) e_object_del(E_OBJECT(policy));
+ policy = NULL;
+
+ return 1;
+}
+
+EAPI Eina_List *
+e_illume_layout_policies_get(void)
+{
+ Eina_List *l = NULL, *files;
+ char dir[PATH_MAX], *file;
+
+ snprintf(dir, sizeof(dir), "%s/enlightenment/modules/illume2/policies",
+ e_prefix_lib_get());
+
+ files = ecore_file_ls(dir);
+ EINA_LIST_FREE(files, file)
+ {
+ E_Illume_Layout_Policy *p;
+
+ if (!strstr(file, ".so")) continue;
+ snprintf(dir, sizeof(dir),
+ "%s/enlightenment/modules/illume2/policies/%s",
+ e_prefix_lib_get(), file);
+
+ p =
+ E_OBJECT_ALLOC(E_Illume_Layout_Policy, E_ILLUME_LAYOUT_POLICY_TYPE,
+ _e_mod_layout_policy_free);
+
+ p->handle = dlopen(dir, RTLD_NOW | RTLD_GLOBAL);
+ if (!p->handle)
+ {
+ E_ILLUME_ERR("Error opening policy: %s", file);
+ e_object_del(E_OBJECT(p));
+ p = NULL;
+ continue;
+ }
+ p->api = dlsym(p->handle, "e_layapi");
+ if (!p->api)
+ {
+ E_ILLUME_ERR("Policy does not support needed functions: %s", file);
+ e_object_del(E_OBJECT(p));
+ p = NULL;
+ continue;
+ }
+ if (p->api->version < E_ILLUME_LAYOUT_API_VERSION)
+ {
+ E_ILLUME_ERR("Policy is too old: %s", file);
+ e_object_del(E_OBJECT(p));
+ p = NULL;
+ continue;
+ }
+ l = eina_list_append(l, p);
+ }
+
+ return l;
+}
+
+/* local functions */
+static const char *
+_e_mod_layout_policy_find(void)
+{
+ Eina_List *files;
+ char buff[PATH_MAX], dir[PATH_MAX], *file;
+
+ snprintf(buff, sizeof(buff), "%s.so", il_cfg->policy.name);
+ snprintf(dir, sizeof(dir), "%s/enlightenment/modules/illume2/policies",
+ e_prefix_lib_get());
+
+ /* get all files in this directory */
+ files = ecore_file_ls(dir);
+
+ /* loop through the files, searching for this policy */
+ EINA_LIST_FREE(files, file)
+ {
+ /* compare file with needed .so */
+ if (!strcmp(file, buff))
+ {
+ snprintf(dir, sizeof(dir),
+ "%s/enlightenment/modules/illume2/policies/%s",
+ e_prefix_lib_get(), file);
+ break;
+ }
+ free(file);
+ }
+ if (file) free(file);
+ else
+ {
+ /* if we did not find the policy, use a fallback */
+ snprintf(dir, sizeof(dir),
+ "%s/enlightenment/modules/illume2/policies/illume.so",
+ e_prefix_lib_get());
+ }
+ return strdup(dir);
+}
+
+static int
+_e_mod_layout_policy_load(const char *dir)
+{
+ if (!dir) return 0;
+
+ /* delete existing policy first */
+ if (policy) e_object_del(E_OBJECT(policy));
+ policy = NULL;
+
+ /* create new policy object */
+ policy =
+ E_OBJECT_ALLOC(E_Illume_Layout_Policy, E_ILLUME_LAYOUT_POLICY_TYPE,
+ _e_mod_layout_policy_free);
+
+ /* attempt to open .so */
+ policy->handle = dlopen(dir, RTLD_NOW | RTLD_GLOBAL);
+ if (!policy->handle)
+ {
+ /* open failed, bail out */
+ E_ILLUME_ERR("Error Opening Policy: %s", dir);
+ e_object_del(E_OBJECT(policy));
+ policy = NULL;
+ return 0;
+ }
+
+ /* try to link to the needed policy api functions */
+ policy->api = dlsym(policy->handle, "e_layapi");
+ policy->funcs.init = dlsym(policy->handle, "e_layapi_init");
+ policy->funcs.shutdown = dlsym(policy->handle, "e_layapi_shutdown");
+
+ /* check the policy supports needed api functions */
+ if ((!policy->api) || (!policy->funcs.init) || (!policy->funcs.shutdown))
+ {
+ /* policy doesn't support what we need, bail out */
+ E_ILLUME_ERR("Policy does not support needed functions: %s", dir);
+ e_object_del(E_OBJECT(policy));
+ policy = NULL;
+ return 0;
+ }
+
+ /* check policy api version */
+ if (policy->api->version < E_ILLUME_LAYOUT_API_VERSION)
+ {
+ E_ILLUME_ERR("Policy is too old: %s", dir);
+ e_object_del(E_OBJECT(policy));
+ policy = NULL;
+ return 0;
+ }
+
+ /* initialize the policy */
+ policy->funcs.init(policy);
+
+ return 1;
+}
+
+static void
+_e_mod_layout_policy_free(E_Illume_Layout_Policy *p)
+{
+ /* call the policy shutdown function if we can */
+ if (p->funcs.shutdown) p->funcs.shutdown(p);
+
+ p->funcs.shutdown = NULL;
+ p->funcs.init = NULL;
+ p->api = NULL;
+
+ /* close the linked .so */
+ if (p->handle) dlclose(p->handle);
+ p->handle = NULL;
+
+ E_FREE(p);
+}
+
+static void
+_e_mod_layout_hooks_add(void)
+{
+ hooks =
+ eina_list_append(hooks,
+ e_border_hook_add(E_BORDER_HOOK_EVAL_POST_FETCH,
+ _e_mod_layout_cb_hook_post_fetch, NULL));
+ hooks =
+ eina_list_append(hooks,
+ e_border_hook_add(E_BORDER_HOOK_EVAL_POST_BORDER_ASSIGN,
+ _e_mod_layout_cb_hook_post_assign, NULL));
+ hooks =
+ eina_list_append(hooks,
+ e_border_hook_add(E_BORDER_HOOK_CONTAINER_LAYOUT,
+ _e_mod_layout_cb_hook_layout, NULL));
+}
+
+static void
+_e_mod_layout_handlers_add(void)
+{
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_ILLUME_EVENT_POLICY_CHANGE,
+ _e_mod_layout_cb_policy_change,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_ADD,
+ _e_mod_layout_cb_border_add,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_REMOVE,
+ _e_mod_layout_cb_border_del,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN,
+ _e_mod_layout_cb_border_focus_in,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT,
+ _e_mod_layout_cb_border_focus_out,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
+ _e_mod_layout_cb_zone_move_resize,
+ NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
+ _e_mod_layout_cb_client_message,
+ NULL));
+}
+
+static void
+_e_mod_layout_cb_hook_post_fetch(void *data, void *data2)
+{
+ E_Border *bd;
+
+ if (!(bd = data2)) return;
+ if ((bd->stolen) || (!bd->new_client)) return;
+ if (bd->remember)
+ {
+ if (bd->bordername)
+ {
+ eina_stringshare_del(bd->bordername);
+ bd->bordername = NULL;
+ }
+ e_remember_unuse(bd->remember);
+ bd->remember = NULL;
+ }
+ eina_stringshare_replace(&bd->bordername, "borderless");
+ bd->client.border.changed = 1;
+}
+
+static void
+_e_mod_layout_cb_hook_post_assign(void *data, void *data2)
+{
+ E_Border *bd;
+
+ if (!(bd = data2)) return;
+ if (bd->stolen) return;
+ bd->lock_client_shade = 1;
+ bd->lock_client_maximize = 1;
+}
+
+static void
+_e_mod_layout_cb_hook_layout(void *data, void *data2)
+{
+ E_Container *con;
+ E_Zone *zone;
+ Eina_List *l;
+
+ if (!(con = data2)) return;
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ {
+ if ((policy) && (policy->funcs.zone_layout))
+ policy->funcs.zone_layout(zone);
+ }
+}
+
+static int
+_e_mod_layout_cb_policy_change(void *data, int type, void *event)
+{
+ const char *file;
+
+ if (type != E_ILLUME_EVENT_POLICY_CHANGE) return 1;
+
+ if (policy) e_object_del(E_OBJECT(policy));
+ policy = NULL;
+
+ /* find the policy specified in config */
+ file = _e_mod_layout_policy_find();
+ if (!file) return 1;
+
+ /* try to load the policy */
+ if (!_e_mod_layout_policy_load(file)) return 1;
+
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_border_add(void *data, int type, void *event)
+{
+ E_Event_Border_Add *ev;
+
+ ev = event;
+ if (ev->border->stolen) return 1;
+ if ((policy) && (policy->funcs.border_add))
+ policy->funcs.border_add(ev->border);
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_border_del(void *data, int type, void *event)
+{
+ E_Event_Border_Remove *ev;
+
+ ev = event;
+ if (ev->border->stolen) return 1;
+ if ((policy) && (policy->funcs.border_del))
+ policy->funcs.border_del(ev->border);
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_border_focus_in(void *data, int type, void *event)
+{
+ E_Event_Border_Focus_In *ev;
+
+ ev = event;
+ if (ev->border->stolen) return 1;
+ if ((policy) && (policy->funcs.border_focus_in))
+ policy->funcs.border_focus_in(ev->border);
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_border_focus_out(void *data, int type, void *event)
+{
+ E_Event_Border_Focus_Out *ev;
+
+ ev = event;
+ if (ev->border->stolen) return 1;
+ if ((policy) && (policy->funcs.border_focus_out))
+ policy->funcs.border_focus_out(ev->border);
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_zone_move_resize(void *data, int type, void *event)
+{
+ E_Event_Zone_Move_Resize *ev;
+
+ ev = event;
+ if ((policy) && (policy->funcs.zone_move_resize))
+ policy->funcs.zone_move_resize(ev->zone);
+ return 1;
+}
+
+static int
+_e_mod_layout_cb_client_message(void *data, int type, void *event)
+{
+ Ecore_X_Event_Client_Message *ev;
+
+ ev = event;
+ if (ev->message_type == ECORE_X_ATOM_NET_ACTIVE_WINDOW)
+ {
+ E_Border *bd;
+
+ bd = e_border_find_by_client_window(ev->win);
+ if ((!bd) || (bd->stolen)) return 1;
+ if ((policy) && (policy->funcs.border_activate))
+ policy->funcs.border_activate(bd);
+ }
+ else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_MODE)
+ {
+ E_Border *bd;
+ E_Container *con;
+ E_Zone *zone;
+ Eina_List *l;
+ int lock = 1;
+
+ con = e_container_current_get(e_manager_current_get());
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ {
+ if (zone->black_win == ev->win)
+ {
+ E_Illume_Config_Zone *cz;
+
+ cz = e_illume_zone_config_get(zone->id);
+ if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)
+ cz->mode.dual = 0;
+ else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP)
+ {
+ if (e_illume_border_valid_count_get(zone) < 2)
+ ecore_x_e_illume_home_send(zone->black_win);
+ cz->mode.dual = 1;
+ cz->mode.side = 0;
+ lock = 0;
+ }
+ else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT)
+ {
+ if (e_illume_border_valid_count_get(zone) < 2)
+ ecore_x_e_illume_home_send(zone->black_win);
+ cz->mode.dual = 1;
+ cz->mode.side = 1;
+ }
+ else
+ cz->mode.dual = 0;
+ e_config_save_queue();
+
+ bd = e_illume_border_top_shelf_get(zone);
+ if (bd)
+ ecore_x_e_illume_drag_locked_set(bd->client.win, lock);
+ bd = e_illume_border_bottom_panel_get(zone);
+ if (bd)
+ ecore_x_e_illume_drag_locked_set(bd->client.win, lock);
+ break;
+ }
+ }
+ }
+ else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_BACK)
+ {
+ E_Border *bd, *fbd;
+ Eina_List *focused, *l;
+
+ if (!(bd = e_border_focused_get())) return 1;
+ focused = e_border_focus_stack_get();
+ EINA_LIST_REVERSE_FOREACH(focused, l, fbd)
+ {
+ E_Border *fb;
+
+ if (e_object_is_del(E_OBJECT(fbd))) continue;
+ if ((!fbd->client.icccm.accepts_focus) &&
+ (!fbd->client.icccm.take_focus)) continue;
+ if (fbd->client.netwm.state.skip_taskbar) continue;
+ if (fbd == bd)
+ {
+ if (!(fb = focused->next->data)) continue;
+ if (e_object_is_del(E_OBJECT(fb))) continue;
+ if ((!fb->client.icccm.accepts_focus) &&
+ (!fb->client.icccm.take_focus)) continue;
+ if (fb->client.netwm.state.skip_taskbar) continue;
+ e_border_raise(fb);
+ e_border_focus_set(fb, 1, 1);
+ break;
+ }
+ }
+ }
+ else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_CLOSE)
+ {
+ E_Border *bd;
+
+ if (!(bd = e_border_focused_get())) return 1;
+ e_border_act_close_begin(bd);
+ }
+ else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_DRAG_START)
+ {
+ E_Border *bd;
+
+ bd = e_border_find_by_client_window(ev->win);
+ if ((!bd) || (bd->stolen)) return 1;
+ if ((policy) && (policy->funcs.drag_start))
+ policy->funcs.drag_start(bd);
+ }
+ else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_DRAG_END)
+ {
+ E_Border *bd;
+
+ bd = e_border_find_by_client_window(ev->win);
+ if ((!bd) || (bd->stolen)) return 1;
+ if ((policy) && (policy->funcs.drag_end))
+ policy->funcs.drag_end(bd);
+ }
+ return 1;
+}
diff --git a/src/modules/illume2/e_mod_layout.h b/src/modules/illume2/e_mod_layout.h
new file mode 100644
index 000000000..4d1858631
--- /dev/null
+++ b/src/modules/illume2/e_mod_layout.h
@@ -0,0 +1,7 @@
+#ifndef E_MOD_LAYOUT_H
+# define E_MOD_LAYOUT_H
+
+int e_mod_layout_init(void);
+int e_mod_layout_shutdown(void);
+
+#endif
diff --git a/src/modules/illume2/e_mod_main.c b/src/modules/illume2/e_mod_main.c
new file mode 100644
index 000000000..b0fa67167
--- /dev/null
+++ b/src/modules/illume2/e_mod_main.c
@@ -0,0 +1,132 @@
+#include "E_Illume.h"
+#include "e_mod_main.h"
+#include "e_mod_config.h"
+#include "e_mod_layout.h"
+#include "e_kbd.h"
+#include "e_quickpanel.h"
+
+/* local variabels */
+static E_Kbd *kbd = NULL;
+static Eina_List *quickpanels = NULL;
+int _e_illume_log_dom = -1;
+
+EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume2" };
+
+EAPI void *
+e_modapi_init(E_Module *m)
+{
+ E_Container *con;
+ E_Zone *zone;
+ Eina_List *l;
+
+ /* setup eina logging */
+ if (_e_illume_log_dom < 0)
+ {
+ _e_illume_log_dom =
+ eina_log_domain_register("illume2", E_ILLUME_DEFAULT_LOG_COLOR);
+ if (_e_illume_log_dom < 0)
+ {
+ EINA_LOG_CRIT("Could not register illume2 logging domain");
+ return NULL;
+ }
+ }
+
+ /* set module priority */
+ e_module_priority_set(m, 100);
+
+ /* initialize the config subsystem */
+ if (!e_mod_config_init(m))
+ {
+ /* cleanup eina logging */
+ if (_e_illume_log_dom > 0)
+ {
+ eina_log_domain_unregister(_e_illume_log_dom);
+ _e_illume_log_dom = -1;
+ }
+ return NULL;
+ }
+
+ con = e_container_current_get(e_manager_current_get());
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ {
+ E_Illume_Config_Zone *cz;
+
+ cz = e_illume_zone_config_get(zone->id);
+ if (cz->mode.dual == 0)
+ ecore_x_e_illume_mode_set(zone->black_win,
+ ECORE_X_ILLUME_MODE_SINGLE);
+ else
+ {
+ if (cz->mode.side == 0)
+ ecore_x_e_illume_mode_set(zone->black_win,
+ ECORE_X_ILLUME_MODE_DUAL_TOP);
+ else
+ ecore_x_e_illume_mode_set(zone->black_win,
+ ECORE_X_ILLUME_MODE_DUAL_LEFT);
+ }
+ }
+
+ /* initialize the keyboard subsystem */
+ e_kbd_init();
+
+ /* initialize the quickpanel subsystem */
+ e_quickpanel_init();
+
+ /* initialize the layout subsystem */
+ e_mod_layout_init();
+
+ /* create a new vkbd */
+ kbd = e_kbd_new();
+
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ {
+ E_Quickpanel *qp;
+
+ /* create a new quickpanel */
+ if (!(qp = e_quickpanel_new(zone))) continue;
+ quickpanels = eina_list_append(quickpanels, qp);
+ }
+
+ return m;
+}
+
+EAPI int
+e_modapi_shutdown(E_Module *m)
+{
+ E_Quickpanel *qp;
+
+ /* cleanup the quickpanels */
+ EINA_LIST_FREE(quickpanels, qp)
+ e_object_del(E_OBJECT(qp));
+
+ /* cleanup the keyboard */
+ e_object_del(E_OBJECT(kbd));
+ kbd = NULL;
+
+ /* shutdown the quickpanel subsystem */
+ e_quickpanel_shutdown();
+
+ /* shutdown the keyboard subsystem */
+ e_kbd_shutdown();
+
+ /* shutdown the layout subsystem */
+ e_mod_layout_shutdown();
+
+ /* shutdown the config subsystem */
+ e_mod_config_shutdown();
+
+ /* cleanup eina logging */
+ if (_e_illume_log_dom > 0)
+ {
+ eina_log_domain_unregister(_e_illume_log_dom);
+ _e_illume_log_dom = -1;
+ }
+
+ return 1;
+}
+
+EAPI int
+e_modapi_save(E_Module *m)
+{
+ return e_mod_config_save();
+}
diff --git a/src/modules/illume2/e_mod_main.h b/src/modules/illume2/e_mod_main.h
new file mode 100644
index 000000000..fae48ff52
--- /dev/null
+++ b/src/modules/illume2/e_mod_main.h
@@ -0,0 +1,36 @@
+#ifndef E_MOD_MAIN_H
+# define E_MOD_MAIN_H
+
+# ifdef E_ILLUME_DEFAULT_LOG_COLOR
+# undef E_ILLUME_DEFAULT_LOG_COLOR
+# endif
+# define E_ILLUME_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
+
+extern int _e_illume_log_dom;
+# ifdef E_ILLUME_ERR
+# undef E_ILLUME_ERR
+# endif
+# define E_ILLUME_ERR(...) EINA_LOG_DOM_ERR(_e_illume_log_dom, __VA_ARGS__)
+
+# ifdef E_ILLUME_INF
+# undef E_ILLUME_INF
+# endif
+# define E_ILLUME_INF(...) EINA_LOG_DOM_INFO(_e_illume_log_dom, __VA_ARGS__)
+
+# ifdef E_ILLUME_CRIT
+# undef E_ILLUME_CRIT
+# endif
+# define E_ILLUME_CRIT(...) EINA_LOG_DOM_INFO(_e_illume_log_dom, __VA_ARGS__)
+
+# ifdef E_ILLUME_WARN
+# undef E_ILLUME_WARN
+# endif
+# define E_ILLUME_WARN(...) EINA_LOG_DOM_WARN(_e_illume_log_dom, __VA_ARGS__)
+
+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/modules/illume2/e_mod_policy.c b/src/modules/illume2/e_mod_policy.c
new file mode 100644
index 000000000..b86747f11
--- /dev/null
+++ b/src/modules/illume2/e_mod_policy.c
@@ -0,0 +1,113 @@
+#include "E_Illume.h"
+#include "e_mod_policy.h"
+
+/* local function prototypes */
+static void *_il_config_policy_create(E_Config_Dialog *cfd);
+static void _il_config_policy_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_il_config_policy_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static void _il_config_policy_list_changed(void *data);
+static int _il_config_policy_change_timeout(void *data);
+static Evas_Object *_il_config_policy_settings_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+
+/* local variables */
+Ecore_Timer *_policy_change_timer = NULL;
+const char *_policy_name = NULL;
+
+void
+il_config_policy_show(E_Container *con, const char *params)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_illume_policy")) return;
+ v = E_NEW(E_Config_Dialog_View, 1);
+ v->create_cfdata = _il_config_policy_create;
+ v->free_cfdata = _il_config_policy_free;
+ v->basic.create_widgets = _il_config_policy_ui;
+ v->basic_only = 1;
+ v->normal_win = 1;
+ v->scroll = 1;
+ cfd = e_config_dialog_new(con, _("Policy"), "E",
+ "_config_illume_policy",
+ "enlightenment/policy", 0, v, NULL);
+ e_dialog_resizable_set(cfd->dia, 1);
+}
+
+/* local functions */
+static void *
+_il_config_policy_create(E_Config_Dialog *cfd)
+{
+ return NULL;
+}
+
+static void
+_il_config_policy_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ if (_policy_change_timer) ecore_timer_del(_policy_change_timer);
+ _policy_change_timer = NULL;
+}
+
+static Evas_Object *
+_il_config_policy_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *list, *ow;
+ Eina_List *policies;
+ E_Illume_Layout_Policy *p;
+ int i = 0, sel = 0;
+
+ list = e_widget_list_add(evas, 0, 0);
+ ow = e_widget_ilist_add(evas, 24, 24, &(_policy_name));
+ e_widget_ilist_selector_set(ow, 1);
+ evas_event_freeze(evas);
+ edje_freeze();
+ e_widget_ilist_freeze(ow);
+ e_widget_ilist_clear(ow);
+ e_widget_ilist_go(ow);
+
+ policies = e_illume_layout_policies_get();
+ EINA_LIST_FREE(policies, p)
+ {
+ e_widget_ilist_append(ow, NULL, strdup(p->api->label),
+ _il_config_policy_list_changed, NULL,
+ strdup(p->api->name));
+
+ if ((p) && (il_cfg->policy.name) &&
+ (!strcmp(il_cfg->policy.name, p->api->name)))
+ sel = i;
+
+ if (p)
+ {
+ e_object_del(E_OBJECT(p));
+ p = NULL;
+ }
+ i++;
+ }
+
+ e_widget_size_min_set(ow, 100, 200);
+ e_widget_ilist_go(ow);
+ e_widget_ilist_selected_set(ow, sel);
+ e_widget_ilist_thaw(ow);
+ edje_thaw();
+ evas_event_thaw(evas);
+ e_widget_list_object_append(list, ow, 1, 0, 0.0);
+ return list;
+}
+
+static void
+_il_config_policy_list_changed(void *data)
+{
+ if (il_cfg->policy.name) eina_stringshare_del(il_cfg->policy.name);
+ if (_policy_name) il_cfg->policy.name = eina_stringshare_add(_policy_name);
+ if (_policy_change_timer) ecore_timer_del(_policy_change_timer);
+ _policy_change_timer =
+ ecore_timer_add(0.5, _il_config_policy_change_timeout, data);
+}
+
+static int
+_il_config_policy_change_timeout(void *data)
+{
+ e_config_save_queue();
+ _policy_change_timer = NULL;
+ ecore_event_add(E_ILLUME_EVENT_POLICY_CHANGE, NULL, NULL, NULL);
+ return 0;
+}
diff --git a/src/modules/illume2/e_mod_policy.h b/src/modules/illume2/e_mod_policy.h
new file mode 100644
index 000000000..606f3da40
--- /dev/null
+++ b/src/modules/illume2/e_mod_policy.h
@@ -0,0 +1,6 @@
+#ifndef E_MOD_POLICY_H
+#define E_MOD_POLICY_H
+
+void il_config_policy_show(E_Container *con, const char *params);
+
+#endif
diff --git a/src/modules/illume2/e_mod_policy_settings.c b/src/modules/illume2/e_mod_policy_settings.c
new file mode 100644
index 000000000..d3ce29836
--- /dev/null
+++ b/src/modules/illume2/e_mod_policy_settings.c
@@ -0,0 +1,120 @@
+#include "E_Illume.h"
+#include "e_mod_policy_settings.h"
+
+/* local function prototypes */
+static void *_il_config_policy_settings_create(E_Config_Dialog *cfd);
+static void _il_config_policy_settings_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_il_config_policy_settings_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static void _il_config_policy_settings_changed(void *data, Evas_Object *obj, void *event);
+static int _il_config_policy_settings_change_timeout(void *data);
+
+/* local variables */
+Ecore_Timer *_ps_change_timer = NULL;
+Evas_Object *otop, *oleft;
+
+void
+il_config_policy_settings_show(E_Container *con, const char *params)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_illume_policy_settings")) return;
+ v = E_NEW(E_Config_Dialog_View, 1);
+ v->create_cfdata = _il_config_policy_settings_create;
+ v->free_cfdata = _il_config_policy_settings_free;
+ v->basic.create_widgets = _il_config_policy_settings_ui;
+ v->basic_only = 1;
+ v->normal_win = 1;
+ v->scroll = 1;
+ cfd = e_config_dialog_new(con, _("Policy Settings"), "E",
+ "_config_illume_policy_settings",
+ "enlightenment/policy_settings", 0, v, NULL);
+ e_dialog_resizable_set(cfd->dia, 1);
+}
+
+/* local function prototypes */
+static void *
+_il_config_policy_settings_create(E_Config_Dialog *cfd)
+{
+ return NULL;
+}
+
+static void
+_il_config_policy_settings_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ if (_ps_change_timer) ecore_timer_del(_ps_change_timer);
+}
+
+static Evas_Object *
+_il_config_policy_settings_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *list, *of, *ow;
+ E_Radio_Group *rg;
+
+ list = e_widget_list_add(evas, 0, 0);
+ of = e_widget_framelist_add(evas, _("Mode"), 0);
+ rg = e_widget_radio_group_new(&(il_cfg->policy.mode.dual));
+ ow = e_widget_radio_add(evas, _("Single App Mode"), 0, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_policy_settings_changed, NULL);
+ ow = e_widget_radio_add(evas, _("Dual App Mode"), 1, rg);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_policy_settings_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ of = e_widget_framelist_add(evas, _("Window Layout"), 0);
+ rg = e_widget_radio_group_new(&(il_cfg->policy.mode.side));
+ otop = e_widget_radio_add(evas, _("Top/Bottom"), 0, rg);
+ e_widget_framelist_object_append(of, otop);
+ evas_object_smart_callback_add(otop, "changed",
+ _il_config_policy_settings_changed, NULL);
+ oleft = e_widget_radio_add(evas, _("Left/Right"), 1, rg);
+ e_widget_framelist_object_append(of, oleft);
+ evas_object_smart_callback_add(oleft, "changed",
+ _il_config_policy_settings_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ e_widget_disabled_set(otop, !il_cfg->policy.mode.dual);
+ e_widget_disabled_set(oleft, !il_cfg->policy.mode.dual);
+
+ return list;
+}
+
+static void
+_il_config_policy_settings_changed(void *data, Evas_Object *obj, void *event)
+{
+ e_widget_disabled_set(otop, !il_cfg->policy.mode.dual);
+ e_widget_disabled_set(oleft, !il_cfg->policy.mode.dual);
+
+ if (_ps_change_timer) ecore_timer_del(_ps_change_timer);
+ _ps_change_timer =
+ ecore_timer_add(0.5, _il_config_policy_settings_change_timeout, data);
+}
+
+static int
+_il_config_policy_settings_change_timeout(void *data)
+{
+ Ecore_X_Window xwin;
+ Ecore_X_Illume_Mode mode;
+
+ e_config_save_queue();
+ _ps_change_timer = NULL;
+
+ if (il_cfg->policy.mode.dual)
+ {
+ if (il_cfg->policy.mode.side == 0)
+ mode = ECORE_X_ILLUME_MODE_DUAL_TOP;
+ else
+ mode = ECORE_X_ILLUME_MODE_DUAL_LEFT;
+ }
+ else
+ mode = ECORE_X_ILLUME_MODE_SINGLE;
+
+ xwin = ecore_x_window_root_first_get();
+ ecore_x_e_illume_mode_set(xwin, mode);
+ ecore_x_e_illume_mode_send(xwin, mode);
+
+ return 0;
+}
diff --git a/src/modules/illume2/e_mod_policy_settings.h b/src/modules/illume2/e_mod_policy_settings.h
new file mode 100644
index 000000000..ab7c61544
--- /dev/null
+++ b/src/modules/illume2/e_mod_policy_settings.h
@@ -0,0 +1,6 @@
+#ifndef E_MOD_POLICY_SETTINGS_H
+# define E_MOD_POLICY_SETTINGS_H
+
+void il_config_policy_settings_show(E_Container *con, const char *params);
+
+#endif
diff --git a/src/modules/illume2/e_mod_select_window.c b/src/modules/illume2/e_mod_select_window.c
new file mode 100644
index 000000000..5e35741ab
--- /dev/null
+++ b/src/modules/illume2/e_mod_select_window.c
@@ -0,0 +1,269 @@
+#include "E_Illume.h"
+#include "e_mod_select_window.h"
+
+/* local function prototypes */
+static void *_il_config_select_window_create_data(E_Config_Dialog *cfd);
+static void _il_config_select_window_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_il_config_select_window_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static void _il_config_select_window_list_changed(void *data);
+static int _il_config_select_window_change_timeout(void *data);
+static int _il_config_select_window_match(E_Border *bd);
+
+/* local variables */
+Il_Select_Window_Type stype;
+Ecore_Timer *_sw_change_timer = NULL;
+
+/* public functions */
+void
+il_config_select_window(Il_Select_Window_Type type)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_illume_select_window")) return;
+ stype = type;
+ v = E_NEW(E_Config_Dialog_View, 1);
+ v->create_cfdata = _il_config_select_window_create_data;
+ v->free_cfdata = _il_config_select_window_free_data;
+ v->basic.create_widgets = _il_config_select_window_create;
+ v->basic_only = 1;
+ v->normal_win = 1;
+ v->scroll = 1;
+ cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
+ _("Select Home Window"), "E",
+ "_config_illume_select_window",
+ "enlightenment/windows", 0, v, NULL);
+ e_dialog_resizable_set(cfd->dia, 1);
+}
+
+static void *
+_il_config_select_window_create_data(E_Config_Dialog *cfd)
+{
+ return NULL;
+}
+
+static void
+_il_config_select_window_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+
+}
+
+static Evas_Object *
+_il_config_select_window_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *list, *ow;
+ Eina_List *bds, *l;
+ int i = 0, sel = -1;
+
+ list = e_widget_list_add(evas, 0, 0);
+ ow = e_widget_ilist_add(evas, 24, 24, NULL);
+ e_widget_ilist_selector_set(ow, 1);
+ evas_event_freeze(evas);
+ edje_freeze();
+ e_widget_ilist_freeze(ow);
+ e_widget_ilist_clear(ow);
+ e_widget_ilist_go(ow);
+
+ bds = e_border_client_list();
+ for (i = 0, l = bds; l; l = l->next, i++)
+ {
+ E_Border *bd;
+ const char *name;
+
+ if (!(bd = l->data)) continue;
+ if (e_object_is_del(E_OBJECT(bd))) continue;
+ if (_il_config_select_window_match(bd)) sel = i;
+ name = e_border_name_get(bd);
+ e_widget_ilist_append(ow, NULL, name,
+ _il_config_select_window_list_changed,
+ bd, name);
+ }
+ e_widget_size_min_set(ow, 100, 200);
+ e_widget_ilist_go(ow);
+ if (sel >= 0) e_widget_ilist_selected_set(ow, sel);
+ e_widget_ilist_thaw(ow);
+ edje_thaw();
+ evas_event_thaw(evas);
+ e_widget_list_object_append(list, ow, 1, 0, 0.0);
+ return list;
+}
+
+static void
+_il_config_select_window_list_changed(void *data)
+{
+ E_Border *bd;
+ Ecore_X_Window_Type wtype;
+ char *title, *name, *class;
+
+ if (!(bd = data)) return;
+ title = ecore_x_icccm_title_get(bd->client.win);
+ ecore_x_icccm_name_class_get(bd->client.win, &name, &class);
+ ecore_x_netwm_window_type_get(bd->client.win, &wtype);
+
+ switch (stype)
+ {
+ case IL_SELECT_WINDOW_TYPE_HOME:
+ if (il_cfg->policy.home.title)
+ eina_stringshare_del(il_cfg->policy.home.title);
+ if (title) il_cfg->policy.home.title = eina_stringshare_add(title);
+ if (il_cfg->policy.home.class)
+ eina_stringshare_del(il_cfg->policy.home.class);
+ if (class) il_cfg->policy.home.class = eina_stringshare_add(class);
+ if (il_cfg->policy.home.name)
+ eina_stringshare_del(il_cfg->policy.home.name);
+ if (name) il_cfg->policy.home.name = eina_stringshare_add(name);
+ break;
+ case IL_SELECT_WINDOW_TYPE_VKBD:
+ if (il_cfg->policy.vkbd.title)
+ eina_stringshare_del(il_cfg->policy.vkbd.title);
+ if (title) il_cfg->policy.vkbd.title = eina_stringshare_add(title);
+ if (il_cfg->policy.vkbd.class)
+ eina_stringshare_del(il_cfg->policy.vkbd.class);
+ if (class) il_cfg->policy.vkbd.class = eina_stringshare_add(class);
+ if (il_cfg->policy.vkbd.name)
+ eina_stringshare_del(il_cfg->policy.vkbd.name);
+ if (name) il_cfg->policy.vkbd.name = eina_stringshare_add(name);
+ break;
+ case IL_SELECT_WINDOW_TYPE_SOFTKEY:
+ if (il_cfg->policy.softkey.title)
+ eina_stringshare_del(il_cfg->policy.softkey.title);
+ if (title) il_cfg->policy.softkey.title = eina_stringshare_add(title);
+ if (il_cfg->policy.softkey.class)
+ eina_stringshare_del(il_cfg->policy.softkey.class);
+ if (class) il_cfg->policy.softkey.class = eina_stringshare_add(class);
+ if (il_cfg->policy.softkey.name)
+ eina_stringshare_del(il_cfg->policy.softkey.name);
+ if (name) il_cfg->policy.softkey.name = eina_stringshare_add(name);
+ break;
+ case IL_SELECT_WINDOW_TYPE_INDICATOR:
+ if (il_cfg->policy.indicator.title)
+ eina_stringshare_del(il_cfg->policy.indicator.title);
+ if (title) il_cfg->policy.indicator.title = eina_stringshare_add(title);
+ if (il_cfg->policy.indicator.class)
+ eina_stringshare_del(il_cfg->policy.indicator.class);
+ if (class) il_cfg->policy.indicator.class = eina_stringshare_add(class);
+ if (il_cfg->policy.indicator.name)
+ eina_stringshare_del(il_cfg->policy.indicator.name);
+ if (name) il_cfg->policy.indicator.name = eina_stringshare_add(name);
+ break;
+ }
+
+ if (title) free(title);
+ if (name) free(name);
+ if (class) free(class);
+
+ if (_sw_change_timer) ecore_timer_del(_sw_change_timer);
+ _sw_change_timer =
+ ecore_timer_add(0.5, _il_config_select_window_change_timeout, data);
+}
+
+static int
+_il_config_select_window_change_timeout(void *data)
+{
+ e_config_save_queue();
+ _sw_change_timer = NULL;
+ return 0;
+}
+
+static int
+_il_config_select_window_match(E_Border *bd)
+{
+ Ecore_X_Window_Type wtype;
+ char *title, *name, *class;
+ int match = 0;
+
+ if (!bd) return 0;
+ title = ecore_x_icccm_title_get(bd->client.win);
+ ecore_x_icccm_name_class_get(bd->client.win, &name, &class);
+ ecore_x_netwm_window_type_get(bd->client.win, &wtype);
+
+ switch (stype)
+ {
+ case IL_SELECT_WINDOW_TYPE_HOME:
+ if (il_cfg->policy.home.match.title)
+ {
+ if ((title) && (!strcmp(title, il_cfg->policy.home.title)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.home.match.name)
+ {
+ if ((name) && (!strcmp(name, il_cfg->policy.home.name)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.home.match.class)
+ {
+ if ((class) && (!strcmp(class, il_cfg->policy.home.class)))
+ match = 1;
+ break;
+ }
+ break;
+ case IL_SELECT_WINDOW_TYPE_VKBD:
+ if (il_cfg->policy.vkbd.match.title)
+ {
+ if ((title) && (!strcmp(title, il_cfg->policy.vkbd.title)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.vkbd.match.name)
+ {
+ if ((name) && (!strcmp(name, il_cfg->policy.vkbd.name)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.vkbd.match.class)
+ {
+ if ((class) && (!strcmp(class, il_cfg->policy.vkbd.class)))
+ match = 1;
+ break;
+ }
+ break;
+ case IL_SELECT_WINDOW_TYPE_SOFTKEY:
+ if (il_cfg->policy.softkey.match.title)
+ {
+ if ((title) && (!strcmp(title, il_cfg->policy.softkey.title)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.softkey.match.name)
+ {
+ if ((name) && (!strcmp(name, il_cfg->policy.softkey.name)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.softkey.match.class)
+ {
+ if ((class) && (!strcmp(class, il_cfg->policy.softkey.class)))
+ match = 1;
+ break;
+ }
+ break;
+ case IL_SELECT_WINDOW_TYPE_INDICATOR:
+ if (il_cfg->policy.indicator.match.title)
+ {
+ if ((title) && (!strcmp(title, il_cfg->policy.indicator.title)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.indicator.match.name)
+ {
+ if ((name) && (!strcmp(name, il_cfg->policy.indicator.name)))
+ match = 1;
+ break;
+ }
+ if (il_cfg->policy.indicator.match.class)
+ {
+ if ((class) && (!strcmp(class, il_cfg->policy.indicator.class)))
+ match = 1;
+ break;
+ }
+ break;
+ }
+
+ if (title) free(title);
+ if (name) free(name);
+ if (class) free(class);
+
+ return match;
+}
diff --git a/src/modules/illume2/e_mod_select_window.h b/src/modules/illume2/e_mod_select_window.h
new file mode 100644
index 000000000..25cfc96cc
--- /dev/null
+++ b/src/modules/illume2/e_mod_select_window.h
@@ -0,0 +1,15 @@
+#ifndef E_MOD_SELECT_WINDOW_H
+#define E_MOD_SELECT_WINDOW_H
+
+typedef enum _Il_Select_Window_Type Il_Select_Window_Type;
+enum _Il_Select_Window_Type
+{
+ IL_SELECT_WINDOW_TYPE_HOME,
+ IL_SELECT_WINDOW_TYPE_VKBD,
+ IL_SELECT_WINDOW_TYPE_SOFTKEY,
+ IL_SELECT_WINDOW_TYPE_INDICATOR
+};
+
+void il_config_select_window(Il_Select_Window_Type type);
+
+#endif
diff --git a/src/modules/illume2/e_mod_windows.c b/src/modules/illume2/e_mod_windows.c
new file mode 100644
index 000000000..7b22da37f
--- /dev/null
+++ b/src/modules/illume2/e_mod_windows.c
@@ -0,0 +1,217 @@
+#include "E_Illume.h"
+#include "e_mod_windows.h"
+#include "e_mod_select_window.h"
+
+/* local function prototypes */
+static void *_il_config_windows_create(E_Config_Dialog *cfd);
+static void _il_config_windows_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_il_config_windows_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
+static void _il_config_windows_check_changed(void *data, Evas_Object *obj, void *event);
+static void _il_config_windows_change(void *data, Evas_Object *obj, void *event);
+static int _il_config_windows_change_timeout(void *data);
+static void _il_config_windows_select_home(void *data, void *data2);
+static void _il_config_windows_select_vkbd(void *data, void *data2);
+static void _il_config_windows_select_softkey(void *data, void *data2);
+static void _il_config_windows_select_indicator(void *data, void *data2);
+
+/* local variables */
+Ecore_Timer *_windows_change_timer = NULL;
+
+/* public functions */
+void
+il_config_windows_show(E_Container *con, const char *params)
+{
+ E_Config_Dialog *cfd;
+ E_Config_Dialog_View *v;
+
+ if (e_config_dialog_find("E", "_config_illume_windows_settings")) return;
+
+ v = E_NEW(E_Config_Dialog_View, 1);
+ v->create_cfdata = _il_config_windows_create;
+ v->free_cfdata = _il_config_windows_free;
+ v->basic.create_widgets = _il_config_windows_ui;
+ v->basic_only = 1;
+ v->normal_win = 1;
+ v->scroll = 1;
+ cfd = e_config_dialog_new(con, _("Window Settings"), "E",
+ "_config_illume_windows_settings",
+ "preferences-system-windows", 0, v, NULL);
+ e_dialog_resizable_set(cfd->dia, 1);
+}
+
+/* local function prototypes */
+static void *
+_il_config_windows_create(E_Config_Dialog *cfd)
+{
+ return NULL;
+}
+
+static void
+_il_config_windows_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+{
+ if (_windows_change_timer) ecore_timer_del(_windows_change_timer);
+}
+
+static Evas_Object *
+_il_config_windows_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
+{
+ Evas_Object *list, *of, *ow;
+
+ list = e_widget_list_add(evas, 0, 0);
+
+ of = e_widget_framelist_add(evas, _("Home"), 0);
+ ow = e_widget_button_add(evas, _("Select Window"), NULL,
+ _il_config_windows_select_home, NULL, NULL);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_check_add(evas, _("Match Window Class"),
+ &il_cfg->policy.home.match.class);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Name"),
+ &il_cfg->policy.home.match.name);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Title"),
+ &il_cfg->policy.home.match.title);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Type"),
+ &il_cfg->policy.home.match.win_type);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ of = e_widget_framelist_add(evas, _("Indicator"), 0);
+ ow = e_widget_button_add(evas, _("Select Window"), NULL,
+ _il_config_windows_select_indicator, NULL, NULL);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_check_add(evas, _("Match Window Class"),
+ &il_cfg->policy.indicator.match.class);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Name"),
+ &il_cfg->policy.indicator.match.name);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Title"),
+ &il_cfg->policy.indicator.match.title);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Type"),
+ &il_cfg->policy.indicator.match.win_type);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ of = e_widget_framelist_add(evas, _("Keyboard"), 0);
+ ow = e_widget_button_add(evas, _("Select Window"), NULL,
+ _il_config_windows_select_vkbd, NULL, NULL);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_check_add(evas, _("Match Window Class"),
+ &il_cfg->policy.vkbd.match.class);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Name"),
+ &il_cfg->policy.vkbd.match.name);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Title"),
+ &il_cfg->policy.vkbd.match.title);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Type"),
+ &il_cfg->policy.vkbd.match.win_type);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ of = e_widget_framelist_add(evas, _("Softkey"), 0);
+ ow = e_widget_button_add(evas, _("Select Window"), NULL,
+ _il_config_windows_select_softkey, NULL, NULL);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_check_add(evas, _("Match Window Class"),
+ &il_cfg->policy.softkey.match.class);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Name"),
+ &il_cfg->policy.softkey.match.name);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Title"),
+ &il_cfg->policy.softkey.match.title);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ ow = e_widget_check_add(evas, _("Match Window Type"),
+ &il_cfg->policy.softkey.match.win_type);
+ e_widget_framelist_object_append(of, ow);
+ evas_object_smart_callback_add(ow, "changed",
+ _il_config_windows_check_changed, NULL);
+ e_widget_list_object_append(list, of, 1, 0, 0.0);
+
+ return list;
+}
+
+static void
+_il_config_windows_check_changed(void *data, Evas_Object *obj, void *event)
+{
+ _il_config_windows_change(data, obj, event);
+}
+
+static void
+_il_config_windows_change(void *data, Evas_Object *obj, void *event)
+{
+ if (_windows_change_timer) ecore_timer_del(_windows_change_timer);
+ _windows_change_timer =
+ ecore_timer_add(0.5, _il_config_windows_change_timeout, data);
+}
+
+static int
+_il_config_windows_change_timeout(void *data)
+{
+ e_config_save_queue();
+ _windows_change_timer = NULL;
+ return 0;
+}
+
+static void
+_il_config_windows_select_home(void *data, void *data2)
+{
+ if (e_config_dialog_find("E", "_config_illume_select_window")) return;
+ il_config_select_window(IL_SELECT_WINDOW_TYPE_HOME);
+}
+
+static void
+_il_config_windows_select_vkbd(void *data, void *data2)
+{
+ if (e_config_dialog_find("E", "_config_illume_select_window")) return;
+ il_config_select_window(IL_SELECT_WINDOW_TYPE_VKBD);
+}
+
+static void
+_il_config_windows_select_softkey(void *data, void *data2)
+{
+ if (e_config_dialog_find("E", "_config_illume_select_window")) return;
+ il_config_select_window(IL_SELECT_WINDOW_TYPE_SOFTKEY);
+}
+
+static void
+_il_config_windows_select_indicator(void *data, void *data2)
+{
+ if (e_config_dialog_find("E", "_config_illume_select_window")) return;
+ il_config_select_window(IL_SELECT_WINDOW_TYPE_INDICATOR);
+}
diff --git a/src/modules/illume2/e_mod_windows.h b/src/modules/illume2/e_mod_windows.h
new file mode 100644
index 000000000..2f4da3556
--- /dev/null
+++ b/src/modules/illume2/e_mod_windows.h
@@ -0,0 +1,6 @@
+#ifndef E_MOD_WINDOWS_H
+#define E_MOD_WINDOWS_H
+
+void il_config_windows_show(E_Container *con, const char *params);
+
+#endif
diff --git a/src/modules/illume2/e_quickpanel.c b/src/modules/illume2/e_quickpanel.c
new file mode 100644
index 000000000..27ee39298
--- /dev/null
+++ b/src/modules/illume2/e_quickpanel.c
@@ -0,0 +1,421 @@
+#include "E_Illume.h"
+#include "e_quickpanel.h"
+
+/* local function prototypes */
+static void _e_quickpanel_cb_free(E_Quickpanel *qp);
+static int _e_quickpanel_cb_client_message(void *data, int type, void *event);
+static void _e_quickpanel_cb_border_pre_post_fetch(void *data, void *data2);
+static E_Quickpanel *_e_quickpanel_by_border_get(E_Border *bd);
+static int _e_quickpanel_border_is_quickpanel(E_Border *bd);
+static void _e_quickpanel_slide(E_Quickpanel *qp, int visible, double len);
+static int _e_quickpanel_cb_animate(void *data);
+static int _e_quickpanel_cb_delay_hide(void *data);
+static void _e_quickpanel_hide(E_Quickpanel *qp);
+static int _e_quickpanel_cb_sort(const void *b1, const void *b2);
+static int _e_quickpanel_cb_mouse_down(void *data, int type, void *event);
+static int _e_quickpanel_cb_mouse_wheel(void *data, int type, void *event);
+
+/* local variables */
+static Eina_List *qps = NULL, *handlers = NULL, *hooks = NULL;
+static Ecore_X_Window input_win = 0;
+
+/* public functions */
+int
+e_quickpanel_init(void)
+{
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
+ _e_quickpanel_cb_client_message, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ _e_quickpanel_cb_mouse_down, NULL));
+ handlers =
+ eina_list_append(handlers,
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
+ _e_quickpanel_cb_mouse_wheel, NULL));
+
+ hooks =
+ eina_list_append(hooks,
+ e_border_hook_add(E_BORDER_HOOK_EVAL_PRE_POST_FETCH,
+ _e_quickpanel_cb_border_pre_post_fetch,
+ NULL));
+ return 1;
+}
+
+int
+e_quickpanel_shutdown(void)
+{
+ E_Quickpanel *qp;
+ Ecore_Event_Handler *handler;
+ E_Border_Hook *hook;
+
+ EINA_LIST_FREE(handlers, handler)
+ ecore_event_handler_del(handler);
+ EINA_LIST_FREE(hooks, hook)
+ e_border_hook_del(hook);
+ EINA_LIST_FREE(qps, qp)
+ e_object_del(E_OBJECT(qp));
+ return 1;
+}
+
+E_Quickpanel *
+e_quickpanel_new(E_Zone *zone)
+{
+ E_Quickpanel *qp;
+
+ qp = E_OBJECT_ALLOC(E_Quickpanel, E_QUICKPANEL_TYPE, _e_quickpanel_cb_free);
+ if (!qp) return NULL;
+ qp->zone = zone;
+ qps = eina_list_append(qps, qp);
+ return qp;
+}
+
+void
+e_quickpanel_show(E_Quickpanel *qp)
+{
+ if (qp->timer) ecore_timer_del(qp->timer);
+ qp->timer = NULL;
+ if (qp->visible) return;
+ if (!qp->borders) return;
+ qp->borders = eina_list_sort(qp->borders, 0, _e_quickpanel_cb_sort);
+ if (!input_win)
+ {
+ input_win =
+ ecore_x_window_input_new(qp->zone->container->win,
+ qp->zone->x, qp->zone->y,
+ qp->zone->w, qp->zone->h);
+ ecore_x_window_show(input_win);
+ if (!e_grabinput_get(input_win, 1, input_win))
+ {
+ ecore_x_window_free(input_win);
+ input_win = 0;
+ return;
+ }
+ }
+ if (il_cfg->sliding.quickpanel.duration <= 0)
+ {
+ Eina_List *l;
+ E_Border *bd;
+ int ny = 0;
+
+ e_illume_border_top_shelf_size_get(qp->zone, NULL, &ny);
+ EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
+ ny += bd->h;
+
+ EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
+ {
+ e_border_lower(bd);
+ e_border_fx_offset(bd, 0, ny);
+ }
+ qp->visible = 1;
+ }
+ else
+ _e_quickpanel_slide(qp, 1,
+ (double)il_cfg->sliding.quickpanel.duration / 1000.0);
+}
+
+void
+e_quickpanel_hide(E_Quickpanel *qp)
+{
+ if (!qp->visible) return;
+ if (!qp->timer)
+ qp->timer = ecore_timer_add(0.2, _e_quickpanel_cb_delay_hide, qp);
+}
+
+E_Quickpanel *
+e_quickpanel_by_zone_get(E_Zone *zone)
+{
+ Eina_List *l;
+ E_Quickpanel *qp;
+
+ if (!zone) return NULL;
+ EINA_LIST_FOREACH(qps, l, qp)
+ if (qp->zone == zone) return qp;
+ return NULL;
+}
+
+void
+e_quickpanel_position_update(E_Quickpanel *qp)
+{
+ Eina_List *l;
+ E_Border *bd;
+ int ty;
+
+ if (!qp) return;
+ e_illume_border_top_shelf_pos_get(qp->zone, NULL, &ty);
+ EINA_LIST_FOREACH(qp->borders, l, bd)
+ {
+ bd->x = qp->zone->x;
+ bd->y = (ty - qp->h);
+ bd->changed = 1;
+ bd->changes.pos = 1;
+ }
+}
+
+/* local functions */
+static void
+_e_quickpanel_cb_free(E_Quickpanel *qp)
+{
+ E_Border *bd;
+
+ if (qp->animator) ecore_animator_del(qp->animator);
+ qp->animator = NULL;
+ if (qp->timer) ecore_timer_del(qp->timer);
+ qp->timer = NULL;
+ EINA_LIST_FREE(qp->borders, bd)
+ bd->stolen = 0;
+ E_FREE(qp);
+}
+
+static int
+_e_quickpanel_cb_client_message(void *data, int type, void *event)
+{
+ Ecore_X_Event_Client_Message *ev;
+ E_Zone *zone;
+ E_Quickpanel *qp;
+
+ ev = event;
+ if (ev->win != ecore_x_window_root_first_get()) return 1;
+ if (ev->message_type != ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) return 1;
+ zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
+ if (!(qp = e_quickpanel_by_zone_get(zone))) return 1;
+ if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
+ e_quickpanel_hide(qp);
+ else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
+ e_quickpanel_show(qp);
+ return 1;
+}
+
+static void
+_e_quickpanel_cb_border_pre_post_fetch(void *data, void *data2)
+{
+ E_Border *bd;
+ E_Quickpanel *qp;
+ int ty;
+
+ if (!(bd = data2)) return;
+ if (!bd->new_client) return;
+ if (!_e_quickpanel_border_is_quickpanel(bd)) return;
+ if (_e_quickpanel_by_border_get(bd)) return;
+ if (!(qp = e_quickpanel_by_zone_get(bd->zone))) return;
+
+ printf("Appending: %s\n", bd->client.icccm.name);
+ qp->borders = eina_list_append(qp->borders, bd);
+// qp->borders = eina_list_sorted_insert(qp->borders, _e_quickpanel_cb_sort, bd);
+
+ e_illume_border_top_shelf_pos_get(qp->zone, NULL, &ty);
+ bd->stolen = 1;
+ if (bd->remember)
+ {
+ if (bd->bordername)
+ {
+ eina_stringshare_del(bd->bordername);
+ bd->bordername = NULL;
+ bd->client.border.changed = 1;
+ }
+ e_remember_unuse(bd->remember);
+ bd->remember = NULL;
+ }
+ eina_stringshare_replace(&bd->bordername, "borderless");
+ bd->client.border.changed = 1;
+ qp->h += bd->h;
+ e_border_move(bd, qp->zone->x, (ty - qp->h));
+ /*
+ if (qp->visible)
+ {
+ int th;
+
+ e_illume_border_top_shelf_size_get(qp->zone, NULL, &th);
+ e_border_fx_offset(bd, 0, (bd->h - th));
+ }
+ */
+}
+
+static E_Quickpanel *
+_e_quickpanel_by_border_get(E_Border *bd)
+{
+ Eina_List *l, *ll;
+ E_Border *b;
+ E_Quickpanel *qp;
+
+ if (!bd->stolen) return NULL;
+ EINA_LIST_FOREACH(qps, l, qp)
+ EINA_LIST_FOREACH(qp->borders, ll, b)
+ if (b == bd) return qp;
+ return NULL;
+}
+
+static int
+_e_quickpanel_border_is_quickpanel(E_Border *bd)
+{
+ return bd->client.illume.quickpanel.quickpanel;
+}
+
+static void
+_e_quickpanel_slide(E_Quickpanel *qp, int visible, double len)
+{
+ qp->start = ecore_loop_time_get();
+ qp->len = len;
+ qp->adjust_start = qp->adjust;
+ qp->adjust_end = 0;
+ if (visible)
+ {
+ Eina_List *l;
+ E_Border *bd;
+
+ EINA_LIST_FOREACH(qp->borders, l, bd)
+ qp->adjust_end += bd->h;
+ }
+ else
+ {
+ int th;
+
+ e_illume_border_top_shelf_size_get(qp->zone, NULL, &th);
+ qp->adjust_end = -th;
+ }
+ if (!qp->animator)
+ qp->animator = ecore_animator_add(_e_quickpanel_cb_animate, qp);
+}
+
+static int
+_e_quickpanel_cb_animate(void *data)
+{
+ E_Quickpanel *qp;
+ Eina_List *l;
+ E_Border *bd;
+ double t, v;
+
+ if (!(qp = data)) return 0;
+ t = ecore_loop_time_get() - qp->start;
+ if (t > qp->len) t = qp->len;
+ if (qp->len > 0.0)
+ {
+ v = t / qp->len;
+ v = 1.0 - v;
+ v = v * v * v * v;
+ v = 1.0 - v;
+ }
+ else
+ {
+ t = qp->len;
+ v = 1.0;
+ }
+ qp->adjust = (qp->adjust_end * v) + (qp->adjust_start * (1.0 - v));
+
+ EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
+ {
+ e_border_lower(bd);
+ e_border_fx_offset(bd, 0, (bd->h + qp->adjust));
+ }
+
+ if (t == qp->len)
+ {
+ qp->animator = NULL;
+ if (qp->visible)
+ qp->visible = 0;
+ else
+ qp->visible = 1;
+ return 0;
+ }
+ return 1;
+}
+
+static int
+_e_quickpanel_cb_delay_hide(void *data)
+{
+ E_Quickpanel *qp;
+
+ if (!(qp = data)) return 0;
+ _e_quickpanel_hide(qp);
+ qp->timer = NULL;
+ return 0;
+}
+
+static void
+_e_quickpanel_hide(E_Quickpanel *qp)
+{
+ if (qp->timer) ecore_timer_del(qp->timer);
+ qp->timer = NULL;
+ if (!qp->visible) return;
+ if (input_win)
+ {
+ ecore_x_window_free(input_win);
+ e_grabinput_release(input_win, input_win);
+ input_win = 0;
+ }
+ if (il_cfg->sliding.quickpanel.duration <= 0)
+ {
+ Eina_List *l;
+ E_Border *bd;
+
+ EINA_LIST_FOREACH(qp->borders, l, bd)
+ {
+ e_border_lower(bd);
+ e_border_fx_offset(bd, 0, 0);
+ }
+ qp->visible = 0;
+ }
+ else
+ _e_quickpanel_slide(qp, 0,
+ (double)il_cfg->sliding.quickpanel.duration / 1000.0);
+}
+
+static int
+_e_quickpanel_cb_sort(const void *b1, const void *b2)
+{
+ const E_Border *bd1, *bd2;
+ int major1, major2, ret;
+
+ if (!(bd1 = b1)) return -1;
+ if (!(bd2 = b2)) return 1;
+ printf("Checking: %s against %s\n", bd2->client.icccm.name, bd1->client.icccm.name);
+ major1 = bd1->client.illume.quickpanel.priority.major;
+ major2 = bd2->client.illume.quickpanel.priority.major;
+ if (major1 < major2) ret = -1;
+ else if (major1 > major2) ret = 1;
+ else
+ {
+ int minor1, minor2;
+
+ minor1 = bd1->client.illume.quickpanel.priority.minor;
+// ecore_x_e_illume_quickpanel_priority_minor_get(bd1->client.win);
+ minor2 = bd2->client.illume.quickpanel.priority.minor;
+// ecore_x_e_illume_quickpanel_priority_minor_get(bd2->client.win);
+ if (minor1 < minor2) ret = -1;
+ else if (minor1 > minor2) ret = 1;
+ else ret = 0;
+ }
+ printf("Return: %d\n", ret);
+ return ret;
+}
+
+static int
+_e_quickpanel_cb_mouse_down(void *data, int type, void *event)
+{
+ Ecore_Event_Mouse_Button *ev;
+ Ecore_X_Window xwin;
+
+ ev = event;
+ if (ev->event_window != input_win) return 1;
+ xwin = ecore_x_window_root_first_get();
+ ecore_x_e_illume_quickpanel_state_set(xwin, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+ ecore_x_e_illume_quickpanel_state_send(xwin, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+ return 1;
+}
+
+static int
+_e_quickpanel_cb_mouse_wheel(void *data, int type, void *event)
+{
+ Ecore_Event_Mouse_Wheel *ev;
+ Ecore_X_Window xwin;
+
+ ev = event;
+ if (ev->event_window != input_win) return 1;
+ if (ev->z > 0) return 1;
+ xwin = ecore_x_window_root_first_get();
+ ecore_x_e_illume_quickpanel_state_set(xwin, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+ ecore_x_e_illume_quickpanel_state_send(xwin, ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+ return 1;
+}
diff --git a/src/modules/illume2/e_quickpanel.h b/src/modules/illume2/e_quickpanel.h
new file mode 100644
index 000000000..a6d9f85a2
--- /dev/null
+++ b/src/modules/illume2/e_quickpanel.h
@@ -0,0 +1,29 @@
+#ifndef E_QUICKPANEL_H
+#define E_QUICKPANEL_H
+
+#define E_QUICKPANEL_TYPE 0xE1b0990
+
+typedef struct _E_Quickpanel E_Quickpanel;
+struct _E_Quickpanel
+{
+ E_Object e_obj_inherit;
+
+ E_Zone *zone;
+ Eina_List *borders;
+ Ecore_Timer *timer;
+ Ecore_Animator *animator;
+ double start, len;
+ int h, adjust, adjust_start, adjust_end;
+ unsigned char visible : 1;
+};
+
+int e_quickpanel_init(void);
+int e_quickpanel_shutdown(void);
+
+E_Quickpanel *e_quickpanel_new(E_Zone *zone);
+void e_quickpanel_show(E_Quickpanel *qp);
+void e_quickpanel_hide(E_Quickpanel *qp);
+E_Quickpanel *e_quickpanel_by_zone_get(E_Zone *zone);
+void e_quickpanel_position_update(E_Quickpanel *qp);
+
+#endif
diff --git a/src/modules/illume2/keyboards/Makefile.am b/src/modules/illume2/keyboards/Makefile.am
new file mode 100644
index 000000000..1b2192047
--- /dev/null
+++ b/src/modules/illume2/keyboards/Makefile.am
@@ -0,0 +1,11 @@
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = illume2
+
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)/keyboards
+files_DATA = ignore_built_in_keyboards
+
+EXTRA_DIST = $(files_DATA)
+
+uninstall:
+ rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)/keyboards
+
diff --git a/src/modules/illume2/keyboards/ignore_built_in_keyboards b/src/modules/illume2/keyboards/ignore_built_in_keyboards
new file mode 100644
index 000000000..bdb9d6bbb
--- /dev/null
+++ b/src/modules/illume2/keyboards/ignore_built_in_keyboards
@@ -0,0 +1 @@
+/org/freedesktop/Hal/devices/platform_*
diff --git a/src/modules/illume2/module.desktop.in b/src/modules/illume2/module.desktop.in
new file mode 100644
index 000000000..8f3845f13
--- /dev/null
+++ b/src/modules/illume2/module.desktop.in
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Link
+Name=Illume2
+Icon=e-module-illume2
+X-Enlightenment-ModuleType=system
+Comment=<title>Illume2 for Embedded</title>
+Comment[fr]=<title>Illume2 pour l'embarqué</title>
+Comment[it]=<title>Illume2 per sistemi embedded</title>
diff --git a/src/modules/illume2/policies/Makefile.am b/src/modules/illume2/policies/Makefile.am
new file mode 100644
index 000000000..e433fcee7
--- /dev/null
+++ b/src/modules/illume2/policies/Makefile.am
@@ -0,0 +1,2 @@
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = illume
diff --git a/src/modules/illume2/policies/illume/Makefile.am b/src/modules/illume2/policies/illume/Makefile.am
new file mode 100644
index 000000000..2ba8665ab
--- /dev/null
+++ b/src/modules/illume2/policies/illume/Makefile.am
@@ -0,0 +1,20 @@
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = illume2
+
+# 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@
+
+plugindir = $(libdir)/enlightenment/modules/$(MODULE)/policies
+
+illumedir = $(plugindir)
+illume_LTLIBRARIES = illume.la
+illume_la_SOURCES = illume.c layout.c
+illume_la_LIBADD = @e_libs@
+illume_la_LDFLAGS = -no-undefined -module -avoid-version
+illume_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/src/modules/illume2/policies/illume/illume.c b/src/modules/illume2/policies/illume/illume.c
new file mode 100644
index 000000000..fe0cb7c3d
--- /dev/null
+++ b/src/modules/illume2/policies/illume/illume.c
@@ -0,0 +1,44 @@
+#include "E_Illume.h"
+#include "illume.h"
+#include "layout.h"
+
+EAPI E_Illume_Layout_Api e_layapi =
+{
+ E_ILLUME_LAYOUT_API_VERSION, "Illume", "illume"
+};
+
+EAPI void *
+e_layapi_init(E_Illume_Layout_Policy *p)
+{
+ p->funcs.border_add = _layout_border_add;
+ p->funcs.border_del = _layout_border_del;
+ p->funcs.border_focus_in = _layout_border_focus_in;
+ p->funcs.border_focus_out = _layout_border_focus_out;
+ p->funcs.border_activate = _layout_border_activate;
+ p->funcs.zone_layout = _layout_zone_layout;
+ p->funcs.zone_move_resize = _layout_zone_move_resize;
+ p->funcs.drag_start = _layout_drag_start;
+ p->funcs.drag_end = _layout_drag_end;
+ return p;
+}
+
+EAPI int
+e_layapi_shutdown(E_Illume_Layout_Policy *p)
+{
+ p->funcs.border_add = NULL;
+ p->funcs.border_del = NULL;
+ p->funcs.border_focus_in = NULL;
+ p->funcs.border_focus_out = NULL;
+ p->funcs.border_activate = NULL;
+ p->funcs.zone_layout = NULL;
+ p->funcs.zone_move_resize = NULL;
+ p->funcs.drag_start = NULL;
+ p->funcs.drag_end = NULL;
+ return 1;
+}
+
+EAPI void
+e_layapi_config(E_Container *con, const char *params)
+{
+
+}
diff --git a/src/modules/illume2/policies/illume/illume.h b/src/modules/illume2/policies/illume/illume.h
new file mode 100644
index 000000000..bd585078e
--- /dev/null
+++ b/src/modules/illume2/policies/illume/illume.h
@@ -0,0 +1,10 @@
+#ifndef _ILLUME_H
+# define _ILLUME_H
+
+EAPI extern E_Illume_Layout_Api e_layapi;
+
+EAPI void *e_layapi_init(E_Illume_Layout_Policy *p);
+EAPI int e_layapi_shutdown(E_Illume_Layout_Policy *p);
+EAPI void e_layapi_config(E_Container *con, const char *params);
+
+#endif
diff --git a/src/modules/illume2/policies/illume/layout.c b/src/modules/illume2/policies/illume/layout.c
new file mode 100644
index 000000000..16023fa7a
--- /dev/null
+++ b/src/modules/illume2/policies/illume/layout.c
@@ -0,0 +1,561 @@
+#include "E_Illume.h"
+#include "layout.h"
+
+/* local function prototypes */
+static void _zone_layout_border_move(E_Border *bd, int x, int y);
+static void _zone_layout_border_resize(E_Border *bd, int w, int h);
+static void _zone_layout_single(E_Border *bd);
+static void _zone_layout_dual(E_Border *bd);
+static void _zone_layout_dual_top(E_Border *bd);
+static void _zone_layout_dual_top_custom(E_Border *bd);
+static void _zone_layout_dual_left(E_Border *bd);
+
+/* local variables */
+static int shelfsize = 0;
+static int kbdsize = 0;
+static int panelsize = 0;
+
+void
+_layout_border_add(E_Border *bd)
+{
+ if ((bd->new_client) || (!bd->visible)) return;
+ if ((bd->need_fullscreen) || (bd->fullscreen))
+ {
+ if (bd->layer != IL_FULLSCREEN_LAYER)
+ e_border_layer_set(bd, IL_FULLSCREEN_LAYER);
+ bd->lock_user_stacking = 1;
+ }
+ else if (e_illume_border_is_conformant(bd))
+ {
+ if (bd->layer != IL_CONFORM_LAYER)
+ e_border_layer_set(bd, IL_CONFORM_LAYER);
+ bd->lock_user_stacking = 1;
+ }
+ if ((bd->client.icccm.accepts_focus) && (bd->client.icccm.take_focus)
+ && (!bd->lock_focus_out))
+ e_border_focus_set(bd, 1, 1);
+}
+
+void
+_layout_border_del(E_Border *bd)
+{
+ /* Do something if a border gets removed */
+}
+
+void
+_layout_border_focus_in(E_Border *bd)
+{
+ /* Do something if focus enters a window */
+}
+
+void
+_layout_border_focus_out(E_Border *bd)
+{
+ /* Do something if focus exits a window */
+}
+
+void
+_layout_border_activate(E_Border *bd)
+{
+ /* HANDLE A BORDER BEING ACTIVATED */
+
+ if (bd->stolen) return;
+
+ /* only set focus if border accepts it and it's not locked out */
+ if (((!bd->client.icccm.accepts_focus) && (!bd->client.icccm.take_focus)) ||
+ (bd->lock_focus_out))
+ return;
+
+ /* if the border is not focused, check focus settings */
+ if ((bd) && (!bd->focused))
+ {
+ if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) ||
+ ((bd->parent) &&
+ ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
+ ((bd->parent->focused) &&
+ (e_config->focus_setting == E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED)))))
+ {
+ if (bd->iconic)
+ {
+ /* if it's iconic, then uniconify */
+ if (!bd->lock_user_iconify) e_border_uniconify(bd);
+ }
+ /* if we can, raise the border */
+ if (!bd->lock_user_stacking) e_border_raise(bd);
+ /* if we can, focus the border */
+ if (!bd->lock_focus_out) e_border_focus_set(bd, 1, 1);
+ }
+ }
+}
+
+void
+_layout_zone_layout(E_Zone *zone)
+{
+ E_Illume_Config_Zone *cfg_zone;
+ Eina_List *l;
+ E_Border *bd;
+
+// printf("Layout Zone: %d\n", zone->id);
+ cfg_zone = e_illume_zone_config_get(zone->id);
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
+ {
+ int mh;
+
+ if ((bd->zone != zone) || (bd->new_client) || (!bd->visible)) continue;
+// printf("\tBorder: %s\n", bd->client.icccm.name);
+ if (e_illume_border_is_top_shelf(bd))
+ {
+ e_illume_border_min_get(bd, NULL, &mh);
+ if (shelfsize < mh) shelfsize = mh;
+ if (!bd->client.illume.drag.drag)
+ {
+ if ((bd->w != zone->w) || (bd->h != shelfsize))
+ _zone_layout_border_resize(bd, zone->w, shelfsize);
+ if (!cfg_zone->mode.dual)
+ {
+ if ((bd->x != zone->x) || (bd->y != zone->y))
+ _zone_layout_border_move(bd, zone->x, zone->y);
+ }
+ else
+ {
+ if (cfg_zone->mode.side == 0)
+ {
+ if (bd->x != zone->x)
+ _zone_layout_border_move(bd, zone->x, bd->y);
+ }
+ else
+ {
+ if ((bd->x != zone->x) || (bd->y != zone->y))
+ _zone_layout_border_move(bd, zone->x, zone->y);
+ }
+ }
+ }
+ e_border_stick(bd);
+ if (bd->layer != IL_TOP_SHELF_LAYER)
+ e_border_layer_set(bd, IL_TOP_SHELF_LAYER);
+ }
+ else if (e_illume_border_is_bottom_panel(bd))
+ {
+ e_illume_border_min_get(bd, NULL, &mh);
+ if (panelsize < mh) panelsize = mh;
+ if (!bd->client.illume.drag.drag)
+ {
+ if ((bd->w != zone->w) || (bd->h != panelsize))
+ _zone_layout_border_resize(bd, zone->w, panelsize);
+ if ((bd->x != zone->x) ||
+ (bd->y != (zone->y + zone->h - panelsize)))
+ _zone_layout_border_move(bd, zone->x,
+ (zone->y + zone->h - panelsize));
+ }
+ e_border_stick(bd);
+ if (bd->layer != IL_BOTTOM_PANEL_LAYER)
+ e_border_layer_set(bd, IL_BOTTOM_PANEL_LAYER);
+ }
+ else if (e_illume_border_is_keyboard(bd))
+ {
+ e_illume_border_min_get(bd, NULL, &mh);
+ if (kbdsize < mh) kbdsize = mh;
+ if ((bd->w != zone->w) || (bd->h != kbdsize))
+ _zone_layout_border_resize(bd, zone->w, kbdsize);
+ if ((bd->x != zone->x) ||
+ (bd->y != (zone->y + zone->h - kbdsize)))
+ _zone_layout_border_move(bd, zone->x,
+ (zone->y + zone->h - kbdsize));
+ e_border_stick(bd);
+ if (bd->layer != IL_KEYBOARD_LAYER)
+ e_border_layer_set(bd, IL_KEYBOARD_LAYER);
+ }
+ else if (e_illume_border_is_dialog(bd))
+ {
+ int mw, nx, ny;
+
+ e_illume_border_min_get(bd, &mw, &mh);
+ if (mw > zone->w) mw = zone->w;
+ if (mh > zone->h) mh = zone->h;
+ nx = (zone->x + ((zone->w - mw) / 2));
+ ny = (zone->y + ((zone->h - mh) / 2));
+ if ((bd->x != nx) || (bd->y != ny))
+ _zone_layout_border_move(bd, nx, ny);
+ if (bd->layer != IL_DIALOG_LAYER)
+ e_border_layer_set(bd, IL_DIALOG_LAYER);
+ }
+ else if (e_illume_border_is_quickpanel(bd))
+ {
+ e_illume_border_min_get(bd, NULL, &mh);
+ if ((bd->w != zone->w) || (bd->h != mh))
+ _zone_layout_border_resize(bd, zone->w, mh);
+ if (bd->layer != IL_QUICKPANEL_LAYER)
+ e_border_layer_set(bd, IL_QUICKPANEL_LAYER);
+ bd->lock_user_stacking = 1;
+ }
+ else
+ {
+ if (cfg_zone->mode.dual) _zone_layout_dual(bd);
+ else _zone_layout_single(bd);
+ if (bd->layer != IL_APP_LAYER)
+ e_border_layer_set(bd, IL_APP_LAYER);
+ }
+ }
+}
+
+void
+_layout_zone_move_resize(E_Zone *zone)
+{
+ _layout_zone_layout(zone);
+}
+
+void
+_layout_drag_start(E_Border *bd)
+{
+ ecore_x_e_illume_drag_set(bd->client.win, 1);
+ ecore_x_e_illume_drag_set(bd->zone->black_win, 1);
+}
+
+void
+_layout_drag_end(E_Border *bd)
+{
+ ecore_x_e_illume_drag_set(bd->client.win, 0);
+ ecore_x_e_illume_drag_set(bd->zone->black_win, 0);
+}
+
+/* local functions */
+static void
+_zone_layout_border_move(E_Border *bd, int x, int y)
+{
+ bd->x = x;
+ bd->y = y;
+ bd->changes.pos = 1;
+ bd->changed = 1;
+}
+
+static void
+_zone_layout_border_resize(E_Border *bd, int w, int h)
+{
+ bd->w = w;
+ bd->h = h;
+ bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r);
+ bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b);
+ bd->changes.size = 1;
+ bd->changed = 1;
+}
+
+static void
+_zone_layout_single(E_Border *bd)
+{
+ int kx, ky, kw, kh;
+ int ss = 0, ps = 0;
+
+ e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
+ if (!e_illume_border_is_conformant(bd))
+ {
+ if (!((bd->need_fullscreen) || (bd->fullscreen)))
+ {
+ if (kh >= bd->zone->h) ps = panelsize;
+ ss = shelfsize;
+ }
+ }
+ else
+ kh = bd->zone->h;
+ if ((bd->w != kw) || (bd->h != (kh - ss - ps)))
+ _zone_layout_border_resize(bd, kw, (kh - ss - ps));
+ if ((bd->x != kx) || (bd->y != (ky + ss)))
+ _zone_layout_border_move(bd, kx, (ky + ss));
+}
+
+static void
+_zone_layout_dual(E_Border *bd)
+{
+ E_Illume_Config_Zone *cz;
+
+ cz = e_illume_zone_config_get(bd->zone->id);
+ if (cz->mode.side == 0)
+ {
+ int ty;
+
+ e_illume_border_top_shelf_pos_get(bd->zone, NULL, &ty);
+ if (ty <= bd->zone->y)
+ _zone_layout_dual_top(bd);
+ else
+ _zone_layout_dual_top_custom(bd);
+ }
+ else if (cz->mode.side == 1)
+ _zone_layout_dual_left(bd);
+}
+
+static void
+_zone_layout_dual_top(E_Border *bd)
+{
+ int kx, ky, kw, kh;
+ int ss = 0, ps = 0;
+ int conform;
+
+ conform = e_illume_border_is_conformant(bd);
+ e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
+ if (!conform)
+ {
+ if (!((bd->need_fullscreen) || (bd->fullscreen)))
+ {
+ if (kh >= bd->zone->h) ps = panelsize;
+ ss = shelfsize;
+ }
+ }
+ if (e_illume_border_valid_count_get(bd->zone) < 2)
+ {
+ if ((bd->w != kw) || (bd->h != (kh - ss - ps)))
+ _zone_layout_border_resize(bd, kw, (kh - ss - ps));
+ if ((bd->x != kx) || (bd->y != (ky + ss)))
+ _zone_layout_border_move(bd, kx, (ky + ss));
+ }
+ else
+ {
+ E_Border *b;
+ int bx, by, bw, bh;
+
+ /* more than one valid border */
+ bx = kx;
+ by = (ky + ss);
+ bw = kw;
+ bh = (kh - ss - ps);
+
+ /* grab the border at this location */
+ b = e_illume_border_at_xy_get(bd->zone, kx, shelfsize);
+
+ if ((b) && (bd != b))
+ {
+ /* we have a border there, and it's not the current one */
+ if (!e_illume_border_is_conformant(b))
+ {
+ /* border in this location is not conformant */
+ bh = ((kh - ss - ps) / 2);
+ by = (b->y + b->h); // b->fx.y
+ }
+ else
+ {
+ /* border there is conformant */
+ if (conform)
+ {
+ /* if current border is conformant, divide zone in half */
+ bh = ((bd->zone->h - ss) / 2);
+ by = by + bh;
+ }
+ else
+ {
+ /* current border is not conformant */
+ by = (b->y + b->h);
+ bh = (kh - by - ps);
+ }
+ }
+ }
+ else if (b)
+ {
+ /* border at this location and it's the current border */
+ by = bd->y;
+ bh = ((kh - ss - ps) / 2);
+ }
+ else
+ {
+ /* no border at this location */
+ b = e_illume_border_valid_border_get(bd->zone);
+ by = ky + ss;
+ bh = (ky - b->h);
+ }
+ if ((bd->w != bw) || (bd->h != bh))
+ _zone_layout_border_resize(bd, bw, bh);
+ if ((bd->x != bx) || (bd->y != by))
+ _zone_layout_border_move(bd, bx, by);
+ }
+}
+
+static void
+_zone_layout_dual_top_custom(E_Border *bd)
+{
+ int kx, kw;
+ int count, conform;
+ int ax, ay, aw, ah;
+ int zx, zy, zw, zh;
+
+ /* get count of valid borders */
+ count = e_illume_border_valid_count_get(bd->zone);
+
+ /* fetch if this border is conformant */
+ conform = e_illume_border_is_conformant(bd);
+
+ /* grab the 'safe' region. Safe region is space not occupied by keyboard */
+ e_illume_kbd_safe_app_region_get(bd->zone, &kx, NULL, &kw, NULL);
+
+ e_illume_border_app1_safe_region_get(bd->zone, &ax, &ay, &aw, &ah);
+ e_illume_border_app2_safe_region_get(bd->zone, &zx, &zy, &zw, &zh);
+
+ /* if there are no other borders, than give this one all available space */
+ if (count < 2)
+ {
+ if (ah >= zh)
+ {
+ zx = ax;
+ zy = ax;
+ zw = aw;
+ zh = ah;
+ }
+ if ((bd->w != zw) || (bd->h != zh))
+ _zone_layout_border_resize(bd, zw, zh);
+ if ((bd->x != zx) || (bd->y != zy))
+ _zone_layout_border_move(bd, zx, zy);
+ }
+ else
+ {
+ E_Border *bt, *bb;
+ int bh, by;
+
+ /* more than one valid border */
+
+ if (bd->client.vkbd.state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ {
+ bh = ah;
+ by = ay;
+ }
+ else
+ {
+ /* grab the border at this location */
+ bt = e_illume_border_at_xy_get(bd->zone, kx, ay);
+
+ if ((bt) && (bd != bt))
+ {
+ /* is there a border in the bottom section */
+ bb = e_illume_border_at_xy_get(bd->zone, kx, zy);
+ if (!bb)
+ {
+ bh = zh;
+ by = zy;
+ }
+ else if ((bb) && (bd != bb))
+ {
+ if (bt == e_border_focused_get())
+ {
+ if (bd->client.vkbd.state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ {
+ bh = zh;
+ by = zy;
+ }
+ else
+ {
+ bh = ah;
+ by = ay;
+ }
+ }
+ else if (bb = e_border_focused_get())
+ {
+ if (bd->client.vkbd.state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ {
+ bh = ah;
+ by = ay;
+ }
+ }
+ }
+ else if (bb)
+ {
+ bh = zh;
+ by = zy;
+ }
+ }
+ else
+ {
+ bh = ah;
+ by = ay;
+ }
+ }
+ if ((bd->w != kw) || (bd->h != bh))
+ _zone_layout_border_resize(bd, kw, bh);
+ if ((bd->x != kx) || (bd->y != by))
+ _zone_layout_border_move(bd, kx, by);
+ }
+}
+
+static void
+_zone_layout_dual_left(E_Border *bd)
+{
+ int kx, ky, kw, kh, ss = 0, ps = 0;
+ int conform;
+
+ /* fetch if this border is conformant */
+ conform = e_illume_border_is_conformant(bd);
+
+ /* grab the 'safe' region. Safe region is space not occupied by keyboard */
+ e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
+ if (!conform)
+ {
+ /* if the border is not conformant and doesn't need fullscreen, then
+ * we account for shelf & panel sizes */
+ if (!((bd->need_fullscreen) || (bd->fullscreen)))
+ {
+ if (kh >= bd->zone->h) ps = panelsize;
+ ss = shelfsize;
+ }
+ }
+
+ /* if there are no other borders, than give this one all available space */
+ if (e_illume_border_valid_count_get(bd->zone) < 2)
+ {
+ if ((bd->w != kw) || (bd->h != (kh - ss - ps)))
+ _zone_layout_border_resize(bd, kw, (kh - ss - ps));
+ if ((bd->x != kx) || (bd->y != (ky + ss)))
+ _zone_layout_border_move(bd, kx, (ky + ss));
+ }
+ else
+ {
+ E_Border *b;
+ int bx, by, bw, bh;
+
+ /* more than one valid border */
+ bx = kx;
+ by = (ky + ss);
+ bw = kw;
+ bh = (kh - ss - ps);
+
+ /* grab the border at this location */
+ b = e_illume_border_at_xy_get(bd->zone, kx, shelfsize);
+
+ if ((b) && (bd != b))
+ {
+ /* we have a border there, and it's not the current one */
+ if (!e_illume_border_is_conformant(b))
+ {
+ /* border in this location is not conformant */
+ bw = (kw / 2);
+ bx = (b->x + b->w);
+ }
+ else
+ {
+ /* border there is conformant */
+ if (conform)
+ {
+ /* if current border is conformant, divide zone in half */
+ bw = (bd->zone->w / 2);
+ bx = bx + bw;
+ }
+ else
+ {
+ /* current border is not conformant */
+ bx = (b->x + b->w);
+ bw = (kw - bx);
+ }
+ }
+ }
+ else if (b)
+ {
+ /* border at this location and it's the current border */
+ bx = bd->x;
+ bw = (kw / 2);
+ }
+ else
+ {
+ /* no border at this location */
+ b = e_illume_border_valid_border_get(bd->zone);
+ bx = kx;
+ bw = (kw - b->w);
+ }
+ if ((bd->w != bw) || (bd->h != bh))
+ _zone_layout_border_resize(bd, bw, bh);
+ if ((bd->x != bx) || (bd->y != by))
+ _zone_layout_border_move(bd, bx, by);
+ }
+}
diff --git a/src/modules/illume2/policies/illume/layout.h b/src/modules/illume2/policies/illume/layout.h
new file mode 100644
index 000000000..0617246de
--- /dev/null
+++ b/src/modules/illume2/policies/illume/layout.h
@@ -0,0 +1,25 @@
+#ifndef _LAYOUT_H
+# define _LAYOUT_H
+
+/* define some values here for easily changing layers so we don't have to
+ * grep through code to change layers */
+#define IL_TOP_SHELF_LAYER 200
+#define IL_BOTTOM_PANEL_LAYER 100
+#define IL_KEYBOARD_LAYER 150
+#define IL_DIALOG_LAYER 120
+#define IL_CONFORM_LAYER 140
+#define IL_FULLSCREEN_LAYER 140
+#define IL_QUICKPANEL_LAYER 160
+#define IL_APP_LAYER 100
+
+void _layout_border_add(E_Border *bd);
+void _layout_border_del(E_Border *bd);
+void _layout_border_focus_in(E_Border *bd);
+void _layout_border_focus_out(E_Border *bd);
+void _layout_border_activate(E_Border *bd);
+void _layout_zone_layout(E_Zone *zone);
+void _layout_zone_move_resize(E_Zone *zone);
+void _layout_drag_start(E_Border *bd);
+void _layout_drag_end(E_Border *bd);
+
+#endif