aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2008-11-21 03:59:30 +0000
committerCarsten Haitzler <raster@rasterman.com>2008-11-21 03:59:30 +0000
commit5b50a2b89e2d3a2098ff9e514f2bc17f3fc76fb7 (patch)
treebe50a9845baafaf94d167e8013bb57ab7e6fc3e3 /src/bin
parentchange default engine for illume. (diff)
downloadenlightenment-5b50a2b89e2d3a2098ff9e514f2bc17f3fc76fb7.tar.gz
* 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
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/Makefile.am4
-rw-r--r--src/bin/e_config.c6
-rw-r--r--src/bin/e_config.h4
-rw-r--r--src/bin/e_config_dialog.c6
-rw-r--r--src/bin/e_dialog.c18
-rw-r--r--src/bin/e_dialog.h1
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_scrollframe.c20
-rw-r--r--src/bin/e_scrollframe.h2
-rw-r--r--src/bin/e_test.c64
-rw-r--r--src/bin/e_widget_toolbar.c361
-rw-r--r--src/bin/e_widget_toolbar.h15
12 files changed, 489 insertions, 13 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 51929b956..c6bffe14b 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -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 = \
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index d79fa28ed..7db9c5cb1 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -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);
}
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 965aa730c..959826071 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -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
diff --git a/src/bin/e_config_dialog.c b/src/bin/e_config_dialog.c
index b598ea5ab..0d16ba5ff 100644
--- a/src/bin/e_config_dialog.c
+++ b/src/bin/e_config_dialog.c
@@ -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);
diff --git a/src/bin/e_dialog.c b/src/bin/e_dialog.c
index 0baa69c1f..575233b1b 100644
--- a/src/bin/e_dialog.c
+++ b/src/bin/e_dialog.c
@@ -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)
{
diff --git a/src/bin/e_dialog.h b/src/bin/e_dialog.h
index fcc425639..f7ff60636 100644
--- a/src/bin/e_dialog.h
+++ b/src/bin/e_dialog.h
@@ -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);
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index b8f4b9cc2..0d62914a0 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -135,3 +135,4 @@
#include "e_widget_flist.h"
#include "e_fm_op.h"
#include "e_scale.h"
+#include "e_widget_toolbar.h"
diff --git a/src/bin/e_scrollframe.c b/src/bin/e_scrollframe.c
index 29652ba68..1fb0b0738 100644
--- a/src/bin/e_scrollframe.c
+++ b/src/bin/e_scrollframe.c
@@ -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;
}
diff --git a/src/bin/e_scrollframe.h b/src/bin/e_scrollframe.h
index c0394c7be..fd4c294c6 100644
--- a/src/bin/e_scrollframe.h
+++ b/src/bin/e_scrollframe.h
@@ -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
diff --git a/src/bin/e_test.c b/src/bin/e_test.c
index fca70cdf2..2138e893e 100644
--- a/src/bin/e_test.c
+++ b/src/bin/e_test.c
@@ -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)
diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c
new file mode 100644
index 000000000..7fba14088
--- /dev/null
+++ b/src/bin/e_widget_toolbar.c
@@ -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);
+}
+
diff --git a/src/bin/e_widget_toolbar.h b/src/bin/e_widget_toolbar.h
new file mode 100644
index 000000000..5595b872e
--- /dev/null
+++ b/src/bin/e_widget_toolbar.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