* shortening config category titles.

* remove illume custom config dialog - use normal one
* add toolbar used in config dialog. will be used for more. makes ui more
  compact and flexible.
* make dialog windows optionally ALWAYS be "normal windows".
* config module exports a config gadget now - illume doesnt need it anymore



SVN revision: 37721
devs/princeamd/enlightenment-0.17-elive
Carsten Haitzler 14 years ago
parent f8fc0ae092
commit 5b50a2b89e
  1. 3
      config/default/e.src
  2. 7
      config/illume/e.src
  3. 4
      config/minimalist/e.src
  4. 4
      config/netbook/e.src
  5. 4
      config/scaleable/e.src
  6. 4
      config/standard/e.src
  7. 273
      data/themes/default.edc
  8. 1
      data/themes/images/Makefile.am
  9. BIN
      data/themes/images/toolbar_sel.png
  10. 4
      src/bin/Makefile.am
  11. 6
      src/bin/e_config.c
  12. 4
      src/bin/e_config.h
  13. 6
      src/bin/e_config_dialog.c
  14. 18
      src/bin/e_dialog.c
  15. 1
      src/bin/e_dialog.h
  16. 1
      src/bin/e_includes.h
  17. 20
      src/bin/e_scrollframe.c
  18. 2
      src/bin/e_scrollframe.h
  19. 64
      src/bin/e_test.c
  20. 361
      src/bin/e_widget_toolbar.c
  21. 15
      src/bin/e_widget_toolbar.h
  22. 41
      src/modules/conf/e_conf.c
  23. 95
      src/modules/conf/e_mod_main.c
  24. 2
      src/modules/conf_applications/e_mod_main.c
  25. 2
      src/modules/conf_borders/e_mod_main.c
  26. 2
      src/modules/conf_colors/e_mod_main.c
  27. 6
      src/modules/conf_dialogs/e_int_config_dialogs.c
  28. 2
      src/modules/conf_fonts/e_mod_main.c
  29. 2
      src/modules/conf_icon_theme/e_mod_main.c
  30. 4
      src/modules/conf_interaction/e_mod_main.c
  31. 2
      src/modules/conf_keybindings/e_mod_main.c
  32. 2
      src/modules/conf_mouse/e_mod_main.c
  33. 2
      src/modules/conf_mouse_cursor/e_mod_main.c
  34. 2
      src/modules/conf_mousebindings/e_mod_main.c
  35. 2
      src/modules/conf_scale/e_mod_main.c
  36. 2
      src/modules/conf_startup/e_mod_main.c
  37. 2
      src/modules/conf_theme/e_mod_main.c
  38. 2
      src/modules/conf_transitions/e_mod_main.c
  39. 2
      src/modules/conf_wallpaper/e_mod_main.c
  40. 2
      src/modules/dropshadow/e_mod_main.c
  41. 2
      src/modules/fileman/e_mod_main.c
  42. 2
      src/modules/illume/Makefile.am
  43. 297
      src/modules/illume/e_mod_gad_cfg.c
  44. 7
      src/modules/illume/e_mod_gad_cfg.h
  45. 2
      src/modules/illume/e_mod_main.c
  46. 4
      x-ui.sh

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 0;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i";
@ -521,4 +521,5 @@ group "E_Config" struct {
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
}

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i";
@ -613,8 +613,8 @@ group "E_Config" struct {
}
group "clients" list {
group "E_Config_Gadcon_Client" struct {
value "name" string: "illume-cfg";
value "id" string: "illume-cfg";
value "name" string: "configuration";
value "id" string: "configuration";
value "geom.pos" int: 0;
value "geom.size" int: 32;
value "geom.res" int: 472;
@ -787,4 +787,5 @@ group "E_Config" struct {
value "show_cursor" uchar: 0;
value "idle_cursor" uchar: 0;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 1;
}

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Light_Gradient.edj";
@ -1933,4 +1933,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 1;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
}

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Dark_Gradient.edj";
@ -1997,4 +1997,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
}

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i";
@ -2020,4 +2020,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
}

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 65833;
value "config_version" int: 65834;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i";
@ -2020,4 +2020,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
}

@ -5357,6 +5357,271 @@ collections { /* begin the collection of edje groups that are in this file */
}
}
/////////////////////////////////////////////////////////////////////////////
/*** TOOLBAR */
group { name: "e/widgets/toolbar";
images {
image: "bt_dis_base.png" COMP;
image: "bt_dis_hilight.png" COMP;
image: "bt_dis_shine.png" COMP;
image: "icon_left_arrow.png" COMP;
image: "icon_right_arrow.png" COMP;
}
parts {
part { name: "base";
mouse_events: 1;
description { state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2.offset: -3 -3;
image {
normal: "bt_dis_base.png";
border: 4 4 4 4;
}
}
}
part { name: "clipper";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "base";
offset: 2 2;
}
rel2 {
to: "base";
offset: -3 -3;
}
}
}
part { name: "e.swallow.content";
clip_to: "clipper";
type: SWALLOW;
description {
state: "default" 0.0;
rel1.to: "clipper";
rel2.to: "clipper";
}
}
part { name: "over2";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image {
normal: "bt_dis_shine.png";
border: 4 4 4 4;
}
}
}
part { name: "over1";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
rel2.relative: 1.0 0.5;
image {
normal: "bt_dis_hilight.png";
border: 4 4 4 0;
}
}
}
part { name: "left_arrow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "icon_left_arrow.png";
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
align: 0.0 0.5;
min: 32 32;
max: 32 32;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "right_arrow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "icon_right_arrow.png";
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
align: 1.0 0.5;
min: 32 32;
max: 32 32;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "event";
type: RECT;
mouse_events: 1;
repeat_events: 1;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
program { name: "sb_hbar_show";
signal: "e,action,show,hbar";
source: "e";
action: STATE_SET "default" 0.0;
transition: LINEAR 0.5;
target: "left_arrow";
target: "right_arrow";
}
program { name: "sb_hbar_hide";
signal: "e,action,hide,hbar";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "left_arrow";
target: "right_arrow";
transition: LINEAR 0.5;
}
}
}
group { name: "e/widgets/toolbar/item";
images {
image: "toolbar_sel.png" COMP;
}
parts {
part { name: "label2";
type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
align: 0.5 1.0;
fixed: 0 1;
rel1.to: "e.text.label";
rel2.to: "e.text.label";
color: 0 0 0 255;
text {
font: "Sans";
text_source: "e.text.label";
size: 10;
min: 1 1;
align: 0.5 0.5;
text_class: "fileman_icon";
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "bg";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
image {
normal: "toolbar_sel.png";
border: 3 3 0 0;
}
fill.smooth: 0;
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part { name: "e.swallow.icon";
type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.5;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2 {
to_y: "e.text.label";
relative: 1.0 0.0;
offset: -3 -1;
}
color: 0 0 0 0;
}
}
part { name: "e.text.label";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
align: 0.5 1.0;
fixed: 0 1;
rel1 {
relative: 0.0 1.0;
offset: 0 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
visible: 0;
color: 224 224 224 255;
color3: 0 0 0 32;
text {
font: "Sans:style=Bold";
size: 10;
min: 1 1;
align: 0.5 0.5;
text_class: "fileman_icon";
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "event";
type: RECT;
mouse_events: 1;
ignore_flags: ON_HOLD;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
program { name: "go_active";
signal: "e,state,selected";
source: "e";
action: STATE_SET "selected" 0.0;
target: "bg";
target: "e.text.label";
target: "label2";
transition: LINEAR 0.2;
}
program { name: "go_passive";
signal: "e,state,unselected";
source: "e";
action: STATE_SET "default" 0.0;
target: "bg";
target: "e.text.label";
target: "label2";
transition: LINEAR 0.1;
}
program { name: "go";
signal: "mouse,up,1";
source: "event";
action: SIGNAL_EMIT "e,action,click" "e";
}
}
}
/////////////////////////////////////////////////////////////////////////////
/*** MENUS ***/
/* this is the background for all menus. it also may optionally display a
@ -15767,11 +16032,11 @@ collections { /* begin the collection of edje groups that are in this file */
type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.5;
min: 320 200;
rel1.offset: 24 5;
min: 100 200;
rel1.offset: 5 5;
rel2 {
relative: 1.0 0.0;
offset: -25 -9;
offset: -6 -9;
to_y: "e.swallow.button";
}
}
@ -21705,7 +21970,7 @@ group { name: "e/icons/"NAME ; \
max: SIZE SIZE; \
parts { \
part { name: "icon"; \
mouse_events: 0; \
repeat_events: 1; \
description { state: "default" 0.0; \
aspect: 1.0 1.0; \
aspect_preference: BOTH; \

@ -529,6 +529,7 @@ temp_base.png \
temp_mid.png \
temp_over.png \
toolbar_bottom.png \
toolbar_sel.png \
toolbar_top.png \
topsh.png \
transition_vswipe.png \

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -163,7 +163,8 @@ e_powersave.h \
e_slidesel.h \
e_slidecore.h \
e_widget_flist.h \
e_scale.h
e_scale.h \
e_widget_toolbar.h
enlightenment_src = \
e_user.c \
@ -298,6 +299,7 @@ e_slidesel.c \
e_slidecore.c \
e_widget_flist.c \
e_scale.c \
e_widget_toolbar.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_SOURCES = \

@ -640,6 +640,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, default_system_menu, STR);
E_CONFIG_VAL(D, T, cfgdlg_normal_wins, UCHAR); /**/
e_config_load();
e_config_save_queue();
@ -818,6 +820,10 @@ e_config_load(void)
COPYVAL(desklock_start_locked);
IFCFGEND;
IFCFG(0x012b);
COPYVAL(cfgdlg_normal_wins);
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg);
}

@ -33,7 +33,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 0x012a
#define E_CONFIG_FILE_GENERATION 0x012b
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0
@ -316,6 +316,8 @@ struct _E_Config
unsigned char idle_cursor; // GUI
const char *default_system_menu;
unsigned char cfgdlg_normal_wins;
};
struct _E_Config_Module

@ -173,8 +173,10 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
else
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED");
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf);
if (cfd->view->normal_win) e_win_dialog_set(cfd->dia->win, 0);
if ((cfd->view->normal_win) || (e_config->cfgdlg_normal_wins))
cfd->dia = e_dialog_normal_win_new(cfd->con, cfd->name, buf);
else
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf);
cfd->dia->data = cfd;
e_object_del_attach_func_set(E_OBJECT(cfd->dia), _e_config_dialog_cb_dialog_del);
e_dialog_title_set(cfd->dia, cfd->title);

@ -15,8 +15,8 @@ static void _e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj);
/* externally accessible functions */
EAPI E_Dialog *
e_dialog_new(E_Container *con, const char *name, const char *class)
static E_Dialog *
_e_dialog_internal_new(E_Container *con, const char *name, const char *class, int dialog)
{
E_Dialog *dia;
E_Manager *man;
@ -42,7 +42,7 @@ e_dialog_new(E_Container *con, const char *name, const char *class)
e_win_delete_callback_set(dia->win, _e_dialog_cb_delete);
e_win_resize_callback_set(dia->win, _e_dialog_cb_resize);
dia->win->data = dia;
e_win_dialog_set(dia->win, 1);
if (dialog) e_win_dialog_set(dia->win, 1);
e_win_name_class_set(dia->win, name, class);
o = edje_object_add(e_win_evas_get(dia->win));
dia->bg_object = o;
@ -74,6 +74,18 @@ e_dialog_new(E_Container *con, const char *name, const char *class)
return dia;
}
EAPI E_Dialog *
e_dialog_new(E_Container *con, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 1);
}
EAPI E_Dialog *
e_dialog_normal_win_new(E_Container *con, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 0);
}
EAPI void
e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data)
{

@ -30,6 +30,7 @@ struct _E_Dialog
};
EAPI E_Dialog *e_dialog_new (E_Container *con, const char *name, const char *class);
EAPI E_Dialog *e_dialog_normal_win_new (E_Container *con, const char *name, const char *class);
EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);

@ -135,3 +135,4 @@
#include "e_widget_flist.h"
#include "e_fm_op.h"
#include "e_scale.h"
#include "e_widget_toolbar.h"

@ -51,7 +51,9 @@ struct _E_Smart_Data
void (*max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
void (*child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
} pan_func;
struct {
Evas_Bool forced : 1;
} thumbscroll;
unsigned char hbar_visible : 1;
unsigned char vbar_visible : 1;
@ -349,6 +351,13 @@ e_scrollframe_single_dir_get(Evas_Object *obj)
return sd->one_dir_at_a_time;
}
EAPI void
e_scrollframe_thumbscroll_force(Evas_Object *obj, Evas_Bool forced)
{
API_ENTRY return;
sd->thumbscroll.forced = forced;
}
/* local subsystem functions */
static void
_e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source)
@ -429,7 +438,7 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
sd = data;
ev = event_info;
if (e_config->thumbscroll_enable)
if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{
if (sd->down.momentum_animator)
{
@ -494,7 +503,7 @@ _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
sd = data;
ev = event_info;
if (e_config->thumbscroll_enable)
if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{
if (ev->button == 1)
{
@ -558,7 +567,7 @@ _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
sd = data;
ev = event_info;
if (e_config->thumbscroll_enable)
if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{
if (sd->down.now)
{
@ -673,7 +682,8 @@ _e_smart_scrollbar_read(E_Smart_Data *sd)
x = vx * (double)mx;
y = vy * (double)my;
sd->pan_func.set(sd->pan_obj, x, y);
if ((e_config->thumbscroll_enable) && (sd->down.now) && (!sd->down.dragged))
if (((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
&& (sd->down.now) && (!sd->down.dragged))
sd->down.now = 0;
}

@ -32,7 +32,7 @@ EAPI void e_scrollframe_policy_get (Evas_Object *obj, E_Scrollframe
EAPI Evas_Object *e_scrollframe_edje_object_get (Evas_Object *obj);
EAPI void e_scrollframe_single_dir_set (Evas_Object *obj, Evas_Bool single_dir);
EAPI Evas_Bool e_scrollframe_single_dir_get (Evas_Object *obj);
EAPI void e_scrollframe_thumbscroll_force (Evas_Object *obj, Evas_Bool forced);
#endif
#endif

@ -739,6 +739,70 @@ _e_test_internal(E_Container *con)
e_win_resize(dia->win, 400, 400);
}
#elif 0
static int
_e_test_timer(void *data)
{
E_Container *con;
E_Dialog *dia;
Evas_Object *o, *ic;
Evas_Coord mw, mh;
con = data;
dia = e_dialog_new(con, "E", "_test");
e_dialog_title_set(dia, "A Test Dialog");
o = e_widget_toolbar_add(dia->win->evas, 48, 48);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_hdd.png");
e_widget_toolbar_item_append(o, ic, "HDD", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_cd.png");
e_widget_toolbar_item_append(o, ic, "CD", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_desktop.png");
e_widget_toolbar_item_append(o, ic, "Desktop", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_home.png");
e_widget_toolbar_item_append(o, ic, "Home", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_root.png");
e_widget_toolbar_item_append(o, ic, "Root", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_tmp.png");
e_widget_toolbar_item_append(o, ic, "Temp", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_globe.png");
e_widget_toolbar_item_append(o, ic, "World", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_mixer.png");
e_widget_toolbar_item_append(o, ic, "Mixer", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_performance.png");
e_widget_toolbar_item_append(o, ic, "Perform", NULL, NULL, NULL);
e_widget_toolbar_scrollable_set(o, 1);
e_widget_toolbar_item_select(o, 1);
/* fixme... more */
e_widget_min_size_get(o, &mw, &mh);
e_dialog_content_set(dia, o, mw, mh);
evas_object_show(o);
/* buttons at the bottom */
e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
e_dialog_resizable_set(dia, 1);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
e_win_resize(dia->win, 400, 200);
return 0;
}
static void
_e_test_internal(E_Container *con)
{
ecore_timer_add(1.0, _e_test_timer, con);
}
#else
static void
_e_test_internal(E_Container *con)

@ -0,0 +1,361 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
typedef struct _E_Widget_Data E_Widget_Data;
typedef struct _Item Item;
struct _E_Widget_Data
{
Evas_Object *o_base, *o_box, *o_scrollframe0;
int icon_w, icon_h;
Eina_List *items;
Evas_Bool scrollable : 1;
};
struct _Item
{
Evas_Object *o_toolbar, *o_base, *o_icon;
void (*func) (void *data1, void *data2);
const void *data1, *data2;
Evas_Bool selected : 1;
};
static void _e_wid_del_hook(Evas_Object *obj);
static void _e_wid_focus_hook(Evas_Object *obj);
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_wid_disable_hook(Evas_Object *obj);
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _item_show(Item *it);
/* local subsystem functions */
/* externally accessible functions */
EAPI Evas_Object *
e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
e_widget_disable_hook_set(obj, _e_wid_disable_hook);
wd = calloc(1, sizeof(E_Widget_Data));
e_widget_data_set(obj, wd);
wd->icon_w = icon_w;
wd->icon_h = icon_h;
o = e_scrollframe_add(evas);
wd->o_base = o;
e_scrollframe_custom_theme_set(o, "base/theme/widgets", "e/widgets/toolbar");
e_scrollframe_single_dir_set(o, 1);
e_scrollframe_policy_set(o, E_SCROLLFRAME_POLICY_AUTO, E_SCROLLFRAME_POLICY_OFF);
e_scrollframe_thumbscroll_force(o, 1);
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
_e_wid_cb_scrollframe_resize, obj);
evas_object_event_callback_add(e_scrollframe_edje_object_get(wd->o_base),
EVAS_CALLBACK_MOUSE_DOWN,
_e_wid_focus_steal, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
_e_wid_cb_key_down, obj);
evas_object_show(o);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_box_add(evas);
wd->o_box = o;
e_box_orientation_set(o, 1);
e_box_homogenous_set(o, 1);
e_scrollframe_child_set(wd->o_base, o);
e_widget_sub_object_add(obj, o);
evas_object_show(o);
edje_object_size_min_calc
(e_scrollframe_edje_object_get(wd->o_base), &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
return obj;
}
EAPI void
e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2)
{
E_Widget_Data *wd;
Evas_Object *o;
Item *it;
Evas_Coord mw = 0, mh = 0, vw = 0, vh = 0;
wd = e_widget_data_get(obj);
o = edje_object_add(evas_object_evas_get(obj));
e_theme_edje_object_set(o, "base/theme/widgets",
"e/widgets/toolbar/item");
it = E_NEW(Item, 1);
it->o_toolbar = obj;
it->o_base = o;
it->o_icon = icon;
it->func = func;
it->data1 = data1;
it->data2 = data2;
wd->items = eina_list_append(wd->items, it);
edje_object_signal_callback_add(o, "e,action,click", "e",
_e_wid_signal_cb1, it);
edje_extern_object_min_size_set(icon, wd->icon_w, wd->icon_h);
edje_object_part_swallow(o, "e.swallow.icon", icon);
evas_object_show(icon);
edje_object_part_text_set(o, "e.text.label", label);
edje_object_size_min_calc(o, &mw, &mh);
e_widget_sub_object_add(obj, o);
e_box_pack_end(wd->o_box, o);
evas_object_show(o);
e_box_pack_options_set(o,
1, 1, /* fill */
0, 0, /* expand */
0.5, 0.5, /* align */
mw, mh, /* min */
9999, 9999 /* max */
);
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_resize(wd->o_box, mw, mh);
evas_object_resize(wd->o_base, 500, 500);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
if (wd->scrollable)
e_widget_min_size_set(obj, 500 - vw, mh + (500 - vh));
else
e_widget_min_size_set(obj, mw + (500 - vw), mh + (500 - vh));
}
EAPI void
e_widget_toolbar_item_select(Evas_Object *obj, int num)
{
E_Widget_Data *wd;
Eina_List *l;
Item *it;
int i;
wd = e_widget_data_get(obj);
for (i = 0, l = wd->items; l; l = l->next, i++)
{
it = l->data;
if (i == num)
{
if (!it->selected)
{
it->selected = 1;
edje_object_signal_emit(it->o_base, "e,state,selected", "e");
edje_object_signal_emit(it->o_icon, "e,state,selected", "e");
_item_show(it);
if (it->func) it->func(it->data1, it->data2);
}
}
else
{
if (it->selected)
{
it->selected = 0;
edje_object_signal_emit(it->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it->o_icon, "e,state,unselected", "e");
}
}
}
}
EAPI void
e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable)
{
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0, vw = 0, vh = 0;
wd = e_widget_data_get(obj);
wd->scrollable = scrollable;
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_resize(wd->o_box, mw, mh);
evas_object_resize(wd->o_base, 500, 500);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
if (wd->scrollable)
e_widget_min_size_set(obj, 500 - vw, mh + (500 - vh));
else
e_widget_min_size_set(obj, mw + (500 - vw), mh + (500 - vh));
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
while (wd->items)
{
Item *it;
it = wd->items->data;
evas_object_del(it->o_base);
evas_object_del(it->o_icon);
free(it);
wd->items = eina_list_remove_list(wd->items, wd->items);
}
free(wd);
}
static void
_e_wid_disable_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
if (e_widget_disabled_get(obj))
edje_object_signal_emit
(e_scrollframe_edje_object_get(wd->o_base), "e,state,disabled", "e");
else
edje_object_signal_emit
(e_scrollframe_edje_object_get(wd->o_base), "e,state,enabled", "e");
}
static void
_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Item *it, *it2;
E_Widget_Data *wd;
Eina_List *l;
it = data;
if (it->selected) return;
wd = e_widget_data_get(it->o_toolbar);
for (l = wd->items; l; l = l->next)
{
it2 = l->data;
if (it2->selected)
{
it2->selected = 0;
edje_object_signal_emit(it2->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it2->o_icon, "e,state,unselected", "e");
break;
}
}
it->selected = 1;
edje_object_signal_emit(it->o_base, "e,state,selected", "e");
edje_object_signal_emit(it->o_icon, "e,state,selected", "e");
_item_show(it);
if (it->func) it->func(it->data1, it->data2);
}
static void
_e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_Coord mw, mh, vw, vh, w, h;
Eina_List *l;
Item *it;
wd = e_widget_data_get(data);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_geometry_get(wd->o_box, NULL, NULL, &w, &h);
if (vw >= mw)
{
if (w != vw) evas_object_resize(wd->o_box, vw, h);
}
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
_item_show(it);
break;
}
}
}
static void
_e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Evas_Event_Key_Down *ev;
E_Widget_Data *wd;
Eina_List *l;
Item *it = NULL, *it2 = NULL;
ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
wd = e_widget_data_get(data);
if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")) ||
(!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))
)
{
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
if (l->prev) it2 = l->prev->data;
break;
}
}
}
else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")) ||
(!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))
)
{
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
if (l->next) it2 = l->next->data;
break;
}
}
}
if ((it) && (it2))
{
it->selected = 0;
edje_object_signal_emit(it->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it->o_icon, "e,state,unselected", "e");
it2->selected = 1;
edje_object_signal_emit(it2->o_base, "e,state,selected", "e");
edje_object_signal_emit(it2->o_icon, "e,state,selected", "e");
_item_show(it2);
if (it2->func) it->func(it2->data1, it2->data2);
}
}
static void
_e_wid_focus_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
if (e_widget_focus_get(obj))
{
edje_object_signal_emit(wd->o_base, "e,state,focused", "e");
evas_object_focus_set(obj, 1);
}
else
{
edje_object_signal_emit(wd->o_base, "e,state,unfocused", "e");
evas_object_focus_set(obj, 0);
}
}
static void
_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
e_widget_focus_steal(data);
}
static void
_item_show(Item *it)
{
E_Widget_Data *wd;
Evas_Coord x, y, w, h, bx, by;
wd = e_widget_data_get(it->o_toolbar);
evas_object_geometry_get(wd->o_box, &bx, &by, NULL, NULL);
evas_object_geometry_get(it->o_base, &x, &y, &w, &h);
e_scrollframe_child_region_show(wd->o_base, x - bx, y - by, w, h);
}

@ -0,0 +1,15 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_TOOLBAR_H
#define E_WIDGET_TOOLBAR_H
EAPI Evas_Object *e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h);
EAPI void e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2);
EAPI void e_widget_toolbar_item_select(Evas_Object *obj, int num);
EAPI void e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable);
#endif
#endif

@ -52,7 +52,7 @@ static void _e_configure_cb_del_req(E_Win *win);
static void _e_configure_cb_resize(E_Win *win);
static void _e_configure_cb_close(void *data, void *data2);
static E_Configure_Category *_e_configure_category_add(E_Configure *eco, const char *label, const char *icon);
static void _e_configure_category_cb(void *data);
static void _e_configure_category_cb(void *data, void *data2);
static void _e_configure_item_add(E_Configure_Category *cat, const char *label, const char *icon, const char *path);
static void _e_configure_item_cb(void *data);
static void _e_configure_focus_cb(void *data, Evas_Object *obj);
@ -119,9 +119,9 @@ e_configure_show(E_Container *con)
eco->mod_hdl = ecore_event_handler_add(E_EVENT_MODULE_UPDATE,
_e_configure_module_update_cb, eco);
e_win_title_set(eco->win, _("Enlightenment Configuration"));
e_win_title_set(eco->win, _("Configuration"));
e_win_name_class_set(eco->win, "E", "_configure");
e_win_dialog_set(eco->win, 1);
e_win_dialog_set(eco->win, 0);
e_win_delete_callback_set(eco->win, _e_configure_cb_del_req);
e_win_resize_callback_set(eco->win, _e_configure_cb_resize);
e_win_centered_set(eco->win, 1);
@ -130,9 +130,9 @@ e_configure_show(E_Container *con)
e_theme_edje_object_set(eco->edje, "base/theme/configure",
"e/widgets/configure/main");
edje_object_part_text_set(eco->edje, "e.text.title",
_("Enlightenment Configuration"));
_("Configuration"));
eco->o_list = e_widget_list_add(eco->evas, 1, 1);
eco->o_list = e_widget_list_add(eco->evas, 0, 0);
edje_object_part_swallow(eco->edje, "e.swallow.content", eco->o_list);
/* Event Obj for keydown */
@ -146,25 +146,24 @@ e_configure_show(E_Container *con)
mask = 0;
evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_configure_keydown_cb, eco->win);
/* Category List */
of = e_widget_framelist_add(eco->evas, _("Categories"), 1);
eco->cat_list = e_widget_ilist_add(eco->evas, 32 * e_scale, 32 * e_scale, NULL);
e_widget_ilist_selector_set(eco->cat_list, 1);
eco->cat_list = e_widget_toolbar_add(eco->evas, 32 * e_scale, 32 * e_scale);
e_widget_toolbar_scrollable_set(eco->cat_list, 1);
/***--- fill ---***/
_e_configure_fill_cat_list(eco);
e_widget_on_focus_hook_set(eco->cat_list, _e_configure_focus_cb, eco->win);
e_widget_framelist_object_append(of, eco->cat_list);
e_widget_list_object_append(eco->o_list, of, 1, 1, 0.5);
e_widget_list_object_append(eco->o_list, eco->cat_list, 1, 0, 0.5);
/* Item List */
of = e_widget_framelist_add(eco->evas, _("Items"), 1);
eco->item_list = e_widget_ilist_add(eco->evas, 32 * e_scale, 32 * e_scale, NULL);
e_widget_ilist_selector_set(eco->item_list, 1);
e_widget_ilist_go(eco->item_list);
e_widget_on_focus_hook_set(eco->item_list, _e_configure_focus_cb, eco->win);
e_widget_framelist_object_append(of, eco->item_list);
e_widget_list_object_append(eco->o_list, of, 1, 1, 0.5);
e_widget_min_size_get(eco->item_list, &mw, &mh);
if (mw < (200 * e_scale)) mw = 200 * e_scale;
if (mh < (120 * e_scale)) mh = 120 * e_scale;
e_widget_min_size_set(eco->item_list, mw, mh);
e_widget_list_object_append(eco->o_list, eco->item_list, 1, 1, 0.5);
e_widget_min_size_get(eco->o_list, &mw, &mh);
edje_extern_object_min_size_set(eco->o_list, mw, mh);
@ -187,14 +186,14 @@ e_configure_show(E_Container *con)
/* Preselect "Appearance" */
e_widget_focus_set(eco->cat_list, 1);
e_widget_ilist_selected_set(eco->cat_list, 0);
e_widget_toolbar_item_select(eco->cat_list, 0);
if (eco->cats)
{
E_Configure_Category *cat;
cat = eco->cats->data;
_e_configure_category_cb(cat);
_e_configure_category_cb(cat, NULL);
}
_e_configure = eco;
@ -316,12 +315,12 @@ _e_configure_category_add(E_Configure *eco, const char *label, const char *icon)
}
eco->cats = eina_list_append(eco->cats, cat);
e_widget_ilist_append(eco->cat_list, o, label, _e_configure_category_cb, cat, NULL);
e_widget_toolbar_item_append(eco->cat_list, o, label, _e_configure_category_cb, cat, NULL);
return cat;
}
static void
_e_configure_category_cb(void *data)
_e_configure_category_cb(void *data, void *data2)
{
E_Configure_Category *cat;
E_Configure *eco;
@ -487,8 +486,6 @@ _e_configure_fill_cat_list(void *data)
evas_event_freeze(evas_object_evas_get(eco->cat_list));
edje_freeze();
e_widget_ilist_freeze(eco->cat_list);
e_widget_ilist_clear(eco->cat_list);
for (l = e_configure_registry; l; l = l->next)
{
@ -514,10 +511,8 @@ _e_configure_fill_cat_list(void *data)
}
}
e_widget_ilist_go(eco->cat_list);
e_widget_min_size_get(eco->cat_list, &mw, &mh);
e_widget_min_size_set(eco->cat_list, mw, mh);
e_widget_ilist_thaw(eco->cat_list);
edje_thaw();
evas_event_thaw(evas_object_evas_get(eco->cat_list));
}

@ -21,7 +21,100 @@ static E_Int_Menu_Augmentation *maug = NULL;
/***************************************************************************/
/**/
/* gadget */
/***************************************************************************/
/**/
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label(E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
static void _cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
GADCON_CLIENT_CLASS_VERSION,
"configuration",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
Evas_Object *o;
E_Gadcon_Client *gcc;
o = edje_object_add(gc->evas);
e_util_edje_icon_set(o, "enlightenment/configuration");
evas_object_show(o);
gcc = e_gadcon_client_new(gc, name, id, style, o);
gcc->data = o;
e_gadcon_client_util_menu_attach(gcc);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP,
_cb_mouse_up, NULL);
return gcc;
}
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
evas_object_del(gcc->o_base);
}
static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{
Evas_Coord mw, mh;
mw = 0, mh = 0;
edje_object_size_min_get(gcc->o_base, &mw, &mh);
if ((mw < 1) || (mh < 1))
edje_object_size_min_calc(gcc->o_base, &mw, &mh);
if (mw < 4) mw = 4;
if (mh < 4) mh = 4;
e_gadcon_client_aspect_set(gcc, mw, mh);
e_gadcon_client_min_size_set(gcc, mw, mh);
}
static char *
_gc_label(<