forked from enlightenment/enlightenment
remove old e_msg-based comp api as well as e_manager_comp api, replacing both with e_comp functions and events
this completely breaks anything external which used comp, so module api version has been bumped SVN revision: 82973
This commit is contained in:
parent
e75bc273b2
commit
8fcf2cbcca
|
@ -1,3 +1,7 @@
|
|||
2013-01-15 Mike Blumenkrantz
|
||||
|
||||
* Removed old comp hook and msgbus API, replacing with new e_comp namespaced API and events
|
||||
|
||||
2013-01-17 Chidambar Zinnoury (ilLogict)
|
||||
* Mixer and battery modules: reuse notifications.
|
||||
|
||||
|
|
4
NEWS
4
NEWS
|
@ -17,7 +17,7 @@ Additions:
|
|||
* Added e_configure_option API
|
||||
* Added D-Bus notification to systray module
|
||||
* Added D-Bus menu support
|
||||
* Added e_comp namespace
|
||||
* Added e_comp namespace and E_EVENT_COMP events
|
||||
* Added API for fetching module .desktop files
|
||||
Config:
|
||||
* Added option for disabling icons in menus
|
||||
|
@ -40,7 +40,7 @@ Deprecations:
|
|||
*
|
||||
|
||||
Removed:
|
||||
*
|
||||
* e_manager_comp namespace
|
||||
|
||||
Improvements:
|
||||
* Check changed added to several settings dialogs:
|
||||
|
|
|
@ -1100,7 +1100,7 @@ e_border_hide(E_Border *bd,
|
|||
|
||||
case 1:
|
||||
default:
|
||||
if (!e_manager_comp_evas_get(bd->zone->container->manager))
|
||||
if (!e_comp_evas_get(bd->zone->container->manager->comp))
|
||||
{
|
||||
/* Make sure that this border isn't deleted */
|
||||
bd->await_hide_event++;
|
||||
|
@ -3496,7 +3496,7 @@ _e_border_shape_input_rectangle_set(E_Border *bd)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!e_manager_comp_evas_get(bd->zone->container->manager))
|
||||
if (!e_comp_evas_get(bd->zone->container->manager->comp))
|
||||
ecore_x_composite_window_events_enable(bd->win);
|
||||
else
|
||||
ecore_x_composite_window_events_disable(bd->win);
|
||||
|
@ -3672,7 +3672,7 @@ _e_border_hide(E_Border *bd)
|
|||
E_Border *tmp;
|
||||
Eina_List *l;
|
||||
|
||||
if (!e_manager_comp_evas_get(bd->zone->container->manager))
|
||||
if (!e_comp_evas_get(bd->zone->container->manager->comp))
|
||||
{
|
||||
ecore_x_window_hide(bd->win);
|
||||
ecore_evas_hide(bd->bg_ecore_evas);
|
||||
|
|
427
src/bin/e_comp.c
427
src/bin/e_comp.c
|
@ -51,7 +51,6 @@ struct _E_Comp
|
|||
|
||||
int nocomp_override;
|
||||
|
||||
E_Manager_Comp comp;
|
||||
Ecore_X_Window cm_selection;
|
||||
|
||||
Eina_Bool gl : 1;
|
||||
|
@ -167,6 +166,11 @@ static E_Config_DD *conf_match_edd = NULL;
|
|||
static Ecore_Timer *action_timeout = NULL;
|
||||
static Eina_Bool gl_avail = EINA_FALSE;
|
||||
|
||||
EAPI int E_EVENT_COMP_SOURCE_VISIBILITY = -1;
|
||||
EAPI int E_EVENT_COMP_SOURCE_ADD = -1;
|
||||
EAPI int E_EVENT_COMP_SOURCE_DEL = -1;
|
||||
EAPI int E_EVENT_COMP_SOURCE_CONFIGURE = -1;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#undef DBG
|
||||
#if 0
|
||||
|
@ -191,6 +195,56 @@ static void _e_comp_win_configure(E_Comp_Win *cw,
|
|||
int x, int y, int w, int h,
|
||||
int border);
|
||||
|
||||
static void
|
||||
_e_comp_event_end(void *d EINA_UNUSED, E_Event_Comp *ev)
|
||||
{
|
||||
ev->cw->pending_count--;
|
||||
if (ev->cw->delete_pending && (!ev->cw->pending_count))
|
||||
free(ev->cw);
|
||||
free(ev);
|
||||
}
|
||||
|
||||
/* FIXME: external ? */
|
||||
static void
|
||||
_e_comp_event_source_visibility(E_Comp_Win *cw)
|
||||
{
|
||||
E_Event_Comp *ev;
|
||||
|
||||
ev = E_NEW(E_Event_Comp, 1);
|
||||
ev->cw = cw;
|
||||
ecore_event_add(E_EVENT_COMP_SOURCE_VISIBILITY, ev, (Ecore_End_Cb)_e_comp_event_end, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_event_source_add(E_Comp_Win *cw)
|
||||
{
|
||||
E_Event_Comp *ev;
|
||||
|
||||
ev = E_NEW(E_Event_Comp, 1);
|
||||
ev->cw = cw;
|
||||
ecore_event_add(E_EVENT_COMP_SOURCE_VISIBILITY, ev, (Ecore_End_Cb)_e_comp_event_end, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_event_source_del(E_Comp_Win *cw)
|
||||
{
|
||||
E_Event_Comp *ev;
|
||||
|
||||
ev = E_NEW(E_Event_Comp, 1);
|
||||
ev->cw = cw;
|
||||
ecore_event_add(E_EVENT_COMP_SOURCE_VISIBILITY, ev, (Ecore_End_Cb)_e_comp_event_end, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_event_source_configure(E_Comp_Win *cw)
|
||||
{
|
||||
E_Event_Comp *ev;
|
||||
|
||||
ev = E_NEW(E_Event_Comp, 1);
|
||||
ev->cw = cw;
|
||||
ecore_event_add(E_EVENT_COMP_SOURCE_VISIBILITY, ev, (Ecore_End_Cb)_e_comp_event_end, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_child_show(E_Comp_Win *cw)
|
||||
{
|
||||
|
@ -233,20 +287,6 @@ _e_comp_child_hide(E_Comp_Win *cw)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_pending_after(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
cw->pending_count--;
|
||||
if (!cw->delete_pending) return;
|
||||
if (cw->pending_count == 0)
|
||||
{
|
||||
free(cw);
|
||||
}
|
||||
}
|
||||
|
||||
static E_Comp_Win *
|
||||
_e_comp_fullscreen_check(E_Comp *c)
|
||||
{
|
||||
|
@ -898,10 +938,7 @@ _e_comp_win_update(E_Comp_Win *cw)
|
|||
cw->animating = 1;
|
||||
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_visibility_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
|
||||
_e_comp_event_source_visibility(cw);
|
||||
cw->show_anim = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1162,9 +1199,7 @@ _e_comp_cb_nocomp_end(E_Comp *c)
|
|||
{
|
||||
if (!cw->hidden_override) _e_comp_child_show(cw);
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_visibility_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_visibility(cw);
|
||||
// no need for effect
|
||||
}
|
||||
if (cw->counter)
|
||||
|
@ -2064,9 +2099,7 @@ _e_comp_win_add(E_Comp *c,
|
|||
evas_object_pass_events_set(cw->obj, 1);
|
||||
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_add_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_add(cw);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2114,9 +2147,7 @@ _e_comp_win_del(E_Comp_Win *cw)
|
|||
if ((!cw->input_only) && (!cw->invalid))
|
||||
{
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_del_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_del(cw);
|
||||
}
|
||||
|
||||
e_comp_update_free(cw->up);
|
||||
|
@ -2319,9 +2350,7 @@ _e_comp_win_show(E_Comp_Win *cw)
|
|||
_e_comp_win_render_queue(cw);
|
||||
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_visibility_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_visibility(cw);
|
||||
}
|
||||
_e_comp_win_render_queue(cw);
|
||||
}
|
||||
|
@ -2360,9 +2389,7 @@ _e_comp_win_hide(E_Comp_Win *cw)
|
|||
_e_comp_win_render_queue(cw);
|
||||
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_visibility_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_visibility(cw);
|
||||
return;
|
||||
}
|
||||
cw->defer_hide = 0;
|
||||
|
@ -2458,9 +2485,7 @@ _e_comp_win_raise_above(E_Comp_Win *cw,
|
|||
_e_comp_win_restack(cw);
|
||||
_e_comp_win_render_queue(cw);
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_config_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_configure(cw);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2473,9 +2498,7 @@ _e_comp_win_raise(E_Comp_Win *cw)
|
|||
_e_comp_win_restack(cw);
|
||||
_e_comp_win_render_queue(cw);
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_config_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_configure(cw);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2488,9 +2511,7 @@ _e_comp_win_lower(E_Comp_Win *cw)
|
|||
_e_comp_win_restack(cw);
|
||||
_e_comp_win_render_queue(cw);
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_config_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_configure(cw);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2598,9 +2619,7 @@ _e_comp_win_configure(E_Comp_Win *cw,
|
|||
if (moved || resized) _e_comp_win_geometry_update(cw);
|
||||
// add pending manager comp event count to match below config send
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_config_send(cw->c->man,
|
||||
(E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_configure(cw);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3532,173 +3551,6 @@ _e_comp_signal_user(void *data __UNUSED__,
|
|||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static Evas *
|
||||
_e_comp_evas_get_func(void *data,
|
||||
E_Manager *man __UNUSED__)
|
||||
{
|
||||
E_Comp *c = data;
|
||||
return c->evas;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_update_func(void *data,
|
||||
E_Manager *man __UNUSED__)
|
||||
{
|
||||
E_Comp *c = data;
|
||||
_e_comp_render_queue(c);
|
||||
}
|
||||
|
||||
static E_Manager_Comp_Source *
|
||||
_e_comp_border_src_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
Ecore_X_Window win)
|
||||
{
|
||||
return (E_Manager_Comp_Source *)_e_comp_border_client_find(win);
|
||||
}
|
||||
|
||||
static E_Manager_Comp_Source *
|
||||
_e_comp_src_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
Ecore_X_Window win)
|
||||
{
|
||||
return (E_Manager_Comp_Source *)_e_comp_win_find(win);
|
||||
}
|
||||
|
||||
static const Eina_List *
|
||||
_e_comp_src_list_get_func(void *data,
|
||||
E_Manager *man __UNUSED__)
|
||||
{
|
||||
E_Comp *c = data;
|
||||
E_Comp_Win *cw;
|
||||
|
||||
if (!c->wins) return NULL;
|
||||
if (c->wins_invalid)
|
||||
{
|
||||
c->wins_invalid = 0;
|
||||
if (c->wins_list) eina_list_free(c->wins_list);
|
||||
c->wins_list = NULL;
|
||||
EINA_INLIST_FOREACH(c->wins, cw)
|
||||
{
|
||||
if ((cw->shobj) && (cw->obj))
|
||||
c->wins_list = eina_list_append(c->wins_list, cw);
|
||||
}
|
||||
}
|
||||
return c->wins_list;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_comp_src_image_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return NULL;
|
||||
return cw->obj;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_comp_src_shadow_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return NULL;
|
||||
return cw->shobj;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_comp_src_image_mirror_add_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return NULL;
|
||||
return _e_comp_win_mirror_add(cw);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_src_visible_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return 0;
|
||||
return cw->visible;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_src_hidden_set_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src,
|
||||
Eina_Bool hidden)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return;
|
||||
if (cw->hidden_override == hidden) return;
|
||||
cw->hidden_override = hidden;
|
||||
if (cw->bd) e_border_comp_hidden_set(cw->bd, cw->hidden_override);
|
||||
if (cw->visible)
|
||||
{
|
||||
if (cw->hidden_override)
|
||||
_e_comp_child_hide(cw);
|
||||
else if (!cw->bd || cw->bd->visible)
|
||||
_e_comp_child_show(cw);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cw->hidden_override) _e_comp_child_hide(cw);
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_src_hidden_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return 0;
|
||||
return cw->hidden_override;
|
||||
}
|
||||
|
||||
static E_Popup *
|
||||
_e_comp_src_popup_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return 0;
|
||||
return cw->pop;
|
||||
}
|
||||
|
||||
static E_Border *
|
||||
_e_comp_src_border_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return 0;
|
||||
return cw->bd;
|
||||
}
|
||||
|
||||
static Ecore_X_Window
|
||||
_e_comp_src_window_get_func(void *data __UNUSED__,
|
||||
E_Manager *man __UNUSED__,
|
||||
E_Manager_Comp_Source *src)
|
||||
{
|
||||
// E_Comp *c = data;
|
||||
E_Comp_Win *cw = (E_Comp_Win *)src;
|
||||
if (!cw->c) return 0;
|
||||
return cw->win;
|
||||
}
|
||||
|
||||
static E_Comp *
|
||||
_e_comp_add(E_Manager *man)
|
||||
{
|
||||
|
@ -3733,6 +3585,7 @@ _e_comp_add(E_Manager *man)
|
|||
ecore_x_e_comp_sync_supported_set(man->root, conf->efl_sync);
|
||||
|
||||
c->man = man;
|
||||
man->comp = c;
|
||||
c->win = ecore_x_composite_render_window_enable(man->root);
|
||||
if (!c->win)
|
||||
{
|
||||
|
@ -3881,23 +3734,6 @@ _e_comp_add(E_Manager *man)
|
|||
ECORE_EVENT_MODIFIER_CTRL |
|
||||
ECORE_EVENT_MODIFIER_ALT, 0);
|
||||
|
||||
c->comp.data = c;
|
||||
c->comp.func.evas_get = _e_comp_evas_get_func;
|
||||
c->comp.func.update = _e_comp_update_func;
|
||||
c->comp.func.src_get = _e_comp_src_get_func;
|
||||
c->comp.func.border_src_get = _e_comp_border_src_get_func;
|
||||
c->comp.func.src_list_get = _e_comp_src_list_get_func;
|
||||
c->comp.func.src_image_get = _e_comp_src_image_get_func;
|
||||
c->comp.func.src_shadow_get = _e_comp_src_shadow_get_func;
|
||||
c->comp.func.src_image_mirror_add = _e_comp_src_image_mirror_add_func;
|
||||
c->comp.func.src_visible_get = _e_comp_src_visible_get_func;
|
||||
c->comp.func.src_hidden_set = _e_comp_src_hidden_set_func;
|
||||
c->comp.func.src_hidden_get = _e_comp_src_hidden_get_func;
|
||||
c->comp.func.src_window_get = _e_comp_src_window_get_func;
|
||||
c->comp.func.src_border_get = _e_comp_src_border_get_func;
|
||||
c->comp.func.src_popup_get = _e_comp_src_popup_get_func;
|
||||
|
||||
e_manager_comp_set(c->man, &(c->comp));
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -3909,6 +3745,7 @@ _e_comp_del(E_Comp *c)
|
|||
Eina_List *l, *hide_bd = NULL;
|
||||
E_Border *bd;
|
||||
|
||||
c->man->comp = NULL;
|
||||
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
|
||||
{
|
||||
if (!bd->visible)
|
||||
|
@ -3925,7 +3762,6 @@ _e_comp_del(E_Comp *c)
|
|||
evas_object_del(c->fps_bg);
|
||||
c->fps_bg = NULL;
|
||||
}
|
||||
e_manager_comp_set(c->man, NULL);
|
||||
|
||||
ecore_x_window_key_ungrab(c->man->root,
|
||||
"F",
|
||||
|
@ -4490,6 +4326,11 @@ e_comp_init(void)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
E_EVENT_COMP_SOURCE_VISIBILITY = ecore_event_type_new();
|
||||
E_EVENT_COMP_SOURCE_ADD = ecore_event_type_new();
|
||||
E_EVENT_COMP_SOURCE_DEL = ecore_event_type_new();
|
||||
E_EVENT_COMP_SOURCE_CONFIGURE = ecore_event_type_new();
|
||||
|
||||
e_comp_cfdata_edd_init(&conf_edd, &conf_match_edd);
|
||||
conf = e_config_domain_load("e_comp", conf_edd);
|
||||
if (conf)
|
||||
|
@ -4604,12 +4445,130 @@ e_comp_shadows_reset(void)
|
|||
cw->animating = 1;
|
||||
|
||||
cw->pending_count++;
|
||||
e_manager_comp_event_src_visibility_send
|
||||
(cw->c->man, (E_Manager_Comp_Source *)cw,
|
||||
_e_comp_cb_pending_after, cw->c);
|
||||
_e_comp_event_source_visibility(cw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EAPI Evas *
|
||||
e_comp_evas_get(E_Comp *c)
|
||||
{
|
||||
return c->evas;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_comp_update(E_Comp *c)
|
||||
{
|
||||
_e_comp_render_queue(c);
|
||||
}
|
||||
|
||||
EAPI E_Comp_Win *
|
||||
e_comp_border_src_get(Ecore_X_Window win)
|
||||
{
|
||||
return _e_comp_border_client_find(win);
|
||||
}
|
||||
|
||||
EAPI E_Comp_Win *
|
||||
e_comp_src_get(Ecore_X_Window win)
|
||||
{
|
||||
return _e_comp_win_find(win);
|
||||
}
|
||||
|
||||
EAPI const Eina_List *
|
||||
e_comp_src_list_get(E_Comp *c)
|
||||
{
|
||||
E_Comp_Win *cw;
|
||||
|
||||
if (!c->wins) return NULL;
|
||||
if (c->wins_invalid)
|
||||
{
|
||||
c->wins_invalid = 0;
|
||||
if (c->wins_list) eina_list_free(c->wins_list);
|
||||
c->wins_list = NULL;
|
||||
EINA_INLIST_FOREACH(c->wins, cw)
|
||||
{
|
||||
if ((cw->shobj) && (cw->obj))
|
||||
c->wins_list = eina_list_append(c->wins_list, cw);
|
||||
}
|
||||
}
|
||||
return c->wins_list;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_comp_src_image_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return NULL;
|
||||
return cw->obj;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_comp_src_shadow_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return NULL;
|
||||
return cw->shobj;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_comp_src_image_mirror_add(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return NULL;
|
||||
return _e_comp_win_mirror_add(cw);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_comp_src_visible_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return EINA_FALSE;
|
||||
return cw->visible;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_comp_src_hidden_set(E_Comp_Win *cw, Eina_Bool hidden)
|
||||
{
|
||||
if (!cw->c) return;
|
||||
if (cw->hidden_override == hidden) return;
|
||||
cw->hidden_override = hidden;
|
||||
if (cw->bd) e_border_comp_hidden_set(cw->bd, cw->hidden_override);
|
||||
if (cw->visible)
|
||||
{
|
||||
if (cw->hidden_override)
|
||||
_e_comp_child_hide(cw);
|
||||
else if (!cw->bd || cw->bd->visible)
|
||||
_e_comp_child_show(cw);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cw->hidden_override) _e_comp_child_hide(cw);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_comp_src_hidden_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return EINA_FALSE;
|
||||
return cw->hidden_override;
|
||||
}
|
||||
|
||||
EAPI E_Popup *
|
||||
e_comp_src_popup_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return NULL;
|
||||
return cw->pop;
|
||||
}
|
||||
|
||||
EAPI E_Border *
|
||||
e_comp_src_border_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return NULL;
|
||||
return cw->bd;
|
||||
}
|
||||
|
||||
EAPI Ecore_X_Window
|
||||
e_comp_src_window_get(E_Comp_Win *cw)
|
||||
{
|
||||
if (!cw->c) return 0;
|
||||
return cw->win;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
typedef struct _E_Comp E_Comp;
|
||||
typedef struct _E_Comp_Win E_Comp_Win;
|
||||
typedef struct _E_Comp_Zone E_Comp_Zone;
|
||||
typedef struct E_Event_Comp E_Event_Comp;
|
||||
|
||||
#else
|
||||
#ifndef E_MOD_COMP_H
|
||||
|
@ -10,6 +11,16 @@ typedef struct _E_Comp_Zone E_Comp_Zone;
|
|||
# include "e_comp_cfdata.h"
|
||||
# include "e_comp_update.h"
|
||||
|
||||
struct E_Event_Comp
|
||||
{
|
||||
E_Comp_Win *cw;
|
||||
};
|
||||
|
||||
extern EAPI int E_EVENT_COMP_SOURCE_VISIBILITY;
|
||||
extern EAPI int E_EVENT_COMP_SOURCE_ADD;
|
||||
extern EAPI int E_EVENT_COMP_SOURCE_DEL;
|
||||
extern EAPI int E_EVENT_COMP_SOURCE_CONFIGURE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_COMP_ENGINE_NONE = 0,
|
||||
|
@ -24,5 +35,20 @@ EAPI int e_comp_internal_save(void);
|
|||
EAPI E_Comp_Config *e_comp_config_get(void);
|
||||
EAPI void e_comp_shadows_reset(void);
|
||||
|
||||
EAPI Evas *e_comp_evas_get(E_Comp *c);
|
||||
EAPI void e_comp_update(E_Comp *c);
|
||||
EAPI E_Comp_Win *e_comp_border_src_get(Ecore_X_Window win);
|
||||
EAPI E_Comp_Win *e_comp_src_get(Ecore_X_Window win);
|
||||
EAPI const Eina_List *e_comp_src_list_get(E_Comp *c);
|
||||
EAPI Evas_Object *e_comp_src_image_get(E_Comp_Win *cw);
|
||||
EAPI Evas_Object *e_comp_src_shadow_get(E_Comp_Win *cw);
|
||||
EAPI Evas_Object *e_comp_src_image_mirror_add(E_Comp_Win *cw);
|
||||
EAPI Eina_Bool e_comp_src_visible_get(E_Comp_Win *cw);
|
||||
EAPI void e_comp_src_hidden_set(E_Comp_Win *cw, Eina_Bool hidden);
|
||||
EAPI Eina_Bool e_comp_src_hidden_get(E_Comp_Win *cw);
|
||||
EAPI E_Popup *e_comp_src_popup_get(E_Comp_Win *cw);
|
||||
EAPI E_Border *e_comp_src_border_get(E_Comp_Win *cw);
|
||||
EAPI Ecore_X_Window e_comp_src_window_get(E_Comp_Win *cw);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -525,163 +525,6 @@ e_managers_keys_ungrab(void)
|
|||
}
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
e_manager_comp_set(E_Manager *man, E_Manager_Comp *comp)
|
||||
{
|
||||
E_OBJECT_CHECK(man);
|
||||
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
|
||||
man->comp = comp;
|
||||
ecore_event_add(E_EVENT_MANAGER_COMP_SET, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
EAPI Evas *
|
||||
e_manager_comp_evas_get(E_Manager *man)
|
||||
{
|
||||
E_OBJECT_CHECK(man);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
|
||||
if (!man->comp) return NULL;
|
||||
return man->comp->func.evas_get(man->comp->data, man);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_evas_update(E_Manager *man)
|
||||
{
|
||||
E_OBJECT_CHECK(man);
|
||||
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
|
||||
if (!man->comp) return;
|
||||
man->comp->func.update(man->comp->data, man);
|
||||
}
|
||||
|
||||
EAPI const Eina_List *
|
||||
e_manager_comp_src_list(E_Manager *man)
|
||||
{
|
||||
return man->comp->func.src_list_get(man->comp->data, man);
|
||||
}
|
||||
|
||||
EAPI E_Manager_Comp_Source *
|
||||
e_manager_comp_border_src_get(E_Manager *man, Ecore_X_Window win)
|
||||
{
|
||||
return man->comp->func.border_src_get(man->comp->data, man, win);
|
||||
}
|
||||
|
||||
EAPI E_Manager_Comp_Source *
|
||||
e_manager_comp_src_get(E_Manager *man, Ecore_X_Window win)
|
||||
{
|
||||
return man->comp->func.src_get(man->comp->data, man, win);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_manager_comp_src_image_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_image_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_manager_comp_src_shadow_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_shadow_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_manager_comp_src_image_mirror_add(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_image_mirror_add(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_manager_comp_src_visible_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_visible_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_src_hidden_set(E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden)
|
||||
{
|
||||
man->comp->func.src_hidden_set(man->comp->data, man, src, hidden);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_manager_comp_src_hidden_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_hidden_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI Ecore_X_Window
|
||||
e_manager_comp_src_window_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_window_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI E_Popup *
|
||||
e_manager_comp_src_popup_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_popup_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI E_Border *
|
||||
e_manager_comp_src_border_get(E_Manager *man, E_Manager_Comp_Source *src)
|
||||
{
|
||||
return man->comp->func.src_border_get(man->comp->data, man, src);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_event_resize_send(E_Manager *man)
|
||||
{
|
||||
e_msg_send("comp.manager", "resize.comp", // name + info
|
||||
0, // val
|
||||
E_OBJECT(man), // obj
|
||||
NULL, // msgdata
|
||||
NULL, NULL); // afterfunc + afterdata
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_event_src_add_send(E_Manager *man, E_Manager_Comp_Source *src,
|
||||
void (*afterfunc)(void *data, E_Manager *man, E_Manager_Comp_Source *src),
|
||||
void *data)
|
||||
{
|
||||
e_msg_send("comp.manager", "add.src", // name + info
|
||||
0, // val
|
||||
E_OBJECT(man), // obj
|
||||
src, // msgdata
|
||||
(void (*)(void *, E_Object *, void *))afterfunc, data); // afterfunc + afterdata
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_event_src_del_send(E_Manager *man, E_Manager_Comp_Source *src,
|
||||
void (*afterfunc)(void *data, E_Manager *man, E_Manager_Comp_Source *src),
|
||||
void *data)
|
||||
{
|
||||
e_msg_send("comp.manager", "del.src", // name + info
|
||||
0, // val
|
||||
E_OBJECT(man), // obj
|
||||
src, // msgdata
|
||||
(void (*)(void *, E_Object *, void *))afterfunc, data); // afterfunc + afterdata
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_event_src_config_send(E_Manager *man, E_Manager_Comp_Source *src,
|
||||
void (*afterfunc)(void *data, E_Manager *man, E_Manager_Comp_Source *src),
|
||||
void *data)
|
||||
{
|
||||
e_msg_send("comp.manager", "config.src", // name + info
|
||||
0, // val
|
||||
E_OBJECT(man), // obj
|
||||
src, // msgdata
|
||||
(void (*)(void *, E_Object *, void *))afterfunc, data); // afterfunc + afterdata
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_manager_comp_event_src_visibility_send(E_Manager *man, E_Manager_Comp_Source *src,
|
||||
void (*afterfunc)(void *data, E_Manager *man, E_Manager_Comp_Source *src),
|
||||
void *data)
|
||||
{
|
||||
e_msg_send("comp.manager", "visibility.src", // name + info
|
||||
0, // val
|
||||
E_OBJECT(man), // obj
|
||||
src, // msgdata
|
||||
(void (*)(void *, E_Object *, void *))afterfunc, data); // afterfunc + afterdata
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_manager_free(E_Manager *man)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Manager E_Manager;
|
||||
typedef struct _E_Manager_Comp E_Manager_Comp;
|
||||
typedef struct _E_Manager_Comp_Source E_Manager_Comp_Source;
|
||||
|
||||
#else
|
||||
#ifndef E_MANAGER_H
|
||||
|
@ -27,32 +25,11 @@ struct _E_Manager
|
|||
|
||||
E_Pointer *pointer;
|
||||
Ecore_X_Window initwin;
|
||||
E_Comp *comp;
|
||||
|
||||
E_Manager_Comp *comp;
|
||||
Ecore_Timer *clear_timer;
|
||||
};
|
||||
|
||||
struct _E_Manager_Comp
|
||||
{
|
||||
struct {
|
||||
Evas * (*evas_get) (void *data, E_Manager *man);
|
||||
void (*update) (void *data, E_Manager *man);
|
||||
const Eina_List * (*src_list_get) (void *data, E_Manager *man);
|
||||
Evas_Object * (*src_image_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
Evas_Object * (*src_shadow_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
Evas_Object * (*src_image_mirror_add) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
Eina_Bool (*src_visible_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
void (*src_hidden_set) (void *data, E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden);
|
||||
Eina_Bool (*src_hidden_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
E_Manager_Comp_Source * (*src_get) (void *data, E_Manager *man, Ecore_X_Window win);
|
||||
E_Manager_Comp_Source * (*border_src_get) (void *data, E_Manager *man, Ecore_X_Window win);
|
||||
E_Popup * (*src_popup_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
E_Border * (*src_border_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
Ecore_X_Window (*src_window_get) (void *data, E_Manager *man, E_Manager_Comp_Source *src);
|
||||
} func;
|
||||
void *data;
|
||||
};
|
||||
|
||||
EINTERN int e_manager_init(void);
|
||||
EINTERN int e_manager_shutdown(void);
|
||||
EAPI Eina_List *e_manager_list(void);
|
||||
|
@ -71,68 +48,5 @@ EAPI E_Manager *e_manager_number_get(int num);
|
|||
|
||||
EAPI void e_managers_keys_grab(void);
|
||||
EAPI void e_managers_keys_ungrab(void);
|
||||
|
||||
// tenative api for e's compositor to advertise to the rest of e the comp
|
||||
// canvas. on comp evas register (set evas) we send:
|
||||
// e_msg_send("comp.manager", "comp.change", 0, man);
|
||||
// so to hook up to it:
|
||||
// static void handler(void *data, const char *name, const char *info, int val, E_Object *obj, void *msgdata)
|
||||
// {
|
||||
// if (!strcmp(name, "comp.manager"))
|
||||
// {
|
||||
// if (!strcmp(info, "change.comp"))
|
||||
// { // compositor canvas added or deleted
|
||||
// Evas *e = e_manager_comp_evas_get((E_Manager *)obj);
|
||||
// if (!e) printf("No comp manager\n");
|
||||
// else printf("comp canvas = %p\n", e);
|
||||
// }
|
||||
/// FIXME: implement below
|
||||
// else if (!strcmp(info, "resize.comp"))
|
||||
// { // compositor canvas resized
|
||||
// }
|
||||
// else if (!strcmp(info, "add.src"))
|
||||
// { // compositor source added
|
||||
// }
|
||||
// else if (!strcmp(info, "del.src"))
|
||||
// { // compositor source deleted
|
||||
// }
|
||||
// else if (!strcmp(info, "config.src"))
|
||||
// { // compositor src reconfigured (moved, resized)
|
||||
// }
|
||||
// else if (!strcmp(info, "visible.src"))
|
||||
// { // compositor src shown or hidden
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// e_msg_handler_add(handler, mydata);
|
||||
//
|
||||
// remember to listen to zone confiugre events like:
|
||||
// E_EVENT_ZONE_MOVE_RESIZE
|
||||
// E_EVENT_ZONE_ADD
|
||||
// E_EVENT_ZONE_DEL
|
||||
//
|
||||
// only 1 compositor can own a manager at a time, so before you "set" the
|
||||
// comp evas, you need to get it and make sure it's NULL, if so, then
|
||||
// you can set the update func and the comp evas
|
||||
EINTERN void e_manager_comp_set(E_Manager *man, E_Manager_Comp *comp);
|
||||
EAPI Evas *e_manager_comp_evas_get(E_Manager *man);
|
||||
EAPI void e_manager_comp_evas_update(E_Manager *man);
|
||||
EAPI const Eina_List *e_manager_comp_src_list(E_Manager *man);
|
||||
EAPI Evas_Object *e_manager_comp_src_image_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI Evas_Object *e_manager_comp_src_shadow_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI Evas_Object *e_manager_comp_src_image_mirror_add(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI Eina_Bool e_manager_comp_src_visible_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI void e_manager_comp_src_hidden_set(E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden);
|
||||
EAPI Eina_Bool e_manager_comp_src_hidden_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI void e_manager_comp_event_resize_send(E_Manager *man);
|
||||
EAPI void e_manager_comp_event_src_add_send(E_Manager *man, E_Manager_Comp_Source *src, void (*afterfunc) (void *data, E_Manager *man, E_Manager_Comp_Source *src), void *data);
|
||||
EAPI void e_manager_comp_event_src_del_send(E_Manager *man, E_Manager_Comp_Source *src, void (*afterfunc) (void *data, E_Manager *man, E_Manager_Comp_Source *src), void *data);
|
||||
EAPI void e_manager_comp_event_src_config_send(E_Manager *man, E_Manager_Comp_Source *src, void (*afterfunc) (void *data, E_Manager *man, E_Manager_Comp_Source *src), void *data);
|
||||
EAPI void e_manager_comp_event_src_visibility_send(E_Manager *man, E_Manager_Comp_Source *src, void (*afterfunc) (void *data, E_Manager *man, E_Manager_Comp_Source *src), void *data);
|
||||
EAPI E_Manager_Comp_Source *e_manager_comp_src_get(E_Manager *man, Ecore_X_Window win);
|
||||
EAPI E_Manager_Comp_Source *e_manager_comp_border_src_get(E_Manager *man, Ecore_X_Window win);
|
||||
EAPI E_Popup *e_manager_comp_src_popup_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI E_Border *e_manager_comp_src_border_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
EAPI Ecore_X_Window e_manager_comp_src_window_get(E_Manager *man, E_Manager_Comp_Source *src);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#define E_MODULE_API_VERSION 11
|
||||
#define E_MODULE_API_VERSION 12
|
||||
|
||||
typedef struct _E_Module E_Module;
|
||||
typedef struct _E_Module_Api E_Module_Api;
|
||||
|
|
Loading…
Reference in New Issue