enlightenment/src/modules/ibar/e_mod_main.c

2746 lines
81 KiB
C
Raw Normal View History

#include "e.h"
#include "e_mod_main.h"
/* gadcon requirements */
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);
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);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
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
},
E_GADCON_CLIENT_STYLE_INSET
};
/* actual module specifics */
typedef struct _Instance Instance;
2012-06-22 00:28:13 -07:00
typedef struct _IBar IBar;
typedef struct _IBar_Icon IBar_Icon;
2005-02-13 03:37:13 -08:00
struct _Instance
{
E_Gadcon_Client *gcc;
E_Comp_Object_Mover *iconify_provider;
2012-06-22 00:28:13 -07:00
IBar *ibar;
E_Drop_Handler *drop_handler;
Config_Item *ci;
E_Gadcon_Orient orient;
};
2005-02-13 03:37:13 -08:00
typedef struct
{
E_Order *eo;
2013-06-18 02:32:34 -07:00
Eina_Inlist *bars;
} IBar_Order;
struct _IBar
{
2013-06-18 02:32:34 -07:00
EINA_INLIST;
2012-06-22 00:28:13 -07:00
Instance *inst;
Ecore_Job *resize_job;
Evas_Object *o_outerbox;
Evas_Object *o_box, *o_drop;
Evas_Object *o_drop_over, *o_empty;
Evas_Object *o_sep;
unsigned int not_in_order_count;
2012-06-22 00:28:13 -07:00
IBar_Icon *ic_drop_before;
int drop_before;
Eina_Hash *icon_hash;
2013-06-17 00:21:01 -07:00
Eina_Inlist *icons;
IBar_Order *io;
2012-06-22 00:28:13 -07:00
Evas_Coord dnd_x, dnd_y;
IBar_Icon *menu_icon;
Eina_Bool focused : 1;
};
struct _IBar_Icon
{
2013-06-17 00:21:01 -07:00
EINA_INLIST;
IBar *ibar;
Evas_Object *o_holder, *o_icon;
Evas_Object *o_holder2, *o_icon2;
Efreet_Desktop *app;
Ecore_Timer *reset_timer;
Ecore_Timer *timer;
Ecore_Timer *show_timer; //for menu
Ecore_Timer *hide_timer; //for menu
E_Exec_Instance *exe_inst;
Eina_List *exes; //all instances
2013-08-22 01:49:39 -07:00
Eina_List *exe_current;
Eina_List *menu_pending; //clients with menu items pending
E_Gadcon_Popup *menu;
int mouse_down;
2012-06-22 00:28:13 -07:00
struct
{
unsigned char start : 1;
unsigned char dnd : 1;
int x, y;
} drag;
Eina_Bool focused : 1;
Eina_Bool not_in_order : 1;
Eina_Bool menu_grabbed : 1;
};
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);
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);
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, Eina_Bool notinorder);
static IBar_Icon *_ibar_icon_notinorder_new(IBar *b, E_Exec_Instance *exe);
2012-06-22 00:28:13 -07:00
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_sep_create(IBar *b);
2012-06-22 00:28:13 -07:00
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);
2013-08-22 01:49:39 -07:00
static void _ibar_cb_icon_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info);
2012-06-22 00:28:13 -07:00
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);
static void _ibar_exec_new_client_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
static Eina_Bool _ibar_cb_out_hide_delay(void *data);
static void _ibar_icon_menu_show(IBar_Icon *ic, Eina_Bool grab);
static void _ibar_icon_menu_hide(IBar_Icon *ic, Eina_Bool grab);
static E_Config_DD *conf_edd = NULL;
static E_Config_DD *conf_item_edd = NULL;
static Eina_Hash *ibar_orders = NULL;
static Eina_List *ibars = NULL;
Config *ibar_config = NULL;
static inline const char *
_desktop_name_get(const Efreet_Desktop *desktop)
{
if (!desktop) return NULL;
return desktop->orig_path ?: desktop->name;
}
static IBar_Order *
_ibar_order_new(IBar *b, const char *path)
{
IBar_Order *io;
io = eina_hash_find(ibar_orders, path);
if (io)
{
2013-06-18 02:32:34 -07:00
io->bars = eina_inlist_append(io->bars, EINA_INLIST_GET(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);
2013-06-18 02:32:34 -07:00
io->bars = eina_inlist_append(io->bars, EINA_INLIST_GET(b));
return io;
}
static void
_ibar_order_del(IBar *b)
{
IBar_Order *io;
if (!b->io) return;
io = b->io;
2013-06-18 02:32:34 -07:00
io->bars = eina_inlist_remove(io->bars, EINA_INLIST_GET(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;
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);
2013-06-18 02:32:34 -07:00
io->bars = eina_inlist_append(io->bars, EINA_INLIST_GET(b));
b->io = io;
}
/* else same order, refresh all users */
}
else
io = b->io = _ibar_order_new(b, path);
2013-06-18 02:32:34 -07:00
EINA_INLIST_FOREACH(io->bars, bar)
{
_ibar_empty(bar);
_ibar_fill(bar);
}
}
2014-01-29 05:41:35 -08:00
static void
_ibar_cb_iconify_end_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
{
E_Client *ec = data;
evas_object_layer_set(ec->frame, ec->layer);
ec->layer_block = 0;
if (ec->iconic)
evas_object_hide(ec->frame);
}
static Eina_Bool
_ibar_cb_iconify_provider(void *data, Evas_Object *obj, const char *signal EINA_UNUSED)
2014-01-29 05:41:35 -08:00
{
Instance *inst = data;
IBar_Icon *ic;
int ox, oy, ow, oh;
E_Client *ec;
2014-01-29 05:41:35 -08:00
ec = e_comp_object_client_get(obj);
if (ec->zone != inst->gcc->gadcon->zone) return EINA_FALSE;
ic = eina_hash_find(inst->ibar->icon_hash, _desktop_name_get(ec->exe_inst ? ec->exe_inst->desktop : ec->desktop));
if (!ic) return EINA_FALSE;
ec->layer_block = 1;
evas_object_layer_set(ec->frame, E_LAYER_CLIENT_PRIO);
evas_object_geometry_get(ic->o_holder, &ox, &oy, &ow, &oh);
e_comp_object_effect_set(ec->frame, "iconify/ibar");
e_comp_object_effect_params_set(ec->frame, 1, (int[]){ec->x, ec->y, ec->w, ec->h, ox, oy, ow, oh}, 8);
e_comp_object_effect_params_set(ec->frame, 0, (int[]){!!strcmp(signal, "e,action,iconify")}, 1);
e_comp_object_effect_start(ec->frame, _ibar_cb_iconify_end_cb, ec);
return EINA_TRUE;
2014-01-29 05:41:35 -08:00
}
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
IBar *b;
E_Gadcon_Client *gcc;
Instance *inst;
Evas_Coord x, y, w, h;
const char *drop[] = { "enlightenment/desktop", "enlightenment/border", "text/uri-list" };
Config_Item *ci;
inst = E_NEW(Instance, 1);
ci = _ibar_config_item_get(id);
inst->ci = ci;
if (!ci->dir) ci->dir = eina_stringshare_add("default");
b = _ibar_new(gc->evas, inst);
gcc = e_gadcon_client_new(gc, name, id, style, b->o_outerbox);
e_gadcon_client_min_size_set(gcc, 16, 16);
e_gadcon_client_autoscroll_toggle_disabled_set(gcc, !ci->dont_add_nonorder);
gcc->data = inst;
inst->gcc = gcc;
inst->orient = E_GADCON_ORIENT_HORIZ;
evas_object_geometry_get(b->o_box, &x, &y, &w, &h);
inst->drop_handler =
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);
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_MOVE,
2012-06-22 00:28:13 -07:00
_ibar_cb_obj_moveresize, inst);
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_RESIZE,
2012-06-22 00:28:13 -07:00
_ibar_cb_obj_moveresize, inst);
ibar_config->instances = eina_list_append(ibar_config->instances, inst);
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify", _ibar_cb_iconify_provider, inst);
return gcc;
}
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
Instance *inst;
inst = gcc->data;
e_comp_object_effect_mover_del(inst->iconify_provider);
ibar_config->instances = eina_list_remove(ibar_config->instances, inst);
e_drop_handler_del(inst->drop_handler);
_ibar_free(inst->ibar);
E_FREE(inst);
}
static Eina_Bool
_gc_vertical(Instance *inst)
{
switch (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:
return EINA_FALSE;
2012-06-22 00:28:13 -07:00
break;
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:
default:
2012-06-22 00:28:13 -07:00
break;
}
return EINA_TRUE;
}
static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{
Instance *inst;
inst = gcc->data;
if ((int)orient != -1) inst->orient = orient;
if (_gc_vertical(inst))
{
_ibar_orient_set(inst->ibar, 0);
}
else
{
_ibar_orient_set(inst->ibar, 1);
}
}
static const char *
_gc_label(const E_Gadcon_Client_Class *client_class __UNUSED__)
{
return _("IBar");
}
static Evas_Object *
_gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
{
Evas_Object *o;
char buf[PATH_MAX];
o = edje_object_add(evas);
snprintf(buf, sizeof(buf), "%s/e-module-ibar.edj",
2012-06-22 00:28:13 -07:00
e_module_dir_get(ibar_config->module));
edje_object_file_set(o, buf, "icon");
return o;
}
static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class __UNUSED__)
{
Config_Item *ci;
ci = _ibar_config_item_get(NULL);
return ci->id;
}
static void
_gc_id_del(const E_Gadcon_Client_Class *client_class __UNUSED__, const char *id __UNUSED__)
{
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
*
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);
}
2008-10-20 18:10:42 -07:00
*/
}
2005-05-14 07:06:09 -07:00
static IBar *
_ibar_new(Evas *evas, Instance *inst)
{
IBar *b;
char buf[PATH_MAX];
int w, h;
b = E_NEW(IBar, 1);
inst->ibar = b;
b->inst = inst;
b->icon_hash = eina_hash_string_superfast_new(NULL);
b->o_outerbox = e_box_add(evas);
e_box_orientation_set(b->o_outerbox, 1);
e_box_align_set(b->o_outerbox, 0.5, 0.5);
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);
if (inst->ci->dir[0] != '/')
2012-06-22 00:28:13 -07:00
e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
inst->ci->dir);
2005-05-14 07:06:09 -07:00
else
eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
b->io = _ibar_order_new(b, buf);
e_box_pack_end(b->o_outerbox, b->o_box);
_ibar_fill(b);
e_box_size_min_get(b->o_box, &w, &h);
e_box_pack_options_set(b->o_box,
1, 1, /* fill */
1, 1, /* expand */
0.5, 0.5, /* align */
w, h, /* min */
-1, -1 /* max */
);
evas_object_show(b->o_box);
ibars = eina_list_append(ibars, b);
return b;
}
static void
_ibar_free(IBar *b)
{
_ibar_empty(b);
evas_object_del(b->o_outerbox);
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);
if (b->o_empty) evas_object_del(b->o_empty);
E_FREE_FUNC(b->resize_job, ecore_job_del);
eina_hash_free(b->icon_hash);
_ibar_order_del(b);
ibars = eina_list_remove(ibars, b);
2013-06-18 03:09:28 -07:00
free(b);
}
static void
_ibar_cb_empty_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev;
IBar *b;
E_Menu *m;
E_Menu_Item *mi;
int cx, cy, cw, ch;
ev = event_info;
b = data;
if (ev->button != 3) return;
2012-06-22 00:28:13 -07:00
m = e_menu_new();
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);
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
}
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, b);
}
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
m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
2012-06-22 00:28:13 -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);
}
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;
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,
_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 */
);
}
}
else if (b->o_empty)
{
2012-06-22 00:28:13 -07:00
evas_object_del(b->o_empty);
b->o_empty = NULL;
}
}
2005-05-14 07:06:09 -07:00
static void
_ibar_fill(IBar *b)
{
IBar_Icon *ic;
int w, h;
if (b->io->eo)
{
2012-06-22 00:28:13 -07:00
Efreet_Desktop *desktop;
const Eina_List *l;
EINA_LIST_FOREACH(b->io->eo->desktops, l, desktop)
2012-06-22 00:28:13 -07:00
{
const Eina_List *ll;
ic = _ibar_icon_new(b, desktop, 0);
ll = e_exec_desktop_instances_find(desktop);
if (ll)
{
ic->exes = eina_list_clone(ll);
_ibar_icon_signal_emit(ic, "e,state,on", "e");
}
2012-06-22 00:28:13 -07:00
}
}
if (!b->inst->ci->dont_add_nonorder)
{
const Eina_Hash *execs = e_exec_instances_get();
Eina_Iterator *it;
const Eina_List *l, *ll;
E_Exec_Instance *exe;
it = eina_hash_iterator_data_new(execs);
EINA_ITERATOR_FOREACH(it, l)
{
EINA_LIST_FOREACH(l, ll, exe)
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec;
Eina_List *lll;
Eina_Bool skip = EINA_TRUE;
if (!exe->desktop) continue;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
EINA_LIST_FOREACH(exe->clients, lll, ec)
if (!ec->netwm.state.skip_taskbar)
{
skip = EINA_FALSE;
break;
}
if (skip) continue;
ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop));
if (ic)
{
if (!eina_list_data_find(ic->exes, exe))
ic->exes = eina_list_append(ic->exes, exe);
continue;
}
_ibar_sep_create(b);
_ibar_icon_notinorder_new(b, exe);
}
}
eina_iterator_free(it);
}
_ibar_empty_handle(b);
_ibar_resize_handle(b);
if (!b->inst->gcc) return;
e_box_size_min_get(b->o_box, &w, &h);
e_box_pack_options_set(b->o_box,
1, 1, /* fill */
1, 1, /* expand */
0.5, 0.5, /* align */
w, h, /* min */
w, h /* max */
);
}
static void
_ibar_empty(IBar *b)
{
2013-06-17 00:21:01 -07:00
while (b->icons)
_ibar_icon_free((IBar_Icon*)b->icons);
E_FREE_FUNC(b->o_sep, evas_object_del);
_ibar_empty_handle(b);
}
static void
_ibar_orient_set(IBar *b, int horizontal)
{
e_box_orientation_set(b->o_box, horizontal);
e_box_align_set(b->o_box, 0.5, 0.5);
e_box_orientation_set(b->o_outerbox, horizontal);
e_box_align_set(b->o_outerbox, 0.5, 0.5);
}
static void
_ibar_resize_handle(IBar *b)
{
IBar_Icon *ic;
Evas_Coord w, h;
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
2013-08-13 03:04:55 -07:00
if (b->inst->gcc)
{
if (b->inst->gcc->max.w)
w = MIN(w, b->inst->gcc->max.w);
if (b->inst->gcc->max.h)
h = MIN(h, b->inst->gcc->max.h);
}
if (e_box_orientation_get(b->o_box))
w = h;
else
h = w;
e_box_freeze(b->o_outerbox);
e_box_freeze(b->o_box);
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, ic)
{
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 */
);
}
if (b->o_sep)
{
if (_gc_vertical(b->inst))
h = 16 * e_scale;
else
w = 16 * e_scale;
e_box_pack_options_set(b->o_sep,
1, 1, /* fill */
0, 0, /* expand */
0.5, 0.5, /* align */
8, 8, /* min */
w, h /* max */
);
}
e_box_thaw(b->o_box);
e_box_thaw(b->o_outerbox);
e_box_size_min_get(b->o_box, &w, &h);
e_box_pack_options_set(b->o_box,
1, 1, /* fill */
1, 1, /* expand */
0.5, 0.5, /* align */
w, h, /* min */
-1, -1 /* max */
);
if (!b->inst->gcc) return;
e_box_size_min_get(b->o_outerbox, &w, &h);
e_gadcon_client_aspect_set(b->inst->gcc, w, h);
}
static void
_ibar_instance_drop_zone_recalc(Instance *inst)
{
Evas_Coord x, y, w, h;
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
e_drop_handler_geometry_set(inst->drop_handler, x, y, w, h);
2012-06-22 00:28:13 -07:00
}
static Config_Item *
_ibar_config_item_get(const char *id)
{
Config_Item *ci;
GADCON_CLIENT_CONFIG_GET(Config_Item, ibar_config->items, _gadcon_class, id);
ci = E_NEW(Config_Item, 1);
ci->id = eina_stringshare_add(id);
2008-10-20 18:10:42 -07:00
ci->dir = eina_stringshare_add("default");
ci->show_label = 1;
ci->eap_label = 0;
ci->lock_move = 0;
ci->dont_add_nonorder = 0;
ci->dont_track_launch = 0;
ci->dont_icon_menu_mouseover = 0;
ibar_config->items = eina_list_append(ibar_config->items, ci);
return ci;
}
void
_ibar_config_update(Config_Item *ci)
{
const Eina_List *l;
Instance *inst;
IBar_Icon *ic;
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];
2012-06-22 00:28:13 -07:00
if (inst->ci != ci) continue;
2012-06-22 00:28:13 -07:00
if (inst->ci->dir[0] != '/')
e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
inst->ci->dir);
2012-06-22 00:28:13 -07:00
else
eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
_ibar_order_refresh(inst->ibar, buf);
2012-06-22 00:28:13 -07:00
_ibar_resize_handle(inst->ibar);
_gc_orient(inst->gcc, -1);
}
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(inst->ibar->icons, 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",
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",
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",
ic->app->generic_name);
2012-06-22 00:28:13 -07:00
break;
}
}
}
static void
_ibar_sep_create(IBar *b)
{
if (b->o_sep) return;
b->o_sep = edje_object_add(evas_object_evas_get(b->o_box));
if (_gc_vertical(b->inst))
e_theme_edje_object_set(b->o_sep, "base/theme/modules/ibar", "e/modules/ibar/separator/horizontal");
else
e_theme_edje_object_set(b->o_sep, "base/theme/modules/ibar", "e/modules/ibar/separator/default");
evas_object_show(b->o_sep);
e_box_pack_end(b->o_outerbox, b->o_sep);
}
static IBar_Icon *
_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y)
{
IBar_Icon *ic;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, ic)
{
Evas_Coord dx, dy, dw, dh;
evas_object_geometry_get(ic->o_holder, &dx, &dy, &dw, &dh);
if (E_INSIDE(x, y, dx, dy, dw, dh))
{
if (ic->not_in_order)
{
/* block drops in the non-order section */
return NULL;
}
return ic;
}
}
return NULL;
}
static IBar_Icon *
_ibar_icon_new(IBar *b, Efreet_Desktop *desktop, Eina_Bool notinorder)
{
IBar_Icon *ic;
ic = E_NEW(IBar_Icon, 1);
ic->ibar = b;
ic->app = desktop;
efreet_desktop_ref(desktop);
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,
_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,
_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,
_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,
_ibar_cb_icon_mouse_move, ic);
2013-08-22 01:49:39 -07:00
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_WHEEL,
_ibar_cb_icon_wheel, ic);
2012-06-22 00:28:13 -07:00
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOVE,
_ibar_cb_icon_move, ic);
2012-06-22 00:28:13 -07:00
evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_RESIZE,
_ibar_cb_icon_resize, ic);
evas_object_show(ic->o_holder);
ic->o_holder2 = edje_object_add(evas_object_evas_get(b->o_box));
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
evas_object_name_set(ic->o_holder2, "ibar_icon->o_holder2");
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");
evas_object_layer_set(ic->o_holder2, 9999);
evas_object_pass_events_set(ic->o_holder2, 1);
evas_object_show(ic->o_holder2);
_ibar_icon_fill(ic);
b->icons = eina_inlist_append(b->icons, EINA_INLIST_GET(ic));
eina_hash_add(b->icon_hash, _desktop_name_get(ic->app), ic);
if (notinorder)
{
ic->not_in_order = 1;
b->not_in_order_count++;
e_box_pack_end(b->o_outerbox, ic->o_holder);
}
else
e_box_pack_end(b->o_box, ic->o_holder);
return ic;
}
static IBar_Icon *
_ibar_icon_notinorder_new(IBar *b, E_Exec_Instance *exe)
{
IBar_Icon *ic;
ic = _ibar_icon_new(b, exe->desktop, 1);
ic->exes = eina_list_append(ic->exes, exe);
_ibar_icon_signal_emit(ic, "e,state,on", "e");
return ic;
}
2005-05-14 07:06:09 -07:00
static void
_ibar_icon_free(IBar_Icon *ic)
2005-05-14 07:06:09 -07:00
{
E_Exec_Instance *inst;
2013-06-17 00:21:01 -07:00
if (ic->ibar->menu_icon == ic) ic->ibar->menu_icon = NULL;
if (ic->ibar->ic_drop_before == ic) ic->ibar->ic_drop_before = NULL;
if (ic->menu) e_object_data_set(E_OBJECT(ic->menu), NULL);
E_FREE_FUNC(ic->menu, e_object_del);
E_FREE_FUNC(ic->timer, ecore_timer_del);
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
E_FREE_FUNC(ic->show_timer, ecore_timer_del);
2013-06-17 00:21:01 -07:00
ic->ibar->icons = eina_inlist_remove(ic->ibar->icons, EINA_INLIST_GET(ic));
eina_hash_del_by_key(ic->ibar->icon_hash, _desktop_name_get(ic->app));
2013-06-17 00:21:01 -07:00
E_FREE_FUNC(ic->reset_timer, ecore_timer_del);
if (ic->app) efreet_desktop_unref(ic->app);
ic->exe_current = NULL;
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_IN,
_ibar_cb_icon_mouse_in, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_OUT,
_ibar_cb_icon_mouse_out, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_DOWN,
_ibar_cb_icon_mouse_down, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_UP,
_ibar_cb_icon_mouse_up, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_MOVE,
_ibar_cb_icon_mouse_move, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOUSE_WHEEL,
_ibar_cb_icon_wheel, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_MOVE,
_ibar_cb_icon_move, ic);
evas_object_event_callback_del_full(ic->o_holder, EVAS_CALLBACK_RESIZE,
_ibar_cb_icon_resize, ic);
2013-08-22 01:49:39 -07:00
ic->ibar->not_in_order_count -= ic->not_in_order;
if (ic->ibar->ic_drop_before == ic)
ic->ibar->ic_drop_before = NULL;
_ibar_icon_empty(ic);
EINA_LIST_FREE(ic->exes, inst)
if (!ic->not_in_order)
e_exec_instance_watcher_del(inst, _ibar_instance_watch, ic);
evas_object_del(ic->o_holder);
evas_object_del(ic->o_holder2);
if (ic->exe_inst)
{
e_exec_instance_watcher_del(ic->exe_inst, _ibar_instance_watch, ic);
ic->exe_inst = NULL;
}
free(ic);
2005-05-14 07:06:09 -07:00
}
static void
_ibar_icon_fill(IBar_Icon *ic)
2005-05-14 07:06:09 -07:00
{
if (ic->o_icon) evas_object_del(ic->o_icon);
ic->o_icon = e_icon_add(evas_object_evas_get(ic->ibar->o_box));
evas_object_name_set(ic->o_icon, "icon");
e_icon_fdo_icon_set(ic->o_icon, ic->app->icon);
edje_object_part_swallow(ic->o_holder, "e.swallow.content", ic->o_icon);
evas_object_pass_events_set(ic->o_icon, 1);
evas_object_show(ic->o_icon);
if (ic->o_icon2) evas_object_del(ic->o_icon2);
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);
edje_object_part_swallow(ic->o_holder2, "e.swallow.content", ic->o_icon2);
evas_object_pass_events_set(ic->o_icon2, 1);
evas_object_show(ic->o_icon2);
2012-06-22 00:28:13 -07:00
switch (ic->ibar->inst->ci->eap_label)
{
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;
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;
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;
}
2005-05-14 07:06:09 -07:00
}
static void
_ibar_icon_empty(IBar_Icon *ic)
{
if (ic->o_icon) evas_object_del(ic->o_icon);
if (ic->o_icon2) evas_object_del(ic->o_icon2);
ic->o_icon = NULL;
ic->o_icon2 = NULL;
}
static void
_ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src)
{
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);
}
static void
_ibar_cb_app_change(void *data, E_Order *eo __UNUSED__)
{
IBar *b;
2013-06-18 02:32:34 -07:00
IBar_Order *io = data;
2013-06-18 02:32:34 -07:00
EINA_INLIST_FOREACH(io->bars, b)
{
_ibar_empty(b);
_ibar_fill(b);
_ibar_resize_handle(b);
if (b->inst) _gc_orient(b->inst->gcc, -1);
}
}
static void
_ibar_cb_resize_job(void *data)
{
Instance *inst = data;
_ibar_resize_handle(inst->ibar);
_ibar_instance_drop_zone_recalc(inst);
inst->ibar->resize_job = NULL;
}
static void
_ibar_cb_obj_moveresize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Instance *inst = data;
if (inst->ibar->resize_job) return;
inst->ibar->resize_job = ecore_job_add((Ecore_Cb)_ibar_cb_resize_job, inst);
}
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__)
{
if (!e_configure_registry_exists("applications/new_application")) return;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_configure_registry_call("applications/new_application", e_comp_get(NULL), NULL);
}
2012-06-22 00:28:13 -07:00
static void
_ibar_cb_menu_icon_add(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
char path[PATH_MAX];
IBar *b;
b = data;
e_user_dir_snprintf(path, sizeof(path), "applications/bar/%s/.order",
b->inst->ci->dir);
e_configure_registry_call("internal/ibar_other",
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
NULL, path);
}
static void
_ibar_cb_menu_icon_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
2005-05-14 07:06:09 -07:00
IBar_Icon *ic;
ic = data;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_desktop_edit(e_comp_get(ic->ibar->inst->gcc), ic->app);
}
static void
_ibar_cb_menu_icon_stick(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
IBar_Icon *ic = data;
e_order_append(ic->ibar->io->eo, ic->app);
_ibar_icon_free(ic);
}
static void
_ibar_cb_menu_icon_remove(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
2013-06-17 00:21:01 -07:00
IBar_Icon *ic = data;
IBar *i;
2013-06-17 00:21:01 -07:00
i = ic->ibar;
e_order_remove(i->io->eo, ic->app);
_ibar_icon_free(ic);
2013-06-17 00:21:01 -07:00
_ibar_resize_handle(i);
}
static void
_ibar_cb_menu_configuration(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
IBar *b;
b = data;
_config_ibar_module(b->inst->ci);
}
static void
_ibar_cb_icon_menu_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
IBar_Icon *ic;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec = data;
Evas_Event_Mouse_Up *ev = event_info;
ic = evas_object_data_get(obj, "ibar_icon");
if (ev->button == 3)
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_int_client_menu_show(ec, ev->canvas.x, ev->canvas.y, 0, ev->timestamp);
return;
}
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_client_activate(ec, 1);
if (!ic) return;
2014-01-17 15:09:35 -08:00
evas_object_pass_events_set(ic->menu->comp_object, 1);
edje_object_signal_emit(ic->menu->o_bg, "e,action,hide", "e");
}
static void
_ibar_cb_icon_menu_del(void *obj)
{
IBar_Icon *ic = e_object_data_get(obj);
if (!ic) return;
ic->menu = NULL;
}
static void
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
_ibar_cb_icon_menu_autodel(void *data, Evas_Object *obj EINA_UNUSED)
{
IBar_Icon *ic = data;
2013-05-20 04:02:34 -07:00
if (!ic->menu) return;
2014-01-17 15:09:35 -08:00
evas_object_pass_events_set(ic->menu->comp_object, 1);
edje_object_signal_emit(ic->menu->o_bg, "e,action,hide", "e");
}
static void
_ibar_cb_icon_menu_shown(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
{
IBar_Icon *ic = data;
evas_object_pass_events_set(ic->menu->o_bg, 0);
}
static void
_ibar_cb_icon_menu_hidden(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
{
IBar_Icon *ic = data;
E_Client *ec;
E_OBJECT_DEL_SET(ic->menu, NULL);
E_FREE_FUNC(ic->menu, e_object_del);
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
EINA_LIST_FREE(ic->menu_pending, ec)
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_SHOW, _ibar_exec_new_client_show, ic);
}
static void
_ibar_icon_menu_recalc(IBar_Icon *ic)
{
int x, y, w, h, iw, ih, ox, oy;
Evas_Object *o;
o = ic->menu->o_bg;
edje_object_calc_force(o);
edje_object_size_min_calc(o, &w, &h);
edje_extern_object_min_size_set(o, w, h);
ic->menu->w = w, ic->menu->h = h;
evas_object_resize(ic->menu->comp_object, w, h);
e_gadcon_popup_show(ic->menu);
evas_object_geometry_get(ic->o_holder, &x, &y, &iw, &ih);
evas_object_geometry_get(ic->menu->comp_object, &ox, &oy, NULL, NULL);
if (e_box_orientation_get(ic->ibar->o_box))
ox = (x + (iw / 2)) - (w / 2);
else
oy = (y + (ih / 2)) - (h / 2);
evas_object_move(ic->menu->comp_object, ox, oy);
}
static void
_ibar_cb_icon_menu_img_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
int w, h;
IBar_Icon *ic = evas_object_data_del(data, "ibar_icon");
if (!ic) return; //menu is closing
if (!ic->menu) return; //who knows
edje_object_part_box_remove(ic->menu->o_bg, "e.box", data);
evas_object_del(data);
if (eina_list_count(ic->exes) < 1)
{
evas_object_pass_events_set(ic->menu->o_bg, 1);
edje_object_signal_emit(ic->menu->o_bg, "e,action,hide", "e");
return;
}
edje_object_calc_force(ic->menu->o_bg);
edje_object_size_min_calc(ic->menu->o_bg, &w, &h);
edje_extern_object_min_size_set(ic->menu->o_bg, w, h);
if (e_box_orientation_get(ic->ibar->o_box))
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
int cx, cy, cw, ch, ny;
E_Zone *zone;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
evas_object_geometry_get(ic->menu->comp_object, &cx, &cy, &cw, &ch);
zone = e_comp_zone_xy_get(e_comp_get(ic->menu), cx, cy);
if (cy > (zone->h / 2))
ny = cy - (h - ch);
else
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ny = cy;
evas_object_geometry_set(ic->menu->comp_object, cx, ny, w, h);
}
else
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
evas_object_resize(ic->menu->comp_object, w, h);
}
static void
_ibar_icon_menu_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
IBar_Icon *ic = data;
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
}
static void
_ibar_icon_menu_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
IBar_Icon *ic = data;
if (e_menu_grab_window_get()) return;
if (ic->hide_timer)
ecore_timer_reset(ic->hide_timer);
else
ic->hide_timer = ecore_timer_add(0.5, _ibar_cb_out_hide_delay, ic);
}
static Eina_Bool
_ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec)
{
Evas_Object *o, *it, *img;
Eina_Stringshare *txt;
int w, h;
if (ec->netwm.state.skip_taskbar) return EINA_FALSE;
o = ic->menu->o_bg;
it = edje_object_add(e_comp_get(ec)->evas);
e_comp_object_util_del_list_append(ic->menu->comp_object, it);
e_theme_edje_object_set(it, "base/theme/modules/ibar",
"e/modules/ibar/menu/item");
img = e_comp_object_util_mirror_add(ec->frame);
evas_object_event_callback_add(img, EVAS_CALLBACK_DEL,
_ibar_cb_icon_menu_img_del, it);
txt = e_client_util_name_get(ec);
w = ec->client.w;
h = ec->client.h;
e_comp_object_util_del_list_append(ic->menu->comp_object, img);
evas_object_show(img);
edje_extern_object_aspect_set(img, EDJE_ASPECT_CONTROL_BOTH, w, h);
edje_object_part_swallow(it, "e.swallow.icon", img);
edje_object_part_text_set(it, "e.text.title", txt);
edje_object_calc_force(it);
edje_object_size_min_calc(it, &w, &h);
edje_extern_object_min_size_set(it, w, h);
evas_object_size_hint_min_set(it, w, h);
evas_object_show(it);
evas_object_event_callback_add(it, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_icon_menu_mouse_up, ec);
evas_object_data_set(it, "ibar_icon", ic);
edje_object_part_box_append(o, "e.box", it);
return EINA_TRUE;
}
static void
_ibar_icon_menu(IBar_Icon *ic, Eina_Bool grab)
{
Evas_Object *o;
Eina_List *l;
E_Exec_Instance *exe;
Evas *e;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
Eina_Bool empty = EINA_TRUE;
E_Client *ec;
if (!ic->exes) return; //FIXME
EINA_LIST_FREE(ic->menu_pending, ec)
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_SHOW, _ibar_exec_new_client_show, ic);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ic->menu = e_gadcon_popup_new(ic->ibar->inst->gcc, 1);
e_object_data_set(E_OBJECT(ic->menu), ic);
E_OBJECT_DEL_SET(ic->menu, _ibar_cb_icon_menu_del);
e = e_comp_get(ic->menu)->evas;
o = edje_object_add(e);
e_theme_edje_object_set(o, "base/theme/modules/ibar",
"e/modules/ibar/menu");
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
/* gadcon popups don't really prevent this,
* so away we go!
*/
evas_object_del(ic->menu->comp_object);
ic->menu->o_bg = o;
ic->menu->comp_object = e_comp_object_util_add(o, E_COMP_OBJECT_TYPE_NONE);
evas_object_layer_set(ic->menu->comp_object, E_LAYER_POPUP);
EINA_LIST_FOREACH(ic->exes, l, exe)
{
Eina_List *ll;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
EINA_LIST_FOREACH(exe->clients, ll, ec)
{
if (_ibar_icon_menu_client_add(ic, ec))
empty = EINA_FALSE;
}
}
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
if (empty)
{
/* something crazy happened */
evas_object_del(o);
e_object_del(E_OBJECT(ic->menu));
return;
}
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
if (!grab)
{
evas_object_event_callback_add(ic->menu->comp_object, EVAS_CALLBACK_MOUSE_IN, _ibar_icon_menu_mouse_in, ic);
evas_object_event_callback_add(ic->menu->comp_object, EVAS_CALLBACK_MOUSE_OUT, _ibar_icon_menu_mouse_out, ic);
}
edje_object_signal_callback_add(o, "e,action,show,done", "*",
_ibar_cb_icon_menu_shown, ic);
edje_object_signal_callback_add(o, "e,action,hide,done", "*",
_ibar_cb_icon_menu_hidden, ic);
edje_object_signal_emit(o, "e,state,hidden", "e");
edje_object_message_signal_process(o);
ic->ibar->menu_icon = ic;
_ibar_icon_menu_recalc(ic);
evas_object_pass_events_set(o, 1);
edje_object_signal_emit(o, "e,action,show", "e");
ic->menu_grabbed = grab;
if (grab)
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_comp_object_util_autoclose(ic->menu->comp_object, _ibar_cb_icon_menu_autodel, NULL, ic);
}
static void
_ibar_exec_new_client_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
IBar_Icon *ic = data;
E_Client *ec = e_comp_object_client_get(obj);
if (!ic->menu) return;
_ibar_icon_menu_client_add(ic, ec);
_ibar_icon_menu_recalc(ic);
ic->menu_pending = eina_list_remove(ic->menu_pending, ec);
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_SHOW, _ibar_exec_new_client_show, ic);
}
static void
_ibar_icon_menu_show(IBar_Icon *ic, Eina_Bool grab)
{
if (ic->ibar->menu_icon && (ic->ibar->menu_icon != ic))
_ibar_icon_menu_hide(ic->ibar->menu_icon, ic->ibar->menu_icon->menu_grabbed);
if (ic->menu)
{
if (ic->ibar->menu_icon != ic)
{
edje_object_signal_emit(ic->menu->o_bg, "e,action,show", "e");
ic->ibar->menu_icon = ic;
}
return;
}
ic->drag.start = 0;
ic->drag.dnd = 0;
ic->mouse_down = 0;
_ibar_icon_menu(ic, grab);
}
static void
_ibar_icon_menu_hide(IBar_Icon *ic, Eina_Bool grab)
{
if (!ic->menu) return;
if (ic->menu_grabbed != grab) return;
if (ic->ibar && (ic->ibar->menu_icon == ic))
ic->ibar->menu_icon = NULL;
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
ic->menu_grabbed = EINA_FALSE;
2014-01-17 15:09:35 -08:00
evas_object_pass_events_set(ic->menu->comp_object, 1);
edje_object_signal_emit(ic->menu->o_bg, "e,action,hide", "e");
}
static Eina_Bool
_ibar_icon_mouse_in_timer(void *data)
{
IBar_Icon *ic = data;
ic->show_timer = NULL;
_ibar_icon_menu_show(ic, EINA_FALSE);
return EINA_FALSE;
}
static void
_ibar_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
2005-05-14 07:06:09 -07:00
IBar_Icon *ic;
ic = data;
E_FREE_FUNC(ic->reset_timer, ecore_timer_del);
ic->focused = EINA_TRUE;
_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");
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
if (!ic->ibar->inst->ci->dont_icon_menu_mouseover)
{
if (ic->show_timer)
ecore_timer_reset(ic->show_timer);
else
ic->show_timer = ecore_timer_add(0.2, _ibar_icon_mouse_in_timer, ic);
}
}
static Eina_Bool
_ibar_cb_out_hide_delay(void *data)
{
IBar_Icon *ic = data;
ic->hide_timer = NULL;
_ibar_icon_menu_hide(ic, EINA_FALSE);
return EINA_FALSE;
}
static void
_ibar_cb_icon_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
2005-05-14 07:06:09 -07:00
IBar_Icon *ic;
ic = data;
E_FREE_FUNC(ic->reset_timer, ecore_timer_del);
E_FREE_FUNC(ic->show_timer, ecore_timer_del);
ic->focused = EINA_FALSE;
_ibar_icon_signal_emit(ic, "e,state,unfocused", "e");
if (ic->ibar->inst->ci->show_label)
_ibar_icon_signal_emit(ic, "e,action,hide,label", "e");
if (!ic->ibar->inst->ci->dont_icon_menu_mouseover)
{
if (ic->hide_timer)
ecore_timer_reset(ic->hide_timer);
else
ic->hide_timer = ecore_timer_add(0.75, _ibar_cb_out_hide_delay, ic);
}
}
static Eina_Bool
_ibar_cb_icon_menu_cb(void *data)
{
IBar_Icon *ic = data;
ic->timer = NULL;
_ibar_icon_menu_show(ic, EINA_TRUE);
return EINA_FALSE;
}
static void
_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;
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;
if (!ic->timer)
ic->timer = ecore_timer_add(0.35, _ibar_cb_icon_menu_cb, ic);
}
else if (ev->button == 2)
{
E_FREE_FUNC(ic->show_timer, ecore_timer_del);
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
E_FREE_FUNC(ic->timer, ecore_timer_del);
_ibar_icon_menu_show(ic, EINA_TRUE);
}
else if (ev->button == 3)
{
2012-06-22 00:28:13 -07:00
E_Menu *m, *mo;
E_Menu_Item *mi;
char buf[256];
2012-06-22 00:28:13 -07:00
int cx, cy;
E_FREE_FUNC(ic->show_timer, ecore_timer_del);
E_FREE_FUNC(ic->hide_timer, ecore_timer_del);
E_FREE_FUNC(ic->timer, ecore_timer_del);
if (ic->menu)
_ibar_icon_menu_hide(ic, ic->menu_grabbed);
2012-06-22 00:28:13 -07:00
m = e_menu_new();
2012-06-22 00:28:13 -07:00
/* FIXME: other icon options go here too */
mo = e_menu_new();
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);
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, ic->ibar);
2012-06-22 00:28:13 -07:00
}
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);
if (ic->not_in_order)
{
e_menu_item_label_set(mi, _("Add to bar"));
e_util_menu_item_theme_icon_set(mi, "list-add");
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_stick, ic);
}
else
{
e_menu_item_label_set(mi, _("Remove from bar"));
e_util_menu_item_theme_icon_set(mi, "list-remove");
e_menu_item_callback_set(mi, _ibar_cb_menu_icon_remove, ic);
}
mi = e_menu_item_new_relative(m, NULL);
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),
mi);
e_menu_item_submenu_set(mi, mo);
e_object_unref(E_OBJECT(mo));
e_gadcon_client_menu_set(ic->ibar->inst->gcc, m);
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
}
}
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;
}
static void
2013-08-22 01:49:39 -07:00
_ibar_cb_icon_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Wheel *ev = event_info;
E_Exec_Instance *exe;
IBar_Icon *ic = data;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *cur, *sel = NULL;
2013-08-22 01:49:39 -07:00
Eina_List *l;
2013-06-17 00:21:01 -07:00
2013-08-22 01:49:39 -07:00
if (!ic->exes) return;
2013-06-17 00:21:01 -07:00
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
cur = e_client_focused_get();
2013-08-22 01:49:39 -07:00
if (!ic->exe_current)
ic->exe_current = ic->exes;
2013-08-22 01:49:39 -07:00
exe = eina_list_data_get(ic->exe_current);
if (ev->z < 0)
{
if (cur && (cur->exe_inst == exe))
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
l = eina_list_data_find_list(exe->clients, cur);
if (l) sel = eina_list_data_get(eina_list_next(l));
}
if (!sel)
2013-08-22 01:49:39 -07:00
{
ic->exe_current = eina_list_next(ic->exe_current);
if (!ic->exe_current)
ic->exe_current = ic->exes;
2013-08-22 01:49:39 -07:00
}
}
else if (ev->z > 0)
{
if (cur && (cur->exe_inst == exe))
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
l = eina_list_data_find_list(exe->clients, cur);
if (l) sel = eina_list_data_get(eina_list_prev(l));
}
if (!sel)
{
2013-08-22 01:49:39 -07:00
ic->exe_current = eina_list_prev(ic->exe_current);
if (!ic->exe_current)
ic->exe_current = eina_list_last(ic->exes);
2013-08-22 01:49:39 -07:00
}
}
if (!sel)
2013-08-22 01:49:39 -07:00
{
exe = eina_list_data_get(ic->exe_current);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
sel = eina_list_data_get(exe->clients);
2013-08-22 01:49:39 -07:00
}
if (sel)
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_client_activate(sel, 1);
2013-08-22 01:49:39 -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:
_ibar_icon_signal_emit(ic, "e,state,started", "e");
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
if (ic->exe_inst == inst) ic->exe_inst = NULL;
if (!eina_list_data_find(ic->exes, inst))
ic->exes = eina_list_append(ic->exes, inst);
break;
default:
break;
}
}
static void
_ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
{
if (ic->not_in_order)
{
Eina_List *l, *ll;
E_Exec_Instance *exe;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec, *eclast = NULL;
unsigned int count = 0;
EINA_LIST_FOREACH(ic->exes, l, exe)
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
EINA_LIST_FOREACH(exe->clients, ll, ec)
{
count++;
if (count > 1)
{
ecore_job_add((Ecore_Cb)_ibar_cb_icon_menu_cb, ic);
return;
}
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
eclast = ec;
}
}
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
if (eclast)
e_client_activate(eclast, 1);
return;
}
if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
{
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;
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");
}
}
}
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)
ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
}
2005-05-14 07:06:09 -07:00
static void
_ibar_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Up *ev;
2005-05-14 07:06:09 -07:00
IBar_Icon *ic;
ev = event_info;
ic = data;
if ((ev->button == 1) && (ic->mouse_down == 1))
2005-05-14 07:06:09 -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;
E_FREE_FUNC(ic->timer, ecore_timer_del);
2005-05-14 07:06:09 -07:00
}
2005-05-01 12:29:17 -07:00
}
static void
_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 = event_info;
IBar_Icon *ic = data;
int dx, dy;
E_FREE_FUNC(ic->timer, ecore_timer_del);
if (!ic->drag.start) return;
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))
2005-05-14 07:06:09 -07:00
{
E_Drag *d;
Evas_Object *o;
Evas_Coord x, y, w, h;
unsigned int size;
2013-06-17 00:21:01 -07:00
IBar *i;
const char *drag_types[] = { "enlightenment/desktop" };
ic->drag.dnd = 1;
ic->drag.start = 0;
2012-06-22 00:28:13 -07:00
if (ic->ibar->inst->ci->lock_move) return;
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->comp,
x, y, drag_types, 1,
ic->app, -1, NULL, _ibar_cb_drag_finished);
efreet_desktop_ref(ic->app);
size = MAX(w, h);
o = e_util_desktop_icon_add(ic->app, size, e_drag_evas_get(d));
e_drag_object_set(d, o);
e_drag_resize(d, w, h);
e_drag_start(d, ic->drag.x, ic->drag.y);
2013-06-17 00:21:01 -07:00
i = ic->ibar;
e_object_data_set(E_OBJECT(d), i);
if (!ic->not_in_order)
e_order_remove(i->io->eo, ic->app);
_ibar_icon_free(ic);
2013-06-17 00:21:01 -07:00
_ibar_resize_handle(i);
_gc_orient(i->inst->gcc, -1);
2005-05-14 07:06:09 -07:00
}
}
static void
_ibar_cb_icon_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
IBar_Icon *ic;
Evas_Coord x, y;
ic = data;
evas_object_geometry_get(ic->o_holder, &x, &y, NULL, NULL);
evas_object_move(ic->o_holder2, x, y);
}
static void
_ibar_cb_icon_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
IBar_Icon *ic;
Evas_Coord w, h;
ic = data;
evas_object_geometry_get(ic->o_holder, NULL, NULL, &w, &h);
evas_object_resize(ic->o_holder2, w, h);
}
static void
_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
{
IBar *b;
Evas_Coord x, y;
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
_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
{
IBar *b;
Evas_Coord w, h;
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
}
static void
_ibar_cb_drag_finished(E_Drag *drag, int dropped)
{
IBar *i = e_object_data_get(E_OBJECT(drag));
efreet_desktop_unref(drag->data);
if (!i) return;
if (!dropped)
{
_ibar_empty(i);
_ibar_fill(i);
_ibar_resize_handle(i);
}
}
2005-05-14 07:06:09 -07:00
static void
_ibar_inst_cb_scroll(void *data)
2005-05-01 12:29:17 -07:00
{
Instance *inst;
/* Update the position of the dnd to handle for autoscrolling
* gadgets. */
inst = data;
_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;
if (inst->ibar->o_drop) e_box_unpack(inst->ibar->o_drop);
ic = _ibar_icon_at_coord(inst->ibar, x, y);
inst->ibar->ic_drop_before = ic;
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;
}
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 */
);
_ibar_resize_handle(inst->ibar);
_gc_orient(inst->gcc, -1);
}
static void
_ibar_inst_cb_enter(void *data, const char *type __UNUSED__, void *event_info)
{
E_Event_Dnd_Enter *ev;
Instance *inst;
Evas_Object *o, *o2;
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,
_ibar_cb_drop_move, inst->ibar);
2012-06-22 00:28:13 -07:00
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
_ibar_cb_drop_resize, inst->ibar);
e_theme_edje_object_set(o, "base/theme/modules/ibar",
2012-06-22 00:28:13 -07:00
"e/modules/ibar/drop");
e_theme_edje_object_set(o2, "base/theme/modules/ibar",
2012-06-22 00:28:13 -07:00
"e/modules/ibar/drop_overlay");
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);
e_gadcon_client_autoscroll_update(inst->gcc, ev->x, ev->y);
2005-05-14 07:06:09 -07:00
}
2005-05-14 07:06:09 -07:00
static void
_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;
Instance *inst;
ev = event_info;
inst = data;
_ibar_drop_position_update(inst, ev->x, ev->y);
e_gadcon_client_autoscroll_update(inst->gcc, ev->x, ev->y);
}
2005-05-14 07:06:09 -07:00
static void
_ibar_inst_cb_leave(void *data, const char *type __UNUSED__, void *event_info __UNUSED__)
{
Instance *inst;
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);
e_gadcon_client_autoscroll_cb_set(inst->gcc, NULL, NULL);
_gc_orient(inst->gcc, -1);
2005-05-14 07:06:09 -07:00
}
static void
_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;
Instance *inst;
Efreet_Desktop *app = NULL;
Eina_List *fl = NULL;
2005-05-14 07:06:09 -07:00
IBar_Icon *ic;
ev = event_info;
inst = data;
if (!strcmp(type, "enlightenment/desktop"))
app = ev->data;
else if (!strcmp(type, "enlightenment/border"))
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec;
2012-06-22 00:28:13 -07:00
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ec = ev->data;
app = ec->desktop;
2012-06-22 00:28:13 -07:00
if (!app)
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
app = e_desktop_client_create(ec);
2012-06-22 00:28:13 -07:00
efreet_desktop_save(app);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_desktop_edit(NULL, app);
2012-06-22 00:28:13 -07:00
}
}
else if (!strcmp(type, "text/uri-list"))
fl = ev->data;
ic = inst->ibar->ic_drop_before;
if (ic)
{
2012-06-22 00:28:13 -07:00
/* Add new eapp before this icon */
if (!inst->ibar->drop_before)
{
IBar_Icon *ic2;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(inst->ibar->icons, ic2)
2012-06-22 00:28:13 -07:00
{
if (ic2 == ic)
{
2013-06-17 00:21:01 -07:00
if (EINA_INLIST_GET(ic2)->next)
ic = (IBar_Icon*)EINA_INLIST_GET(ic2)->next;
2012-06-22 00:28:13 -07:00
else
ic = NULL;
break;
}
}
}
if (!ic) goto atend;
if (app)
e_order_prepend_relative(ic->ibar->io->eo, app, ic->app);
2012-06-22 00:28:13 -07:00
else if (fl)
e_order_files_prepend_relative(ic->ibar->io->eo, fl, ic->app);
}
else
{
2012-06-22 00:28:13 -07:00
atend:
if (inst->ibar->io->eo)
2012-06-22 00:28:13 -07:00
{
if (app)
e_order_append(inst->ibar->io->eo, app);
2012-06-22 00:28:13 -07:00
else if (fl)
e_order_files_append(inst->ibar->io->eo, fl);
2012-06-22 00:28:13 -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;
e_gadcon_client_autoscroll_cb_set(inst->gcc, NULL, NULL);
_ibar_empty_handle(inst->ibar);
_ibar_resize_handle(inst->ibar);
_gc_orient(inst->gcc, -1);
}
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;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
id1 = z1->id + (z1->comp->num * 100) + (z1->comp->num * 10000);
id2 = z2->id + (z2->comp->num * 100) + (z2->comp->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
{
bn = eina_list_last_data_get(tmpl);
break;
}
}
}
if (tmpl != ibars) eina_list_free(tmpl);
return bn;
}
static void
_ibar_focus(IBar *b)
{
IBar_Icon *ic;
if (b->focused) return;
b->focused = EINA_TRUE;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, ic)
{
if (ic->focused)
{
_ibar_icon_unfocus_focus(ic, NULL);
break;
}
}
if (b->icons)
2013-06-17 00:21:01 -07:00
_ibar_icon_unfocus_focus(NULL, (IBar_Icon*)b->icons);
}
static void
_ibar_unfocus(IBar *b)
{
IBar_Icon *ic;
if (!b->focused) return;
b->focused = EINA_FALSE;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, 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;
if (!b->focused) return;
if (!b->icons) return;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, ic)
{
if (!ic1)
{
if (ic->focused) ic1 = ic;
}
else
{
ic2 = ic;
break;
}
}
// wrap to start
2013-06-17 00:21:01 -07:00
if ((ic1) && (!ic2)) ic2 = (IBar_Icon*)b->icons;
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;
if (!b->focused) return;
if (!b->icons) return;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, ic)
{
if (ic->focused)
{
ic1 = ic;
break;
}
ic2 = ic;
}
// wrap to end
2013-06-17 00:21:01 -07:00
if ((ic1) && (!ic2)) ic2 = (IBar_Icon*)b->icons;
if ((ic1) && (ic2) && (ic1 != ic2))
_ibar_icon_unfocus_focus(ic1, ic2);
}
static void
_ibar_focus_launch(IBar *b)
{
IBar_Icon *ic;
if (!b->focused) return;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(b->icons, 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;
2013-05-07 05:11:05 -07:00
_ibar_focus_win = e_comp_get(man)->ee_win;
if (!e_grabinput_get(0, 0, _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);
}
_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);
_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();
}
static Eina_Bool
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
_ibar_cb_client_prop(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Property *ev)
{
IBar *b;
Eina_List *l;
Eina_Bool skip;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
if (e_client_util_ignored_get(ev->ec) || (!ev->ec->exe_inst) || (!ev->ec->exe_inst->desktop)) return ECORE_CALLBACK_RENEW;
if (!(ev->property & E_CLIENT_PROPERTY_NETWM_STATE)) return ECORE_CALLBACK_RENEW;
skip = ev->ec->netwm.state.skip_taskbar;
EINA_LIST_FOREACH(ibars, l, b)
{
IBar_Icon *ic;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ic = eina_hash_find(b->icon_hash, _desktop_name_get(ev->ec->exe_inst->desktop));
if (skip && (!ic)) continue;
if (!skip)
{
if (ic)
{
_ibar_icon_signal_emit(ic, "e,state,started", "e");
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
if (!eina_list_data_find(ic->exes, ev->ec->exe_inst))
ic->exes = eina_list_append(ic->exes, ev->ec->exe_inst);
}
else if (!b->inst->ci->dont_add_nonorder)
{
_ibar_sep_create(b);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ic = _ibar_icon_notinorder_new(b, ev->ec->exe_inst);
_ibar_resize_handle(b);
}
}
else
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ic->exes = eina_list_remove(ic->exes, ev->ec->exe_inst);
if (ic->exe_inst == ev->ec->exe_inst) ic->exe_inst = NULL;
if (!ic->exes)
{
if (ic->not_in_order)
{
_ibar_icon_free(ic);
if (!b->not_in_order_count)
{
E_FREE_FUNC(b->o_sep, evas_object_del);
}
_ibar_resize_handle(b);
}
else
_ibar_icon_signal_emit(ic, "e,state,off", "e");
}
}
}
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_ibar_cb_exec_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
{
IBar *b;
Eina_List *l;
if (!exe->desktop) return ECORE_CALLBACK_RENEW; //can't do anything here :(
EINA_LIST_FOREACH(ibars, l, b)
{
IBar_Icon *ic;
ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop));
if (ic)
{
_ibar_icon_signal_emit(ic, "e,state,started", "e");
ic->exes = eina_list_remove(ic->exes, exe);
if (ic->exe_inst == exe) ic->exe_inst = NULL;
if (!ic->exes)
{
if (ic->not_in_order)
{
_ibar_icon_free(ic);
if (!b->not_in_order_count)
{
E_FREE_FUNC(b->o_sep, evas_object_del);
}
_ibar_resize_handle(b);
}
else
_ibar_icon_signal_emit(ic, "e,state,off", "e");
}
}
}
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_ibar_cb_exec_new_client(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
{
IBar *b;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec;
Eina_List *l;
Eina_Bool skip;
if (!exe->desktop) return ECORE_CALLBACK_RENEW; //can't do anything here :(
if (!exe->desktop->icon) return ECORE_CALLBACK_RENEW;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
ec = eina_list_last_data_get(exe->clients); //only care about last (new) one
skip = ec->netwm.state.skip_taskbar;
EINA_LIST_FOREACH(ibars, l, b)
{
IBar_Icon *ic;
ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop));
if (ic)
{
_ibar_icon_signal_emit(ic, "e,state,started", "e");
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
if (skip) continue;
if (!eina_list_data_find(ic->exes, exe))
ic->exes = eina_list_append(ic->exes, exe);
if (ic->menu)
{
/* adding will fail if client hasn't been shown yet */
ic->menu_pending = eina_list_append(ic->menu_pending, ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, _ibar_exec_new_client_show, ic);
}
}
else if (!b->inst->ci->dont_add_nonorder)
{
if (skip) continue;
_ibar_sep_create(b);
ic = _ibar_icon_notinorder_new(b, exe);
_ibar_resize_handle(b);
}
}
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_ibar_cb_exec_new(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
{
IBar *b;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_Client *ec;
Eina_List *l;
Eina_Bool skip = EINA_TRUE;
if (!exe->desktop) return ECORE_CALLBACK_RENEW; //can't do anything here :(
if (!exe->desktop->icon) return ECORE_CALLBACK_RENEW;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
EINA_LIST_FOREACH(exe->clients, l, ec)
if (!ec->netwm.state.skip_taskbar)
skip = EINA_FALSE;
EINA_LIST_FOREACH(ibars, l, b)
{
IBar_Icon *ic;
ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop));
if (ic)
{
_ibar_icon_signal_emit(ic, "e,state,started", "e");
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
if (skip) continue;
if (!eina_list_data_find(ic->exes, exe))
ic->exes = eina_list_append(ic->exes, exe);
if (ic->menu)
{
/* adding will fail if client hasn't been shown yet */
ic->menu_pending = eina_list_append(ic->menu_pending, ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, _ibar_exec_new_client_show, ic);
}
}
else if (!b->inst->ci->dont_add_nonorder)
{
if (skip) continue;
_ibar_sep_create(b);
ic = _ibar_icon_notinorder_new(b, exe);
_ibar_resize_handle(b);
}
}
return ECORE_CALLBACK_RENEW;
}
/* module setup */
EAPI E_Module_Api e_modapi =
2005-02-13 03:37:13 -08:00
{
E_MODULE_API_VERSION, "IBar"
};
EAPI void *
e_modapi_init(E_Module *m)
2005-02-13 03:37:13 -08: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);
E_CONFIG_VAL(D, T, show_label, INT);
E_CONFIG_VAL(D, T, eap_label, INT);
E_CONFIG_VAL(D, T, lock_move, INT);
E_CONFIG_VAL(D, T, dont_add_nonorder, INT);
E_CONFIG_VAL(D, T, dont_track_launch, UCHAR);
E_CONFIG_VAL(D, T, dont_icon_menu_mouseover, UCHAR);
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);
ibar_config = e_config_domain_load("module.ibar", conf_edd);
if (!ibar_config)
2005-02-13 03:37:13 -08:00
{
2012-06-22 00:28:13 -07:00
Config_Item *ci;
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;
ci->lock_move = 0;
ci->dont_add_nonorder = 0;
ci->dont_track_launch = 0;
ci->dont_icon_menu_mouseover = 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
ibar_config->module = m;
E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_CONFIG_ICON_THEME,
_ibar_cb_config_icons, NULL);
E_LIST_HANDLER_APPEND(ibar_config->handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
_ibar_cb_config_icons, NULL);
E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_EXEC_NEW,
_ibar_cb_exec_new, NULL);
E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_EXEC_NEW_CLIENT,
_ibar_cb_exec_new_client, NULL);
E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_EXEC_DEL,
_ibar_cb_exec_del, NULL);
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_CLIENT_PROPERTY,
_ibar_cb_client_prop, NULL);
e_gadcon_provider_register(&_gadcon_class);
ibar_orders = eina_hash_string_superfast_new(NULL);
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);
}
return m;
2005-02-13 03:37:13 -08:00
}
EAPI int
e_modapi_shutdown(E_Module *m __UNUSED__)
{
Ecore_Event_Handler *eh;
Config_Item *ci;
_ibar_go_unfocus();
e_action_del("ibar_focus");
e_action_predef_name_del("IBar", "Focus IBar");
act_ibar_focus = NULL;
e_gadcon_provider_unregister(&_gadcon_class);
if (ibar_config->config_dialog)
e_object_del(E_OBJECT(ibar_config->config_dialog));
EINA_LIST_FREE(ibar_config->handlers, eh)
ecore_event_handler_del(eh);
EINA_LIST_FREE(ibar_config->items, ci)
{
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);
}
E_FREE(ibar_config);
ibar_config = NULL;
eina_hash_free(ibar_orders);
ibar_orders = NULL;
E_CONFIG_DD_FREE(conf_item_edd);
E_CONFIG_DD_FREE(conf_edd);
return 1;
}
EAPI int
e_modapi_save(E_Module *m __UNUSED__)
{
e_config_domain_save("module.ibar", conf_edd, ibar_config);
return 1;
}
static Eina_Bool
_ibar_cb_config_icons(__UNUSED__ void *data, __UNUSED__ int ev_type, __UNUSED__ void *ev)
{
const Eina_List *l;
Instance *inst;
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
{
2012-06-22 00:28:13 -07:00
IBar_Icon *icon;
2013-06-17 00:21:01 -07:00
EINA_INLIST_FOREACH(inst->ibar->icons, icon)
2012-06-22 00:28:13 -07:00
_ibar_icon_fill(icon);
}
return ECORE_CALLBACK_PASS_ON;
}
2012-06-22 00:28:13 -07:00