forked from enlightenment/enlightenment
* $XXX [xxxxxxxxxx] default view (plain or inset) of a gadget should be able to be
specified by the gadcon client so when it is added it can also supply an initial style mode. This first commit, sets up the infrastructure. See the collab mail describing how this works. The next patch shall simply update the core modules to use this. Then comes the modules in e_modules SVN revision: 24491
This commit is contained in:
parent
5c5c3721bb
commit
26abf12032
|
@ -1120,9 +1120,9 @@ e_config_init(void)
|
||||||
CFG_GADCON_CLIENT("start", "default", 800, 32,
|
CFG_GADCON_CLIENT("start", "default", 800, 32,
|
||||||
0, NULL, 0, 0);
|
0, NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("pager", "default", 800, 120,
|
CFG_GADCON_CLIENT("pager", "default", 800, 120,
|
||||||
32, "inset", 0, 0);
|
32, NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("ibar", "default", 800, 200,
|
CFG_GADCON_CLIENT("ibar", "default", 800, 200,
|
||||||
400 - (16 / 2), "inset", 1, 0);
|
400 - (16 / 2), NULL, 1, 0);
|
||||||
CFG_GADCON_CLIENT("temperature", "default", 800, 32,
|
CFG_GADCON_CLIENT("temperature", "default", 800, 32,
|
||||||
800 - (5 * 32), NULL, 0, 0);
|
800 - (5 * 32), NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("cpufreq", "default", 800, 32,
|
CFG_GADCON_CLIENT("cpufreq", "default", 800, 32,
|
||||||
|
@ -1132,25 +1132,25 @@ e_config_init(void)
|
||||||
CFG_GADCON_CLIENT("clock", "default", 800, 32,
|
CFG_GADCON_CLIENT("clock", "default", 800, 32,
|
||||||
800 - (2 * 32), NULL, 0, 0);
|
800 - (2 * 32), NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
||||||
400 - (1 * 32), "inset", 1, 0);
|
400 - (1 * 32), NULL, 1, 0);
|
||||||
/* additional shelves for up to 3 more heads by default */
|
/* additional shelves for up to 3 more heads by default */
|
||||||
CFG_GADCON("shelf", "1");
|
CFG_GADCON("shelf", "1");
|
||||||
CFG_GADCON_CLIENT("pager", "default2", 800, 120,
|
CFG_GADCON_CLIENT("pager", "default2", 800, 120,
|
||||||
0, "inset", 0, 0);
|
0, NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
||||||
400 - (1 * 32), "inset", 1, 0);
|
400 - (1 * 32), NULL, 1, 0);
|
||||||
|
|
||||||
CFG_GADCON("shelf", "2");
|
CFG_GADCON("shelf", "2");
|
||||||
CFG_GADCON_CLIENT("pager", "default3", 800, 120,
|
CFG_GADCON_CLIENT("pager", "default3", 800, 120,
|
||||||
0, "inset", 0, 0);
|
0, NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
||||||
400 - (1 * 32), "inset", 1, 0);
|
400 - (1 * 32), NULL, 1, 0);
|
||||||
|
|
||||||
CFG_GADCON("shelf", "3");
|
CFG_GADCON("shelf", "3");
|
||||||
CFG_GADCON_CLIENT("pager", "default4", 800, 120,
|
CFG_GADCON_CLIENT("pager", "default4", 800, 120,
|
||||||
0, "inset", 0, 0);
|
0, NULL, 0, 0);
|
||||||
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
CFG_GADCON_CLIENT("ibox", "default", 800, 200,
|
||||||
400 - (1 * 32), "inset", 1, 0);
|
400 - (1 * 32), NULL, 1, 0);
|
||||||
}
|
}
|
||||||
IFCFGEND;
|
IFCFGEND;
|
||||||
|
|
||||||
|
|
|
@ -228,8 +228,15 @@ e_gadcon_populate(E_Gadcon *gc)
|
||||||
{
|
{
|
||||||
E_Gadcon_Client *gcc;
|
E_Gadcon_Client *gcc;
|
||||||
|
|
||||||
|
if(!cf_gcc->style)
|
||||||
|
{
|
||||||
|
gcc = cc->func.init(gc, cf_gcc->name, cf_gcc->id,
|
||||||
|
cc->default_style);
|
||||||
|
}
|
||||||
|
else
|
||||||
gcc = cc->func.init(gc, cf_gcc->name, cf_gcc->id,
|
gcc = cc->func.init(gc, cf_gcc->name, cf_gcc->id,
|
||||||
cf_gcc->style);
|
cf_gcc->style);
|
||||||
|
|
||||||
if (gcc)
|
if (gcc)
|
||||||
{
|
{
|
||||||
gcc->client_class = cc;
|
gcc->client_class = cc;
|
||||||
|
@ -866,7 +873,7 @@ _e_gadcon_client_cb_menu_style_plain(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
gcc = data;
|
gcc = data;
|
||||||
gc = gcc->gadcon;
|
gc = gcc->gadcon;
|
||||||
if (gcc->style) evas_stringshare_del(gcc->style);
|
if (gcc->style) evas_stringshare_del(gcc->style);
|
||||||
gcc->style = NULL;
|
gcc->style = evas_stringshare_add(E_GADCON_CLIENT_STYLE_PLAIN);
|
||||||
_e_gadcon_client_save(gcc);
|
_e_gadcon_client_save(gcc);
|
||||||
e_gadcon_unpopulate(gc);
|
e_gadcon_unpopulate(gc);
|
||||||
e_gadcon_populate(gc);
|
e_gadcon_populate(gc);
|
||||||
|
@ -881,7 +888,7 @@ _e_gadcon_client_cb_menu_style_inset(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
gcc = data;
|
gcc = data;
|
||||||
gc = gcc->gadcon;
|
gc = gcc->gadcon;
|
||||||
if (gcc->style) evas_stringshare_del(gcc->style);
|
if (gcc->style) evas_stringshare_del(gcc->style);
|
||||||
gcc->style = evas_stringshare_add("inset");
|
gcc->style = evas_stringshare_add(E_GADCON_CLIENT_STYLE_INSET);
|
||||||
_e_gadcon_client_save(gcc);
|
_e_gadcon_client_save(gcc);
|
||||||
e_gadcon_unpopulate(gc);
|
e_gadcon_unpopulate(gc);
|
||||||
e_gadcon_populate(gc);
|
e_gadcon_populate(gc);
|
||||||
|
@ -990,7 +997,8 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int f
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/plain");
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/plain");
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
e_menu_item_radio_group_set(mi, 1);
|
||||||
e_menu_item_radio_set(mi, 1);
|
e_menu_item_radio_set(mi, 1);
|
||||||
if (!gcc->style) e_menu_item_toggle_set(mi, 1);
|
if ((gcc->style) && (!strcmp(gcc->style, E_GADCON_CLIENT_STYLE_PLAIN)))
|
||||||
|
e_menu_item_toggle_set(mi, 1);
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_plain, gcc);
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_plain, gcc);
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
mi = e_menu_item_new(mn);
|
||||||
|
@ -998,7 +1006,7 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int f
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/plain");
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/plain");
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
e_menu_item_radio_group_set(mi, 1);
|
||||||
e_menu_item_radio_set(mi, 1);
|
e_menu_item_radio_set(mi, 1);
|
||||||
if ((gcc->style) && (!strcmp(gcc->style, "inset")))
|
if ((gcc->style) && (!strcmp(gcc->style, E_GADCON_CLIENT_STYLE_INSET)))
|
||||||
e_menu_item_toggle_set(mi, 1);
|
e_menu_item_toggle_set(mi, 1);
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_inset, gcc);
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_style_inset, gcc);
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@ typedef enum _E_Gadcon_Orient
|
||||||
E_GADCON_ORIENT_CORNER_RB
|
E_GADCON_ORIENT_CORNER_RB
|
||||||
} E_Gadcon_Orient;
|
} E_Gadcon_Orient;
|
||||||
|
|
||||||
|
#define E_GADCON_CLIENT_STYLE_PLAIN "plain"
|
||||||
|
#define E_GADCON_CLIENT_STYLE_INSET "inset"
|
||||||
|
|
||||||
typedef struct _E_Gadcon E_Gadcon;
|
typedef struct _E_Gadcon E_Gadcon;
|
||||||
typedef struct _E_Gadcon_Client E_Gadcon_Client;
|
typedef struct _E_Gadcon_Client E_Gadcon_Client;
|
||||||
typedef struct _E_Gadcon_Client_Class E_Gadcon_Client_Class;
|
typedef struct _E_Gadcon_Client_Class E_Gadcon_Client_Class;
|
||||||
|
@ -93,6 +96,7 @@ struct _E_Gadcon_Client_Class
|
||||||
Evas_Object *(*icon) (Evas *evas);
|
Evas_Object *(*icon) (Evas *evas);
|
||||||
/* All members below are part of version 2 */
|
/* All members below are part of version 2 */
|
||||||
} func;
|
} func;
|
||||||
|
char *default_style;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Gadcon_Client
|
struct _E_Gadcon_Client
|
||||||
|
|
Loading…
Reference in New Issue