2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
2007-03-25 03:16:05 -07:00
|
|
|
/* TODO:
|
|
|
|
* - Track execution status
|
|
|
|
*/
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* gadcon requirements */
|
2006-05-31 09:12:16 -07:00
|
|
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
|
2012-06-22 00:28:13 -07:00
|
|
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
|
|
|
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
|
2012-07-27 01:25:22 -07:00
|
|
|
static const char *_gc_label(const E_Gadcon_Client_Class *client_class);
|
|
|
|
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas);
|
|
|
|
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
|
|
|
|
static void _gc_id_del(const E_Gadcon_Client_Class *client_class, const char *id);
|
2007-12-12 16:56:31 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* and actually define the gadcon class that this module provides (just 1) */
|
2006-05-31 09:12:16 -07:00
|
|
|
static const E_Gadcon_Client_Class _gadcon_class =
|
2005-09-23 10:13:47 -07:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
GADCON_CLIENT_CLASS_VERSION,
|
2012-06-22 00:28:13 -07:00
|
|
|
"ibar",
|
|
|
|
{
|
|
|
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, _gc_id_del,
|
|
|
|
e_gadcon_site_is_not_toolbar
|
|
|
|
},
|
2006-08-08 23:38:35 -07:00
|
|
|
E_GADCON_CLIENT_STYLE_INSET
|
2005-09-23 10:13:47 -07:00
|
|
|
};
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* actual module specifics */
|
|
|
|
typedef struct _Instance Instance;
|
2012-06-22 00:28:13 -07:00
|
|
|
typedef struct _IBar IBar;
|
2006-04-20 04:30:25 -07:00
|
|
|
typedef struct _IBar_Icon IBar_Icon;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
struct _Instance
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
E_Gadcon_Client *gcc;
|
2012-06-22 00:28:13 -07:00
|
|
|
Evas_Object *o_ibar;
|
|
|
|
IBar *ibar;
|
|
|
|
E_Drop_Handler *drop_handler;
|
|
|
|
Config_Item *ci;
|
|
|
|
E_Gadcon_Orient orient;
|
2006-04-20 04:30:25 -07:00
|
|
|
};
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2012-06-22 01:27:10 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
E_Order *eo;
|
|
|
|
Eina_List *bars;
|
|
|
|
} IBar_Order;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
struct _IBar
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
Instance *inst;
|
2009-05-19 15:50:35 -07:00
|
|
|
Evas_Object *o_box, *o_drop;
|
|
|
|
Evas_Object *o_drop_over, *o_empty;
|
2012-06-22 00:28:13 -07:00
|
|
|
IBar_Icon *ic_drop_before;
|
|
|
|
int drop_before;
|
|
|
|
Eina_List *icons;
|
2012-06-22 01:27:10 -07:00
|
|
|
IBar_Order *io;
|
2012-06-22 00:28:13 -07:00
|
|
|
Evas_Coord dnd_x, dnd_y;
|
2012-08-03 03:10:23 -07:00
|
|
|
Eina_Bool focused : 1;
|
2006-04-20 04:30:25 -07:00
|
|
|
};
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
struct _IBar_Icon
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2012-09-18 03:00:37 -07:00
|
|
|
IBar *ibar;
|
|
|
|
Evas_Object *o_holder, *o_icon;
|
|
|
|
Evas_Object *o_holder2, *o_icon2;
|
|
|
|
Efreet_Desktop *app;
|
|
|
|
Ecore_Timer *reset_timer;
|
|
|
|
E_Exec_Instance *exe_inst;
|
|
|
|
int mouse_down;
|
2012-06-22 00:28:13 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned char start : 1;
|
|
|
|
unsigned char dnd : 1;
|
|
|
|
int x, y;
|
|
|
|
} drag;
|
2012-08-03 03:10:23 -07:00
|
|
|
Eina_Bool focused : 1;
|
2006-04-20 04:30:25 -07:00
|
|
|
};
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
static IBar *_ibar_new(Evas *evas, Instance *inst);
|
|
|
|
static void _ibar_free(IBar *b);
|
|
|
|
static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_empty_handle(IBar *b);
|
2012-09-18 03:00:37 -07:00
|
|
|
static void _ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type);
|
2012-06-22 00:28:13 -07:00
|
|
|
static void _ibar_fill(IBar *b);
|
|
|
|
static void _ibar_empty(IBar *b);
|
|
|
|
static void _ibar_orient_set(IBar *b, int horizontal);
|
|
|
|
static void _ibar_resize_handle(IBar *b);
|
|
|
|
static void _ibar_instance_drop_zone_recalc(Instance *inst);
|
2006-05-31 09:12:16 -07:00
|
|
|
static Config_Item *_ibar_config_item_get(const char *id);
|
2012-06-22 00:28:13 -07:00
|
|
|
static IBar_Icon *_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y);
|
|
|
|
static IBar_Icon *_ibar_icon_new(IBar *b, Efreet_Desktop *desktop);
|
|
|
|
static void _ibar_icon_free(IBar_Icon *ic);
|
|
|
|
static void _ibar_icon_fill(IBar_Icon *ic);
|
|
|
|
static void _ibar_icon_empty(IBar_Icon *ic);
|
|
|
|
static void _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src);
|
|
|
|
static void _ibar_cb_app_change(void *data, E_Order *eo);
|
|
|
|
static void _ibar_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_menu_icon_new(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_cb_menu_icon_add(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_cb_menu_icon_properties(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_cb_menu_icon_remove(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_cb_menu_configuration(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_cb_icon_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_inst_cb_enter(void *data, const char *type, void *event_info);
|
|
|
|
static void _ibar_inst_cb_move(void *data, const char *type, void *event_info);
|
|
|
|
static void _ibar_inst_cb_leave(void *data, const char *type, void *event_info);
|
|
|
|
static void _ibar_inst_cb_drop(void *data, const char *type, void *event_info);
|
|
|
|
static void _ibar_cb_drag_finished(E_Drag *data, int dropped);
|
|
|
|
static void _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y);
|
|
|
|
static void _ibar_inst_cb_scroll(void *data);
|
|
|
|
static Eina_Bool _ibar_cb_config_icons(void *data, int ev_type, void *ev);
|
2007-04-05 10:38:23 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static E_Config_DD *conf_edd = NULL;
|
|
|
|
static E_Config_DD *conf_item_edd = NULL;
|
|
|
|
|
2012-06-22 01:27:10 -07:00
|
|
|
static Eina_Hash *ibar_orders = NULL;
|
2012-08-03 03:10:23 -07:00
|
|
|
static Eina_List *ibars = NULL;
|
2012-06-22 01:27:10 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
Config *ibar_config = NULL;
|
|
|
|
|
2012-06-22 01:27:10 -07:00
|
|
|
static IBar_Order *
|
|
|
|
_ibar_order_new(IBar *b, const char *path)
|
|
|
|
{
|
|
|
|
IBar_Order *io;
|
|
|
|
|
|
|
|
io = eina_hash_find(ibar_orders, path);
|
|
|
|
if (io)
|
|
|
|
{
|
|
|
|
io->bars = eina_list_append(io->bars, b);
|
|
|
|
return io;
|
|
|
|
}
|
|
|
|
io = E_NEW(IBar_Order, 1);
|
|
|
|
io->eo = e_order_new(path);
|
|
|
|
e_order_update_callback_set(io->eo, _ibar_cb_app_change, io);
|
|
|
|
eina_hash_add(ibar_orders, path, io);
|
|
|
|
io->bars = eina_list_append(io->bars, b);
|
|
|
|
return io;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_order_del(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Order *io;
|
|
|
|
if (!b->io) return;
|
|
|
|
io = b->io;
|
|
|
|
io->bars = eina_list_remove(io->bars, b);
|
|
|
|
b->io = NULL;
|
|
|
|
if (io->bars) return;
|
|
|
|
eina_hash_del_by_key(ibar_orders, io->eo->path);
|
|
|
|
e_order_update_callback_set(io->eo, NULL, NULL);
|
|
|
|
e_object_del(E_OBJECT(io->eo));
|
|
|
|
free(io);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_order_refresh(IBar *b, const char *path)
|
|
|
|
{
|
|
|
|
IBar_Order *io;
|
|
|
|
Eina_List *l;
|
|
|
|
IBar *bar;
|
|
|
|
|
|
|
|
io = eina_hash_find(ibar_orders, path);
|
|
|
|
if (io)
|
|
|
|
{
|
|
|
|
/* different order, remove/refresh */
|
|
|
|
if (io != b->io)
|
|
|
|
{
|
|
|
|
if (b->io) _ibar_order_del(b);
|
|
|
|
io->bars = eina_list_append(io->bars, b);
|
2012-12-24 05:12:47 -08:00
|
|
|
b->io = io;
|
2012-06-22 01:27:10 -07:00
|
|
|
}
|
|
|
|
/* else same order, refresh all users */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
io = b->io = _ibar_order_new(b, path);
|
|
|
|
EINA_LIST_FOREACH(io->bars, l, bar)
|
|
|
|
{
|
|
|
|
_ibar_empty(bar);
|
|
|
|
_ibar_fill(bar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static E_Gadcon_Client *
|
2006-05-31 09:12:16 -07:00
|
|
|
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
|
|
|
IBar *b;
|
|
|
|
Evas_Object *o;
|
|
|
|
E_Gadcon_Client *gcc;
|
|
|
|
Instance *inst;
|
|
|
|
Evas_Coord x, y, w, h;
|
2007-03-25 03:16:05 -07:00
|
|
|
const char *drop[] = { "enlightenment/desktop", "enlightenment/border", "text/uri-list" };
|
2006-04-20 04:30:25 -07:00
|
|
|
Config_Item *ci;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = E_NEW(Instance, 1);
|
|
|
|
|
|
|
|
ci = _ibar_config_item_get(id);
|
2007-09-15 17:02:53 -07:00
|
|
|
inst->ci = ci;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (!ci->dir) ci->dir = eina_stringshare_add("default");
|
2007-09-15 17:02:53 -07:00
|
|
|
b = _ibar_new(gc->evas, inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
o = b->o_box;
|
2006-12-30 15:32:25 -08:00
|
|
|
gcc = e_gadcon_client_new(gc, name, id, style, o);
|
2006-04-20 04:30:25 -07:00
|
|
|
gcc->data = inst;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst->gcc = gcc;
|
|
|
|
inst->o_ibar = o;
|
2008-11-04 19:28:19 -08:00
|
|
|
inst->orient = E_GADCON_ORIENT_HORIZ;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_geometry_get(o, &x, &y, &w, &h);
|
|
|
|
inst->drop_handler =
|
2006-11-12 03:32:44 -08:00
|
|
|
e_drop_handler_add(E_OBJECT(inst->gcc), inst,
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_inst_cb_enter, _ibar_inst_cb_move,
|
|
|
|
_ibar_inst_cb_leave, _ibar_inst_cb_drop,
|
|
|
|
drop, 3, x, y, w, h);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_cb_obj_moveresize, inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_cb_obj_moveresize, inst);
|
2008-10-22 04:49:33 -07:00
|
|
|
ibar_config->instances = eina_list_append(ibar_config->instances, inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
return gcc;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static void
|
|
|
|
_gc_shutdown(E_Gadcon_Client *gcc)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = gcc->data;
|
2008-10-22 04:49:33 -07:00
|
|
|
ibar_config->instances = eina_list_remove(ibar_config->instances, inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
e_drop_handler_del(inst->drop_handler);
|
|
|
|
_ibar_free(inst->ibar);
|
2009-05-19 15:50:35 -07:00
|
|
|
E_FREE(inst);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static void
|
2008-11-03 19:57:45 -08:00
|
|
|
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
2005-12-17 03:21:54 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2008-11-04 19:12:45 -08:00
|
|
|
|
2008-11-04 19:28:19 -08:00
|
|
|
inst = gcc->data;
|
2010-08-19 13:17:01 -07:00
|
|
|
if ((int)orient != -1) inst->orient = orient;
|
2008-11-04 19:12:45 -08:00
|
|
|
|
2008-11-04 19:28:19 -08:00
|
|
|
switch (inst->orient)
|
2005-12-30 05:54:44 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_orient_set(inst->ibar, 1);
|
|
|
|
e_gadcon_client_aspect_set(gcc, eina_list_count(inst->ibar->icons) * 16, 16);
|
|
|
|
break;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_orient_set(inst->ibar, 0);
|
|
|
|
e_gadcon_client_aspect_set(gcc, 16, eina_list_count(inst->ibar->icons) * 16);
|
|
|
|
break;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
default:
|
2012-06-22 00:28:13 -07:00
|
|
|
break;
|
2005-12-30 05:54:44 -08:00
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
2005-12-17 03:21:54 -08:00
|
|
|
}
|
2006-05-09 06:02:48 -07:00
|
|
|
|
2011-11-14 13:46:57 -08:00
|
|
|
static const char *
|
2012-07-27 01:25:22 -07:00
|
|
|
_gc_label(const E_Gadcon_Client_Class *client_class __UNUSED__)
|
2006-05-09 06:02:48 -07:00
|
|
|
{
|
|
|
|
return _("IBar");
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-07-27 01:25:22 -07:00
|
|
|
_gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
|
2006-05-09 06:02:48 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
2010-12-03 08:49:20 -08:00
|
|
|
char buf[PATH_MAX];
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-05-09 06:02:48 -07:00
|
|
|
o = edje_object_add(evas);
|
2007-03-25 03:16:05 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/e-module-ibar.edj",
|
2012-06-22 00:28:13 -07:00
|
|
|
e_module_dir_get(ibar_config->module));
|
2006-05-09 06:02:48 -07:00
|
|
|
edje_object_file_set(o, buf, "icon");
|
|
|
|
return o;
|
|
|
|
}
|
2007-09-15 17:02:53 -07:00
|
|
|
|
|
|
|
static const char *
|
2012-07-27 01:25:22 -07:00
|
|
|
_gc_id_new(const E_Gadcon_Client_Class *client_class __UNUSED__)
|
2007-09-15 17:02:53 -07:00
|
|
|
{
|
2012-06-22 00:24:31 -07:00
|
|
|
Config_Item *ci;
|
2007-09-15 17:02:53 -07:00
|
|
|
|
2012-06-22 00:24:31 -07:00
|
|
|
ci = _ibar_config_item_get(NULL);
|
|
|
|
return ci->id;
|
2007-09-15 17:02:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-27 01:25:22 -07:00
|
|
|
_gc_id_del(const E_Gadcon_Client_Class *client_class __UNUSED__, const char *id __UNUSED__)
|
2007-09-15 17:02:53 -07:00
|
|
|
{
|
2008-10-20 18:10:42 -07:00
|
|
|
/* yes - don't do this. on shutdown gadgets are deleted and this means config
|
|
|
|
* for them is deleted - that means empty config is saved. keep them around
|
|
|
|
* as if u add a gadget back it can pick up its old config again
|
2012-06-22 00:28:13 -07:00
|
|
|
*
|
2007-09-15 17:02:53 -07:00
|
|
|
Config_Item *ci;
|
|
|
|
|
|
|
|
ci = _ibar_config_item_get(id);
|
|
|
|
if (ci)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
if (ci->id) eina_stringshare_del(ci->id);
|
|
|
|
ibar_config->items = eina_list_remove(ibar_config->items, ci);
|
2007-09-15 17:02:53 -07:00
|
|
|
}
|
2008-10-20 18:10:42 -07:00
|
|
|
*/
|
2007-09-15 17:02:53 -07:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static IBar *
|
2007-09-15 17:02:53 -07:00
|
|
|
_ibar_new(Evas *evas, Instance *inst)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar *b;
|
2010-12-03 08:49:20 -08:00
|
|
|
char buf[PATH_MAX];
|
2008-10-27 06:31:39 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
b = E_NEW(IBar, 1);
|
2007-09-15 17:02:53 -07:00
|
|
|
inst->ibar = b;
|
|
|
|
b->inst = inst;
|
2006-04-20 04:30:25 -07:00
|
|
|
b->o_box = e_box_add(evas);
|
|
|
|
e_box_homogenous_set(b->o_box, 1);
|
|
|
|
e_box_orientation_set(b->o_box, 1);
|
|
|
|
e_box_align_set(b->o_box, 0.5, 0.5);
|
2007-09-15 17:02:53 -07:00
|
|
|
if (inst->ci->dir[0] != '/')
|
2012-06-22 00:28:13 -07:00
|
|
|
e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
|
2009-05-19 15:50:35 -07:00
|
|
|
inst->ci->dir);
|
2005-05-14 07:06:09 -07:00
|
|
|
else
|
2010-01-30 14:11:11 -08:00
|
|
|
eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
|
2012-06-22 01:27:10 -07:00
|
|
|
b->io = _ibar_order_new(b, buf);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_fill(b);
|
2012-08-03 03:10:23 -07:00
|
|
|
ibars = eina_list_append(ibars, b);
|
2006-04-20 04:30:25 -07:00
|
|
|
return b;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_free(IBar *b)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_empty(b);
|
|
|
|
evas_object_del(b->o_box);
|
|
|
|
if (b->o_drop) evas_object_del(b->o_drop);
|
|
|
|
if (b->o_drop_over) evas_object_del(b->o_drop_over);
|
2006-05-10 04:58:20 -07:00
|
|
|
if (b->o_empty) evas_object_del(b->o_empty);
|
2012-06-22 01:27:10 -07:00
|
|
|
_ibar_order_del(b);
|
2009-05-19 15:50:35 -07:00
|
|
|
E_FREE(b);
|
2012-08-03 03:10:23 -07:00
|
|
|
ibars = eina_list_remove(ibars, b);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2006-05-10 04:58:20 -07:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2006-05-10 04:58:20 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
|
|
|
IBar *b;
|
2012-08-15 00:22:04 -07:00
|
|
|
E_Menu *m;
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
int cx, cy, cw, ch;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-05-10 04:58:20 -07:00
|
|
|
ev = event_info;
|
|
|
|
b = data;
|
2012-08-15 00:22:04 -07:00
|
|
|
if (ev->button != 3) return;
|
2012-06-22 00:28:13 -07:00
|
|
|
|
2012-08-15 00:22:04 -07:00
|
|
|
m = e_menu_new();
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Settings"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, b);
|
2012-06-22 00:28:13 -07:00
|
|
|
|
2012-08-15 00:22:04 -07:00
|
|
|
m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
|
2012-06-22 00:28:13 -07:00
|
|
|
|
2012-08-15 00:22:04 -07:00
|
|
|
e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
|
|
|
|
&cx, &cy, &cw, &ch);
|
|
|
|
e_menu_activate_mouse(m,
|
|
|
|
e_util_zone_current_get(e_manager_current_get()),
|
|
|
|
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
|
|
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
|
|
|
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
|
|
|
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
2006-05-10 04:58:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_empty_handle(IBar *b)
|
|
|
|
{
|
|
|
|
if (!b->icons)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
if (!b->o_empty)
|
|
|
|
{
|
|
|
|
Evas_Coord w, h;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box));
|
|
|
|
evas_object_event_callback_add(b->o_empty,
|
|
|
|
EVAS_CALLBACK_MOUSE_DOWN,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_empty_mouse_down, b);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_color_set(b->o_empty, 0, 0, 0, 0);
|
|
|
|
evas_object_show(b->o_empty);
|
|
|
|
e_box_pack_end(b->o_box, b->o_empty);
|
|
|
|
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
|
|
|
if (e_box_orientation_get(b->o_box))
|
|
|
|
w = h;
|
|
|
|
else
|
|
|
|
h = w;
|
|
|
|
e_box_pack_options_set(b->o_empty,
|
|
|
|
1, 1, /* fill */
|
|
|
|
1, 1, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
w, h, /* min */
|
|
|
|
9999, 9999 /* max */
|
|
|
|
);
|
|
|
|
}
|
2006-05-10 04:58:20 -07:00
|
|
|
}
|
|
|
|
else if (b->o_empty)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_del(b->o_empty);
|
|
|
|
b->o_empty = NULL;
|
2006-05-10 04:58:20 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_fill(IBar *b)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2012-06-22 01:27:10 -07:00
|
|
|
if (b->io->eo)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
const Eina_List *l;
|
|
|
|
|
2012-06-22 01:27:10 -07:00
|
|
|
EINA_LIST_FOREACH(b->io->eo->desktops, l, desktop)
|
2012-06-22 00:28:13 -07:00
|
|
|
{
|
|
|
|
IBar_Icon *ic = _ibar_icon_new(b, desktop);
|
|
|
|
b->icons = eina_list_append(b->icons, ic);
|
|
|
|
e_box_pack_end(b->o_box, ic->o_holder);
|
|
|
|
}
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
2006-05-10 04:58:20 -07:00
|
|
|
_ibar_empty_handle(b);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_resize_handle(b);
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_empty(IBar *b)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2009-02-25 19:57:10 -08:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2009-02-25 19:57:10 -08:00
|
|
|
EINA_LIST_FREE(b->icons, ic)
|
|
|
|
_ibar_icon_free(ic);
|
|
|
|
|
2006-05-10 04:58:20 -07:00
|
|
|
_ibar_empty_handle(b);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
|
2005-12-12 20:47:41 -08:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_orient_set(IBar *b, int horizontal)
|
2005-12-12 20:47:41 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
e_box_orientation_set(b->o_box, horizontal);
|
|
|
|
e_box_align_set(b->o_box, 0.5, 0.5);
|
2005-12-12 20:47:41 -08:00
|
|
|
}
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_resize_handle(IBar *b)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2009-02-25 19:57:10 -08:00
|
|
|
const Eina_List *l;
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar_Icon *ic;
|
|
|
|
Evas_Coord w, h;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
|
|
|
if (e_box_orientation_get(b->o_box))
|
|
|
|
w = h;
|
|
|
|
else
|
|
|
|
h = w;
|
|
|
|
e_box_freeze(b->o_box);
|
2009-02-25 19:57:10 -08:00
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
e_box_pack_options_set(ic->o_holder,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
|
|
|
);
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
|
|
|
e_box_thaw(b->o_box);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_instance_drop_zone_recalc(Instance *inst)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2010-11-08 12:11:45 -08:00
|
|
|
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
|
2006-09-16 23:12:48 -07:00
|
|
|
e_drop_handler_geometry_set(inst->drop_handler, x, y, w, h);
|
2012-06-22 00:28:13 -07:00
|
|
|
}
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static Config_Item *
|
2006-05-31 09:12:16 -07:00
|
|
|
_ibar_config_item_get(const char *id)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Config_Item *ci;
|
2007-09-15 19:23:32 -07:00
|
|
|
|
2011-09-03 07:39:28 -07:00
|
|
|
GADCON_CLIENT_CONFIG_GET(Config_Item, ibar_config->items, _gadcon_class, id);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2007-09-15 19:23:32 -07:00
|
|
|
ci = E_NEW(Config_Item, 1);
|
2008-10-15 08:12:56 -07:00
|
|
|
ci->id = eina_stringshare_add(id);
|
2008-10-20 18:10:42 -07:00
|
|
|
ci->dir = eina_stringshare_add("default");
|
2007-09-15 19:23:32 -07:00
|
|
|
ci->show_label = 1;
|
|
|
|
ci->eap_label = 0;
|
2012-09-18 03:00:37 -07:00
|
|
|
ci->lock_move = 0;
|
|
|
|
ci->dont_track_launch = 0;
|
2008-10-22 04:49:33 -07:00
|
|
|
ibar_config->items = eina_list_append(ibar_config->items, ci);
|
2006-04-20 04:30:25 -07:00
|
|
|
return ci;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
void
|
2007-09-15 17:02:53 -07:00
|
|
|
_ibar_config_update(Config_Item *ci)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2009-02-25 19:57:10 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
Instance *inst;
|
2012-06-22 01:27:10 -07:00
|
|
|
const Eina_List *i;
|
|
|
|
IBar_Icon *ic;
|
2007-04-09 16:12:24 -07:00
|
|
|
|
2009-02-25 19:57:10 -08:00
|
|
|
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
char buf[PATH_MAX];
|
2007-09-15 17:02:53 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
if (inst->ci != ci) continue;
|
2009-02-25 19:57:10 -08:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
if (inst->ci->dir[0] != '/')
|
|
|
|
e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
|
2009-05-19 15:50:35 -07:00
|
|
|
inst->ci->dir);
|
2012-06-22 00:28:13 -07:00
|
|
|
else
|
|
|
|
eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
|
2012-06-22 01:27:10 -07:00
|
|
|
_ibar_order_refresh(inst->ibar, buf);
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_resize_handle(inst->ibar);
|
|
|
|
_gc_orient(inst->gcc, -1);
|
2012-06-22 01:27:10 -07:00
|
|
|
}
|
|
|
|
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
|
|
|
|
EINA_LIST_FOREACH(inst->ibar->icons, i, ic)
|
2012-06-22 00:28:13 -07:00
|
|
|
{
|
|
|
|
switch (ci->eap_label)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label",
|
2009-05-19 15:50:35 -07:00
|
|
|
ic->app->name);
|
2012-06-22 00:28:13 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label",
|
2009-05-19 15:50:35 -07:00
|
|
|
ic->app->comment);
|
2012-06-22 00:28:13 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label",
|
2009-05-19 15:50:35 -07:00
|
|
|
ic->app->generic_name);
|
2012-06-22 00:28:13 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2005-06-10 09:01:00 -07:00
|
|
|
static IBar_Icon *
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y)
|
2005-06-10 09:01:00 -07:00
|
|
|
{
|
2009-02-25 19:57:10 -08:00
|
|
|
const Eina_List *l;
|
2005-06-10 09:01:00 -07:00
|
|
|
IBar_Icon *ic;
|
2006-11-17 20:56:12 -08:00
|
|
|
|
2009-02-25 19:57:10 -08:00
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
2005-06-10 09:01:00 -07:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Evas_Coord dx, dy, dw, dh;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_geometry_get(ic->o_holder, &dx, &dy, &dw, &dh);
|
2012-06-22 00:28:13 -07:00
|
|
|
if (E_INSIDE(x, y, dx, dy, dw, dh)) return ic;
|
2005-06-10 09:01:00 -07:00
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
return NULL;
|
2005-06-10 09:01:00 -07:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static IBar_Icon *
|
2007-03-25 03:16:05 -07:00
|
|
|
_ibar_icon_new(IBar *b, Efreet_Desktop *desktop)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ic = E_NEW(IBar_Icon, 1);
|
|
|
|
ic->ibar = b;
|
2007-03-25 03:16:05 -07:00
|
|
|
ic->app = desktop;
|
2006-04-20 04:30:25 -07:00
|
|
|
ic->o_holder = edje_object_add(evas_object_evas_get(b->o_box));
|
|
|
|
e_theme_edje_object_set(ic->o_holder, "base/theme/modules/ibar",
|
2012-06-22 00:28:13 -07:00
|
|
|
"e/modules/ibar/icon");
|
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
_ibar_cb_icon_mouse_in, ic);
|
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_OUT,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_mouse_out, ic);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_DOWN,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_mouse_down, ic);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_UP,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_mouse_up, ic);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_MOVE,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_mouse_move, ic);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOVE,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_move, ic);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_RESIZE,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_icon_resize, ic);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_show(ic->o_holder);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ic->o_holder2 = edje_object_add(evas_object_evas_get(b->o_box));
|
|
|
|
e_theme_edje_object_set(ic->o_holder2, "base/theme/modules/ibar",
|
2012-06-22 00:28:13 -07:00
|
|
|
"e/modules/ibar/icon_overlay");
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_layer_set(ic->o_holder2, 9999);
|
|
|
|
evas_object_pass_events_set(ic->o_holder2, 1);
|
|
|
|
evas_object_show(ic->o_holder2);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_fill(ic);
|
|
|
|
return ic;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_free(IBar_Icon *ic)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2012-08-03 03:10:23 -07:00
|
|
|
if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
|
|
|
|
ic->reset_timer = NULL;
|
2006-04-20 04:30:25 -07:00
|
|
|
if (ic->ibar->ic_drop_before == ic)
|
|
|
|
ic->ibar->ic_drop_before = NULL;
|
|
|
|
_ibar_icon_empty(ic);
|
|
|
|
evas_object_del(ic->o_holder);
|
|
|
|
evas_object_del(ic->o_holder2);
|
2012-09-18 03:00:37 -07:00
|
|
|
if (ic->exe_inst)
|
|
|
|
{
|
|
|
|
e_exec_instance_watcher_del(ic->exe_inst, _ibar_instance_watch, ic);
|
|
|
|
ic->exe_inst = NULL;
|
|
|
|
}
|
2009-05-19 15:50:35 -07:00
|
|
|
E_FREE(ic);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_fill(IBar_Icon *ic)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2007-04-05 10:38:23 -07:00
|
|
|
if (ic->o_icon) evas_object_del(ic->o_icon);
|
2010-11-05 06:11:31 -07:00
|
|
|
ic->o_icon = e_icon_add(evas_object_evas_get(ic->ibar->o_box));
|
|
|
|
e_icon_fdo_icon_set(ic->o_icon, ic->app->icon);
|
2006-08-24 11:11:17 -07:00
|
|
|
edje_object_part_swallow(ic->o_holder, "e.swallow.content", ic->o_icon);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_pass_events_set(ic->o_icon, 1);
|
|
|
|
evas_object_show(ic->o_icon);
|
2007-04-05 10:38:23 -07:00
|
|
|
if (ic->o_icon2) evas_object_del(ic->o_icon2);
|
2010-11-05 06:11:31 -07:00
|
|
|
ic->o_icon2 = e_icon_add(evas_object_evas_get(ic->ibar->o_box));
|
|
|
|
e_icon_fdo_icon_set(ic->o_icon2, ic->app->icon);
|
2006-08-24 11:11:17 -07:00
|
|
|
edje_object_part_swallow(ic->o_holder2, "e.swallow.content", ic->o_icon2);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_pass_events_set(ic->o_icon2, 1);
|
|
|
|
evas_object_show(ic->o_icon2);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
switch (ic->ibar->inst->ci->eap_label)
|
2006-06-02 12:09:08 -07:00
|
|
|
{
|
|
|
|
case 0: /* Eap Name */
|
2012-06-22 00:28:13 -07:00
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->name);
|
|
|
|
break;
|
|
|
|
|
2006-06-02 12:09:08 -07:00
|
|
|
case 1: /* Eap Comment */
|
2012-06-22 00:28:13 -07:00
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->comment);
|
|
|
|
break;
|
|
|
|
|
2006-06-02 12:09:08 -07:00
|
|
|
case 2: /* Eap Generic */
|
2012-06-22 00:28:13 -07:00
|
|
|
edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->generic_name);
|
|
|
|
break;
|
2006-06-02 12:09:08 -07:00
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_empty(IBar_Icon *ic)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-05-17 23:30:33 -07:00
|
|
|
if (ic->o_icon) evas_object_del(ic->o_icon);
|
|
|
|
if (ic->o_icon2) evas_object_del(ic->o_icon2);
|
2006-04-20 04:30:25 -07:00
|
|
|
ic->o_icon = NULL;
|
2006-05-17 23:30:33 -07:00
|
|
|
ic->o_icon2 = NULL;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2006-05-17 23:30:33 -07:00
|
|
|
if (ic->o_holder)
|
|
|
|
edje_object_signal_emit(ic->o_holder, sig, src);
|
|
|
|
if (ic->o_icon)
|
|
|
|
edje_object_signal_emit(ic->o_icon, sig, src);
|
|
|
|
if (ic->o_holder2)
|
|
|
|
edje_object_signal_emit(ic->o_holder2, sig, src);
|
|
|
|
if (ic->o_icon2)
|
|
|
|
edje_object_signal_emit(ic->o_icon2, sig, src);
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_app_change(void *data, E_Order *eo __UNUSED__)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
|
|
|
IBar *b;
|
2012-06-22 01:27:10 -07:00
|
|
|
IBar_Order *io;
|
|
|
|
Eina_List *l;
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2012-06-22 01:27:10 -07:00
|
|
|
io = data;
|
|
|
|
EINA_LIST_FOREACH(io->bars, l, b)
|
|
|
|
{
|
|
|
|
_ibar_empty(b);
|
|
|
|
_ibar_fill(b);
|
|
|
|
_ibar_resize_handle(b);
|
|
|
|
if (b->inst) _gc_orient(b->inst->gcc, -1);
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_obj_moveresize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = data;
|
|
|
|
_ibar_resize_handle(inst->ibar);
|
|
|
|
_ibar_instance_drop_zone_recalc(inst);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
static void
|
|
|
|
_ibar_cb_menu_icon_new(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
2007-12-12 16:56:31 -08:00
|
|
|
{
|
|
|
|
E_Container *con;
|
|
|
|
|
|
|
|
if (!e_configure_registry_exists("applications/new_application")) return;
|
|
|
|
con = e_container_current_get(e_manager_current_get());
|
|
|
|
e_configure_registry_call("applications/new_application", con, NULL);
|
|
|
|
}
|
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
static void
|
|
|
|
_ibar_cb_menu_icon_add(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
2007-12-12 16:56:31 -08:00
|
|
|
{
|
|
|
|
E_Container *con;
|
|
|
|
|
|
|
|
if (!e_configure_registry_exists("applications/ibar_applications")) return;
|
|
|
|
con = e_container_current_get(e_manager_current_get());
|
|
|
|
e_configure_registry_call("applications/ibar_applications", con, NULL);
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_menu_icon_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ic = data;
|
2009-05-19 15:50:35 -07:00
|
|
|
e_desktop_edit(ic->ibar->inst->gcc->gadcon->zone->container, ic->app);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_menu_icon_remove(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2008-11-03 19:57:45 -08:00
|
|
|
E_Gadcon_Client *gc;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ic = data;
|
2008-10-22 04:49:33 -07:00
|
|
|
ic->ibar->icons = eina_list_remove(ic->ibar->icons, ic);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_resize_handle(ic->ibar);
|
2008-11-03 19:57:45 -08:00
|
|
|
gc = ic->ibar->inst->gcc;
|
2008-11-04 19:12:45 -08:00
|
|
|
_gc_orient(gc, -1);
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_remove(ic->ibar->io->eo, ic->app);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_icon_free(ic);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_menu_configuration(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-05-10 04:58:20 -07:00
|
|
|
IBar *b;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-05-10 04:58:20 -07:00
|
|
|
b = data;
|
2007-09-15 17:02:53 -07:00
|
|
|
_config_ibar_module(b->inst->ci);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2010-09-09 13:20:24 -07:00
|
|
|
/*
|
2012-06-22 00:28:13 -07:00
|
|
|
static void
|
|
|
|
_ibar_cb_menu_add(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
|
|
|
{
|
2006-08-30 03:06:32 -07:00
|
|
|
IBar *b;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-08-30 03:06:32 -07:00
|
|
|
b = data;
|
2007-07-04 04:11:03 -07:00
|
|
|
e_configure_registry_call("internal/ibar_other",
|
2012-06-22 00:28:13 -07:00
|
|
|
b->inst->gcc->gadcon->zone->container,
|
2012-06-22 01:27:10 -07:00
|
|
|
b->io->eo->path);
|
2012-06-22 00:28:13 -07:00
|
|
|
}
|
|
|
|
*/
|
2006-08-30 03:06:32 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ic = data;
|
2012-08-03 03:10:23 -07:00
|
|
|
if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
|
|
|
|
ic->reset_timer = NULL;
|
2012-09-18 03:00:37 -07:00
|
|
|
if (ic->exe_inst) return;
|
2012-08-03 03:10:23 -07:00
|
|
|
ic->focused = EINA_TRUE;
|
2006-08-22 00:39:11 -07:00
|
|
|
_ibar_icon_signal_emit(ic, "e,state,focused", "e");
|
2007-09-15 17:02:53 -07:00
|
|
|
if (ic->ibar->inst->ci->show_label)
|
2006-08-22 00:39:11 -07:00
|
|
|
_ibar_icon_signal_emit(ic, "e,action,show,label", "e");
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ic = data;
|
2012-08-03 03:10:23 -07:00
|
|
|
if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
|
|
|
|
ic->reset_timer = NULL;
|
|
|
|
ic->focused = EINA_FALSE;
|
2006-08-22 00:39:11 -07:00
|
|
|
_ibar_icon_signal_emit(ic, "e,state,unfocused", "e");
|
2007-09-15 17:02:53 -07:00
|
|
|
if (ic->ibar->inst->ci->show_label)
|
2006-08-22 00:39:11 -07:00
|
|
|
_ibar_icon_signal_emit(ic, "e,action,hide,label", "e");
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
if (ev->button == 1)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
ic->drag.x = ev->output.x;
|
|
|
|
ic->drag.y = ev->output.y;
|
|
|
|
ic->drag.start = 1;
|
|
|
|
ic->drag.dnd = 0;
|
|
|
|
ic->mouse_down = 1;
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
2012-08-15 00:22:04 -07:00
|
|
|
else if (ev->button == 3)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
E_Menu *m, *mo;
|
|
|
|
E_Menu_Item *mi;
|
2010-09-09 08:08:36 -07:00
|
|
|
char buf[256];
|
2012-06-22 00:28:13 -07:00
|
|
|
int cx, cy;
|
2008-11-07 21:51:27 -08:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
m = e_menu_new();
|
2006-04-20 04:30:25 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
/* FIXME: other icon options go here too */
|
|
|
|
mo = e_menu_new();
|
2010-09-09 07:44:21 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
if (e_configure_registry_exists("applications/new_application"))
|
|
|
|
{
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Create new Icon"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "document-new");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_new, NULL);
|
2010-09-09 07:44:21 -07:00
|
|
|
|
2011-03-17 10:08:36 -07:00
|
|
|
mi = e_menu_item_new(m);
|
2010-09-09 08:04:36 -07:00
|
|
|
e_menu_item_separator_set(mi, 1);
|
2012-06-22 00:28:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (e_configure_registry_exists("applications/ibar_applications"))
|
|
|
|
{
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Contents"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "list-add");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_add, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Settings"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, ic->ibar);
|
|
|
|
|
|
|
|
m = e_gadcon_client_util_menu_items_append(ic->ibar->inst->gcc, m, 0);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(mo);
|
|
|
|
e_menu_item_label_set(mi, _("Properties"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_properties, ic);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(mo);
|
|
|
|
e_menu_item_label_set(mi, _("Remove"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "list-remove");
|
|
|
|
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_remove, ic);
|
2011-03-17 10:08:36 -07:00
|
|
|
|
|
|
|
mi = e_menu_item_new_relative(m, NULL);
|
2012-12-16 09:01:31 -08:00
|
|
|
snprintf(buf, sizeof(buf), _("Icon %s"), ic->app->name);
|
|
|
|
e_menu_item_label_set(mi, buf);
|
2012-06-22 00:28:13 -07:00
|
|
|
e_util_desktop_menu_item_icon_add(ic->app,
|
|
|
|
e_util_icon_size_normalize(24 * e_scale),
|
2011-03-17 10:08:36 -07:00
|
|
|
mi);
|
|
|
|
e_menu_item_submenu_set(mi, mo);
|
2012-09-03 01:30:39 -07:00
|
|
|
e_object_unref(E_OBJECT(mo));
|
|
|
|
e_gadcon_client_menu_set(ic->ibar->inst->gcc, m);
|
2011-03-17 10:08:36 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
e_gadcon_canvas_zone_geometry_get(ic->ibar->inst->gcc->gadcon,
|
|
|
|
&cx, &cy, NULL, NULL);
|
|
|
|
e_menu_activate_mouse(m,
|
|
|
|
e_util_zone_current_get(e_manager_current_get()),
|
|
|
|
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
|
|
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-03 03:10:23 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_ibar_cb_icon_reset(void *data)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic = data;
|
|
|
|
|
|
|
|
if (ic->focused)
|
|
|
|
{
|
|
|
|
_ibar_icon_signal_emit(ic, "e,state,focused", "e");
|
|
|
|
if (ic->ibar->inst->ci->show_label)
|
|
|
|
_ibar_icon_signal_emit(ic, "e,action,show,label", "e");
|
|
|
|
}
|
|
|
|
ic->reset_timer = NULL;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-09-18 03:00:37 -07:00
|
|
|
static void
|
|
|
|
_ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic = data;
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case E_EXEC_WATCH_STARTED:
|
|
|
|
case E_EXEC_WATCH_STOPPED:
|
|
|
|
case E_EXEC_WATCH_TIMEOUT:
|
|
|
|
if (ic->exe_inst == inst)
|
|
|
|
{
|
|
|
|
_ibar_icon_signal_emit(ic, "e,state,started", "e");
|
|
|
|
e_exec_instance_watcher_del(inst, _ibar_instance_watch, ic);
|
|
|
|
ic->exe_inst = NULL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-03 03:10:23 -07:00
|
|
|
static void
|
|
|
|
_ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
|
|
|
|
{
|
|
|
|
if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
|
2012-09-18 03:00:37 -07:00
|
|
|
{
|
|
|
|
if (ic->ibar->inst->ci->dont_track_launch)
|
|
|
|
e_exec(ic->ibar->inst->gcc->gadcon->zone,
|
|
|
|
ic->app, NULL, NULL, "ibar");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
E_Exec_Instance *einst;
|
|
|
|
|
|
|
|
if (ic->exe_inst) return;
|
|
|
|
einst = e_exec(ic->ibar->inst->gcc->gadcon->zone,
|
|
|
|
ic->app, NULL, NULL, "ibar");
|
|
|
|
if (einst)
|
|
|
|
{
|
|
|
|
ic->exe_inst = einst;
|
|
|
|
e_exec_instance_watcher_add(einst, _ibar_instance_watch, ic);
|
|
|
|
_ibar_icon_signal_emit(ic, "e,state,starting", "e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-08-03 03:10:23 -07:00
|
|
|
else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
|
|
|
|
{
|
|
|
|
if (!strncasecmp(ic->app->url, "file:", 5))
|
|
|
|
{
|
|
|
|
E_Action *act;
|
|
|
|
|
|
|
|
act = e_action_find("fileman");
|
|
|
|
if (act) act->func.go(NULL, ic->app->url + 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_ibar_icon_signal_emit(ic, "e,action,exec", "e");
|
|
|
|
if (keep_going)
|
2012-09-18 03:00:37 -07:00
|
|
|
ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
|
2012-08-03 03:10:23 -07:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2012-08-03 03:10:23 -07:00
|
|
|
_ibar_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
2012-07-16 00:31:12 -07:00
|
|
|
|
|
|
|
if ((ev->button == 1) && (ic->mouse_down == 1))
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2012-08-03 03:10:23 -07:00
|
|
|
if (!ic->drag.dnd) _ibar_icon_go(ic, EINA_FALSE);
|
2012-06-22 00:28:13 -07:00
|
|
|
ic->drag.start = 0;
|
|
|
|
ic->drag.dnd = 0;
|
|
|
|
ic->mouse_down = 0;
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-05-01 12:29:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Move *ev;
|
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
2006-04-20 04:30:25 -07:00
|
|
|
if (ic->drag.start)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
int dx, dy;
|
|
|
|
|
|
|
|
dx = ev->cur.output.x - ic->drag.x;
|
|
|
|
dy = ev->cur.output.y - ic->drag.y;
|
|
|
|
if (((dx * dx) + (dy * dy)) >
|
|
|
|
(e_config->drag_resist * e_config->drag_resist))
|
|
|
|
{
|
|
|
|
E_Drag *d;
|
|
|
|
Evas_Object *o;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
unsigned int size;
|
|
|
|
const char *drag_types[] = { "enlightenment/desktop" };
|
|
|
|
E_Gadcon_Client *gc;
|
|
|
|
|
|
|
|
ic->drag.dnd = 1;
|
|
|
|
ic->drag.start = 0;
|
|
|
|
|
2012-07-16 00:31:12 -07:00
|
|
|
if (ic->ibar->inst->ci->lock_move) return;
|
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
|
|
|
d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container,
|
|
|
|
x, y, drag_types, 1,
|
|
|
|
ic->app, -1, NULL, _ibar_cb_drag_finished);
|
2010-11-08 12:11:45 -08:00
|
|
|
efreet_desktop_ref(ic->app);
|
2012-06-22 00:28:13 -07:00
|
|
|
size = MAX(w, h);
|
2008-08-14 13:49:37 -07:00
|
|
|
o = e_util_desktop_icon_add(ic->app, size, e_drag_evas_get(d));
|
2012-06-22 00:28:13 -07:00
|
|
|
e_drag_object_set(d, o);
|
2005-05-14 07:06:09 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
e_drag_resize(d, w, h);
|
|
|
|
e_drag_start(d, ic->drag.x, ic->drag.y);
|
|
|
|
ic->ibar->icons = eina_list_remove(ic->ibar->icons, ic);
|
|
|
|
_ibar_resize_handle(ic->ibar);
|
2008-11-03 19:57:45 -08:00
|
|
|
gc = ic->ibar->inst->gcc;
|
2012-06-22 00:28:13 -07:00
|
|
|
_gc_orient(gc, -1);
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_remove(ic->ibar->io->eo, ic->app);
|
2012-06-22 00:28:13 -07:00
|
|
|
_ibar_icon_free(ic);
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar_Icon *ic;
|
|
|
|
Evas_Coord x, y;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ic = data;
|
|
|
|
evas_object_geometry_get(ic->o_holder, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(ic->o_holder2, x, y);
|
|
|
|
evas_object_raise(ic->o_holder2);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_icon_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar_Icon *ic;
|
|
|
|
Evas_Coord w, h;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ic = data;
|
|
|
|
evas_object_geometry_get(ic->o_holder, NULL, NULL, &w, &h);
|
|
|
|
evas_object_resize(ic->o_holder2, w, h);
|
|
|
|
evas_object_raise(ic->o_holder2);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_drop_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar *b;
|
|
|
|
Evas_Coord x, y;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
b = data;
|
|
|
|
evas_object_geometry_get(b->o_drop, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(b->o_drop_over, x, y);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_cb_drop_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
IBar *b;
|
|
|
|
Evas_Coord w, h;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
b = data;
|
|
|
|
evas_object_geometry_get(b->o_drop, NULL, NULL, &w, &h);
|
|
|
|
evas_object_resize(b->o_drop_over, w, h);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
|
2010-11-08 12:11:45 -08:00
|
|
|
static void
|
2010-12-03 08:49:20 -08:00
|
|
|
_ibar_cb_drag_finished(E_Drag *drag, int dropped __UNUSED__)
|
2010-11-08 12:11:45 -08:00
|
|
|
{
|
|
|
|
efreet_desktop_unref(drag->data);
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2006-11-14 22:24:30 -08:00
|
|
|
_ibar_inst_cb_scroll(void *data)
|
2005-05-01 12:29:17 -07:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2006-11-14 22:24:30 -08:00
|
|
|
|
|
|
|
/* Update the position of the dnd to handle for autoscrolling
|
|
|
|
* gadgets. */
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = data;
|
2006-11-14 22:24:30 -08:00
|
|
|
_ibar_drop_position_update(inst, inst->ibar->dnd_x, inst->ibar->dnd_y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
inst->ibar->dnd_x = x;
|
|
|
|
inst->ibar->dnd_y = y;
|
|
|
|
|
2009-05-19 15:50:35 -07:00
|
|
|
if (inst->ibar->o_drop) e_box_unpack(inst->ibar->o_drop);
|
2010-11-09 13:14:38 -08:00
|
|
|
ic = _ibar_icon_at_coord(inst->ibar, x, y);
|
2006-11-17 20:56:12 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst->ibar->ic_drop_before = ic;
|
2005-06-08 06:08:44 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
Evas_Coord ix, iy, iw, ih;
|
|
|
|
int before = 0;
|
|
|
|
|
|
|
|
evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
|
|
|
|
if (e_box_orientation_get(inst->ibar->o_box))
|
|
|
|
{
|
|
|
|
if (x < (ix + (iw / 2))) before = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (y < (iy + (ih / 2))) before = 1;
|
|
|
|
}
|
|
|
|
if (before)
|
|
|
|
e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
|
|
|
|
else
|
|
|
|
e_box_pack_after(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
|
|
|
|
inst->ibar->drop_before = before;
|
2005-06-08 06:08:44 -07:00
|
|
|
}
|
2006-11-14 22:24:30 -08:00
|
|
|
else e_box_pack_end(inst->ibar->o_box, inst->ibar->o_drop);
|
|
|
|
e_box_pack_options_set(inst->ibar->o_drop,
|
2012-06-22 00:28:13 -07:00
|
|
|
1, 1, /* fill */
|
|
|
|
1, 1, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
1, 1, /* min */
|
|
|
|
-1, -1 /* max */
|
|
|
|
);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_resize_handle(inst->ibar);
|
2008-11-04 19:12:45 -08:00
|
|
|
_gc_orient(inst->gcc, -1);
|
2006-11-14 22:24:30 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_inst_cb_enter(void *data, const char *type __UNUSED__, void *event_info)
|
2006-11-14 22:24:30 -08:00
|
|
|
{
|
|
|
|
E_Event_Dnd_Enter *ev;
|
|
|
|
Instance *inst;
|
|
|
|
Evas_Object *o, *o2;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-11-14 22:24:30 -08:00
|
|
|
ev = event_info;
|
|
|
|
inst = data;
|
|
|
|
o = edje_object_add(evas_object_evas_get(inst->ibar->o_box));
|
|
|
|
inst->ibar->o_drop = o;
|
|
|
|
o2 = edje_object_add(evas_object_evas_get(inst->ibar->o_box));
|
|
|
|
inst->ibar->o_drop_over = o2;
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_drop_move, inst->ibar);
|
2012-06-22 00:28:13 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
|
2009-05-19 15:50:35 -07:00
|
|
|
_ibar_cb_drop_resize, inst->ibar);
|
2006-11-14 22:24:30 -08:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
2012-06-22 00:28:13 -07:00
|
|
|
"e/modules/ibar/drop");
|
2006-11-14 22:24:30 -08:00
|
|
|
e_theme_edje_object_set(o2, "base/theme/modules/ibar",
|
2012-06-22 00:28:13 -07:00
|
|
|
"e/modules/ibar/drop_overlay");
|
2006-11-14 22:24:30 -08:00
|
|
|
evas_object_layer_set(o2, 19999);
|
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_show(o2);
|
|
|
|
|
|
|
|
_ibar_drop_position_update(inst, ev->x, ev->y);
|
|
|
|
e_gadcon_client_autoscroll_cb_set(inst->gcc, _ibar_inst_cb_scroll, inst);
|
2006-11-12 03:32:44 -08:00
|
|
|
e_gadcon_client_autoscroll_update(inst->gcc, ev->x, ev->y);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-05-03 10:27:42 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_inst_cb_move(void *data, const char *type __UNUSED__, void *event_info)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
E_Event_Dnd_Move *ev;
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2006-12-14 11:31:48 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ev = event_info;
|
|
|
|
inst = data;
|
2006-11-14 22:24:30 -08:00
|
|
|
_ibar_drop_position_update(inst, ev->x, ev->y);
|
2006-11-12 03:32:44 -08:00
|
|
|
e_gadcon_client_autoscroll_update(inst->gcc, ev->x, ev->y);
|
2005-05-03 10:27:42 -07:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
2010-08-18 17:00:56 -07:00
|
|
|
_ibar_inst_cb_leave(void *data, const char *type __UNUSED__, void *event_info __UNUSED__)
|
2005-05-03 10:27:42 -07:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = data;
|
|
|
|
inst->ibar->ic_drop_before = NULL;
|
|
|
|
evas_object_del(inst->ibar->o_drop);
|
|
|
|
inst->ibar->o_drop = NULL;
|
|
|
|
evas_object_del(inst->ibar->o_drop_over);
|
|
|
|
inst->ibar->o_drop_over = NULL;
|
|
|
|
_ibar_resize_handle(inst->ibar);
|
2006-11-14 22:24:30 -08:00
|
|
|
e_gadcon_client_autoscroll_cb_set(inst->gcc, NULL, NULL);
|
2008-11-04 19:12:45 -08:00
|
|
|
_gc_orient(inst->gcc, -1);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_inst_cb_drop(void *data, const char *type, void *event_info)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
E_Event_Dnd_Drop *ev;
|
2006-04-20 04:30:25 -07:00
|
|
|
Instance *inst;
|
2007-03-25 03:16:05 -07:00
|
|
|
Efreet_Desktop *app = NULL;
|
2009-02-25 19:57:10 -08:00
|
|
|
Eina_List *fl = NULL;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ev = event_info;
|
|
|
|
inst = data;
|
2006-11-14 22:24:30 -08:00
|
|
|
|
2007-03-25 03:16:05 -07:00
|
|
|
if (!strcmp(type, "enlightenment/desktop"))
|
2009-05-19 15:50:35 -07:00
|
|
|
app = ev->data;
|
2005-10-05 10:56:35 -07:00
|
|
|
else if (!strcmp(type, "enlightenment/border"))
|
2005-07-26 04:03:36 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
E_Border *bd;
|
|
|
|
|
|
|
|
bd = ev->data;
|
|
|
|
app = bd->desktop;
|
|
|
|
if (!app)
|
|
|
|
{
|
|
|
|
app = e_desktop_border_create(bd);
|
|
|
|
efreet_desktop_save(app);
|
|
|
|
e_desktop_edit(e_container_current_get(e_manager_current_get()),
|
2009-05-19 15:50:35 -07:00
|
|
|
app);
|
2012-06-22 00:28:13 -07:00
|
|
|
}
|
2007-03-25 10:23:49 -07:00
|
|
|
}
|
2005-10-05 10:56:35 -07:00
|
|
|
else if (!strcmp(type, "text/uri-list"))
|
2009-05-19 15:50:35 -07:00
|
|
|
fl = ev->data;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ic = inst->ibar->ic_drop_before;
|
2005-06-10 14:26:50 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
/* Add new eapp before this icon */
|
|
|
|
if (!inst->ibar->drop_before)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
IBar_Icon *ic2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(inst->ibar->icons, l, ic2)
|
|
|
|
{
|
|
|
|
if (ic2 == ic)
|
|
|
|
{
|
|
|
|
if (l->next)
|
|
|
|
ic = l->next->data;
|
|
|
|
else
|
|
|
|
ic = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!ic) goto atend;
|
|
|
|
if (app)
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_prepend_relative(ic->ibar->io->eo, app, ic->app);
|
2012-06-22 00:28:13 -07:00
|
|
|
else if (fl)
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_files_prepend_relative(ic->ibar->io->eo, fl, ic->app);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
atend:
|
2012-06-22 01:27:10 -07:00
|
|
|
if (inst->ibar->io->eo)
|
2012-06-22 00:28:13 -07:00
|
|
|
{
|
|
|
|
if (app)
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_append(inst->ibar->io->eo, app);
|
2012-06-22 00:28:13 -07:00
|
|
|
else if (fl)
|
2012-06-22 01:27:10 -07:00
|
|
|
e_order_files_append(inst->ibar->io->eo, fl);
|
2012-06-22 00:28:13 -07:00
|
|
|
}
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_del(inst->ibar->o_drop);
|
|
|
|
inst->ibar->o_drop = NULL;
|
|
|
|
evas_object_del(inst->ibar->o_drop_over);
|
|
|
|
inst->ibar->o_drop_over = NULL;
|
2006-11-14 22:24:30 -08:00
|
|
|
e_gadcon_client_autoscroll_cb_set(inst->gcc, NULL, NULL);
|
2006-05-17 23:30:33 -07:00
|
|
|
_ibar_empty_handle(inst->ibar);
|
2006-04-20 04:30:25 -07:00
|
|
|
_ibar_resize_handle(inst->ibar);
|
2008-11-04 19:12:45 -08:00
|
|
|
_gc_orient(inst->gcc, -1);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
|
|
|
|
2012-08-03 03:10:23 -07:00
|
|
|
static E_Action *act_ibar_focus = NULL;
|
|
|
|
static Ecore_X_Window _ibar_focus_win = 0;
|
|
|
|
static Ecore_Event_Handler *_ibar_key_down_handler = NULL;
|
|
|
|
|
|
|
|
static void _ibar_go_unfocus(void);
|
|
|
|
|
|
|
|
static IBar *
|
|
|
|
_ibar_manager_find(E_Manager *man)
|
|
|
|
{
|
|
|
|
E_Zone *z = e_util_zone_current_get(man);
|
|
|
|
IBar *b;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!z) return NULL;
|
|
|
|
// find iubar on current zone
|
|
|
|
EINA_LIST_FOREACH(ibars, l, b)
|
|
|
|
{
|
|
|
|
if ((!b->inst) || (!b->inst->gcc) || (!b->inst->gcc->gadcon)) continue;
|
|
|
|
if (b->inst->gcc->gadcon->zone == z) return b;
|
|
|
|
}
|
|
|
|
// no ibars on current zone - return any old ibar
|
|
|
|
EINA_LIST_FOREACH(ibars, l, b)
|
|
|
|
{
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
// no ibars. null.
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_icon_unfocus_focus(IBar_Icon *ic1, IBar_Icon *ic2)
|
|
|
|
{
|
|
|
|
if (ic1)
|
|
|
|
{
|
|
|
|
ic1->focused = EINA_FALSE;
|
|
|
|
_ibar_icon_signal_emit(ic1, "e,state,unfocused", "e");
|
|
|
|
if (ic1->ibar->inst->ci->show_label)
|
|
|
|
_ibar_icon_signal_emit(ic1, "e,action,hide,label", "e");
|
|
|
|
}
|
|
|
|
if (ic2)
|
|
|
|
{
|
|
|
|
ic2->focused = EINA_TRUE;
|
|
|
|
_ibar_icon_signal_emit(ic2, "e,state,focused", "e");
|
|
|
|
if (ic2->ibar->inst->ci->show_label)
|
|
|
|
_ibar_icon_signal_emit(ic2, "e,action,show,label", "e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static IBar *
|
|
|
|
_ibar_focused_find(void)
|
|
|
|
{
|
|
|
|
IBar *b;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ibars, l, b)
|
|
|
|
{
|
|
|
|
if (b->focused) return b;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_ibar_cb_sort(IBar *b1, IBar *b2)
|
|
|
|
{
|
|
|
|
E_Zone *z1 = NULL, *z2 = NULL;
|
|
|
|
|
|
|
|
if ((b1) && (b1->inst) && (b1->inst->gcc) && (b1->inst->gcc->gadcon))
|
|
|
|
z1 = b1->inst->gcc->gadcon->zone;
|
|
|
|
if ((b2) && (b2->inst) && (b2->inst->gcc) && (b2->inst->gcc->gadcon))
|
|
|
|
z2 = b2->inst->gcc->gadcon->zone;
|
|
|
|
if ((z1) && (!z2)) return -1;
|
|
|
|
else if ((!z1) && (z2)) return 1;
|
|
|
|
else if ((!z1) && (!z2)) return 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int id1, id2;
|
|
|
|
|
|
|
|
id1 = z1->id + (z1->container->num * 100) + (z1->container->manager->num * 10000);
|
|
|
|
id2 = z2->id + (z2->container->num * 100) + (z2->container->manager->num * 10000);
|
|
|
|
return id2 - id1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IBar *
|
|
|
|
_ibar_focused_next_find(void)
|
|
|
|
{
|
|
|
|
IBar *b, *bn = NULL;
|
|
|
|
Eina_List *l;
|
|
|
|
Eina_List *tmpl = NULL;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ibars, l, b)
|
|
|
|
{
|
|
|
|
if (!b->icons) continue;
|
|
|
|
tmpl = eina_list_sorted_insert
|
|
|
|
(tmpl, EINA_COMPARE_CB(_ibar_cb_sort), b);
|
|
|
|
}
|
|
|
|
if (!tmpl) tmpl = ibars;
|
|
|
|
EINA_LIST_FOREACH(tmpl, l, b)
|
|
|
|
{
|
|
|
|
if (b->focused)
|
|
|
|
{
|
|
|
|
if (l->next)
|
|
|
|
{
|
|
|
|
bn = l->next->data;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bn = tmpl->data;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tmpl != ibars) eina_list_free(tmpl);
|
|
|
|
return bn;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IBar *
|
|
|
|
_ibar_focused_prev_find(void)
|
|
|
|
{
|
|
|
|
IBar *b, *bn = NULL;
|
|
|
|
Eina_List *l;
|
|
|
|
Eina_List *tmpl = NULL;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ibars, l, b)
|
|
|
|
{
|
|
|
|
if (!b->icons) continue;
|
|
|
|
tmpl = eina_list_sorted_insert
|
|
|
|
(tmpl, EINA_COMPARE_CB(_ibar_cb_sort), b);
|
|
|
|
}
|
|
|
|
if (!tmpl) tmpl = ibars;
|
|
|
|
EINA_LIST_FOREACH(tmpl, l, b)
|
|
|
|
{
|
|
|
|
if (b->focused)
|
|
|
|
{
|
|
|
|
if (l->prev)
|
|
|
|
{
|
|
|
|
bn = l->prev->data;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-12 02:05:09 -08:00
|
|
|
bn = eina_list_last_data_get(tmpl);
|
2012-08-03 03:10:23 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tmpl != ibars) eina_list_free(tmpl);
|
|
|
|
return bn;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_focus(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (b->focused) return;
|
|
|
|
b->focused = EINA_TRUE;
|
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
|
|
|
{
|
|
|
|
if (ic->focused)
|
|
|
|
{
|
|
|
|
_ibar_icon_unfocus_focus(ic, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (b->icons)
|
|
|
|
_ibar_icon_unfocus_focus(NULL, b->icons->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_unfocus(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!b->focused) return;
|
|
|
|
b->focused = EINA_FALSE;
|
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
|
|
|
{
|
|
|
|
if (ic->focused)
|
|
|
|
{
|
|
|
|
_ibar_icon_unfocus_focus(ic, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_focus_next(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic, *ic1 = NULL, *ic2 = NULL;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!b->focused) return;
|
|
|
|
if (!b->icons) return;
|
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
|
|
|
{
|
|
|
|
if (!ic1)
|
|
|
|
{
|
|
|
|
if (ic->focused) ic1 = ic;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ic2 = ic;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// wrap to start
|
|
|
|
if ((ic1) && (!ic2)) ic2 = b->icons->data;
|
|
|
|
if ((ic1) && (ic2) && (ic1 != ic2))
|
|
|
|
_ibar_icon_unfocus_focus(ic1, ic2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_focus_prev(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic, *ic1 = NULL, *ic2 = NULL;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!b->focused) return;
|
|
|
|
if (!b->icons) return;
|
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
|
|
|
{
|
|
|
|
if (ic->focused)
|
|
|
|
{
|
|
|
|
ic1 = ic;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ic2 = ic;
|
|
|
|
}
|
|
|
|
// wrap to end
|
2012-11-12 02:05:09 -08:00
|
|
|
if ((ic1) && (!ic2)) ic2 = eina_list_last_data_get(b->icons);
|
2012-08-03 03:10:23 -07:00
|
|
|
if ((ic1) && (ic2) && (ic1 != ic2))
|
|
|
|
_ibar_icon_unfocus_focus(ic1, ic2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_focus_launch(IBar *b)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!b->focused) return;
|
|
|
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
|
|
|
{
|
|
|
|
if (ic->focused)
|
|
|
|
{
|
|
|
|
_ibar_icon_go(ic, EINA_TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_ibar_focus_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|
|
|
{
|
|
|
|
Ecore_Event_Key *ev;
|
|
|
|
IBar *b, *b2;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
if (ev->window != _ibar_focus_win) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
b = _ibar_focused_find();
|
|
|
|
if (!b) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (!strcmp(ev->key, "Up"))
|
|
|
|
{
|
|
|
|
if (b->inst)
|
|
|
|
{
|
|
|
|
switch (b->inst->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
_ibar_focus_prev(b);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "Down"))
|
|
|
|
{
|
|
|
|
if (b->inst)
|
|
|
|
{
|
|
|
|
switch (b->inst->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
_ibar_focus_next(b);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "Left"))
|
|
|
|
{
|
|
|
|
if (b->inst)
|
|
|
|
{
|
|
|
|
switch (b->inst->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
_ibar_focus_prev(b);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "Right"))
|
|
|
|
{
|
|
|
|
if (b->inst)
|
|
|
|
{
|
|
|
|
switch (b->inst->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
_ibar_focus_next(b);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "space"))
|
|
|
|
{
|
|
|
|
_ibar_focus_launch(b);
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->key, "Return")) ||
|
|
|
|
(!strcmp(ev->key, "KP_Enter")))
|
|
|
|
{
|
|
|
|
_ibar_focus_launch(b);
|
|
|
|
_ibar_go_unfocus();
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "Escape"))
|
|
|
|
{
|
|
|
|
_ibar_go_unfocus();
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "Tab"))
|
|
|
|
{
|
|
|
|
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
|
|
|
|
{
|
|
|
|
b2 = _ibar_focused_prev_find();
|
|
|
|
if ((b) && (b2) && (b != b2))
|
|
|
|
{
|
|
|
|
_ibar_unfocus(b);
|
|
|
|
_ibar_focus(b2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
b2 = _ibar_focused_next_find();
|
|
|
|
if ((b) && (b2) && (b != b2))
|
|
|
|
{
|
|
|
|
_ibar_unfocus(b);
|
|
|
|
_ibar_focus(b2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->key, "ISO_Left_Tab"))
|
|
|
|
{
|
|
|
|
b2 = _ibar_focused_prev_find();
|
|
|
|
if ((b) && (b2) && (b != b2))
|
|
|
|
{
|
|
|
|
_ibar_unfocus(b);
|
|
|
|
_ibar_focus(b2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_go_focus(void)
|
|
|
|
{
|
|
|
|
E_Manager *man;
|
|
|
|
IBar *b;
|
|
|
|
|
|
|
|
if (_ibar_focus_win) return;
|
|
|
|
man = e_manager_current_get();
|
|
|
|
if (!man) return;
|
|
|
|
_ibar_focus_win = ecore_x_window_input_new(man->root, -10, -20, 1, 1);
|
|
|
|
ecore_x_window_show(_ibar_focus_win);
|
|
|
|
if (!e_grabinput_get(0, 0, _ibar_focus_win))
|
|
|
|
{
|
|
|
|
ecore_x_window_free(_ibar_focus_win);
|
|
|
|
_ibar_focus_win = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_ibar_key_down_handler = ecore_event_handler_add
|
|
|
|
(ECORE_EVENT_KEY_DOWN, _ibar_focus_cb_key_down, NULL);
|
|
|
|
if (!_ibar_key_down_handler) goto err;
|
|
|
|
b = _ibar_manager_find(man);
|
|
|
|
if (!b) goto err;
|
|
|
|
_ibar_focus(b);
|
|
|
|
return;
|
|
|
|
err:
|
|
|
|
if (_ibar_key_down_handler) ecore_event_handler_del(_ibar_key_down_handler);
|
|
|
|
_ibar_key_down_handler = NULL;
|
|
|
|
if (_ibar_focus_win)
|
|
|
|
{
|
|
|
|
e_grabinput_release(0, _ibar_focus_win);
|
|
|
|
ecore_x_window_free(_ibar_focus_win);
|
|
|
|
}
|
|
|
|
_ibar_focus_win = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_go_unfocus(void)
|
|
|
|
{
|
|
|
|
IBar *b;
|
|
|
|
|
|
|
|
if (!_ibar_focus_win) return;
|
|
|
|
b = _ibar_focused_find();
|
|
|
|
if (b) _ibar_unfocus(b);
|
|
|
|
e_grabinput_release(0, _ibar_focus_win);
|
|
|
|
ecore_x_window_free(_ibar_focus_win);
|
|
|
|
_ibar_focus_win = 0;
|
|
|
|
ecore_event_handler_del(_ibar_key_down_handler);
|
|
|
|
_ibar_key_down_handler = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_cb_action_focus(E_Object *obj __UNUSED__, const char *params __UNUSED__, Ecore_Event_Key *ev __UNUSED__)
|
|
|
|
{
|
|
|
|
_ibar_go_focus();
|
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* module setup */
|
|
|
|
EAPI E_Module_Api e_modapi =
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2009-05-19 15:50:35 -07:00
|
|
|
E_MODULE_API_VERSION, "IBar"
|
2006-04-20 04:30:25 -07:00
|
|
|
};
|
2005-12-12 20:47:41 -08:00
|
|
|
|
2006-06-06 08:21:48 -07:00
|
|
|
EAPI void *
|
2006-05-09 06:02:48 -07:00
|
|
|
e_modapi_init(E_Module *m)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
conf_item_edd = E_CONFIG_DD_NEW("IBar_Config_Item", Config_Item);
|
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config_Item
|
|
|
|
#define D conf_item_edd
|
|
|
|
E_CONFIG_VAL(D, T, id, STR);
|
|
|
|
E_CONFIG_VAL(D, T, dir, STR);
|
2006-05-10 00:42:39 -07:00
|
|
|
E_CONFIG_VAL(D, T, show_label, INT);
|
2006-06-02 12:09:08 -07:00
|
|
|
E_CONFIG_VAL(D, T, eap_label, INT);
|
2012-07-16 00:31:12 -07:00
|
|
|
E_CONFIG_VAL(D, T, lock_move, INT);
|
2012-09-18 03:00:37 -07:00
|
|
|
E_CONFIG_VAL(D, T, dont_track_launch, UCHAR);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config);
|
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config
|
|
|
|
#define D conf_edd
|
|
|
|
E_CONFIG_LIST(D, T, items, conf_item_edd);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
ibar_config = e_config_domain_load("module.ibar", conf_edd);
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
if (!ibar_config)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
Config_Item *ci;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
ibar_config = E_NEW(Config, 1);
|
2008-10-20 18:10:42 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
ci = E_NEW(Config_Item, 1);
|
|
|
|
ci->id = eina_stringshare_add("ibar.1");
|
|
|
|
ci->dir = eina_stringshare_add("default");
|
|
|
|
ci->show_label = 1;
|
|
|
|
ci->eap_label = 0;
|
2012-09-18 03:00:37 -07:00
|
|
|
ci->lock_move = 0;
|
|
|
|
ci->dont_track_launch = 0;
|
2012-06-22 00:28:13 -07:00
|
|
|
ibar_config->items = eina_list_append(ibar_config->items, ci);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
2012-06-22 00:28:13 -07:00
|
|
|
|
2006-05-09 06:02:48 -07:00
|
|
|
ibar_config->module = m;
|
2007-04-05 10:38:23 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
ibar_config->handlers =
|
2009-05-19 15:50:35 -07:00
|
|
|
eina_list_append(ibar_config->handlers,
|
2012-06-22 00:28:13 -07:00
|
|
|
ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME,
|
2010-12-02 00:34:18 -08:00
|
|
|
_ibar_cb_config_icons, NULL));
|
2012-06-22 00:28:13 -07:00
|
|
|
ibar_config->handlers =
|
2010-12-02 00:34:18 -08:00
|
|
|
eina_list_append(ibar_config->handlers,
|
|
|
|
ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE,
|
|
|
|
_ibar_cb_config_icons, NULL));
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_provider_register(&_gadcon_class);
|
2012-06-22 01:27:10 -07:00
|
|
|
ibar_orders = eina_hash_string_superfast_new(NULL);
|
2012-08-03 03:10:23 -07:00
|
|
|
|
|
|
|
act_ibar_focus = e_action_add("ibar_focus");
|
|
|
|
if (act_ibar_focus)
|
|
|
|
{
|
|
|
|
act_ibar_focus->func.go_key = _ibar_cb_action_focus;
|
|
|
|
e_action_predef_name_set(N_("IBar"), N_("Focus IBar"),
|
|
|
|
"ibar_focus", "<none>", NULL, 0);
|
|
|
|
}
|
|
|
|
|
2006-07-24 21:15:11 -07:00
|
|
|
return m;
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
EAPI int
|
2010-08-18 17:00:56 -07:00
|
|
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
2005-06-17 17:10:31 -07:00
|
|
|
{
|
2009-05-19 15:50:35 -07:00
|
|
|
Ecore_Event_Handler *eh;
|
|
|
|
Config_Item *ci;
|
|
|
|
|
2012-08-03 03:10:23 -07:00
|
|
|
_ibar_go_unfocus();
|
|
|
|
|
|
|
|
e_action_del("ibar_focus");
|
2012-12-16 08:58:17 -08:00
|
|
|
e_action_predef_name_del("IBar", "Focus IBar");
|
2012-08-03 03:10:23 -07:00
|
|
|
act_ibar_focus = NULL;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_provider_unregister(&_gadcon_class);
|
2009-02-25 19:57:10 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
if (ibar_config->config_dialog)
|
|
|
|
e_object_del(E_OBJECT(ibar_config->config_dialog));
|
2009-02-25 19:57:10 -08:00
|
|
|
|
|
|
|
EINA_LIST_FREE(ibar_config->handlers, eh)
|
|
|
|
ecore_event_handler_del(eh);
|
|
|
|
|
|
|
|
EINA_LIST_FREE(ibar_config->items, ci)
|
2005-06-17 17:10:31 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
if (ci->id) eina_stringshare_del(ci->id);
|
|
|
|
if (ci->dir) eina_stringshare_del(ci->dir);
|
|
|
|
E_FREE(ci);
|
2005-06-17 17:10:31 -07:00
|
|
|
}
|
2009-05-19 15:50:35 -07:00
|
|
|
E_FREE(ibar_config);
|
2006-04-20 04:30:25 -07:00
|
|
|
ibar_config = NULL;
|
2012-06-22 01:27:10 -07:00
|
|
|
eina_hash_free(ibar_orders);
|
|
|
|
ibar_orders = NULL;
|
2006-04-20 04:30:25 -07:00
|
|
|
E_CONFIG_DD_FREE(conf_item_edd);
|
|
|
|
E_CONFIG_DD_FREE(conf_edd);
|
|
|
|
return 1;
|
2005-06-17 17:10:31 -07:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
EAPI int
|
2010-08-18 17:00:56 -07:00
|
|
|
e_modapi_save(E_Module *m __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
e_config_domain_save("module.ibar", conf_edd, ibar_config);
|
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2004-12-25 07:33:48 -08:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2011-08-18 00:34:02 -07:00
|
|
|
_ibar_cb_config_icons(__UNUSED__ void *data, __UNUSED__ int ev_type, __UNUSED__ void *ev)
|
2007-04-05 10:38:23 -07:00
|
|
|
{
|
2009-02-25 19:57:10 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
Instance *inst;
|
2007-04-05 10:38:23 -07:00
|
|
|
|
2009-02-25 19:57:10 -08:00
|
|
|
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
|
2007-04-05 10:38:23 -07:00
|
|
|
{
|
2012-06-22 00:28:13 -07:00
|
|
|
const Eina_List *l2;
|
|
|
|
IBar_Icon *icon;
|
2009-05-19 15:50:35 -07:00
|
|
|
|
2012-06-22 00:28:13 -07:00
|
|
|
EINA_LIST_FOREACH(inst->ibar->icons, l2, icon)
|
|
|
|
_ibar_icon_fill(icon);
|
2007-04-05 10:38:23 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2007-04-05 10:38:23 -07:00
|
|
|
}
|
2012-06-22 00:28:13 -07:00
|
|
|
|