Add config variables for dual-app mode.
Add a config dialog for changing dual-app mode. Rename timer in Select Window to be more specific. SVN revision: 44077
This commit is contained in:
parent
cc05979308
commit
310069f653
|
@ -36,7 +36,9 @@ module_la_SOURCES = e_mod_main.h \
|
||||||
e_mod_select_window.h \
|
e_mod_select_window.h \
|
||||||
e_mod_select_window.c \
|
e_mod_select_window.c \
|
||||||
e_mod_policy.h \
|
e_mod_policy.h \
|
||||||
e_mod_policy.c
|
e_mod_policy.c \
|
||||||
|
e_mod_policy_settings.h \
|
||||||
|
e_mod_policy_settings.c
|
||||||
|
|
||||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||||
module_la_LDFLAGS = -module -avoid-version
|
module_la_LDFLAGS = -module -avoid-version
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "e_mod_animation.h"
|
#include "e_mod_animation.h"
|
||||||
#include "e_mod_windows.h"
|
#include "e_mod_windows.h"
|
||||||
#include "e_mod_policy.h"
|
#include "e_mod_policy.h"
|
||||||
|
#include "e_mod_policy_settings.h"
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
EAPI Il_Config *il_cfg = NULL;
|
EAPI Il_Config *il_cfg = NULL;
|
||||||
|
@ -22,6 +23,8 @@ il_config_init(E_Module *m)
|
||||||
E_CONFIG_VAL(D, T, sliding.kbd.duration, INT);
|
E_CONFIG_VAL(D, T, sliding.kbd.duration, INT);
|
||||||
E_CONFIG_VAL(D, T, sliding.softkey.duration, INT);
|
E_CONFIG_VAL(D, T, sliding.softkey.duration, INT);
|
||||||
E_CONFIG_VAL(D, T, policy.name, STR);
|
E_CONFIG_VAL(D, T, policy.name, STR);
|
||||||
|
E_CONFIG_VAL(D, T, policy.mode.dual, INT);
|
||||||
|
E_CONFIG_VAL(D, T, policy.mode.side, INT);
|
||||||
E_CONFIG_VAL(D, T, policy.vkbd.class, STR);
|
E_CONFIG_VAL(D, T, policy.vkbd.class, STR);
|
||||||
E_CONFIG_VAL(D, T, policy.vkbd.name, STR);
|
E_CONFIG_VAL(D, T, policy.vkbd.name, STR);
|
||||||
E_CONFIG_VAL(D, T, policy.vkbd.title, STR);
|
E_CONFIG_VAL(D, T, policy.vkbd.title, STR);
|
||||||
|
@ -120,6 +123,11 @@ il_config_init(E_Module *m)
|
||||||
il_cfg->policy.indicator.match.title = 1;
|
il_cfg->policy.indicator.match.title = 1;
|
||||||
il_cfg->policy.indicator.match.win_type = 0;
|
il_cfg->policy.indicator.match.win_type = 0;
|
||||||
}
|
}
|
||||||
|
if ((il_cfg->version & 0xffff) < 2)
|
||||||
|
{
|
||||||
|
il_cfg->policy.mode.dual = 0;
|
||||||
|
il_cfg->policy.mode.side = 0;
|
||||||
|
}
|
||||||
il_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
il_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||||
}
|
}
|
||||||
il_cfg->mod_dir = eina_stringshare_add(m->dir);
|
il_cfg->mod_dir = eina_stringshare_add(m->dir);
|
||||||
|
@ -135,12 +143,17 @@ il_config_init(E_Module *m)
|
||||||
e_configure_registry_generic_item_add("illume/policy", 0, _("Policy"),
|
e_configure_registry_generic_item_add("illume/policy", 0, _("Policy"),
|
||||||
NULL, "enlightenment/policy",
|
NULL, "enlightenment/policy",
|
||||||
il_config_policy_show);
|
il_config_policy_show);
|
||||||
|
e_configure_registry_generic_item_add("illume/policy_settings", 0,
|
||||||
|
_("Policy Settings"),
|
||||||
|
NULL, "enlightenment/policy",
|
||||||
|
il_config_policy_settings_show);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
il_config_shutdown(void)
|
il_config_shutdown(void)
|
||||||
{
|
{
|
||||||
|
e_configure_registry_item_del("illume/policy_settings");
|
||||||
e_configure_registry_item_del("illume/policy");
|
e_configure_registry_item_del("illume/policy");
|
||||||
e_configure_registry_item_del("illume/windows");
|
e_configure_registry_item_del("illume/windows");
|
||||||
e_configure_registry_item_del("illume/animation");
|
e_configure_registry_item_del("illume/animation");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef E_MOD_CONFIG_H
|
#ifndef E_MOD_CONFIG_H
|
||||||
# define E_MOD_CONFIG_H
|
# define E_MOD_CONFIG_H
|
||||||
|
|
||||||
# define IL_CONFIG_MIN 1
|
# define IL_CONFIG_MIN 2
|
||||||
# define IL_CONFIG_MAJ 0
|
# define IL_CONFIG_MAJ 0
|
||||||
|
|
||||||
typedef struct _Il_Config Il_Config;
|
typedef struct _Il_Config Il_Config;
|
||||||
|
@ -32,6 +32,10 @@ struct _Il_Config
|
||||||
int class, name, title, win_type;
|
int class, name, title, win_type;
|
||||||
} match;
|
} match;
|
||||||
} vkbd, softkey, home, indicator;
|
} vkbd, softkey, home, indicator;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
int dual, side;
|
||||||
|
} mode;
|
||||||
} policy;
|
} policy;
|
||||||
|
|
||||||
// Not User Configurable. Placeholders
|
// Not User Configurable. Placeholders
|
||||||
|
|
|
@ -9,6 +9,7 @@ static void _il_config_policy_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *c
|
||||||
static Evas_Object *_il_config_policy_ui(E_Config_Dialog *cfd, Evas *evas, 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 void _il_config_policy_list_changed(void *data);
|
||||||
static int _il_config_policy_change_timeout(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 */
|
/* local variables */
|
||||||
Ecore_Timer *_policy_change_timer = NULL;
|
Ecore_Timer *_policy_change_timer = NULL;
|
||||||
|
@ -20,7 +21,7 @@ il_config_policy_show(E_Container *con, const char *params)
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
E_Config_Dialog_View *v;
|
E_Config_Dialog_View *v;
|
||||||
|
|
||||||
if (e_config_dialog_find("E", "_config_illume_policy_settings")) return;
|
if (e_config_dialog_find("E", "_config_illume_policy")) return;
|
||||||
v = E_NEW(E_Config_Dialog_View, 1);
|
v = E_NEW(E_Config_Dialog_View, 1);
|
||||||
v->create_cfdata = _il_config_policy_create;
|
v->create_cfdata = _il_config_policy_create;
|
||||||
v->free_cfdata = _il_config_policy_free;
|
v->free_cfdata = _il_config_policy_free;
|
||||||
|
@ -29,7 +30,7 @@ il_config_policy_show(E_Container *con, const char *params)
|
||||||
v->normal_win = 1;
|
v->normal_win = 1;
|
||||||
v->scroll = 1;
|
v->scroll = 1;
|
||||||
cfd = e_config_dialog_new(con, _("Policy"), "E",
|
cfd = e_config_dialog_new(con, _("Policy"), "E",
|
||||||
"_config_illume_policy_settings",
|
"_config_illume_policy",
|
||||||
"enlightenment/policy", 0, v, NULL);
|
"enlightenment/policy", 0, v, NULL);
|
||||||
e_dialog_resizable_set(cfd->dia, 1);
|
e_dialog_resizable_set(cfd->dia, 1);
|
||||||
}
|
}
|
||||||
|
@ -102,3 +103,21 @@ _il_config_policy_change_timeout(void *data)
|
||||||
_policy_change_timer = NULL;
|
_policy_change_timer = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
ow = e_widget_radio_add(evas, _("Dual App Mode"), 1, rg);
|
||||||
|
e_widget_framelist_object_append(of, ow);
|
||||||
|
|
||||||
|
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
#include "e.h"
|
||||||
|
#include "e_mod_config.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);
|
||||||
|
|
||||||
|
/* local variables */
|
||||||
|
Ecore_Timer *_ps_change_timer = NULL;
|
||||||
|
|
||||||
|
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);
|
||||||
|
ow = e_widget_radio_add(evas, _("Dual App Mode"), 1, rg);
|
||||||
|
e_widget_framelist_object_append(of, ow);
|
||||||
|
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));
|
||||||
|
ow = e_widget_radio_add(evas, _("Top/Bottom"), 0, rg);
|
||||||
|
e_widget_framelist_object_append(of, ow);
|
||||||
|
ow = e_widget_radio_add(evas, _("Left/Right"), 1, rg);
|
||||||
|
e_widget_framelist_object_append(of, ow);
|
||||||
|
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
|
@ -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
|
|
@ -13,7 +13,7 @@ static int _il_config_select_window_match(E_Border *bd);
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
Il_Select_Window_Type stype;
|
Il_Select_Window_Type stype;
|
||||||
Ecore_Timer *_change_timer = NULL;
|
Ecore_Timer *_sw_change_timer = NULL;
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
void
|
void
|
||||||
|
@ -154,8 +154,8 @@ _il_config_select_window_list_changed(void *data)
|
||||||
if (name) free(name);
|
if (name) free(name);
|
||||||
if (class) free(class);
|
if (class) free(class);
|
||||||
|
|
||||||
if (_change_timer) ecore_timer_del(_change_timer);
|
if (_sw_change_timer) ecore_timer_del(_sw_change_timer);
|
||||||
_change_timer =
|
_sw_change_timer =
|
||||||
ecore_timer_add(0.5, _il_config_select_window_change_timeout, data);
|
ecore_timer_add(0.5, _il_config_select_window_change_timeout, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ static int
|
||||||
_il_config_select_window_change_timeout(void *data)
|
_il_config_select_window_change_timeout(void *data)
|
||||||
{
|
{
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
_change_timer = NULL;
|
_sw_change_timer = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue