- getting function is used instead of direct access to global variable.
Change-Id: Ib80983791ca4079d044ab332c5efcb2a73fcb046
_e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec;
- EINA_LIST_FREE(e_comp->post_updates, ec)
+ E_Comp *comp = e_comp_get();
+
+ EINA_LIST_FREE(comp->post_updates, ec)
{
ec->on_post_updates = EINA_FALSE;
if (!e_object_is_del(E_OBJECT(ec)))
e_object_unref(E_OBJECT(ec));
}
- EINA_LIST_FREE(e_comp->render_list, ec)
+ EINA_LIST_FREE(comp->render_list, ec)
{
ec->on_render_list = EINA_FALSE;
e_object_unref(E_OBJECT(ec));
static void
_e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED)
{
- ecore_evas_geometry_get(ee, NULL, NULL, &e_comp->w, &e_comp->h);
- e_comp_screen_e_screens_setup(e_comp_screen_get(), e_comp->w, e_comp->h);
+ E_Comp *comp = e_comp_get();
+
+ ecore_evas_geometry_get(ee, NULL, NULL, &comp->w, &comp->h);
+ e_comp_screen_e_screens_setup(e_comp_screen_get(), comp->w, comp->h);
e_comp_canvas_update();
}
{
E_Comp_Cb cb;
Eina_List *l;
+ E_Comp *comp = e_comp_get();
- EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb)
+ EINA_LIST_FOREACH(comp->pre_render_cbs, l, cb)
cb();
}
static Eina_Bool
_e_comp_cb_compositor_enabled()
{
+ E_Comp *comp= e_comp_get();
+
// canvas is not updated if there were no window or no obj changes on canvas by evas calc.
// it happens sometimes after hwc end, than force canvas render
DBG("Compositor Enabled");
- if (e_comp->evas)
- evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
+ if (comp->evas)
+ evas_damage_rectangle_add(comp->evas, 0, 0, comp->w, comp->h);
return ECORE_CALLBACK_PASS_ON;
}
int color[4] = {0, 0, 0, 255};
E_Zone *zone;
E_Tizen_Screen *tizen_screen;
+ E_Comp *comp;
#ifdef CONTAINER_POLICY
E_Policy_Zone *policy_zone;
e_policy_desk_init();
TRACE_DS_BEGIN(COMP_CANVAS:INIT);
- e_comp->evas = ecore_evas_get(e_comp->ee);
- e_comp->canvas = e_canvas_create(e_comp->evas);
- e_comp->w = w;
- e_comp->h = h;
+ comp = e_comp_get();
+ comp->evas = ecore_evas_get(comp->ee);
+ comp->canvas = e_canvas_create(comp->evas);
+ comp->w = w;
+ comp->h = h;
#ifdef CONTAINER_POLICY
#else
}
#endif
- layer_tree = e_canvas_layer_view_tree_get(e_comp->canvas, E_CANVAS_LAYER_BOTTOM);
- rect = e_view_rect_create(layer_tree, e_comp->w, e_comp->h, color);
- e_comp->bg_blank_view = view = e_view_rect_view_get(rect);
+ layer_tree = e_canvas_layer_view_tree_get(comp->canvas, E_CANVAS_LAYER_BOTTOM);
+ rect = e_view_rect_create(layer_tree, comp->w, comp->h, color);
+ comp->bg_blank_view = view = e_view_rect_view_get(rect);
e_view_position_set(view, 0, 0);
if (opmode != e_view_render_op_get(view))
e_view_name_set(view, "comp->bg_blank_view");
e_view_show(view);
- ecore_evas_name_class_set(e_comp->ee, "E", "Comp_EE");
- ecore_evas_show(e_comp->ee);
+ ecore_evas_name_class_set(comp->ee, "E", "Comp_EE");
+ ecore_evas_show(comp->ee);
- evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, NULL);
+ evas_event_callback_add(comp->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, NULL);
- e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
+ comp->ee_win = ecore_evas_window_get(comp->ee);
screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
if (screens)
}
else
{
- zone = e_zone_screen_new(0, e_comp->w, e_comp->h);
+ zone = e_zone_screen_new(0, comp->w, comp->h);
#ifdef CONTAINER_POLICY
policy_zone = e_policy_zone_new(zone);
g_policy_zones = eina_list_append(g_policy_zones, policy_zone);
#endif
E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMPOSITOR_ENABLE, _e_comp_cb_compositor_enabled, NULL);
- ecore_evas_callback_pre_render_set(e_comp->ee, _e_comp_canvas_prerender);
- ecore_evas_callback_resize_set(e_comp->ee, _e_comp_canvas_resize);
+ ecore_evas_callback_pre_render_set(comp->ee, _e_comp_canvas_prerender);
+ ecore_evas_callback_resize_set(comp->ee, _e_comp_canvas_resize);
TRACE_DS_END();
return EINA_TRUE;
E_API E_Canvas *
e_comp_canvas_get(void)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+ E_Comp *comp = e_comp_get();
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, NULL);
- return e_comp->canvas;
+ return comp->canvas;
}
EINTERN void
e_comp_canvas_clear(void)
{
+ E_Comp *comp = e_comp_get();
+
E_FREE_LIST(handlers, ecore_event_handler_del);
- e_view_destroy(e_comp->bg_blank_view);
- e_canvas_destroy(e_comp->canvas);
- evas_event_freeze(e_comp->evas);
+ e_view_destroy(comp->bg_blank_view);
+ e_canvas_destroy(comp->canvas);
+ evas_event_freeze(comp->evas);
edje_freeze();
- E_FREE_FUNC(e_comp->fps_fg, e_view_destroy);
- E_FREE_FUNC(e_comp->fps_bg, e_view_destroy);
- E_FREE_FUNC(e_comp->autoclose.rect, evas_object_del);
- E_FREE_FUNC(e_comp->pointer, e_object_del);
+ E_FREE_FUNC(comp->fps_fg, e_view_destroy);
+ E_FREE_FUNC(comp->fps_bg, e_view_destroy);
+ E_FREE_FUNC(comp->autoclose.rect, evas_object_del);
+ E_FREE_FUNC(comp->pointer, e_object_del);
}
//////////////////////////////////////////////
e_comp_all_freeze(void)
{
if (_ev_freeze) return;
- evas_event_freeze(e_comp->evas);
+ evas_event_freeze(e_comp_evas_get());
_ev_freeze = EINA_TRUE;
}
e_comp_all_thaw(void)
{
if (!_ev_freeze) return;
- evas_event_thaw(e_comp->evas);
+ evas_event_thaw(e_comp_evas_get());
_ev_freeze = EINA_FALSE;
}
{
const Eina_List *l;
E_Zone *zone;
+ Eina_List *zone_list = e_comp_zone_list_get();
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ EINA_LIST_FOREACH(zone_list, l, zone)
if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h)) return zone;
return NULL;
}
{
Eina_List *l = NULL;
E_Zone *zone = NULL;
-
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ Eina_List *zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(zone_list, l, zone)
{
if ((int)zone->num == num) return zone;
}
{
Eina_List *l = NULL;
E_Zone *zone = NULL;
-
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ Eina_List *zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(zone_list, l, zone)
{
if (zone->id == id) return zone;
}
}
E_FREE_FUNC(zone->base, e_view_destroy);
E_FREE_FUNC(zone->over, e_view_destroy);
- layer_tree = e_canvas_layer_view_tree_get(e_comp->canvas, E_CANVAS_LAYER_BG);
+ layer_tree = e_canvas_layer_view_tree_get(e_comp_canvas_get(), E_CANVAS_LAYER_BG);
view_edje = e_view_edje_create(layer_tree);
zone->base = view = e_view_edje_view_get(view_edje);
e_view_repeat_events_set(view, true);
e_view_edje_size_set(view_edje, zone->w, zone->h);
e_view_show(view);
- layer_tree = e_canvas_layer_view_tree_get(e_comp->canvas, E_CANVAS_LAYER_MAX);
+ layer_tree = e_canvas_layer_view_tree_get(e_comp_canvas_get(), E_CANVAS_LAYER_MAX);
view_edje = e_view_edje_create(layer_tree);
zone->over = view = e_view_edje_view_get(view_edje);
e_view_name_set(view, "zone->over");
#ifdef CONTAINER_POLICY
E_Policy_Zone *policy_zone;
#endif
+ E_Comp *comp;
+ comp = e_comp_get();
screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
if (screens)
{
- zones = e_comp->zones;
- e_comp->zones = NULL;
+ zones = comp->zones;
+ comp->zones = NULL;
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
EINA_LIST_FOREACH(screens, l, scr)
{
if (changed)
printf("@@@ FOUND ZONE %i %i [%p]\n", zone->num, zone->id, zone);
zones = eina_list_remove(zones, zone);
- e_comp->zones = eina_list_append(e_comp->zones, zone);
+ comp->zones = eina_list_append(comp->zones, zone);
zone->num = scr->screen;
free(zone->output_id);
zone->output_id = NULL;
printf("@@@ SCREENS: %i %i | %i %i %ix%i\n",
scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
}
- e_comp->zones = eina_list_sort(e_comp->zones, 0, _e_comp_canvas_cb_zone_sort);
+ comp->zones = eina_list_sort(comp->zones, 0, _e_comp_canvas_cb_zone_sort);
}
else
{
z = e_comp_zone_number_get(0);
if (z)
{
- changed |= e_zone_move_resize(z, 0, 0, e_comp->w, e_comp->h);
+ changed |= e_zone_move_resize(z, 0, 0, comp->w, comp->h);
}
}
if (!changed) return;
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ EINA_LIST_FOREACH(comp->zones, l, zone)
{
E_FREE_FUNC(zone->base, evas_object_del);
E_FREE_FUNC(zone->over, evas_object_del);
e_comp_post_update_add(E_Client *ec)
{
E_Client *ec2;
+ E_Comp *comp;
- if (!e_comp) return;
+ if (!(comp = e_comp_get())) return;
- ec2 = eina_list_data_find(e_comp->post_updates, ec);
+ ec2 = eina_list_data_find(comp->post_updates, ec);
if (ec2) return;
- e_comp->post_updates = eina_list_append(e_comp->post_updates, ec);
+ comp->post_updates = eina_list_append(comp->post_updates, ec);
e_object_ref(E_OBJECT(ec));
}
{
Eina_List *l, *ll;
E_Client *ec2;
+ E_Comp *comp;
- if (!e_comp) return;
+ if (!(comp = e_comp_get())) return;
- EINA_LIST_FOREACH_SAFE(e_comp->post_updates, l, ll, ec2)
+ EINA_LIST_FOREACH_SAFE(comp->post_updates, l, ll, ec2)
{
if (ec2 == ec)
{
- e_comp->post_updates = eina_list_remove_list(e_comp->post_updates, l);
+ comp->post_updates = eina_list_remove_list(comp->post_updates, l);
e_object_unref(E_OBJECT(ec));
}
}
e_comp_canvas_feed_mouse_up(unsigned int activate_time)
{
int button_mask, i;
+ E_Comp *comp = e_comp_get();
- button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
+ button_mask = evas_pointer_button_down_mask_get(comp->evas);
for (i = 0; i < 32; i++)
{
if ((button_mask & (1 << i)))
- evas_event_feed_mouse_up(e_comp->evas, i + 1, EVAS_BUTTON_NONE, activate_time, NULL);
+ evas_event_feed_mouse_up(comp->evas, i + 1, EVAS_BUTTON_NONE, activate_time, NULL);
}
}
e_comp_canvas_norender_push(void)
{
E_Output *primary_output;
+ E_Comp *comp = e_comp_get();
primary_output = e_display_primary_output_get();
- TRACE_DS_BEGIN(Canvas NoRenderPush:%d, e_comp->norender + 1);
+ TRACE_DS_BEGIN(Canvas NoRenderPush:%d, comp->norender + 1);
e_output_norender_push(primary_output);
- e_comp->norender++;
+ comp->norender++;
TRACE_DS_END();
}
e_comp_canvas_norender_pop(void)
{
E_Output *primary_output;
+ E_Comp *comp = e_comp_get();
- if (e_comp->norender <= 0) return;
+ if (comp->norender <= 0) return;
primary_output = e_display_primary_output_get();
- TRACE_DS_BEGIN(Canvas NoRenderPop:%d, e_comp->norender - 1);
+ TRACE_DS_BEGIN(Canvas NoRenderPop:%d, comp->norender - 1);
e_output_norender_pop(primary_output);
- e_comp->norender--;
+ comp->norender--;
TRACE_DS_END();
}
{
int cx;
- ecore_evas_geometry_get(e_comp->ee, &cx, NULL, NULL, NULL);
+ ecore_evas_geometry_get(e_comp_ee_get(), &cx, NULL, NULL, NULL);
return x + cx;
}
{
int cy;
- ecore_evas_geometry_get(e_comp->ee, NULL, &cy, NULL, NULL);
+ ecore_evas_geometry_get(e_comp_ee_get(), NULL, &cy, NULL, NULL);
return y + cy;
}
{
int cx;
- ecore_evas_geometry_get(e_comp->ee, &cx, NULL, NULL, NULL);
+ ecore_evas_geometry_get(e_comp_ee_get(), &cx, NULL, NULL, NULL);
return x - cx;
}
{
int cy;
- ecore_evas_geometry_get(e_comp->ee, NULL, &cy, NULL, NULL);
+ ecore_evas_geometry_get(e_comp_ee_get(), NULL, &cy, NULL, NULL);
return y - cy;
}
cw->force_visible++;
- if (e_comp->hwc && !e_comp_is_on_overlay(cw->ec))
+ if (e_comp_hwc_is_configured() && !e_comp_is_on_overlay(cw->ec))
e_comp_hwc_client_end(cw->ec, __FUNCTION__);
}
static void
_e_comp_object_animating_begin(E_Comp_Object *cw)
{
+ E_Comp *comp = e_comp_get();
+
cw->animating++;
if (cw->animating == 1)
{
- e_comp->animating++;
+ comp->animating++;
REFD(cw->ec, 2);
e_object_ref(E_OBJECT(cw->ec));
}
static Eina_Bool
_e_comp_object_animating_end(E_Comp_Object *cw)
{
+ E_Comp *comp = e_comp_get();
+
if (cw->animating)
{
cw->animating--;
}
}
}
- e_comp->animating--;
+ comp->animating--;
cw->showing = cw->hiding = 0;
UNREFD(cw->ec, 2);
- if (e_comp->animating == 0)
+ if (comp->animating == 0)
e_comp_visibility_calculation_set(EINA_TRUE);
/* remove ref from animation start, account for possibility of deletion from unref */
return !!e_object_unref(E_OBJECT(cw->ec));
if (!e_comp_object_effect_set(cw->smart_obj, cw->visibility_effect))
return _e_comp_object_animating_end(cw);
- evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
+ evas_pointer_canvas_xy_get(e_comp_evas_get(), &x, &y);
x -= cw->x;
y -= cw->y;
zone = e_comp_zone_find_by_ec(cw->ec);
}
static void
-_e_comp_object_setup(E_Comp_Object *cw)
+_e_comp_object_setup(E_Comp_Object *cw, E_Comp *comp)
{
- cw->clip = evas_object_rectangle_add(e_comp->evas);
+ cw->clip = evas_object_rectangle_add(comp->evas);
evas_object_move(cw->clip, -9999, -9999);
evas_object_resize(cw->clip, 999999, 999999);
evas_object_smart_member_add(cw->clip, cw->smart_obj);
- cw->effect_obj = edje_object_add(e_comp->evas);
+ cw->effect_obj = edje_object_add(comp->evas);
evas_object_move(cw->effect_obj, cw->x, cw->y);
evas_object_clip_set(cw->effect_obj, cw->clip);
evas_object_smart_member_add(cw->effect_obj, cw->smart_obj);
evas_object_intercept_color_set_callback_add(cw->effect_obj, _e_comp_intercept_effect_obj_color_set, cw);
e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", "e/comp/effects/none");
- cw->shobj = edje_object_add(e_comp->evas);
+ cw->shobj = edje_object_add(comp->evas);
evas_object_data_set(cw->shobj, "comp_smart_obj", cw->smart_obj);
edje_object_part_swallow(cw->effect_obj, "e.swallow.content", cw->shobj);
edje_object_signal_callback_add(cw->shobj, "e,action,*,done", "e", _e_comp_object_done_defer, cw);
_e_comp_object_mouse_event_callback_set(cw);
}
- cw->default_input_obj = evas_object_rectangle_add(e_comp->evas);
+ cw->default_input_obj = evas_object_rectangle_add(comp->evas);
evas_object_name_set(cw->default_input_obj, "cw->default_input_obj");
evas_object_move(cw->default_input_obj, cw->x, cw->y);
evas_object_resize(cw->default_input_obj, cw->w, cw->h);
if (e_object_is_del(E_OBJECT(ec))) return;
if (cw->external_content) return;
- if (!e_comp->hwc) return;
+ if (!e_comp_hwc_is_configured()) return;
e_comp_client_render_list_add(cw->ec);
}
static void
-_e_comp_intercept_show_helper(E_Comp_Object *cw)
+_e_comp_intercept_show_helper(E_Comp_Object *cw, E_Comp *comp)
{
E_Client *ec = cw->ec;
int w = 0, h = 0;
+ E_Comp_Wl_Data *comp_wl;
- EINA_SAFETY_ON_NULL_RETURN(cw->ec);
+ EINA_SAFETY_ON_NULL_RETURN(ec);
if (ec->show_pending.count > 0)
{
evas_object_resize(cw->smart_obj, ec->w, ec->h);
e_comp_object_frame_theme_set(cw->smart_obj, E_COMP_OBJECT_FRAME_RESHADOW);
- if (e_comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
- e_comp_object_image_filter_set(cw->smart_obj, e_comp->image_filter);
+ if (comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
+ e_comp_object_image_filter_set(cw->smart_obj, comp->image_filter);
cw->real_hid = 0;
ELOGF("COMP", "show_helper. evas_object_show!!!", ec);
evas_object_show(cw->smart_obj);
return;
}
- if (ec->netwm.type == E_WINDOW_TYPE_DND && !e_comp_wl->drag_client)
+ comp_wl = e_comp_wl_get();
+ if (ec->netwm.type == E_WINDOW_TYPE_DND && !comp_wl->drag_client)
{
/* start_drag not received */
ec->changes.visible = 1;
cw->real_hid = 0;
/* force comp theming in case it didn't happen already */
e_comp_object_frame_theme_set(cw->smart_obj, E_COMP_OBJECT_FRAME_RESHADOW);
- if (e_comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
- e_comp_object_image_filter_set(cw->smart_obj, e_comp->image_filter);
+ if (comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
+ e_comp_object_image_filter_set(cw->smart_obj, comp->image_filter);
}
/* only do the show if show is allowed */
_e_comp_intercept_show(void *data, Evas_Object *obj EINA_UNUSED)
{
E_Comp_Object *cw = data;
+ E_Comp *comp;
E_Client *ec = cw->ec;
Eina_List *l;
E_Input_Rect_Data *input_rect_data;
if (ec->ignored) return;
+ comp = e_comp_get();
if (cw->effect_obj)
{
//INF("SHOW2 %p", ec);
- _e_comp_intercept_show_helper(cw);
+ _e_comp_intercept_show_helper(cw, comp);
return;
}
//INF("SHOW %p", ec);
if (ec->input_only)
{
- cw->effect_obj = evas_object_rectangle_add(e_comp->evas);
+ cw->effect_obj = evas_object_rectangle_add(comp->evas);
evas_object_color_set(cw->effect_obj, 0, 0, 0, 0);
evas_object_smart_member_add(cw->effect_obj, cw->smart_obj);
evas_object_name_set(cw->effect_obj, "cw->effect_obj::input_only");
return;
}
- _e_comp_object_setup(cw);
+ _e_comp_object_setup(cw, comp);
if (!cw->obj)
{
cw->content_type = E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE;
- cw->obj = evas_object_image_filled_add(e_comp->evas);
+ cw->obj = evas_object_image_filled_add(comp->evas);
evas_object_image_border_center_fill_set(cw->obj, EVAS_BORDER_FILL_SOLID);
e_util_size_debug_set(cw->obj, 1);
evas_object_image_pixels_get_callback_set(cw->obj, _e_comp_object_pixels_get, cw);
if (cw->mask.obj)
evas_object_resize(cw->mask.obj, cw->w, cw->h);
- _e_comp_intercept_show_helper(cw);
+ _e_comp_intercept_show_helper(cw, comp);
}
static void
eina_stringshare_del(cw->frame_name);
if (cw->animating)
{
+ E_Comp *comp = e_comp_get();
+
cw->animating = 0;
- e_comp->animating--;
+ comp->animating--;
UNREFD(cw->ec, 2);
e_object_unref(E_OBJECT(cw->ec));
}
name = evas_object_name_get(obj);
vis = evas_object_visible_get(obj);
- o = edje_object_add(e_comp->evas);
+ o = edje_object_add(e_comp_evas_get());
evas_object_data_set(o, "comp_object", (void*)1);
if (name)
skip = (!strncmp(name, "noshadow", 8));
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
if (ec->frame) return NULL;
_e_comp_smart_init();
- o = evas_object_smart_add(e_comp->evas, _e_comp_smart);
+ o = evas_object_smart_add(e_comp_evas_get(), _e_comp_smart);
cw = evas_object_smart_data_get(o);
if (!cw) return NULL;
evas_object_data_set(o, "E_Client", ec);
e_client_fullscreen(cw->ec, E_FULLSCREEN_RESIZE);
else
{
+ E_Comp *comp = e_comp_get();
+
evas_object_move(obj, 0, 0);
- evas_object_resize(obj, e_comp->w, e_comp->h);
+ evas_object_resize(obj, comp->w, comp->h);
}
}
if (!cw->input_obj)
{
_e_comp_input_obj_smart_init();
- cw->input_obj = evas_object_smart_add(e_comp->evas, _e_comp_input_obj_smart);
+ cw->input_obj = evas_object_smart_add(e_comp_evas_get(), _e_comp_input_obj_smart);
evas_object_smart_member_add(cw->input_obj, cw->smart_obj);
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
if ((input_rect_data) &&
(x || y || (w != cw->ec->client.w) || (h != cw->ec->client.h)))
{
- input_rect_data->obj = evas_object_rectangle_add(e_comp->evas);
+ input_rect_data->obj = evas_object_rectangle_add(e_comp_evas_get());
evas_object_name_set(input_rect_data->obj, "cw->input_obj");
evas_object_color_set(input_rect_data->obj, 0, 0, 0, 0);
evas_object_clip_set(input_rect_data->obj, cw->clip);
if (!e_pixmap_usable_get(cw->ec->pixmap)) return;
if (!cw->update)
{
+ E_Comp *comp = e_comp_get();
+
cw->update = 1;
- e_comp->updates = eina_list_append(e_comp->updates, cw->ec);
+ comp->updates = eina_list_append(comp->updates, cw->ec);
}
e_comp_render_queue();
}
EINTERN void
e_comp_object_render_update_del(Evas_Object *obj)
{
+ E_Comp *comp;
API_ENTRY;
if (cw->ec->input_only || (!cw->updates)) return;
if (!cw->update) return;
cw->update = 0;
+ comp = e_comp_get();
/* this gets called during comp animating to clear the update flag */
- if (e_comp->grabbed) return;
- e_comp->updates = eina_list_remove(e_comp->updates, cw->ec);
- if (!e_comp->updates)
+ if (comp->grabbed) return;
+ comp->updates = eina_list_remove(comp->updates, cw->ec);
+ if (!comp->updates)
{
- E_FREE_FUNC(e_comp->update_job, ecore_job_del);
- if (e_comp->render_animator)
- ecore_animator_freeze(e_comp->render_animator);
+ E_FREE_FUNC(comp->update_job, ecore_job_del);
+ if (comp->render_animator)
+ ecore_animator_freeze(comp->render_animator);
}
}
evas_object_geometry_get(cw->obj, &obj_x, &obj_y, NULL, NULL);
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_layer_set(o, E_LAYER_MAX);
evas_object_name_set(o, "damage_trace");
evas_object_move(o, dmg_x + obj_x, dmg_y + obj_y);
static void
_e_comp_object_autoclose_cleanup(Eina_Bool already_del)
{
- if (e_comp->autoclose.obj)
+ E_Comp *comp = e_comp_get();
+
+ if (comp->autoclose.obj)
{
e_comp_ungrab_input(0, 1);
- if (e_comp->autoclose.del_cb)
- e_comp->autoclose.del_cb(e_comp->autoclose.data, e_comp->autoclose.obj);
+ if (comp->autoclose.del_cb)
+ comp->autoclose.del_cb(comp->autoclose.data, comp->autoclose.obj);
else if (!already_del)
{
- evas_object_hide(e_comp->autoclose.obj);
- E_FREE_FUNC(e_comp->autoclose.obj, evas_object_del);
+ evas_object_hide(comp->autoclose.obj);
+ E_FREE_FUNC(comp->autoclose.obj, evas_object_del);
}
- E_FREE_FUNC(e_comp->autoclose.rect, evas_object_del);
+ E_FREE_FUNC(comp->autoclose.rect, evas_object_del);
}
- e_comp->autoclose.obj = NULL;
- e_comp->autoclose.data = NULL;
- e_comp->autoclose.del_cb = NULL;
- e_comp->autoclose.key_cb = NULL;
- E_FREE_FUNC(e_comp->autoclose.key_handler, ecore_event_handler_del);
+ comp->autoclose.obj = NULL;
+ comp->autoclose.data = NULL;
+ comp->autoclose.del_cb = NULL;
+ comp->autoclose.key_cb = NULL;
+ E_FREE_FUNC(comp->autoclose.key_handler, ecore_event_handler_del);
}
static void
static void
_e_comp_object_autoclose_setup(Evas_Object *obj)
{
- if (!e_comp->autoclose.rect)
+ E_Comp *comp = e_comp_get();
+
+ if (!comp->autoclose.rect)
{
/* create rect just below autoclose object to catch mouse events */
- e_comp->autoclose.rect = evas_object_rectangle_add(e_comp->evas);
- evas_object_move(e_comp->autoclose.rect, 0, 0);
- evas_object_resize(e_comp->autoclose.rect, e_comp->w, e_comp->h);
- evas_object_show(e_comp->autoclose.rect);
- evas_object_name_set(e_comp->autoclose.rect, "e_comp->autoclose.rect");
- evas_object_color_set(e_comp->autoclose.rect, 0, 0, 0, 0);
- evas_object_event_callback_add(e_comp->autoclose.rect, EVAS_CALLBACK_MOUSE_UP, _e_comp_object_autoclose_mouse_up_cb, e_comp);
+ comp->autoclose.rect = evas_object_rectangle_add(comp->evas);
+ evas_object_move(comp->autoclose.rect, 0, 0);
+ evas_object_resize(comp->autoclose.rect, comp->w, comp->h);
+ evas_object_show(comp->autoclose.rect);
+ evas_object_name_set(comp->autoclose.rect, "e_comp->autoclose.rect");
+ evas_object_color_set(comp->autoclose.rect, 0, 0, 0, 0);
+ evas_object_event_callback_add(comp->autoclose.rect, EVAS_CALLBACK_MOUSE_UP, _e_comp_object_autoclose_mouse_up_cb, comp);
e_comp_grab_input(0, 1);
}
- evas_object_layer_set(e_comp->autoclose.rect, evas_object_layer_get(obj) - 1);
+ evas_object_layer_set(comp->autoclose.rect, evas_object_layer_get(obj) - 1);
evas_object_focus_set(obj, 1);
}
EINTERN void
e_comp_object_util_autoclose(Evas_Object *obj, E_Comp_Object_Autoclose_Cb del_cb, E_Comp_Object_Key_Cb cb, const void *data)
{
+ E_Comp *comp;
SOFT_ENTRY();
- if (e_comp->autoclose.obj)
+ comp = e_comp_get();
+ if (comp->autoclose.obj)
{
- if (e_comp->autoclose.obj == obj) return;
- evas_object_event_callback_del_full(e_comp->autoclose.obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, e_comp);
- e_comp->autoclose.obj = obj;
- e_comp->autoclose.del_cb = del_cb;
- e_comp->autoclose.key_cb = cb;
- e_comp->autoclose.data = (void*)data;
+ if (comp->autoclose.obj == obj) return;
+ evas_object_event_callback_del_full(comp->autoclose.obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, comp);
+ comp->autoclose.obj = obj;
+ comp->autoclose.del_cb = del_cb;
+ comp->autoclose.key_cb = cb;
+ comp->autoclose.data = (void*)data;
if (evas_object_visible_get(obj))
_e_comp_object_autoclose_setup(obj);
else
- evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _e_comp_object_autoclose_show, e_comp);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, e_comp);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _e_comp_object_autoclose_show, comp);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, comp);
return;
}
- e_comp->autoclose.obj = obj;
- e_comp->autoclose.del_cb = del_cb;
- e_comp->autoclose.key_cb = cb;
- e_comp->autoclose.data = (void*)data;
+ comp->autoclose.obj = obj;
+ comp->autoclose.del_cb = del_cb;
+ comp->autoclose.key_cb = cb;
+ comp->autoclose.data = (void*)data;
if (evas_object_visible_get(obj))
_e_comp_object_autoclose_setup(obj);
else
- evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _e_comp_object_autoclose_show, e_comp);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, e_comp);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _e_comp_object_autoclose_show, comp);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, comp);
}
E_API unsigned int
{
if (!cw->mask.obj)
{
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_color_set(o, 0, 0, 0, 0);
evas_object_clip_set(o, cw->clip);
evas_object_smart_member_add(o, obj);
{
if (!cw->transform_bg_obj)
{
- Evas_Object *o = evas_object_rectangle_add(e_comp->evas);
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_move(o, 0, 0);
evas_object_resize(o, 1, 1);
if (cw->transform_bg_color.a >= 255)
{
if (!cw->transform_tranp_obj)
{
- Evas_Object *o = evas_object_rectangle_add(e_comp->evas);
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_move(o, 0, 0);
evas_object_resize(o, 1, 1);
evas_object_render_op_set(o, EVAS_RENDER_COPY);
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec->pixmap, EINA_FALSE);
+
if (!cw->obj && !cw->ec->visible)
{
ELOGF("COMP", "is not visible yet. no need to unset", cw->ec);
return EINA_TRUE;
}
-
cw->content_type = E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE;
- cw->obj = evas_object_image_filled_add(e_comp->evas);
+ cw->obj = evas_object_image_filled_add(e_comp_evas_get());
evas_object_image_border_center_fill_set(cw->obj, EVAS_BORDER_FILL_SOLID);
e_util_size_debug_set(cw->obj, 1);
evas_object_image_pixels_get_callback_set(cw->obj, _e_comp_object_pixels_get, cw);
if (cw->visible)
{
cw->visible = 0;
- _e_comp_intercept_show_helper(cw);
+ _e_comp_intercept_show_helper(cw, e_comp_get());
cw->visible = 1;
}
}
ELOGF("COMP", "DIM |Mask applied on Dim rect mask_rect[%d %d %d %d]", cw->ec, cw->dim.mask_x, cw->dim.mask_y, cw->dim.mask_w, cw->dim.mask_h);
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_color_set(o, 0, 0, 0, 0);
evas_object_smart_member_add(o, obj);
evas_object_resize(o, cw->dim.mask_w, cw->dim.mask_h);
EINTERN void
e_comp_object_damage_trace_debug(Eina_Bool onoff)
{
+ Evas *evas;
+
if (_damage_trace == onoff) return;
+ evas = e_comp_evas_get();
if (onoff)
{
- evas_event_callback_add(e_comp->evas,
+ evas_event_callback_add(evas,
EVAS_CALLBACK_RENDER_PRE,
_e_comp_object_damage_trace_render_pre_cb,
NULL);
- evas_event_callback_add(e_comp->evas,
+ evas_event_callback_add(evas,
EVAS_CALLBACK_RENDER_POST,
_e_comp_object_damage_trace_render_post_cb,
NULL);
_damage_trace_post_objs = NULL;
- evas_event_callback_del(e_comp->evas,
+ evas_event_callback_del(evas,
EVAS_CALLBACK_RENDER_PRE,
_e_comp_object_damage_trace_render_pre_cb);
- evas_event_callback_del(e_comp->evas,
+ evas_event_callback_del(evas,
EVAS_CALLBACK_RENDER_POST,
_e_comp_object_damage_trace_render_post_cb);
}
#include "e_egl_sync_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_comp_intern.h"
#include <EGL/egl.h>
{
E_Egl_Sync_Mgr *egl_sync_mgr = NULL;
const char *extensions = NULL;
+ E_Comp *comp = e_comp_get();
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp->e_comp_screen, EINA_FALSE);
if (_egl_sync_mgr) return EINA_TRUE;
if (!e_comp_gl_get()) return EINA_TRUE;
static void
_e_client_free(E_Client *ec)
{
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ E_Comp *comp = e_comp_get();
+
+ e_comp_ec_list_lock();
E_Input_Thread_Request_EClient_Data ec_data;
memset(&ec_data, 0, sizeof(E_Input_Thread_Request_EClient_Data));
E_OBJECT(ec)->references++;
if (ec->new_client)
- e_comp->new_clients--;
+ comp->new_clients--;
E_FREE_FUNC(ec->kill_timer, ecore_timer_del);
_e_client_private_finish(ec);
free(ec);
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static void
static void
_e_client_del(E_Client *ec)
{
+ E_Comp *comp = e_comp_get();
E_Client *child;
E_Pixmap_Type type;
E_Input_Thread_Request_EClient_Data ec_data;
memset(&ec_data, 0, sizeof(E_Input_Thread_Request_EClient_Data));
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();
ec->changed = 0;
type = e_pixmap_type_get(ec->pixmap);
if (type < E_PIXMAP_TYPE_MAX)
eina_hash_del_by_key(clients_hash[type], &ec->pixmap);
- e_comp->clients = eina_list_remove(e_comp->clients, ec);
+ comp->clients = eina_list_remove(comp->clients, ec);
e_comp_object_render_update_del(ec->frame);
e_comp_post_update_purge(ec);
if (e_pixmap_free(ec->pixmap))
e_input_backend_thread_safe_call(_e_input_thread_client_del, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data));
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
///////////////////////////////////////////
e_client_raise(ec);
}
- if (e_comp->hwc)
+ if (e_comp_hwc_is_configured())
e_comp_client_override_add(ec);
return 1;
if (ec->transformed)
_e_client_transform_move_end(ec);
- if (e_comp->hwc)
+ if (e_comp_hwc_is_configured())
e_comp_client_override_del(ec);
ecmove = NULL;
if (ec->transformed)
_e_client_transform_resize_end(ec);
- if (e_comp->hwc)
+ if (e_comp_hwc_is_configured())
e_comp_client_override_del(ec);
ecresize = NULL;
static Eina_Bool
_e_client_under_pointer_helper_ignore_client(E_Desk *desk, E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
/* If a border was specified which should be excluded from the list
* (because it will be closed shortly for example), skip */
if (e_client_util_ignored_get(ec) || (!e_desk_has_ec(desk, ec))) return EINA_TRUE;
if (!e_view_client_visible_get(PRI(ec)->view_client)) return EINA_TRUE;
if (e_policy_client_is_cursor(ec)) return EINA_TRUE;
- if (e_comp_wl->drag_client == ec) return EINA_TRUE;
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->drag_client == ec) return EINA_TRUE;
return EINA_FALSE;
}
static void
_e_client_eval(E_Client *ec)
{
+ E_Comp *comp;
int send_event = 1;
unsigned int prop = 0;
int tx, ty;
ec->changes.icon = 0;
}
+ comp = e_comp_get();
if (ec->new_client)
- e_comp->new_clients--;
+ comp->new_clients--;
ec->new_client = 0;
ec->changed = ec->changes.pos || ec->changes.size ||
ec->changes.stack || ec->changes.prop || ec->changes.border ||
e_client_visibility_touched_check(E_Client *ec)
{
int tx, ty;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
- tx = wl_fixed_to_int(e_comp->wl_comp_data->ptr.x);
- ty = wl_fixed_to_int(e_comp->wl_comp_data->ptr.y);
+ comp_wl = e_comp_wl_get();
+ tx = wl_fixed_to_int(comp_wl->ptr.x);
+ ty = wl_fixed_to_int(comp_wl->ptr.y);
return _e_client_position_inside_input_rect(ec, tx, ty);
}
{
const Eina_List *l;
E_Client *ec;
+ Eina_List *ec_list;
*check_focus = EINA_FALSE;
TRACE_DS_BEGIN(CLIENT:IDLE BEFORE);
- EINA_LIST_FOREACH(e_comp->clients, l, ec)
+ ec_list = e_comp_ec_list_get();
+ EINA_LIST_FOREACH(ec_list, l, ec)
{
// pass 1 - eval0. fetch properties on new or on change and
// call hooks to decide what to do - maybe move/resize
E_Client_Private *priv = PRI(ec);
E_View_Tree *tree;
- tree = e_canvas_layer_view_tree_get(e_comp->canvas, E_CANVAS_LAYER_CLIENT_NORMAL);
+ tree = e_canvas_layer_view_tree_get(e_comp_canvas_get(), E_CANVAS_LAYER_CLIENT_NORMAL);
if (!tree)
return;
{
E_Client *ec;
E_Pixmap_Type type;
+ E_Comp *comp;
type = e_pixmap_type_get(cp);
if (type >= E_PIXMAP_TYPE_MAX) return NULL;
ec->re_manage = 1;
}
ec->new_client = 1;
- e_comp->new_clients++;
+ comp = e_comp_get();
+ comp->new_clients++;
ec->exp_iconify.by_client = 0;
ec->exp_iconify.not_raise = 0;
EC_CHANGED(ec);
- e_comp->clients = eina_list_append(e_comp->clients, ec);
+ comp->clients = eina_list_append(comp->clients, ec);
eina_hash_add(clients_hash[type], &ec->pixmap, ec);
ELOGF("COMP", "CLIENT ADD. cp:%p, argb:%d, internal:%d, ignored:%d", ec, cp, ec->argb, internal, ec->ignored);
EINTERN unsigned int
e_clients_count(void)
{
- return eina_list_count(e_comp->clients);
+ return eina_list_count(e_comp_ec_list_get());
}
/**
const Eina_List *l;
E_Client *ec;
int loss_overlap = 5;
+ Eina_List *ec_list;
E_OBJECT_CHECK_RETURN(zone, NULL);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
- EINA_LIST_FOREACH(e_comp->clients, l, ec)
+
+ ec_list = e_comp_ec_list_get();
+ EINA_LIST_FOREACH(ec_list, l, ec)
{
if (!e_zone_has_ec(zone, ec)) continue;
if (e_client_util_ignored_get(ec)) continue;
e_client_raise(ec);
}
- if (e_comp->hwc)
+ if (e_comp_hwc_is_configured())
e_comp_client_override_add(ec);
return EINA_TRUE;
EINTERN void
e_client_show(E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
if (ec->comp_data->mapped)
return;
+ comp_wl = e_comp_wl_get();
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.map) &&
(!ec->ignored))
{
_e_client_shell_map(ec);
}
else if (ec->internal || e_comp_wl_subsurface_can_show(ec) ||
- (ec == e_comp_wl->drag_client))
+ (ec == comp_wl->drag_client))
{
ELOGF("E_CLIENT", "Map. internal:%d, drag:%d",
- ec, ec->internal, (ec == e_comp_wl->drag_client));
+ ec, ec->internal, (ec == comp_wl->drag_client));
ec->visible = EINA_TRUE;
ec->ignored = 0;
e_view_client_show(PRI(ec)->view_client);
e_client_hide(E_Client *ec)
{
API_ENTRY;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
if (!ec->comp_data->mapped)
return;
+ comp_wl = e_comp_wl_get();
if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap))
{
ELOGF("E_CLIENT", "Unmap", ec);
e_client_shell_unmap(ec);
}
else if ((ec->internal) || (e_comp_wl_subsurface_check(ec)) ||
- (ec == e_comp_wl->drag_client))
+ (ec == comp_wl->drag_client))
{
ELOGF("E_CLIENT", "Unmap. internal:%d, sub:%p, drag:%d",
- ec, ec->internal, ec->comp_data->sub.data, (ec == e_comp_wl->drag_client));
+ ec, ec->internal, ec->comp_data->sub.data, (ec == comp_wl->drag_client));
ec->visible = EINA_FALSE;
e_view_client_hide(PRI(ec)->view_client);
ec->comp_data->mapped = 0;
E_Config_Desktop_Name *cfname;
int d_x, d_y, ok;
char name[40];
+ Eina_List *comp_zone_list = e_comp_zone_list_get();
- EINA_LIST_FOREACH(e_comp->zones, z, zone)
+ EINA_LIST_FOREACH(comp_zone_list, z, zone)
{
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
{
EINTERN unsigned int
e_desks_count(void)
{
- Eina_List *l;
+ Eina_List *l, *comp_zone_list;
E_Zone *zone;
unsigned int count = 0;
- // FIXME: desk not available
-
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
int cx = 0, cy = 0;
zone = desk->zone;
- desk->smart_obj = evas_object_smart_add(e_comp->evas, _e_desk_smart_class_new());
+ desk->smart_obj = evas_object_smart_add(e_comp_evas_get(), _e_desk_smart_class_new());
e_desk_geometry_set(desk, zone->x, zone->y, zone->w, zone->h);
E_DESK_SMART_DATA_GET_OR_RETURN(desk->smart_obj, sd);
_e_desk_area_configure_send(E_Client *ec, Eina_Bool edges, Eina_Bool send_size)
{
int w, h;
+ E_Comp_Wl_Data *comp_wl;
if (send_size)
{
w = h = -1;
}
- e_client_shell_configure_send(ec, edges * e_comp_wl->resize.edges, w, h);
+ comp_wl = e_comp_wl_get();
+ e_client_shell_configure_send(ec, edges * comp_wl->resize.edges, w, h);
}
static void
static void
_e_comp_object_layers_add(E_Desk_Area *eda, E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object *below, Eina_Bool prepend)
{
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();
if (above)
{
eda->layers[cw->layer].clients_count++;
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static void
_e_comp_object_layers_remove(E_Desk_Area *eda, E_Comp_Object *cw)
{
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();
if (cw->ec && eda->layers[cw->layer].clients)
{
_e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_REMOVE, cw->ec, NULL);
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static Eina_Bool
static void
_e_desk_area_smart_init(E_Desk_Area *eda)
{
- eda->smart_obj = evas_object_smart_add(e_comp->evas, _e_desk_area_smart_class_new());
+ eda->smart_obj = evas_object_smart_add(e_comp_evas_get(), _e_desk_area_smart_class_new());
E_DESK_AREA_SMART_DATA_GET_OR_RETURN(eda->smart_obj, sd);
if (ec->layer == E_LAYER_CLIENT_CURSOR) return;
if (e_util_client_layer_map(ec->layer) == 9999) return;
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();;
/* go up the layers until we find one */
for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
if (!e_object_is_del(E_OBJECT(ec2)))
{
get_above_data->above_ec = ec2;
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return;
}
}
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static void
x = e_comp_canvas_layer_map(ec_layer);
if (x > 0) x--;
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();;
for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
{
if (!e_object_is_del(E_OBJECT(ec2)))
{
get_below_data->below_ec = ec2;
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return;
}
}
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static void
if (ec->layer == E_LAYER_CLIENT_CURSOR) return;
if (e_util_client_layer_map(ec->layer) == 9999) return;
- g_rec_mutex_lock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_lock();;
/* go up the layers until we find one */
for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
(ec2->frame))
{
get_visible_above_data->above_ec = ec2;
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return;
}
}
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
}
static void
w = zone->w;
h = zone->h;
- if (eina_list_count(e_comp->zones) == 1)
+ if (eina_list_count(e_comp_zone_list_get()) == 1)
{
if (zx) *zx = x;
if (zy) *zy = y;
{
E_Desk_Area_Private_Client *eda_client;
E_Client *ec;
+ E_Comp_Wl_Data *comp_wl;
eda_client = wl_container_of(listener, eda_client, comp_object_resize);
ec = eda_client->ec;
if (!ec->comp_data->shell.configure_send) return;
/* TODO: calculate x, y with transfrom object */
- if ((e_client_util_resizing_get(ec)) && (!ec->transformed) && (e_comp_wl->resize.edges))
+ comp_wl = e_comp_wl_get();
+ if ((e_client_util_resizing_get(ec)) && (!ec->transformed) && (comp_wl->resize.edges))
{
int w, h;
h = E_CLAMP(h, 1, h);
e_client_resize_limit(ec, &w, &h);
- e_client_shell_configure_send(ec, e_comp_wl->resize.edges, w, h);
+ e_client_shell_configure_send(ec, comp_wl->resize.edges, w, h);
}
else if ((!ec->fullscreen) && (!ec->maximized) &&
(!e_client_maximize_pre_get(ec)))
for (ec_layer = e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); ec_layer <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); ec_layer++)
{
- obj = eda->layers[ec_layer].obj = evas_object_rectangle_add(e_comp->evas);
+ obj = eda->layers[ec_layer].obj = evas_object_rectangle_add(e_comp_evas_get());
evas_object_layer_set(obj, e_comp_canvas_layer_map_to(ec_layer));
evas_object_name_set(obj, "layer_obj");
}
EINA_INLIST_REVERSE_FOREACH(eda->layers[x].clients, ec)
if (!e_object_is_del(E_OBJECT(ec)))
{
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return ec;
}
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return NULL;
}
EINA_INLIST_FOREACH(eda->layers[x].clients, ec)
if (!e_object_is_del(E_OBJECT(ec)))
{
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return ec;
}
}
- g_rec_mutex_unlock(&e_comp->ec_list_mutex);
+ e_comp_ec_list_unlock();
return NULL;
}
#include "e_comp_wl_intern.h"
#include "e_comp_wl_buffer_intern.h"
#include "e_comp_object_intern.h"
+#include "e_comp_intern.h"
#include "e_view_intern.h"
#include "e_view_client_intern.h"
#include "e_compositor_intern.h"
e_pixmap_image_exists(const E_Pixmap *cp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
- return (!!cp->data) || (e_comp->gl && (!cp->buffer->shm_buffer));
+ return (!!cp->data) || (e_comp_gl_get() && (!cp->buffer->shm_buffer));
}
EINTERN Eina_Bool
#include "e_comp_wl_intern.h"
#include "e_comp_wl_rsm_intern.h"
#include "e_comp_wl_subsurface_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_intern.h"
#include "e_input_intern.h"
#include "e_input_device_intern.h"
{
size_t psz = 0;
E_Zone *zf = z2;
- Eina_List *l;
+ Eina_List *l, *comp_zone_list = e_comp_zone_list_get();
- EINA_LIST_FOREACH(e_comp->zones, l, z2)
+ EINA_LIST_FOREACH(comp_zone_list, l, z2)
{
int w, h;
EINTERN E_Zone *
e_zone_new(int num, int id, int x, int y, int w, int h)
{
+ E_Comp *comp;
E_Zone *zone;
Evas_Object *o;
E_Event_Zone_Add *ev;
snprintf(name, sizeof(name), "Zone %d", zone->num);
zone->name = eina_stringshare_add(name);
- e_comp->zones = eina_list_append(e_comp->zones, zone);
+ comp = e_comp_get();
+ comp->zones = eina_list_append(comp->zones, zone);
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(comp->evas);
zone->bg_clip_object = o;
evas_object_repeat_events_set(o, 1);
evas_object_layer_set(o, E_LAYER_BG);
evas_object_color_set(o, 255, 255, 255, 255);
evas_object_show(o);
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(comp->evas);
zone->bg_event_object = o;
evas_object_name_set(o, "zone->bg_event_object");
evas_object_clip_set(o, zone->bg_clip_object);
E_API E_Zone *
e_zone_current_get(void)
{
- Eina_List *l = NULL;
+ Eina_List *l = NULL, *comp_zone_list;
E_Zone *zone;
#ifdef CONTAINER_POLICY
E_Zone_Data_Is_Current data;
data.is_current = EINA_FALSE;
#endif
+ comp_zone_list = e_comp_zone_list_get();
if (!starting)
{
#ifdef CONTAINER_POLICY
e_input_device_pointer_xy_get(NULL, &x, &y);
#endif
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
#ifdef CONTAINER_POLICY
wl_signal_emit(&PRI(zone)->events.is_current, &data);
return zone;
}
}
- if (!e_comp->zones) return NULL;
- return eina_list_data_get(e_comp->zones);
+ if (!comp_zone_list) return NULL;
+ return eina_list_data_get(comp_zone_list);
}
E_API int
EINTERN E_Zone *
e_zone_get_by_id(int id)
{
- Eina_List *l = NULL;
+ Eina_List *l = NULL, *comp_zone_list;
E_Zone *zone;
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
if (zone->id == id)
{
EINTERN E_Zone *
e_zone_get_by_position(int x, int y)
{
- Eina_List *l = NULL;
+ Eina_List *l = NULL, *comp_zone_list;
E_Zone *zone;
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h))
{
int x, y;
E_Zone_Obstacle *obs;
#endif
+ E_Comp *comp;
wl_signal_emit(&PRI(zone)->events.destroy, NULL);
#endif
if (zone->name) eina_stringshare_del(zone->name);
- e_comp->zones = eina_list_remove(e_comp->zones, zone);
+
+ comp = e_comp_get();
+ comp->zones = eina_list_remove(comp->zones, zone);
+
evas_object_del(zone->bg_event_object);
evas_object_del(zone->bg_clip_object);
if (!e_config->calc_vis_without_effect)
{
- if (e_comp->animating) return EINA_FALSE;
+ E_Comp *comp = e_comp_get();
+
+ if (comp->animating) return EINA_FALSE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(zone, EINA_FALSE);
if (changed_list)
{
- touched_ec = e_comp_wl->ptr.ec ? e_comp_wl->ptr.ec : e_comp_wl->touch.faked_ec;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ touched_ec = comp_wl->ptr.ec ? comp_wl->ptr.ec : comp_wl->touch.faked_ec;
EINA_LIST_FOREACH(changed_list, l, ec)
{
e_client_visibility_change_notify(ec);
if (e_client_visibility_get(ec) == E_VISIBILITY_UNOBSCURED)
{
- if (e_comp_wl->touch.pressed && !touched_win_changed && !e_policy_client_is_keyboard_sub(ec))
+ if (comp_wl->touch.pressed && !touched_win_changed && !e_policy_client_is_keyboard_sub(ec))
{
if (e_client_visibility_touched_check(ec))
{
*hwc = -1;
*pl_zpos = -999;
- if ((!e_comp->hwc) || e_comp_hwc_deactive_get())
+ if ((!e_comp_hwc_is_configured()) || e_comp_hwc_deactive_get())
return;
*hwc = 0;
Eldbus_Message_Iter *iter = eldbus_message_iter_get(reply);
Eldbus_Message_Iter *array_of_zone;
- Eina_List *l;
+ Eina_List *l, *comp_zone_list;
E_Zone *zone = NULL;
E_Zone *current_zone = NULL;
int zone_id = -1;
eldbus_message_iter_arguments_append(iter, "("VALUE_TYPE_FOR_ZONE")", &array_of_zone);
current_zone = e_zone_current_get();
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
Eldbus_Message_Iter *struct_of_zone;
zone_id = zone->id;
eldbus_message_iter_arguments_append(iter, "a("VALUE_TYPE_FOR_TOPVWINS")", &array_of_ec);
// append clients.
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
Eldbus_Message_Iter* struct_of_ec;
Ecore_Window win;
eldbus_message_iter_basic_append(iter, 'i', e_comp_gl_get());
eldbus_message_iter_basic_append(iter, 'i', e_comp_config_get()->hwc);
- eldbus_message_iter_basic_append(iter, 'i', e_comp->hwc);
- eldbus_message_iter_basic_append(iter, 's', ecore_evas_engine_name_get(e_comp->ee));
+ eldbus_message_iter_basic_append(iter, 'i', e_comp_hwc_is_configured());
+ eldbus_message_iter_basic_append(iter, 's', ecore_evas_engine_name_get(e_comp_ee_get()));
eldbus_message_iter_basic_append(iter, 'i', e_comp_config_get()->engine);
eldbus_message_iter_basic_append(iter, 'i', e_config->use_buffer_flush);
eldbus_message_iter_basic_append(iter, 'i', e_config->deiconify_approve);
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
Eldbus_Message_Iter *iter = eldbus_message_iter_get(reply);
- eldbus_message_iter_basic_append(iter, 'i', e_comp->hwc);
+ eldbus_message_iter_basic_append(iter, 'i', e_comp_hwc_is_configured());
_msg_ecs_append(iter, EINA_TRUE);
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
Eldbus_Message_Iter *iter = eldbus_message_iter_get(reply);
- eldbus_message_iter_basic_append(iter, 'i', e_comp->hwc);
+ eldbus_message_iter_basic_append(iter, 'i', e_comp_hwc_is_configured());
_msg_ecs_append(iter, EINA_FALSE);
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
Eldbus_Message_Iter *iter = eldbus_message_iter_get(reply);
- eldbus_message_iter_basic_append(iter, 'i', e_comp->hwc);
+ eldbus_message_iter_basic_append(iter, 'i', e_comp_hwc_is_configured());
_msg_clients_append(iter, EINA_FALSE);
if (!e_util_strcmp(type, "edje"))
{
edje_object_file_get(po, &file, &group);
- edit_obj = edje_edit_object_add(e_comp->evas);
+ edit_obj = edje_edit_object_add(e_comp_evas_get());
if (edje_object_file_set(edit_obj, file, group))
{
parts = edje_edit_parts_list_get(edit_obj);
&cobjs);
/* 1. push: top-level evas objects */
- for (o = evas_object_bottom_get(e_comp->evas); o; o = evas_object_above_get(o))
+ for (o = evas_object_bottom_get(e_comp_evas_get()); o; o = evas_object_above_get(o))
{
info = _obj_info_get(NULL, o, 0);
if (!info) continue;
eldbus_message_iter_arguments_append(struct_of_ec, "ss", (title), (__temp)); \
eldbus_message_iter_container_close(array_of_ec, struct_of_ec);})
- EINA_LIST_FOREACH(e_comp->connected_clients, l, cinfo)
+ Eina_List *comp_connected_ec_list = e_comp_connected_ec_list_get();
+ EINA_LIST_FOREACH(comp_connected_ec_list, l, cinfo)
{
__CONNECTED_CLIENTS_ARG_APPEND_TYPE("[Connected Clients]", "name:%20s pid:%3d uid:%3d gid:%3d", cinfo->name ?: "NO_NAME", cinfo->pid, cinfo->uid, cinfo->gid);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
Ecore_Window win;
uint32_t res_id = 0;
struct wl_list * client_list;
struct wl_client *client;
- E_Comp_Wl_Data *wl_cdata;
+ struct wl_display *display;
int pid = -1;
enum {
eldbus_message_iter_arguments_append(iter, "a("VALUE_TYPE_REPLY_RESLIST")", &array_of_res);
- if (!e_comp) return;
- if (!(wl_cdata = e_comp->wl_comp_data)) return;
- if (!wl_cdata->wl.disp) return;
+ if (!e_comp_get()) return;
+ if (!(display = e_comp_wl_display_get())) return;
- client_list = wl_display_get_client_list(wl_cdata->wl.disp);
+ client_list = wl_display_get_client_list(display);
wl_client_for_each(client, client_list)
{
iter = eldbus_message_iter_get(reply_msg);
eldbus_message_iter_arguments_append(iter, "a(ss)", &array_of_ec);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
Dump_Win_Data *dump = NULL;
E_Capture_Save_State state;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
{
Evas_Object *o;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
Ecore_Window win;
E_Client *ec;
eldbus_message_iter_arguments_append(iter, "a("SIGNATURE_SUBSURFACE")", &array_of_ec);
// append clients.
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
Eldbus_Message_Iter* struct_of_ec;
Ecore_Window win = 0, parent = 0;
ev->zone = e_zone_current_get();
else
{
- EINA_LIST_FOREACH(e_comp->zones, l, z)
+ Eina_List *comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, z)
{
if (z->num == zone_num)
ev->zone = z;
}
+
}
if (!ev->zone)
pid_t client_pid = -1;
const char *client_name = NULL;
E_Comp_Connected_Client_Info *cinfo;
- Eina_List *l;
+ Eina_List *l, *comp_connected_ec_list;
char strbuf[512], *str_buff = strbuf;
int str_r, str_l;
clock_gettime(CLOCK_MONOTONIC, &tp);
time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
- EINA_LIST_FOREACH(e_comp->connected_clients, l, cinfo)
+ comp_connected_ec_list = e_comp_connected_ec_list_get();
+ EINA_LIST_FOREACH(comp_connected_ec_list, l, cinfo)
{
if (cinfo->pid == client_pid)
{
- client_name = cinfo->name;
- break;
+ client_name = cinfo->name;
+ break;
}
}
unsigned int time;
pid_t client_pid = -1;
E_Comp_Connected_Client_Info *cinfo;
- Eina_List *l;
+ Eina_List *l, *comp_connected_ec_list;
char strbuf[512], *str_buff = strbuf;
int str_r, str_l;
elog.client_pid = client_pid;
elog.target_id = wl_resource_get_id(message->resource);
snprintf(elog.name, PATH_MAX, "%s:%s", wl_resource_get_class(message->resource), message->message->name);
- EINA_LIST_FOREACH(e_comp->connected_clients, l, cinfo)
+
+ comp_connected_ec_list = e_comp_connected_ec_list_get();
+ EINA_LIST_FOREACH(comp_connected_ec_list, l, cinfo)
{
if (cinfo->pid == client_pid)
snprintf(elog.cmd, PATH_MAX, "%s", cinfo->name);
wl_protocol_logger_destroy(e_info_protocol_logger);
e_info_protocol_logger = NULL;
}
- e_info_protocol_logger = wl_display_add_protocol_logger(e_comp->wl_comp_data->wl.disp, _e_info_server_protocol_debug_func2, NULL);
+
+ e_info_protocol_logger = wl_display_add_protocol_logger(e_comp_wl_display_get(), _e_info_server_protocol_debug_func2, NULL);
return reply;
}
static Eldbus_Message *
_e_info_server_cb_bgcolor_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
+ E_Comp *comp;
int a, r, g, b;
int pa, pr, pg, pb;
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
return reply;
}
- e_view_color_get(e_comp->bg_blank_view, &pa, &pr, &pg, &pb);
- e_view_color_set(e_comp->bg_blank_view, r, g, b, a);
+ comp = e_comp_get();
+ e_view_color_get(comp->bg_blank_view, &pa, &pr, &pg, &pb);
+ e_view_color_set(comp->bg_blank_view, r, g, b, a);
INF("The background color of bg_blank_view has been changed.");
INF("(A, R, G, B) : %d, %d, %d, %d -> %d, %d, %d, %d", pa, pr, pg, pb, a, r, g, b);
value_number = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
Ecore_Window win;
if (start == 1)
{
+ int comp_w = 0, comp_h = 0;
if (e_info_dump_running == 1)
{
eldbus_message_arguments_append(reply, "is", 0, (e_info_dump_path ?: "nopath"));
}
/* start dump */
+ e_comp_size_get(&comp_w, &comp_h);
if (scale > 0.0)
tbm_surface_internal_dump_with_scale_start(e_info_dump_path,
- e_comp->w,
- e_comp->h,
- count, scale);
+ comp_w, comp_h, count, scale);
else
- tbm_surface_internal_dump_start(e_info_dump_path, e_comp->w, e_comp->h, count);
+ tbm_surface_internal_dump_start(e_info_dump_path, comp_w, comp_h, count);
if (e_info_dump_server_or_client != 2)
{
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
E_Client *ec = evas_object_data_get(o, "E_Client");
Ecore_Window win;
return reply;
}
- if (!e_comp->hwc)
+ if (!e_comp_hwc_is_configured())
{
ERR("Error HWC is not initialized.");
return reply;
}
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, reply);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_get(), reply);
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen_get(), reply);
switch (info)
Evas_Object *o;
E_Client *ec;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
}
else
{
- e_comp->calc_fps = 1;
+ E_Comp *comp = e_comp_get();
+ comp->calc_fps = 1;
_msg_output_fps_append(eldbus_message_iter_get(reply));
}
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
Eina_Bool res;
char result[1024];
E_Client *ec = NULL;
+ int comp_w = 0, comp_h = 0;
res = eldbus_message_arguments_get(msg,
"i",
if (ec->visible && (!ec->input_only))
e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
}
- evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_damage_rectangle_add(e_comp_evas_get(), 0, 0, comp_w, comp_h);
e_comp_render_queue();
snprintf(result, sizeof(result),
"[Server] force rendered all clients and canvas\n");
"[Server] updated clients' surface");
break;
case E_INFO_CMD_FRENDER_CANVAS:
- evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_damage_rectangle_add(e_comp_evas_get(), 0, 0, comp_w, comp_h);
snprintf(result, sizeof(result),
"[Server] updated canvas");
break;
Evas_Object *o;
E_Client *ec;
- o = evas_object_top_at_xy_get(e_comp->evas, x, y, EINA_FALSE, EINA_FALSE);
+ o = evas_object_top_at_xy_get(e_comp_evas_get(), x, y, EINA_FALSE, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
ec = evas_object_data_get(o, "E_Client");
E_Client *ec;
Evas_Object *o;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
Ecore_Window w;
pid_t pid = -1;
char result[128];
- E_Comp_Wl_Data *wl_cdata;
- struct wl_list * client_list;
+ struct wl_display *display;
+ struct wl_list *client_list;
struct wl_client *client;
- if (!e_comp) return 0;
- if (!(wl_cdata = e_comp->wl_comp_data)) return 0;
- if (!wl_cdata->wl.disp) return 0;
+ if (!e_comp_get()) return 0;
+ if (!(display = e_comp_wl_display_get())) return 0;
- client_list = wl_display_get_client_list(wl_cdata->wl.disp);
+ client_list = wl_display_get_client_list(display);
wl_client_for_each(client, client_list)
{
int count = 0;
char result[1024];
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
const char *ec_name, *find;
eldbus_message_iter_arguments_append(iter, "at", &array_of_windows);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
const char *ec_name, *find;
Ecore_Window win;
_e_info_server_ec_hwc_info_get(ec, &hwc, &hwc_policy, &pl_zpos);
- ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &dw, &dh);
+ ecore_evas_screen_geometry_get(e_comp_ee_get(), NULL, NULL, &dw, &dh);
xright = dw - ec->x - ec->border_size * 2 - ec->w;
ybelow = dh - ec->y - ec->border_size * 2 - ec->h;
ERR("Error getting arguments.");
return reply;
}
- if (!e_comp_wl) return reply;
+ if (!e_comp_wl_get()) return reply;
if (path && strlen(path) > 0)
{
static Eldbus_Message *
_e_info_server_cb_memchecker(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
+ E_Comp *comp = e_comp_get();
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
- if (e_comp->func_memory_dump)
+ if (comp->func_memory_dump)
{
- e_comp->func_memory_dump();
+ comp->func_memory_dump();
}
else
{
- e_comp->func_memory_dump = dlsym(RTLD_NEXT, "e_memcheck_dump");
- if (e_comp->func_memory_dump)
- e_comp->func_memory_dump();
+ comp->func_memory_dump = dlsym(RTLD_NEXT, "e_memcheck_dump");
+ if (comp->func_memory_dump)
+ comp->func_memory_dump();
else
ERR("Not available to dump memory");
-
}
return reply;
_input_rect_draw(int x, int y, int w, int h, int time, int color_r, int color_g, int color_b)
{
Evas_Object *rect;
- EINA_SAFETY_ON_NULL_RETURN(e_comp->evas);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp_evas_get());
- rect = evas_object_rectangle_add(e_comp->evas);
+ rect = evas_object_rectangle_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_RETURN(rect);
evas_object_color_set(rect, color_r, color_g, color_b, 150);
ERR("Error getting arguments.");
return reply;
}
- if (!e_comp) return reply;
+ if (!e_comp_get()) return reply;
if (strlen(win_id_str) >= 2 && win_id_str[0] == '0' && win_id_str[1] == 'x')
res = e_util_string_to_ulong(win_id_str, &tmp, 16);
}
win_id_value = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
eldbus_message_iter_basic_append(iter, 'i', e_comp_gl_get());
eldbus_message_iter_basic_append(iter, 'i', e_comp_config_get()->hwc);
- eldbus_message_iter_basic_append(iter, 'i', e_comp->hwc);
- eldbus_message_iter_basic_append(iter, 's', ecore_evas_engine_name_get(e_comp->ee));
+ eldbus_message_iter_basic_append(iter, 'i', e_comp_hwc_is_configured());
+ eldbus_message_iter_basic_append(iter, 's', ecore_evas_engine_name_get(e_comp_ee_get()));
eldbus_message_iter_basic_append(iter, 'i', e_comp_config_get()->engine);
eldbus_message_iter_basic_append(iter, 'i', e_config->use_buffer_flush);
eldbus_message_iter_basic_append(iter, 'i', e_config->deiconify_approve);
if (win_number != 0x0)
{
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
{
char current_filter[15] = {0};
//return current filter mode
- switch (e_comp->image_filter)
+ switch (e_comp_image_filter_get())
{
case E_COMP_IMAGE_FILTER_BLUR:
snprintf(current_filter, sizeof(current_filter), "blur");
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
Ecore_Window win;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
Ecore_Window win;
win_id = (uint64_t)tmp;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
e_info_protocol_logger = NULL;
}
- e_info_protocol_logger = wl_display_add_protocol_logger(e_comp->wl_comp_data->wl.disp, _e_info_server_protocol_debug_func2, NULL);
+ e_info_protocol_logger = wl_display_add_protocol_logger(e_comp_wl_display_get(), _e_info_server_protocol_debug_func2, NULL);
return EINA_TRUE;
}
EINA_SAFETY_ON_NULL_RETURN(th_data);
- if (!(comp = e_comp)) return;
+ if (!(comp = e_comp_get())) return;
eldbus_message_iter_arguments_append(iter, "a("E_TH_SIGN_WIN_INFO")", &array_of_ec);
return reply;
}
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
const char *ec_name = NULL;
ec = evas_object_data_get(o, "E_Client");
r = eldbus_message_arguments_get(msg, "u", &on);
EINA_SAFETY_ON_FALSE_RETURN_VAL(r, reply);
- if (e_comp->hwc)
+ if (e_comp_hwc_is_configured())
{
switch (on)
{
#include "e_hwc_intern.h"
#include "e_utils_intern.h"
#include "e_comp_screen_intern.h"
+#include "e_comp_canvas_intern.h"
#include "e_comp_intern.h"
#include "e_error_intern.h"
#include "e_hwc_window_queue_intern.h"
if (output->tdm_hwc)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_get(), NULL);
gdevice = e_display_gbm_device_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(gdevice, NULL);
static Ecore_Evas *
_e_hwc_ecore_evas_tbm_alloc(E_Hwc *hwc, int src_w, int src_h)
{
+ E_Comp *comp;
Ecore_Evas *ee;
- if (e_comp->avoid_afill)
+ comp = e_comp_get();
+ if (comp->avoid_afill)
{
ee = ecore_evas_tbm_allocfunc_new("gl_tbm_ES", src_w, src_h,
_e_hwc_tbm_surface_queue_alloc,
(void *)hwc);
}
- EHINF("ecore_evas engine:gl_tbm ee:%p avoid_afill:%d", hwc, ee, e_comp->avoid_afill);
+ EHINF("ecore_evas engine:gl_tbm ee:%p avoid_afill:%d", hwc, ee, comp->avoid_afill);
return ee;
}
static Ecore_Evas *
_e_hwc_ecore_evas_gbm_alloc(E_Hwc *hwc, int src_w, int src_h)
{
+ E_Comp *comp;
Ecore_Evas *ee;
struct gbm_device *gdevice;
int gbm_formats[2] = {GBM_FORMAT_ABGR8888, GBM_FORMAT_ARGB8888};
if (!gdevice) return NULL;
format_count = sizeof(gbm_formats) / sizeof(int);
+ comp = e_comp_get();
for (i = 0; i < format_count; i++)
{
hwc->gbm_format = gbm_formats[i];
- if (e_comp->avoid_afill)
+ if (comp->avoid_afill)
{
ee = ecore_evas_tbm_native_allocfunc_new("gl_tbm_ES", gdevice, src_w, src_h,
_e_hwc_gbm_surface_alloc,
if (ee) break;
}
- EHINF("ecore_evas engine:gl_tbm with gbm ee:%p avaoid_afill:%d", hwc, ee, e_comp->avoid_afill);
+ EHINF("ecore_evas engine:gl_tbm with gbm ee:%p avaoid_afill:%d", hwc, ee, comp->avoid_afill);
return ee;
}
const char *backend_name;
struct gbm_device *gdevice;
- if (e_comp->hwc_prefer_gbm)
+ if (e_comp_hwc_is_prefer_gbm())
return EINA_TRUE;
gdevice = e_display_gbm_device_get();
E_Hwc *hwc;
int screen_rotation;
char buf[1024];
+ E_Comp *comp;
primary_output = e_display_primary_output_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(primary_output, EINA_FALSE);
EHINF("ee(%p) with the tqueue(%p) is created.", hwc, ee, hwc->target_buffer_queue);
- e_comp->ee = ee;
- ecore_evas_data_set(e_comp->ee, "comp", e_comp);
+ comp = e_comp_get();
+ comp->ee = ee;
+ ecore_evas_data_set(comp->ee, "comp", comp);
if (screen_rotation)
{
/* SHOULD called with resize option after ecore_evas_resize */
- ecore_evas_rotation_with_resize_set(e_comp->ee, screen_rotation);
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &w, &h);
+ ecore_evas_rotation_with_resize_set(comp->ee, screen_rotation);
+ ecore_evas_geometry_get(comp->ee, NULL, NULL, &w, &h);
snprintf(buf, sizeof(buf), "\tEE Rotate and Resize %d, %dx%d", screen_rotation, w, h);
e_main_ts(buf);
}
{
E_View *view, *view_hwc, *view_tmp;
E_Canvas_Layer layer, layer_hwc;
+ E_Canvas *comp_canvas;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_ec, EINA_FALSE);
view = e_view_client_view_get(e_client_view_get(ec));
view_hwc = e_view_client_view_get(e_client_view_get(hwc_ec));
- layer = e_canvas_layer_find(e_comp->canvas, view);
- layer_hwc = e_canvas_layer_find(e_comp->canvas, view_hwc);
+ comp_canvas = e_comp_canvas_get();
+ layer = e_canvas_layer_find(comp_canvas, view);
+ layer_hwc = e_canvas_layer_find(comp_canvas, view_hwc);
/* compare layer */
if (layer_hwc > layer) return EINA_FALSE;
if (layer > layer_hwc) return EINA_TRUE;
view_tmp = e_view_above_get(view);
- if (e_canvas_layer_find(e_comp->canvas, view_tmp) == layer_hwc)
+ if (e_canvas_layer_find(comp_canvas, view_tmp) == layer_hwc)
{
do
{
return EINA_TRUE;
view_tmp = e_view_above_get(view_tmp);
}
- while (view_tmp && (e_canvas_layer_find(e_comp->canvas, view_tmp) == layer_hwc));
+ while (view_tmp && (e_canvas_layer_find(comp_canvas, view_tmp) == layer_hwc));
}
else
return EINA_TRUE;
#include "e_hwc_planes_intern.h"
#include "e_screen_rotation_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_comp_intern.h"
#include "services/e_service_quickpanel_intern.h"
#include "e_output_intern.h"
{
if (e_screen_rotation_ignore_output_transform_watch(ec))
{
- if (e_comp_wl->touch.pressed)
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (comp_wl->touch.pressed)
return EINA_FALSE;
}
else
Eina_List *hwc_ok_clist = NULL, *vis_clist = NULL;
E_Output *output = hwc->output;
E_View *view;
+ E_Comp *comp;
_e_hwc_planes_prepare_init(hwc);
- if (e_comp->nocomp_override > 0) return EINA_FALSE;
+ comp = e_comp_get();
+ if (comp->nocomp_override > 0) return EINA_FALSE;
vis_clist = e_comp_vis_ec_list_get(zone);
if (!vis_clist) return EINA_FALSE;
e_comp_hook_call(E_COMP_HOOK_PREPARE_PLANE, NULL);
// It is not hwc_usable if cursor is shown when the hw cursor is not supported by libtdm.
- if (!e_pointer_is_hidden(e_comp->pointer) &&
+ if (!e_pointer_is_hidden(e_comp_pointer_get()) &&
(eout->cursor_available.max_w == -1 || eout->cursor_available.max_h == -1))
return EINA_FALSE;
if (ec)
{
+ E_Comp_Wl_Data *comp_wl;
e_plane_ec_set(ep, ec);
/* update the target_buffer */
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer->resource, EINA_FALSE);
- tsurface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, wl_buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, wl_buffer->resource);
EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
ep->tsurface = tsurface;
#include "e_hwc_window_queue_intern.h"
#include "e_comp_wl_buffer_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_subsurface_intern.h"
#include "e_comp_wl_tbm_intern.h"
#include "e_pointer_intern.h"
_e_hwc_window_client_surface_acquire(E_Hwc_Window *hwc_window)
{
E_Comp_Wl_Buffer *buffer = _e_hwc_window_comp_wl_buffer_get(hwc_window);
- E_Comp_Wl_Data *wl_comp_data = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
tbm_surface_h tsurface = NULL;
if (!buffer) return NULL;
break;
case E_COMP_WL_BUFFER_TYPE_NATIVE:
case E_COMP_WL_BUFFER_TYPE_VIDEO:
- tsurface = wayland_tbm_server_get_surface(wl_comp_data->tbm.server, buffer->resource);
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
break;
case E_COMP_WL_BUFFER_TYPE_TBM:
tsurface = buffer->tbm_surface;
static void
_e_hwc_window_update_fps(E_Hwc_Window *hwc_window)
{
- if (e_comp->calc_fps)
+ E_Comp *comp = e_comp_get();
+ if (comp->calc_fps)
{
double dt;
double tim = ecore_time_get();
#include "e_comp_wl_intern.h"
#include "e_comp_wl_renderer_intern.h"
#include "e_comp_wl_tbm_intern.h"
+#include "e_comp_intern.h"
#include "e_pixmap_intern.h"
#include "e_hwc_window_intern.h"
#include "e_hwc_intern.h"
static uint32_t
_comp_wl_buffer_flags_get(E_Comp_Wl_Buffer *buffer)
{
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
uint32_t flags = 0;
if (!buffer) return 0;
case E_COMP_WL_BUFFER_TYPE_VIDEO:
case E_COMP_WL_BUFFER_TYPE_TBM:
if (buffer->resource)
- flags = wayland_tbm_server_get_buffer_flags(wl_cdata->tbm.server, buffer->resource);
+ flags = wayland_tbm_server_get_buffer_flags(comp_wl->tbm.server, buffer->resource);
else
flags = 0;
break;
queue->state = E_HWC_WINDOW_QUEUE_STATE_SET_WAITING_WAIT_USABLE;
- if (e_comp->hwc_send_redraw_request)
+ if (e_comp_hwc_send_redraw_request())
e_comp_wl_renderer_client_redraw_request_send(hwc_window->ec);
EHWQINF("Set Waiting wait usable user ehw:%p - {%s}",
#include "e_comp_wl_intern.h"
#include "e_comp_wl_tbm_intern.h"
#include "e_comp_wl_tizen_hwc_intern.h"
+#include "e_comp_intern.h"
#include "e_pixmap_intern.h"
#include "e_presentation_time_intern.h"
#include "e_output_intern.h"
static void
_e_hwc_windows_update_fps(E_Hwc *hwc)
{
- if (e_comp->calc_fps)
+ E_Comp *comp = e_comp_get();
+ if (comp->calc_fps)
{
double dt;
double tim = ecore_time_get();
if (set)
{
- if (e_comp->commit_handler_timer.use)
+ E_Comp *comp = e_comp_get();
+ if (comp->commit_handler_timer.use)
{
- wins_commit_data->commit_handler_timer = ecore_timer_add(e_comp->commit_handler_timer.interval,
+ wins_commit_data->commit_handler_timer = ecore_timer_add(comp->commit_handler_timer.interval,
_e_hwc_windows_commit_handler_timeout,
wins_commit_data);
}
Eina_Bool qps_visible;
Eina_Bool blur_visible = EINA_FALSE;
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &ee_w, &ee_h);
+ ecore_evas_geometry_get(e_comp_ee_get(), NULL, NULL, &ee_w, &ee_h);
qps_visible = e_qps_visible_get();
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = _e_hwc_windows_client_get_from_object(o, &effect_client);
if (!ec)
TRACE_DS_BEGIN(MANUAL RENDER);
target_hwc_window->is_rendering = EINA_TRUE;
ecore_evas_manual_render(target_hwc_window->ee);
- if (e_comp->gl)
+ if (e_comp_gl_get())
{
egl_error = eglGetError();
if (egl_error != EGL_SUCCESS)
E_Client *ec;
EINA_SAFETY_ON_NULL_RETURN(hwc_window);
- EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp_get());
if (hwc_window->on_rendered_target) return;
E_Client *ec;
Evas_Object *o;
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
E_Zone *zone = NULL;
E_Comp_Wl_Client_Data *cdata;
E_Output *zone_output = NULL;
- Eina_List *l;
+ Eina_List *l, *comp_zone_list;
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
zone_output = e_output_find(zone->output_id);
if (!zone_output) continue;
if (e_output_connected(output))
{
+ int comp_w = 0, comp_h = 0;
E_Output_Mode *mode = NULL;
mode = e_output_best_mode_find(output);
}
ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL);
-
- _e_output_client_resize(e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ _e_output_client_resize(comp_w, comp_h);
}
else
{
E_Output_Intercept_Hook_Point hookpoint;
tdm_output_dpms tval;
tdm_error error;
- Eina_List *l;
+ Eina_List *l, *comp_zone_list;
E_Zone *zone;
E_Output *primary_output = NULL;
primary_output = e_display_primary_output_get();
if (primary_output == output)
{
+ comp_zone_list = e_comp_zone_list_get();
/* FIXME: The zone controlling should be moved to e_zone */
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
if (val == E_OUTPUT_DPMS_ON)
e_zone_display_state_set(zone, E_ZONE_DISPLAY_STATE_ON);
#include "e_comp_canvas_intern.h"
#include "e_comp_screen_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_pointer_intern.h"
#include "e_output_intern.h"
#include "e_comp_wl_video_buffer_intern.h"
}
static tbm_surface_queue_h
-_get_tbm_surface_queue(E_Comp *e_comp)
+_get_tbm_surface_queue(E_Comp *comp)
{
- E_Comp_Screen *e_comp_screen = e_comp_screen_get();
- if (!e_comp_screen) return NULL;
+ if (!comp) return NULL;
- return e_comp_screen->tqueue;
+ return comp->e_comp_screen->tqueue;
}
static Eina_Bool
{
E_Client *ec = plane->ec;
E_Comp_Wl_Buffer *buffer = _get_comp_wl_buffer(ec);
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
E_Plane_Renderer *renderer = plane->renderer;
tbm_surface_h tsurface = NULL;
switch (buffer->type)
{
case E_COMP_WL_BUFFER_TYPE_NATIVE:
- tsurface = wayland_tbm_server_get_surface(wl_cdata->tbm.server, buffer->resource);
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
break;
case E_COMP_WL_BUFFER_TYPE_TBM:
tsurface = buffer->tbm_surface;
if (!renderer->tqueue)
{
- if(!(tqueue = _get_tbm_surface_queue(e_comp)))
+ if(!(tqueue = _get_tbm_surface_queue(e_comp_get())))
{
WRN("fail to _get_tbm_surface_queue");
return NULL;
e_plane_setup(E_Plane *plane)
{
const char *name;
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
+ E_Comp *comp = e_comp_get();
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
E_Plane_Renderer *renderer = NULL;
/* we assume that the primary plane gets a ecore_evas */
if (!plane->is_fb) return EINA_FALSE;
- name = ecore_evas_engine_name_get(e_comp->ee);
+ name = ecore_evas_engine_name_get(comp->ee);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
if(!strcmp("gl_drm_tbm", name))
{
- ecore_evas_manual_render_set(e_comp->ee, 1);
+ ecore_evas_manual_render_set(comp->ee, 1);
}
else if(!strcmp("drm_tbm", name))
{
- ecore_evas_manual_render_set(e_comp->ee, 1);
+ ecore_evas_manual_render_set(comp->ee, 1);
}
else if(!strcmp("gl_tbm", name))
{
- ecore_evas_manual_render_set(e_comp->ee, 1);
+ ecore_evas_manual_render_set(comp->ee, 1);
}
else if(!strcmp("gl_tbm_ES", name))
{
- ecore_evas_manual_render_set(e_comp->ee, 1);
+ ecore_evas_manual_render_set(comp->ee, 1);
}
else if(!strcmp("software_tbm", name))
{
- ecore_evas_manual_render_set(e_comp->ee, 1);
+ ecore_evas_manual_render_set(comp->ee, 1);
}
renderer = e_plane_renderer_new(plane);
static void
_e_plane_update_fps(E_Plane *plane)
{
- if (e_comp->calc_fps)
+ E_Comp *comp = e_comp_get();
+
+ if (comp->calc_fps)
{
double dt;
double tim = ecore_time_get();
#include "e_comp_canvas_intern.h"
#include "e_comp_screen_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_pointer_intern.h"
#include "e_pixmap_intern.h"
#include "e_client_intern.h"
{
struct wayland_tbm_client_queue * cqueue = NULL;
struct wl_resource *wl_surface = NULL;
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
E_Comp_Wl_Client_Data *cdata;
- EINA_SAFETY_ON_NULL_RETURN_VAL(wl_cdata, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, NULL);
cdata = e_pixmap_cdata_get(ec->pixmap);
EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, NULL);
wl_surface = cdata->wl_surface;
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_surface, NULL);
- cqueue = wayland_tbm_server_client_queue_get(wl_cdata->tbm.server, wl_surface);
+ cqueue = wayland_tbm_server_client_queue_get(comp_wl->tbm.server, wl_surface);
EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, NULL);
return cqueue;
tbm_surface_h new_tsurface = NULL;
E_Comp_Wl_Buffer *buffer = NULL;
tbm_surface_info_s src_info, dst_info;
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
int ret = TBM_SURFACE_ERROR_NONE;
E_Client *ec = renderer_client->ec;
E_Plane_Renderer *renderer = renderer_client->renderer;
buffer = _get_comp_wl_buffer(ec);
if (buffer)
{
- tsurface = wayland_tbm_server_get_surface(wl_cdata->tbm.server, buffer->resource);
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, NULL);
}
else
_e_plane_renderer_client_surface_flags_get(E_Plane_Renderer_Client *renderer_client)
{
tbm_surface_h tsurface = NULL;
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
E_Client *ec = renderer_client->ec;
uint32_t flags = 0;
E_Comp_Wl_Buffer *buffer = NULL;
case E_COMP_WL_BUFFER_TYPE_NATIVE:
case E_COMP_WL_BUFFER_TYPE_VIDEO:
case E_COMP_WL_BUFFER_TYPE_TBM:
- tsurface = wayland_tbm_server_get_surface(wl_cdata->tbm.server, buffer->resource);
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, 0);
- flags = wayland_tbm_server_get_buffer_flags(wl_cdata->tbm.server, buffer->resource);
+ flags = wayland_tbm_server_get_buffer_flags(comp_wl->tbm.server, buffer->resource);
break;
default:
flags = 0;
E_Plane *plane = NULL;
E_Plane_Renderer *renderer = NULL;
E_Plane_Renderer_Buffer *renderer_buffer = NULL;
+ E_Comp *comp = e_comp_get();
- EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(comp);
EINA_SAFETY_ON_NULL_RETURN(e_comp_screen_get());
EINA_SAFETY_ON_NULL_RETURN(tsurface);
EINA_SAFETY_ON_NULL_RETURN(data);
- if (!e_comp->hwc_use_detach) return;
+ if (!comp->hwc_use_detach) return;
plane = (E_Plane *)data;
EINA_SAFETY_ON_NULL_RETURN(plane);
E_Plane_Renderer *renderer = NULL;
E_Plane_Renderer_Buffer *renderer_buffer = NULL;
- EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp_get());
EINA_SAFETY_ON_NULL_RETURN(e_comp_screen_get());
EINA_SAFETY_ON_NULL_RETURN(tsurface);
EINA_SAFETY_ON_NULL_RETURN(data);
ELOGF("E_PLANE_RENDERER", "Set backup buffer wl_buffer(%p)::buffer_change",
ec, _get_wl_buffer(ec));
- if (!e_comp->hwc_use_detach &&
+ if (!e_comp_hwc_use_detach() &&
renderer_client->state == E_PLANE_RENDERER_CLIENT_STATE_PENDING_DEACTIVATED)
{
if (renderer && !_e_plane_renderer_release_exported_renderer_buffer(renderer, renderer_buffer))
Eina_List *render_buffers = NULL;
E_Comp_Wl_Buffer_Ref *buffer_ref = NULL;
E_Comp_Wl_Buffer *buffer;
- Eina_List *l;
+ Eina_List *l, *comp_render_list;
E_Client *ec;
if (!renderer->render_dequeued_tsurface) return;
-
- EINA_LIST_FOREACH(e_comp->render_list, l, ec)
+ comp_render_list = e_comp_client_render_list_get();
+ EINA_LIST_FOREACH(comp_render_list, l, ec)
{
buffer = e_pixmap_ref_resource_get(ec->pixmap);
if (!buffer)
if (plane->is_fb)
{
- renderer->ee = e_comp->ee;
+ renderer->ee = e_comp_ee_get();
renderer->evas = ecore_evas_get(renderer->ee);
renderer->event_fd = eventfd(0, EFD_NONBLOCK);
renderer->event_hdlr = ecore_main_fd_handler_add(renderer->event_fd, ECORE_FD_READ,
w = (output->cursor_available.min_w > tw) ? output->cursor_available.min_w : tw;
h = (output->cursor_available.min_h > th) ? output->cursor_available.min_h : th;
- if (e_comp->hwc_reuse_cursor_buffer)
+ if (e_comp_hwc_reuse_cursor_buffer())
{
if (renderer->cursor_tsurface)
{
E_Client *ec = NULL;
struct wayland_tbm_client_queue *cqueue = NULL;
- if (!e_comp->hwc_sync_mode_change) return;
- if (e_comp->hwc_use_detach) return;
+ if (!e_comp_hwc_sync_mode_change()) return;
+ if (e_comp_hwc_use_detach()) return;
if (renderer->state != E_PLANE_RENDERER_STATE_PENDING_DEACTIVATE) return;
if (renderer->pending_deactivate)
wayland_tbm_server_client_queue_activate(cqueue, 0, renderer->tqueue_size, renderer->tqueue_width,
renderer->tqueue_height, 1);
- if (e_comp->hwc_sync_mode_change && !e_comp->hwc_use_detach)
+ if (e_comp_hwc_sync_mode_change() && !e_comp_hwc_use_detach())
wayland_tbm_server_client_queue_set_dequeue_cb(cqueue, _e_plane_renderer_exported_surface_dequeue_cb, plane);
tsq_err = tbm_surface_queue_notify_reset(renderer->tqueue);
ELOGF("E_PLANE_RENDERER", "Deactivate Renderer(%p) Plane(%p) ec(%p, %s)",
ec, renderer, renderer->plane, ec, e_client_util_name_get(ec));
- if (e_comp->hwc_sync_mode_change)
+ if (e_comp_hwc_sync_mode_change())
{
if (cqueue)
{
renderer_client->state = E_PLANE_RENDERER_CLIENT_STATE_PENDING_DEACTIVATED;
- if (e_comp->hwc_use_detach)
+ if (e_comp_hwc_use_detach())
_e_plane_renderer_exported_surfaces_timer_set(renderer);
}
else
e_plane_renderer_client_surface_recieve(E_Plane_Renderer_Client *renderer_client)
{
tbm_surface_h tsurface = NULL;
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
E_Client *ec = NULL;
uint32_t flags = 0;
E_Comp_Wl_Buffer *buffer = NULL;
switch (buffer->type)
{
case E_COMP_WL_BUFFER_TYPE_NATIVE:
- tsurface = wayland_tbm_server_get_surface(wl_cdata->tbm.server, buffer->resource);
+ tsurface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
break;
case E_COMP_WL_BUFFER_TYPE_TBM:
tsurface = buffer->tbm_surface;
}
if (buffer->resource)
- flags = wayland_tbm_server_get_buffer_flags(wl_cdata->tbm.server, buffer->resource);
+ flags = wayland_tbm_server_get_buffer_flags(comp_wl->tbm.server, buffer->resource);
if (renderer_trace_debug)
ELOGF("E_PLANE_RENDERER", "Receive Renderer(%p) tsurface(%p) tqueue(%p) wl_buffer(%p) flags(%d)",
{
if (e_config->scale.inch_correction > 0.0)
{
- inch = floor(sqrt((e_comp->w * e_comp->w) + (e_comp->h * e_comp->h)) / BASE_DPI * 10 + 0.5) / 10;
+ int comp_w = 0, comp_h = 0;
+ e_comp_size_get(&comp_w, &comp_h);
+ inch = floor(sqrt((comp_w * comp_w) + (comp_h * comp_h)) / BASE_DPI * 10 + 0.5) / 10;
if (inch <= e_config->scale.inch_correction_bound)
profile_factor = e_config->scale.profile_factor;
{
if (e_config->scale.inch_correction > 0.0)
{
- inch = floor(sqrt((e_comp->w * e_comp->w) + (e_comp->h * e_comp->h)) / dpi * 10 + 0.5) / 10;
+ int comp_w = 0, comp_h = 0;
+ e_comp_size_get(&comp_w, &comp_h);
+ inch = floor(sqrt((comp_w * comp_w) + (comp_h * comp_h)) / dpi * 10 + 0.5) / 10;
if (inch <= e_config->scale.inch_correction_bound)
profile_factor = e_config->scale.profile_factor;
#include "e_video_hwc_intern.h"
#include "e_comp_screen_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_subsurface_intern.h"
#include "e_comp_wl_viewport_intern.h"
#include "e_output_intern.h"
_e_video_hwc_input_buffer_valid(E_Video_Hwc *evh, E_Comp_Wl_Buffer *comp_buffer)
{
E_Comp_Wl_Video_Buf *vbuf;
+ E_Comp_Wl_Data *comp_wl;
Eina_List *l;
EINA_LIST_FOREACH(evh->input_buffer_list, l, vbuf)
return;
}
- tbm_surf = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, comp_buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tbm_surf = wayland_tbm_server_get_surface(comp_wl->tbm.server, comp_buffer->resource);
bo = tbm_surface_internal_get_bo(tbm_surf, 0);
tbm_surface_internal_get_plane_data(tbm_surf, 0, &size, &offset, &pitch);
static tbm_format
_e_video_hwc_comp_buffer_tbm_format_get(E_Comp_Wl_Buffer *comp_buffer)
{
+ E_Comp_Wl_Data *comp_wl;
tbm_surface_h tbm_surf;
- tbm_surf = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, comp_buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tbm_surf = wayland_tbm_server_get_surface(comp_wl->tbm.server, comp_buffer->resource);
EINA_SAFETY_ON_NULL_RETURN_VAL(tbm_surf, 0);
return tbm_surface_get_format(tbm_surf);
static tbm_surface_h
_e_video_hwc_client_tbm_surface_get(E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Buffer *comp_buffer;
tbm_surface_h tbmsurf;
return NULL;
}
- tbmsurf = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server,
+ comp_wl = e_comp_wl_get();
+ tbmsurf = wayland_tbm_server_get_surface(comp_wl->tbm.server,
comp_buffer->resource);
return tbmsurf;
{
Eina_List *l, *ll;
E_Output *output = NULL;
+ E_Comp *comp = e_comp_get();
if (e_config->comp_canvas_norender.use)
- evas_norender(e_comp->evas);
+ evas_norender(comp->evas);
- if (e_comp->canvas_render_delayed) goto end;
+ if (comp->canvas_render_delayed) goto end;
EINA_LIST_FOREACH_SAFE(e_display_outputs_get(), l, ll, output)
{
{
Ecore_Event_Device_Info *e;
E_Comp *comp = data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
if (!(e = event)) goto end;
if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
{
- if (comp->wl_comp_data->ptr.num_devices == 0)
+ if (comp_wl->ptr.num_devices == 0)
{
e_pointer_view_set(comp->pointer, NULL, 0, 0);
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
}
- comp->wl_comp_data->ptr.num_devices++;
+ comp_wl->ptr.num_devices++;
}
else if (e->clas == ECORE_DEVICE_CLASS_KEYBOARD)
{
e_comp_wl_input_touch_enabled_set(EINA_TRUE);
if (e_comp_screen)
_e_comp_screen_input_rotation_set(e_comp_screen->rotation);
- comp->wl_comp_data->touch.num_devices++;
+ comp_wl->touch.num_devices++;
}
end:
static void
_e_comp_screen_pointer_renew(void)
{
- if ((e_comp_wl->ptr.num_devices == 0) && e_comp_wl->ptr.ec && e_comp_wl->ptr.ec->pointer_enter_sent)
+ E_Comp_Wl_Data *comp_wl;
+
+ comp_wl = e_comp_wl_get();
+ if ((comp_wl->ptr.num_devices == 0) && comp_wl->ptr.ec && comp_wl->ptr.ec->pointer_enter_sent)
{
if (e_devicemgr->last_device_ptr)
{
const char *name;
const char *description;
- list = (Eina_List *)evas_device_list(evas_object_evas_get(e_comp_wl->ptr.ec->frame), NULL);
+ list = (Eina_List *)evas_device_list(evas_object_evas_get(comp_wl->ptr.ec->frame), NULL);
EINA_LIST_FOREACH(list, l, dev)
{
name = evas_device_name_get(dev);
}
}
if (last_ptr)
- e_comp_wl_mouse_out_renew(e_comp_wl->ptr.ec, 0, wl_fixed_to_int(e_comp_wl->ptr.x), wl_fixed_to_int(e_comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
+ e_comp_wl_mouse_out_renew(comp_wl->ptr.ec, 0, wl_fixed_to_int(comp_wl->ptr.x), wl_fixed_to_int(comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
}
}
}
{
Ecore_Event_Device_Info *e;
E_Comp *comp = data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
if (!(e = event)) goto end;
if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
{
- comp->wl_comp_data->ptr.num_devices--;
- if (comp->wl_comp_data->ptr.num_devices == 0)
+ comp_wl->ptr.num_devices--;
+ if (comp_wl->ptr.num_devices == 0)
{
e_comp_wl_input_pointer_enabled_set(EINA_FALSE);
e_pointer_view_set(comp->pointer, NULL, 0, 0);
- e_pointer_hide(e_comp->pointer);
+ e_pointer_hide(comp->pointer);
_e_comp_screen_pointer_renew();
}
}
else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
{
- comp->wl_comp_data->touch.num_devices--;
- if (comp->wl_comp_data->touch.num_devices == 0)
+ comp_wl->touch.num_devices--;
+ if (comp_wl->touch.num_devices == 0)
{
e_comp_wl_input_touch_enabled_set(EINA_FALSE);
}
E_Output *output;
int sum_w = 0, max_h = 0, output_w, output_h;
Eina_List *l;
+ E_Comp *comp;
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, EINA_FALSE);
e_comp_screen->w = sum_w;
e_comp_screen->h = max_h;
- if (e_comp->ee)
+ comp = e_comp_get();
+ if (comp->ee)
{
/* rotation should be reset because tbm_surface_queue or gbm_surface of
* ecore_evas is created without rotation
* and rotation of ecore_evas is reset after it is resized
*/
if (e_comp_screen->rotation)
- ecore_evas_rotation_with_resize_set(e_comp->ee, 0);
+ ecore_evas_rotation_with_resize_set(comp->ee, 0);
- ecore_evas_resize(e_comp->ee, e_comp_screen->w, e_comp_screen->h);
+ ecore_evas_resize(comp->ee, e_comp_screen->w, e_comp_screen->h);
if (e_comp_screen->rotation)
- ecore_evas_rotation_with_resize_set(e_comp->ee, e_comp_screen->rotation);
+ ecore_evas_rotation_with_resize_set(comp->ee, e_comp_screen->rotation);
}
return EINA_TRUE;
}
static E_Comp_Screen *
-_e_comp_screen_new(E_Comp *comp)
+_e_comp_screen_new(void)
{
E_Comp_Screen *e_comp_screen = NULL;
int screen_rotation;
e_comp_screen->num_outputs = e_display_num_outputs_get();
e_comp_screen->outputs = e_display_outputs_get();
- if (e_comp->hwc && e_comp_conf_hwc_deactive_get())
+ if (e_comp_hwc_is_configured() && e_comp_conf_hwc_deactive_get())
e_comp_hwc_deactive_set(EINA_TRUE);
/* tbm bufmgr init */
}
static Eina_Bool
-_e_comp_screen_engine_init(void)
+_e_comp_screen_engine_init(E_Comp *comp)
{
E_Comp_Screen *e_comp_screen = NULL;
/* e_comp_screen new */
e_main_ts_begin("\tE_Comp_Screen New");
- e_comp_screen = _e_comp_screen_new(e_comp);
+ e_comp_screen = _e_comp_screen_new();
if (!e_comp_screen)
{
e_main_ts_end("\tE_Comp_Screen New Failed");
e_comp_screen_e_screens_setup(e_comp_screen, -1, -1);
/* update the screen, outputs and planes at the idle enterer of the ecore_loop */
- ecore_idle_enterer_add(_e_comp_screen_commit_idle_cb, e_comp);
+ ecore_idle_enterer_add(_e_comp_screen_commit_idle_cb, comp);
return EINA_TRUE;
}
else
{
if (e_comp_screen->rotation % 180)
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &screen->h, &screen->w);
+ ecore_evas_geometry_get(e_comp_ee_get(), NULL, NULL, &screen->h, &screen->w);
else
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &screen->w, &screen->h);
+ ecore_evas_geometry_get(e_comp_ee_get(), NULL, NULL, &screen->w, &screen->h);
}
e_screens = eina_list_append(e_screens, screen);
e_comp_screen_init()
{
E_Comp *comp;
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Screen *e_comp_screen;
int w, h, ptr_x = 0, ptr_y = 0;
- if (!(comp = e_comp))
- EINA_SAFETY_ON_NULL_RETURN_VAL(comp, EINA_FALSE);
+ comp = e_comp_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, EINA_FALSE);
e_main_ts_begin("\tE_Comp_Screen_Engine Init");
- if (!_e_comp_screen_engine_init())
+ if (!_e_comp_screen_engine_init(comp))
{
e_main_ts_end("\tE_Comp_Screen_Engine Init Failed");
ERR("Could not initialize the ecore_evas engine.");
e_main_ts_end("\tE_Comp_Screen_Engine Init Done");
e_main_ts_begin("\tE_Input Init");
- if (!e_input_init(e_comp->ee))
+ if (!e_input_init(comp->ee))
{
e_main_ts_end("\tE_Input Init Failed");
ERR("Could not initialize the e_input.");
e_main_ts_end("\tE_Server Init Done");
/* get the current screen geometry */
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &w, &h);
+ ecore_evas_geometry_get(comp->ee, NULL, NULL, &w, &h);
/* canvas */
e_main_ts_begin("\tE_Comp_Canvas Init");
/* pointer */
e_input_device_pointer_xy_get(NULL, &ptr_x, &ptr_y);
- e_comp_wl->ptr.x = wl_fixed_from_int(ptr_x);
- e_comp_wl->ptr.y = wl_fixed_from_int(ptr_y);
+ comp_wl = e_comp_wl_get();
+ comp_wl->ptr.x = wl_fixed_from_int(ptr_x);
+ comp_wl->ptr.y = wl_fixed_from_int(ptr_y);
- evas_event_feed_mouse_in(e_comp->evas, 0, NULL);
+ evas_event_feed_mouse_in(comp->evas, 0, NULL);
e_main_ts_begin("\tE_Pointer New");
if ((comp->pointer = e_pointer_canvas_new(comp->ee, EINA_TRUE)))
{
E_Output *primary_output = NULL;
E_Input_Device *dev;
+ E_Comp* comp;
const Eina_List *l;
int w, h;
if (setter)
setter(e_comp_screen, data);
- ecore_evas_rotation_with_resize_set(e_comp->ee, e_comp_screen->rotation);
- ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &w, &h);
+ comp = e_comp_get();
+ ecore_evas_rotation_with_resize_set(comp->ee, e_comp_screen->rotation);
+ ecore_evas_geometry_get(comp->ee, NULL, NULL, &w, &h);
/* rendering forcely to prepare HWC */
e_comp_render_queue();
EINTERN Eina_Bool e_comp_screen_init(void);
EINTERN void e_comp_screen_shutdown(void);
-EINTERN void e_comp_screen_e_screens_setup(E_Comp_Screen *e_comp_screen, int rw, int rh);
-EINTERN const Eina_List *e_comp_screen_e_screens_get(E_Comp_Screen *e_comp_screen);
-EINTERN Eina_Bool e_comp_screen_rotation_pre_set(E_Comp_Screen *e_comp_screen, int rotation_pre);
-EINTERN Eina_Bool e_comp_screen_size_get(E_Comp_Screen *e_comp_screen, int *w, int *h);
-EINTERN Eina_Bool e_comp_screen_size_update(E_Comp_Screen *e_comp_screen);
+EINTERN void e_comp_screen_e_screens_setup(E_Comp_Screen *comp_screen, int rw, int rh);
+EINTERN const Eina_List *e_comp_screen_e_screens_get(E_Comp_Screen *comp_screen);
+EINTERN Eina_Bool e_comp_screen_rotation_pre_set(E_Comp_Screen *comp_screen, int rotation_pre);
+EINTERN Eina_Bool e_comp_screen_size_get(E_Comp_Screen *comp_screen, int *w, int *h);
+EINTERN Eina_Bool e_comp_screen_size_update(E_Comp_Screen *comp_screen);
#endif
const Eina_List *l;
char env[1024], name[1024];
E_Zone *zone;
+ Eina_List *zone_list = e_comp_zone_list_get();
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ EINA_LIST_FOREACH(zone_list, l, zone)
{
snprintf(name, sizeof(name), "DESK_%d_%d", 0, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
#include "e_devicemgr_intern.h"
#include "e_server_intern.h"
+#include "e_comp_intern.h"
#include <tizen-extension-server-protocol.h>
E_Devicemgr_Config_Data *dconfig = NULL;
Eina_Bool res = EINA_FALSE;
- EINA_SAFETY_ON_NULL_GOTO(e_comp, failed);
+ EINA_SAFETY_ON_NULL_GOTO(e_comp_get(), failed);
_devicemgr_log_dom = eina_log_domain_register("e-devicemgr", EINA_COLOR_BLUE);
EINA_SAFETY_ON_FALSE_GOTO(_devicemgr_log_dom >= 0, failed);
// update evas' mouse position to the requested warp position
// This generates mouse out/in to correct client.
DMWRN("Pointer Constraint activated. feed_mouse_move");
- evas_event_feed_mouse_move(e_comp->evas, x, y, 0, NULL);
+ evas_event_feed_mouse_move(e_comp_evas_get(), x, y, 0, NULL);
}
if (e_comp_wl_input_pointer_constraint_activated_get())
E_Map *map;
int new_x, new_y, ret;
int i, min_x, min_y, max_x, max_y, tmp_x, tmp_y, map_x = 0, map_y = 0;
+ E_Comp_Wl_Data *comp_wl;
if (!(ec = e_client_from_surface_resource(surface)) || !ec->visible)
{
return TIZEN_INPUT_DEVICE_MANAGER_ERROR_INVALID_SURFACE;
}
- if (ec != e_comp_wl->ptr.ec)
+ comp_wl = e_comp_wl_get();
+ if (ec != comp_wl->ptr.ec)
{
DMERR("Pointer is not on the given surface !\n");
return TIZEN_INPUT_DEVICE_MANAGER_ERROR_INVALID_SURFACE;
}
- if ((!e_config->show_cursor) || (!e_comp_wl->ptr.enabled))
+ if ((!e_config->show_cursor) || (!comp_wl->ptr.enabled))
{
DMERR("Pointer is not available");
if (!e_comp_wl_input_pointer_constraint_activated_get())
ev_key->timestamp = e_util_timestamp_get();
ev_key->same_screen = 1;
- ev_key->window = e_comp->ee_win;
- ev_key->event_window = e_comp->ee_win;
- ev_key->root_window = e_comp->ee_win;
+ ev_key->window = e_comp_ee_win_get();
+ ev_key->event_window = ev_key->window;
+ ev_key->root_window = ev_key->window;
ev_key->keycode = e_devicemgr->dconfig->conf->input.back_keycode;
ev_key->data = key_data;
e->compose = eina_stringshare_add(key);
e->string = e->compose;
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
e->keycode = keycode;
e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES);
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
e = calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!e) return TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES;
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
e = calloc(1, sizeof(Ecore_Event_Mouse_Wheel));
if (!e) return TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES;
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES);
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
e = calloc(1, sizeof(Ecore_Event_Mouse_Move));
EINA_SAFETY_ON_NULL_RETURN_VAL(e, TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES);
- e->window = e_comp->ee_win;
- e->event_window = e_comp->ee_win;
- e->root_window = e_comp->ee_win;
+ e->window = e_comp_ee_win_get();
+ e->event_window = e->window;
+ e->root_window = e->window;
e->timestamp = e_util_timestamp_get();
e->same_screen = 1;
-#include "e_input_thread_client_intern.h"
+ #include "e_input_thread_client_intern.h"
#include "e_comp_canvas.h"
#include "e_comp_input_intern.h"
#include "e_utils_intern.h"
#include "e_input_backend_intern.h"
#include "e_comp_wl_input_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_info_server_intern.h"
#include "e_comp_input_intern.h"
#include "e_keyrouter_wl_intern.h"
TRACE_INPUT_BEGIN(e_keyrouter_init);
- EINA_SAFETY_ON_NULL_GOTO(e_comp, err);
+ EINA_SAFETY_ON_NULL_GOTO(e_comp_get(), err);
_keyrouter_log_dom = eina_log_domain_register("e-keyrouter", EINA_COLOR_RED);
EINA_SAFETY_ON_FALSE_GOTO(_keyrouter_log_dom >= 0, err);
#include "e_input_intern.h"
#include "e_comp_wl_input_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_utils_intern.h"
#include "e_screensaver_intern.h"
#include "e_config_intern.h"
ev_key->timestamp = e_util_timestamp_get();
ev_key->same_screen = 1;
- ev_key->window = e_comp->ee_win;
- ev_key->event_window = e_comp->ee_win;
- ev_key->root_window = e_comp->ee_win;
+ ev_key->window = e_comp_ee_win_get();
+ ev_key->event_window = ev_key->window;
+ ev_key->root_window = ev_key->window;
ev_key->keycode = keycode;
ev_key->data = key_data;
{
Eina_List *l;
E_Comp_Connected_Client_Info *cdata;
+ E_Comp *comp = e_comp_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp, NULL);
- EINA_LIST_FOREACH(e_comp->connected_clients, l, cdata)
+ EINA_LIST_FOREACH(comp->connected_clients, l, cdata)
{
if (cdata->pid == pid) return strdup(cdata->name);
}
{
if (!punch_obj)
{
- punch_obj = evas_object_rectangle_add(e_comp->evas);
+ punch_obj = evas_object_rectangle_add(e_comp_evas_get());
evas_object_layer_set(punch_obj, EVAS_LAYER_MAX);
evas_object_render_op_set(punch_obj, EVAS_RENDER_COPY);
}
evas_object_color_set(punch_obj, r, g, b, a);
if (w == 0 || h == 0)
- evas_output_size_get(e_comp->evas, &w, &h);
+ evas_output_size_get(e_comp_evas_get(), &w, &h);
evas_object_move(punch_obj, x, y);
evas_object_resize(punch_obj, w, h);
#include "e_blender_intern.h"
#include "e_client_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_comp_object_intern.h"
#include "e_view_client_intern.h"
#include "e_view_intern.h"
e_blender_init(void)
{
E_Blender *blender;
+ struct wl_display *wl_disp = e_comp_wl_display_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wl_disp, EINA_FALSE);
if (_blender) return EINA_TRUE;
blender = E_NEW(E_Blender, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(blender, EINA_FALSE);
- blender->tizen_blender = ds_tizen_blender_create(e_comp_wl->wl.disp);
+ blender->tizen_blender = ds_tizen_blender_create(wl_disp);
EINA_SAFETY_ON_NULL_GOTO(blender->tizen_blender, fail);
blender->destroy_listener.notify = _e_blender_cb_destroy;
#include "e.h"
#include "e_blur_intern.h"
#include "e_blur_video_capture_intern.h"
+#include "e_comp_wl_intern.h"
#include <pixman.h>
#include <libds-tizen/blur.h>
EINA_SAFETY_ON_NULL_RETURN(blur);
EINA_SAFETY_ON_NULL_RETURN(blur->ec);
- obj = evas_object_image_filled_add(e_comp->evas);
+ obj = evas_object_image_filled_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_RETURN(obj);
blur_rectangle = E_NEW(E_Blur_Rectangle, 1);
{
E_Blur_Manager *blur_manager;
E_Comp_Config *conf = e_comp_config_get();
+ struct wl_display *wl_disp = e_comp_wl_display_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wl_disp, EINA_FALSE);
if (_blur_manager) return EINA_TRUE;
blur_manager = E_NEW(E_Blur_Manager, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(blur_manager, EINA_FALSE);
- blur_manager->tizen_blur_manager = ds_tizen_blur_manager_create(e_comp_wl->wl.disp);
+ blur_manager->tizen_blur_manager = ds_tizen_blur_manager_create(wl_disp);
EINA_SAFETY_ON_NULL_GOTO(blur_manager->tizen_blur_manager, fail);
blur_manager->listener.destroy.notify = _e_blur_manager_cb_destroy;
if (video_capture->source_obj) return EINA_TRUE;
- video_capture->source_obj = evas_object_image_filled_add(e_comp->evas);
+ video_capture->source_obj = evas_object_image_filled_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_RETURN_VAL(video_capture->source_obj, EINA_FALSE);
evas_object_name_set(video_capture->source_obj, "blur_video_capture");
E_Blur_Video_Capture_Object *object;
int x, y, w, h;
unsigned int *pixels;
+ int comp_w = 0, comp_h = 0;
if (!blur_obj) return NULL;
object = E_NEW(E_Blur_Video_Capture_Object, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(object, NULL);
- object->blur_clip_obj = evas_object_image_filled_add(e_comp->evas);
+ object->blur_clip_obj = evas_object_image_filled_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_GOTO(object->blur_clip_obj, fail);
evas_object_image_size_set(object->blur_clip_obj, 1, 1);
pixels = evas_object_image_data_get(object->blur_clip_obj, EINA_TRUE);
evas_object_name_set(object->blur_clip_obj, "blur_video_capture_blur_clip_obj");
evas_object_pass_events_set(object->blur_clip_obj, EINA_TRUE);
- object->source_clip_obj = evas_object_rectangle_add(e_comp->evas);
+ object->source_clip_obj = evas_object_rectangle_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_GOTO(object->source_clip_obj, fail);
evas_object_name_set(object->source_clip_obj, "blur_video_capture_source_clip_obj");
evas_object_pass_events_set(object->source_clip_obj, EINA_TRUE);
- object->source_obj = evas_object_image_filled_add(e_comp->evas);
+ object->source_obj = evas_object_image_filled_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_GOTO(object->source_obj, fail);
evas_object_name_set(object->source_obj, "blur_video_capture_source_obj");
evas_object_pass_events_set(object->source_obj, EINA_TRUE);
e_client_geometry_get(client->ec, &x, &y, &w, &h);
evas_object_geometry_set(object->source_clip_obj, x, y, w, h);
- evas_object_geometry_set(object->source_obj, 0, 0, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_object_geometry_set(object->source_obj, 0, 0, comp_w, comp_h);
evas_object_clip_set(object->source_obj, object->source_clip_obj);
evas_object_clip_set(object->source_clip_obj, object->blur_clip_obj);
E_Blur_Video_Capture_Client *client;
E_Blur_Video_Capture_Object *object;
Eina_List *l, *l2;
+ int comp_w = 0, comp_h = 0;
if (!tbm_surface_queue_can_acquire(video_capture->tqueue, 0)) return;
evas_object_image_native_surface_set(video_capture->source_obj, &ns);
evas_object_image_data_update_add(video_capture->source_obj, 0, 0,
video_capture->width, video_capture->height);
- evas_object_geometry_set(video_capture->source_obj, -e_comp->w, -e_comp->h, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_object_geometry_set(video_capture->source_obj, -comp_w, -comp_h, comp_w, comp_h);
BLUR_VC_TRACE("Blur Video Capture Source Update End", NULL);
if (!_e_blur_video_capture_source_object_visible_get())
struct wl_listener client_created;
};
-static Eina_Bool _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Client *ec);
+static Eina_Bool _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Comp_Wl_Data *comp_wl, E_Client *ec);
static void _e_comp_wl_surface_state_serial_update(E_Client *ec, E_Comp_Wl_Surface_State *state);
/* local variables */
_e_comp_wl_configure_send(E_Client *ec, Eina_Bool edges, Eina_Bool send_size)
{
int w, h;
+ E_Comp_Wl_Data *comp_wl;
if (send_size)
{
w = h = -1;
}
- e_client_shell_configure_send(ec, edges * e_comp_wl->resize.edges, w, h);
+ comp_wl = e_comp_wl_get();
+ e_client_shell_configure_send(ec, edges * comp_wl->resize.edges, w, h);
}
static void
if (stopping) return;
ec = e_client_focused_get();
if (!ec)
- e_grabinput_focus(e_comp->ee_win, E_FOCUS_METHOD_PASSIVE);
+ e_grabinput_focus(e_comp_ee_win_get(), E_FOCUS_METHOD_PASSIVE);
}
static Eina_Bool
_e_comp_wl_cb_read(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* dispatch pending wayland events */
- wl_event_loop_dispatch(e_comp_wl->wl.loop, 0);
+ wl_event_loop_dispatch(comp_wl->wl.loop, 0);
return ECORE_CALLBACK_RENEW;
}
void
e_comp_wl_display_flush()
{
- if (e_comp_wl && e_comp_wl->wl.disp)
+ struct wl_display * comp_wl_display = e_comp_wl_display_get();
+ if (comp_wl_display)
{
if (e_config->key_input_ttrace_enable)
{
}
e_input_main_thread_connection_lock(&connection_mutex);
- wl_display_flush_clients(e_comp_wl->wl.disp);
+ wl_display_flush_clients(comp_wl_display);
e_input_main_thread_connection_unlock(&connection_mutex);
if (e_config->key_input_ttrace_enable)
e_comp_wl_focused_client_flush()
{
E_Client *focused_ec;
- if (!(e_comp_wl && e_comp_wl->wl.disp)) return;
+
+ if (!e_comp_wl_display_get()) return;
e_input_thread_boost_lock(&connection_mutex);
focused_ec = e_client_focused_get();
_e_comp_wl_cb_prepare(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
double gap_time;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- if (e_comp_wl->idle_exiter_timestamp > 0.0)
+ if (comp_wl->idle_exiter_timestamp > 0.0)
{
- gap_time = (ecore_time_get() * 1000) - e_comp_wl->idle_exiter_timestamp;
+ gap_time = (ecore_time_get() * 1000) - comp_wl->idle_exiter_timestamp;
if (gap_time > E_COM_WL_PREPARE_GAP_LOG_TIME)
{
ELOGF("E_COMP", "prepare gap time: %lfms",
}
}
- e_comp_wl->idle_exiter_timestamp = 0.0;
+ comp_wl->idle_exiter_timestamp = 0.0;
- wl_event_loop_dispatch_idle(e_comp_wl->wl.loop);
+ wl_event_loop_dispatch_idle(comp_wl->wl.loop);
/* flush pending client events */
e_comp_wl_display_flush();
- TRACE_DS_ASYNC_END((intptr_t)&e_comp_wl->idle_exiter_timestamp,
+ TRACE_DS_ASYNC_END((intptr_t)&comp_wl->idle_exiter_timestamp,
IDLE_EXITER~CB_PREPARE);
// _e_comp_wl_cb_prepare() function is called before idle state in ecore_main_loop.
static void
_e_comp_wl_cb_awake(void *data)
{
- e_comp_wl->idle_exiter_timestamp = ecore_time_get() * 1000;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ comp_wl->idle_exiter_timestamp = ecore_time_get() * 1000;
- TRACE_DS_ASYNC_BEGIN((intptr_t)&e_comp_wl->idle_exiter_timestamp,
+ TRACE_DS_ASYNC_BEGIN((intptr_t)&comp_wl->idle_exiter_timestamp,
IDLE_EXITER~CB_PREPARE);
// _e_comp_wl_cb_awake() function is called after idle state in ecore_main_loop.
{
E_Client *ec;
E_Client *topmost;
+ E_Comp_Wl_Data *comp_wl;
if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (topmost == ec && (ec->comp_data->sub.list || ec->comp_data->sub.below_list))
e_comp_wl_subsurface_hide(ec);
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_unmap_signal, ec);
+ comp_wl = e_comp_wl_get();
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_unmap_signal, ec);
}
static void
Eina_List *l;
struct wl_resource *res;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
wc = wl_resource_get_client(surface);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
}
static void
-_e_comp_wl_touch_cancel(void)
+_e_comp_wl_touch_cancel(E_Comp_Wl_Data *comp_wl)
{
E_Client *ec;
- ec = e_comp_wl->ptr.ec ? e_comp_wl->ptr.ec : e_comp_wl->touch.faked_ec;
+ ec = comp_wl->ptr.ec ? comp_wl->ptr.ec : comp_wl->touch.faked_ec;
if (!ec) return;
- if (!e_comp_wl->touch.pressed) return;
+ if (!comp_wl->touch.pressed) return;
_e_comp_wl_send_touch_cancel(ec);
}
}
static void
-_e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t timestamp)
+_e_comp_wl_device_send_event_device(E_Comp_Wl_Data *comp_wl, E_Client *ec, Evas_Device *dev, uint32_t timestamp)
{
E_Devicemgr_Input_Device *last_device, *ec_last_device, *input_dev;
struct wl_resource *dev_res;
EINA_SAFETY_ON_NULL_RETURN(dev);
if (!ec) return;
- if (ec->cur_mouse_action || e_comp_wl->drag)
+ if (ec->cur_mouse_action || comp_wl->drag)
return;
if (e_object_is_del(E_OBJECT(ec))) return;
if ((ec->ignored) && (!ec->remote_surface.provider)) return;
last_device = e_comp_wl_device_last_device_get(dev_class);
ec_last_device = _e_comp_wl_device_client_last_device_get(ec, dev_class);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wc = wl_resource_get_client(surface);
g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
}
static void
-_e_comp_wl_device_send_last_event_device(E_Client *ec, Ecore_Device_Class dev_class, uint32_t timestamp)
+_e_comp_wl_device_send_last_event_device(E_Comp_Wl_Data *comp_wl, E_Client *ec, Ecore_Device_Class dev_class, uint32_t timestamp)
{
E_Devicemgr_Input_Device *last_device;
struct wl_resource *dev_res;
_e_comp_wl_device_client_last_device_set(ec, dev_class, last_device);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wc = wl_resource_get_client(surface);
EINA_LIST_FOREACH(last_device->resources, l, dev_res)
{
}
static void
-_e_comp_wl_cursor_reload(E_Client *ec)
+_e_comp_wl_cursor_reload(E_Comp_Wl_Data *comp_wl, E_Client *ec)
{
struct wl_resource *res;
struct wl_client *wc;
E_Map *map;
uint32_t serial;
int cx, cy, px, py;
+ E_Pointer *comp_pointer = e_comp_pointer_get();
- if (e_comp->pointer && e_comp->pointer->view_client &&
- !e_view_client_visible_get(e_comp->pointer->view_client))
- e_pointer_view_set(e_comp->pointer, NULL, 0, 0);
+ if (comp_pointer && comp_pointer->view_client &&
+ !e_view_client_visible_get(comp_pointer->view_client))
+ e_pointer_view_set(comp_pointer, NULL, 0, 0);
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (!surface) return;
if (ec->pointer_enter_sent) return;
- px = wl_fixed_to_int(e_comp_wl->ptr.x);
- py = wl_fixed_to_int(e_comp_wl->ptr.y);
+ px = wl_fixed_to_int(comp_wl->ptr.x);
+ py = wl_fixed_to_int(comp_wl->ptr.y);
if (e_client_transform_core_enable_get(ec))
{
cy = py - ec->client.y;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
wl_fixed_from_int(cx), wl_fixed_from_int(cy));
ec->pointer_enter_sent = EINA_TRUE;
}
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_mousein_signal, ec);
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
}
static Eina_Bool
_e_comp_wl_cursor_timer(void *data)
{
E_Client *ec = data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
ELOGF("Mouse", "Cursor hide timer expired after %d sec.", ec, e_config->cursor_timer_interval);
- if (e_comp_wl->relative_ptr.activated) return ECORE_CALLBACK_CANCEL;
+ if (comp_wl->relative_ptr.activated) return ECORE_CALLBACK_CANCEL;
e_comp_wl_cursor_hide(ec);
}
static Eina_Bool
-_e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Client *ec)
+_e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Comp_Wl_Data *comp_wl, E_Client *ec)
{
+ E_Pointer *comp_pointer = e_comp_pointer_get();
+
Eina_Bool ret = EINA_TRUE;
switch (type)
{
ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_IN, ec);
if (!ret) break;
- if (e_comp_wl->ptr.hide_tmr)
+ if (comp_wl->ptr.hide_tmr)
{
- ecore_timer_del(e_comp_wl->ptr.hide_tmr);
+ ecore_timer_del(comp_wl->ptr.hide_tmr);
cursor_timer_ec = ec;
- e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
+ comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
}
else
{
- if (e_pointer_is_hidden(e_comp->pointer))
+ if (e_pointer_is_hidden(comp_pointer))
ret = EINA_FALSE;
}
break;
ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_OUT, ec);
if (!ret) break;
- if (!e_comp_wl->ptr.hide_tmr && e_pointer_is_hidden(e_comp->pointer))
+ if (!comp_wl->ptr.hide_tmr && e_pointer_is_hidden(comp_pointer))
ret = EINA_FALSE;
break;
ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_MOVE, ec);
if (!ret) break;
- if (e_pointer_is_hidden(e_comp->pointer) || !ec->pointer_enter_sent)
- _e_comp_wl_cursor_reload(ec);
+ if (e_pointer_is_hidden(comp_pointer) || !ec->pointer_enter_sent)
+ _e_comp_wl_cursor_reload(comp_wl, ec);
break;
case EVAS_CALLBACK_MOUSE_WHEEL:
ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_WHEEL, ec);
if (!ret) break;
- if (e_pointer_is_hidden(e_comp->pointer) || !ec->pointer_enter_sent)
- _e_comp_wl_cursor_reload(ec);
+ if (e_pointer_is_hidden(comp_pointer) || !ec->pointer_enter_sent)
+ _e_comp_wl_cursor_reload(comp_wl, ec);
break;
case EVAS_CALLBACK_MOUSE_DOWN:
ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_DOWN, ec);
if (!ret) break;
- if (e_comp_wl->ptr.hide_tmr)
+ if (comp_wl->ptr.hide_tmr)
{
- ecore_timer_del(e_comp_wl->ptr.hide_tmr);
- e_comp_wl->ptr.hide_tmr = NULL;
+ ecore_timer_del(comp_wl->ptr.hide_tmr);
+ comp_wl->ptr.hide_tmr = NULL;
}
cursor_timer_ec = NULL;
- if (e_pointer_is_hidden(e_comp->pointer) || !ec->pointer_enter_sent)
- _e_comp_wl_cursor_reload(ec);
+ if (e_pointer_is_hidden(comp_pointer) || !ec->pointer_enter_sent)
+ _e_comp_wl_cursor_reload(comp_wl, ec);
break;
case EVAS_CALLBACK_MOUSE_UP:
Eina_List *l;
uint32_t serial;
E_Client *prev_ptr_ec;
+ E_Comp_Wl_Data *comp_wl;
ev = event;
-
- e_comp_wl->ptr.x = wl_fixed_from_int(ev->output.x);
- e_comp_wl->ptr.y = wl_fixed_from_int(ev->output.y);
+ comp_wl = e_comp_wl_get();
+ comp_wl->ptr.x = wl_fixed_from_int(ev->output.x);
+ comp_wl->ptr.y = wl_fixed_from_int(ev->output.y);
if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
- prev_ptr_ec = e_comp_wl->ptr.ec;
+ prev_ptr_ec = comp_wl->ptr.ec;
if (prev_ptr_ec)
{
ELOGF("Mouse", "In (prev_ptr_ec: %p pointer_enter_sent: %d)", ec, prev_ptr_ec, prev_ptr_ec->pointer_enter_sent);
prev_ptr_ec->pointer_enter_sent = EINA_FALSE;
}
- e_comp_wl->ptr.ec = ec;
+ comp_wl->ptr.ec = ec;
ELOGF("Mouse", "In (obj: %p, time: %d, canvas(%d, %d) output(%d, %d), name:%20s)",
ec, obj, ev->timestamp, ev->canvas.x, ev->canvas.y, ev->output.x, ev->output.y,
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_IN, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_IN, comp_wl, ec))
return;
}
- if (!eina_list_count(e_comp_wl->ptr.resources)) return;
+ if (!eina_list_count(comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
- _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
+ _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
wl_pointer_send_enter(res, serial, surface,
wl_fixed_from_int(ev->canvas.x - ec->client.x),
wl_fixed_from_int(ev->canvas.y - ec->client.y));
ec->pointer_enter_sent = EINA_TRUE;
}
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_mousein_signal, ec);
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
}
static void
Eina_List *l;
uint32_t serial;
Eina_Bool inside_check;
+ E_Comp_Wl_Data *comp_wl;
+ E_Comp *comp;
ev = event;
inside_check = E_INSIDE(ev->canvas.x, ev->canvas.y,
ec->client.x, ec->client.y, ec->client.w, ec->client.h);
if (ec->cur_mouse_action && inside_check) return;
- if (e_object_is_del(E_OBJECT(e_comp))) return;
- if (e_comp_wl->ptr.ec == ec)
- e_comp_wl->ptr.ec = NULL;
+
+ comp = e_comp_get();
+ if (e_object_is_del(E_OBJECT(comp))) return;
+
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->ptr.ec == ec)
+ comp_wl->ptr.ec = NULL;
if (e_object_is_del(E_OBJECT(ec))) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_OUT, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_OUT, comp_wl, ec))
return;
}
- if (!eina_list_count(e_comp_wl->ptr.resources)) return;
+ if (!eina_list_count(comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (ec->pointer_enter_sent == EINA_FALSE) continue;
- _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
+ _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
wl_pointer_send_leave(res, serial, surface);
ec->pointer_enter_sent = EINA_FALSE;
}
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_mouseout_signal, ec);
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_mouseout_signal, ec);
}
static void
-_e_comp_wl_surface_send_touch(struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp, Eina_Bool pressed)
+_e_comp_wl_surface_send_touch(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp, Eina_Bool pressed)
{
Eina_List *l;
struct wl_client *wc;
uint32_t serial;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
x = wl_fixed_from_int(canvas_x - client_x);
y = wl_fixed_from_int(canvas_y - client_y);
- EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
- TRACE_INPUT_BEGIN(_e_comp_wl_send_touch);
+ TRACE_INPUT_BEGIN(_e_comp_wl_surface_send_touch);
if (pressed)
{
ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, canvas_x - client_x, canvas_y - client_y);
}
static void
-_e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_t timestamp, Eina_Bool pressed)
+_e_comp_wl_send_touch(E_Comp_Wl_Data *comp_wl, E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_t timestamp, Eina_Bool pressed)
{
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
- _e_comp_wl_surface_send_touch(surface, idx, canvas_x, canvas_y, ec->client.x, ec->client.y, timestamp, pressed);
+ _e_comp_wl_surface_send_touch(comp_wl, surface, idx, canvas_x, canvas_y, ec->client.x, ec->client.y, timestamp, pressed);
- e_comp_wl_touch_frame_send_ec_set(ec);
+ e_comp_wl_touch_frame_send_ec_set(comp_wl, ec);
}
EINTERN void
-e_comp_wl_surface_send_touch_move(struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp)
+e_comp_wl_surface_send_touch_move(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp)
{
Eina_List *l;
struct wl_client *wc;
x = wl_fixed_from_int(canvas_x - client_x);
y = wl_fixed_from_int(canvas_y - client_y);
- EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
}
static void
-_e_comp_wl_send_touch_move(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_t timestamp)
+_e_comp_wl_send_touch_move(E_Comp_Wl_Data *comp_wl, E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_t timestamp)
{
if (!ec) return;
if (ec->cur_mouse_action) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
- e_comp_wl_surface_send_touch_move(surface, idx, canvas_x, canvas_y, ec->client.x, ec->client.y, timestamp);
+ e_comp_wl_surface_send_touch_move(comp_wl, surface, idx, canvas_x, canvas_y, ec->client.x, ec->client.y, timestamp);
- e_comp_wl_touch_frame_send_ec_set(ec);
+ e_comp_wl_touch_frame_send_ec_set(comp_wl, ec);
}
static void
-_e_comp_wl_send_touch_frame(E_Client *ec)
+_e_comp_wl_send_touch_frame(E_Comp_Wl_Data *comp_wl, E_Client *ec)
{
Eina_List *l;
struct wl_client *wc;
struct wl_resource *res;
+ struct wl_resource *surface;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (_e_comp_wl_check_block_input(ec)) return;
-
- struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- if (!surface) return;
+ if (!(surface = e_comp_wl_client_surface_get(ec))) return;
wc = wl_resource_get_client(surface);
- EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
wl_touch_send_frame(res);
}
- e_comp_wl_touch_frame_send_ec_set(NULL);
+ e_comp_wl_touch_frame_send_ec_set(comp_wl, NULL);
}
EINTERN void
-e_comp_wl_surface_send_mouse_move(struct wl_resource *surface, int x, int y, int client_x, int client_y, unsigned int timestamp)
+e_comp_wl_surface_send_mouse_move(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int x, int y, int client_x, int client_y, unsigned int timestamp)
{
struct wl_resource *res;
struct wl_client *wc;
if (!surface) return;
wc = wl_resource_get_client(surface);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
}
static void
-_e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp)
+_e_comp_wl_send_mouse_move(E_Comp_Wl_Data *comp_wl, E_Client *ec, int x, int y, unsigned int timestamp)
{
if (!ec) return;
if (ec->cur_mouse_action) return;
if (e_object_is_del(E_OBJECT(ec))) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- e_comp_wl_surface_send_mouse_move(surface, x, y, ec->client.x, ec->client.y, timestamp);
+ e_comp_wl_surface_send_mouse_move(comp_wl, surface, x, y, ec->client.x, ec->client.y, timestamp);
}
static void
-_e_comp_wl_cursor_move_timer_control(E_Client *ec)
+_e_comp_wl_cursor_move_timer_control(E_Comp_Wl_Data* comp_wl, E_Client *ec)
{
- if (e_comp_wl->ptr.hide_tmr)
+ if (comp_wl->ptr.hide_tmr)
{
if (cursor_timer_ec == ec)
{
- ecore_timer_interval_set(e_comp_wl->ptr.hide_tmr, e_config->cursor_timer_interval);
- ecore_timer_reset(e_comp_wl->ptr.hide_tmr);
+ ecore_timer_interval_set(comp_wl->ptr.hide_tmr, e_config->cursor_timer_interval);
+ ecore_timer_reset(comp_wl->ptr.hide_tmr);
}
else
{
- ecore_timer_del(e_comp_wl->ptr.hide_tmr);
+ ecore_timer_del(comp_wl->ptr.hide_tmr);
cursor_timer_ec = ec;
- e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
+ comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
}
}
else
{
cursor_timer_ec = ec;
- e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
+ comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
}
}
const char *dev_name;
E_Comp_Config *comp_conf;
Evas_Device_Class dev_class;
+ struct wl_resource *surface;
+ E_Comp_Wl_Data *comp_wl;
ev = event;
-
- e_comp->wl_comp_data->ptr.x = wl_fixed_from_int(ev->cur.output.x);
- e_comp->wl_comp_data->ptr.y = wl_fixed_from_int(ev->cur.output.y);
+ comp_wl = e_comp_wl_get();
+ comp_wl->ptr.x = wl_fixed_from_int(ev->cur.output.x);
+ comp_wl->ptr.y = wl_fixed_from_int(ev->cur.output.y);
if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if ((ec->ignored) && (!ec->remote_surface.provider)) return;
- struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- if (!surface) return;
-
+ if (!(surface = e_comp_wl_client_surface_get(ec))) return;
if ((!need_send_motion) && (!need_send_released) && (e_client_visibility_get(ec) == E_VISIBILITY_FULLY_OBSCURED)) return;
dev = ev->dev;
if (dev && (dev_class == EVAS_DEVICE_CLASS_TOUCH))
{
- if (!e_comp_wl->drag_client)
+ if (!comp_wl->drag_client)
{
- e_comp_wl->touch.faked_ec = ec;
- if (e_comp_wl->touch.pressed & (1 << 0))
+ comp_wl->touch.faked_ec = ec;
+ if (comp_wl->touch.pressed & (1 << 0))
{
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
if (dev_name)
_e_comp_wl_device_handle_axes(dev_name, dev_class,
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
- _e_comp_wl_send_touch_move(ec, 0, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
+ _e_comp_wl_send_touch_move(comp_wl, ec, 0, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
}
}
- e_pointer_touch_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
+ e_pointer_touch_move(e_comp_pointer_get(), ev->cur.output.x, ev->cur.output.y);
}
else
{
- if (!e_comp_wl->drag_client)
+ if (!comp_wl->drag_client)
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_MOVE, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_MOVE, comp_wl, ec))
return;
}
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
- _e_comp_wl_send_mouse_move(ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
+ _e_comp_wl_send_mouse_move(comp_wl, ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
- _e_comp_wl_cursor_move_timer_control(ec);
+ _e_comp_wl_cursor_move_timer_control(comp_wl, ec);
}
}
- e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
+ e_pointer_mouse_move(e_comp_pointer_get(), ev->cur.output.x, ev->cur.output.y);
}
}
EINTERN void
-e_comp_wl_surface_handle_mouse_button_to_touch(struct wl_resource *surface, uint32_t timestamp, int canvas_x, int canvas_y, int client_x, int client_y, Eina_Bool flag)
+e_comp_wl_surface_handle_mouse_button_to_touch(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, uint32_t timestamp, int canvas_x, int canvas_y, int client_x, int client_y, Eina_Bool flag)
{
- e_comp_wl->ptr.button = BTN_LEFT;
+ comp_wl->ptr.button = BTN_LEFT;
- _e_comp_wl_surface_send_touch(surface, 0, canvas_x, canvas_y, client_x, client_y, timestamp, flag);
+ _e_comp_wl_surface_send_touch(comp_wl, surface, 0, canvas_x, canvas_y, client_x, client_y, timestamp, flag);
}
static void
-_e_comp_wl_evas_handle_mouse_button_to_touch(E_Client *ec, uint32_t timestamp, int canvas_x, int canvas_y, Eina_Bool flag)
+_e_comp_wl_evas_handle_mouse_button_to_touch(E_Comp_Wl_Data *comp_wl, E_Client *ec, uint32_t timestamp, int canvas_x, int canvas_y, Eina_Bool flag)
{
- if (ec->cur_mouse_action || e_comp_wl->drag) return;
+ struct wl_resource *surface;
+
+ if (ec->cur_mouse_action || comp_wl->drag) return;
if (e_object_is_del(E_OBJECT(ec))) return;
- struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- if (!surface) return;
+ if (!(surface = e_comp_wl_client_surface_get(ec))) return;
if ((ec->ignored) && (!ec->remote_surface.provider)) return;
- e_comp_wl->ptr.button = BTN_LEFT;
+ comp_wl->ptr.button = BTN_LEFT;
- _e_comp_wl_send_touch(ec, 0, canvas_x, canvas_y, timestamp, flag);
+ _e_comp_wl_send_touch(comp_wl, ec, 0, canvas_x, canvas_y, timestamp, flag);
}
static void
_e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event)
{
- E_Client *ec = data;
- Evas_Event_Mouse_Down *ev = event;
+ E_Client *ec;
+ Evas_Event_Mouse_Down *ev;
Evas_Device *dev = NULL;
const Evas_Device *seat_dev;
const char *dev_name, *seat_name;
Evas_Device_Class dev_class;
+ E_Comp_Wl_Data *comp_wl;
- if (!ec) return;
+ if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (_e_comp_wl_check_block_input(ec)) return;
+ ev = event;
dev = ev->dev;
dev_name = evas_device_description_get(dev);
ec, obj, ev->button, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
dev_name, seat_name);
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ comp_wl = e_comp_wl_get();
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
if (dev && (dev_class == EVAS_DEVICE_CLASS_TOUCH))
{
- e_comp_wl->touch.faked_ec = ec;
+ comp_wl->touch.faked_ec = ec;
if (dev_name)
_e_comp_wl_device_renew_axis(dev_name, dev_class,
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
- _e_comp_wl_evas_handle_mouse_button_to_touch(ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_TRUE);
+ _e_comp_wl_evas_handle_mouse_button_to_touch(comp_wl, ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_TRUE);
- e_pointer_touch_move(e_comp->pointer, ev->output.x, ev->output.y);
- e_comp_wl->touch.pressed |= (1 << 0);
+ e_pointer_touch_move(e_comp_pointer_get(), ev->output.x, ev->output.y);
+ comp_wl->touch.pressed |= (1 << 0);
}
else
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_DOWN, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_DOWN, comp_wl, ec))
return;
}
- e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
+ e_comp_wl_evas_handle_mouse_button(comp_wl, ec, ev->timestamp, ev->button,
WL_POINTER_BUTTON_STATE_PRESSED);
- e_pointer_mouse_move(e_comp->pointer, ev->output.x, ev->output.y);
+ e_pointer_mouse_move(e_comp_pointer_get(), ev->output.x, ev->output.y);
}
need_send_released = EINA_TRUE;
static void
_e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event)
{
- E_Client *ec = data;
- Evas_Event_Mouse_Up *ev = event;
+ E_Client *ec;
+ Evas_Event_Mouse_Up *ev;
Evas_Device *dev = NULL;
const Evas_Device *seat_dev;
const char *dev_name, *seat_name;
Evas_Device_Class dev_class;
Evas_Event_Flags flags;
+ E_Comp_Wl_Data *comp_wl;
- if (!ec) return;
+ if (!(ec = data)) return;
if (ec->cur_mouse_action) return;
if (e_object_is_del(E_OBJECT(ec))) return;
if (_e_comp_wl_check_block_input(ec)) return;
{
need_send_motion = EINA_TRUE;
}
-
+ ev = event;
dev = ev->dev;
dev_name = evas_device_description_get(dev);
ec, obj, ev->button, flags, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
dev_name, seat_name);
+ comp_wl = e_comp_wl_get();
if (dev && (dev_class == EVAS_DEVICE_CLASS_TOUCH))
{
- e_comp_wl->touch.pressed &= ~(1 << 0);
+ comp_wl->touch.pressed &= ~(1 << 0);
- if (!e_comp_wl->touch.pressed && e_comp_wl->touch.faked_ec)
- e_comp_wl->touch.faked_ec = NULL;
+ if (!comp_wl->touch.pressed && comp_wl->touch.faked_ec)
+ comp_wl->touch.faked_ec = NULL;
}
if (flags & EVAS_EVENT_FLAG_ON_HOLD) goto finish;
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
if (dev && (dev_class == EVAS_DEVICE_CLASS_TOUCH))
{
if (dev_name)
_e_comp_wl_device_handle_axes(dev_name, dev_class,
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
- _e_comp_wl_evas_handle_mouse_button_to_touch(ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_FALSE);
+ _e_comp_wl_evas_handle_mouse_button_to_touch(comp_wl, ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_FALSE);
}
else
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_UP, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_UP, comp_wl, ec))
return;
}
- e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
+ e_comp_wl_evas_handle_mouse_button(comp_wl, ec, ev->timestamp, ev->button,
WL_POINTER_BUTTON_STATE_RELEASED);
if (_e_comp_wl_check_cursor_timer_needed(ec))
- _e_comp_wl_cursor_move_timer_control(ec);
+ _e_comp_wl_cursor_move_timer_control(comp_wl, ec);
}
finish:
}
EINTERN void
-e_comp_wl_surface_mouse_wheel_send(struct wl_resource *surface, int direction, int z, int timestamp)
+e_comp_wl_surface_mouse_wheel_send(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int direction, int z, int timestamp)
{
struct wl_resource *res;
struct wl_client *wc;
dir = wl_fixed_from_int(z);
wc = wl_resource_get_client(surface);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
}
static void
-_e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, int timestamp)
+_e_comp_wl_mouse_wheel_send(E_Comp_Wl_Data *comp_wl, E_Client *ec, int direction, int z, int timestamp)
{
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- e_comp_wl_surface_mouse_wheel_send(surface, direction, z, timestamp);
+ e_comp_wl_surface_mouse_wheel_send(comp_wl, surface, direction, z, timestamp);
}
static void
{
E_Client *ec;
Evas_Event_Mouse_Wheel *ev;
+ E_Comp_Wl_Data *comp_wl;
ev = event;
if (!(ec = data)) return;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
- if (!eina_list_count(e_comp_wl->ptr.resources))
+ comp_wl = e_comp_wl_get();
+ if (!eina_list_count(comp_wl->ptr.resources))
return;
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, comp_wl, ec))
return;
}
- _e_comp_wl_device_send_event_device(ec, ev->dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, ev->dev, ev->timestamp);
- _e_comp_wl_mouse_wheel_send(ec, ev->direction, ev->z, ev->timestamp);
+ _e_comp_wl_mouse_wheel_send(comp_wl, ec, ev->direction, ev->z, ev->timestamp);
if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
- _e_comp_wl_cursor_move_timer_control(ec);
+ _e_comp_wl_cursor_move_timer_control(comp_wl, ec);
}
}
const Evas_Device *seat_dev;
const char *dev_name, *seat_name;
Evas_Device_Class dev_class;
+ E_Comp_Wl_Data *comp_wl;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
dev = ev->dev;
dev_name = evas_device_description_get(dev);
- e_comp_wl->touch.faked_ec = ec;
+
+ comp_wl = e_comp_wl_get();
+ comp_wl->touch.faked_ec = ec;
seat_dev = evas_device_parent_get(dev);
seat_name = evas_device_name_get(seat_dev);
if (dev && dev_name)
{
dev_class = evas_device_class_get(dev);
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
_e_comp_wl_device_renew_axis(dev_name, dev_class, ec, ev->device, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
}
- _e_comp_wl_send_touch(ec, ev->device, ev->canvas.x, ev->canvas.y, ev->timestamp, EINA_TRUE);
- e_comp_wl->touch.pressed |= (1 << ev->device);
+ _e_comp_wl_send_touch(comp_wl, ec, ev->device, ev->canvas.x, ev->canvas.y, ev->timestamp, EINA_TRUE);
+ comp_wl->touch.pressed |= (1 << ev->device);
}
static void
const char *dev_name, *seat_name;
Evas_Device_Class dev_class;
Evas_Event_Flags flags;
+ E_Comp_Wl_Data *comp_wl;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
flags = evas_event_default_flags_get(evas);
- e_comp_wl->touch.pressed &= ~(1 << ev->device);
- if (!e_comp_wl->touch.pressed && e_comp_wl->touch.faked_ec)
- e_comp_wl->touch.faked_ec = NULL;
+ comp_wl = e_comp_wl_get();
+ comp_wl->touch.pressed &= ~(1 << ev->device);
+ if (!comp_wl->touch.pressed && comp_wl->touch.faked_ec)
+ comp_wl->touch.faked_ec = NULL;
if (flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (dev && dev_name)
{
dev_class = evas_device_class_get(dev);
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
_e_comp_wl_device_handle_axes(dev_name, dev_class, ec, ev->device, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
}
- _e_comp_wl_send_touch(ec, ev->device, 0, 0, ev->timestamp, EINA_FALSE);
+ _e_comp_wl_send_touch(comp_wl, ec, ev->device, 0, 0, ev->timestamp, EINA_FALSE);
}
static void
Evas_Device *dev = NULL;
const char *dev_name;
Evas_Device_Class dev_class;
+ E_Comp_Wl_Data *comp_wl;
if (!ec) return;
if (e_object_is_del(E_OBJECT(ec))) return;
/* Do not deliver emulated single touch events to client */
if (ev->device == 0) return;
- e_comp_wl->touch.faked_ec = ec;
+ comp_wl = e_comp_wl_get();
+ comp_wl->touch.faked_ec = ec;
- if (e_comp_wl->touch.pressed & (1 << ev->device))
+ if (comp_wl->touch.pressed & (1 << ev->device))
{
dev = ev->dev;
if (dev && (dev_name = evas_device_description_get(dev)))
{
dev_class = evas_device_class_get(dev);
- _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
+ _e_comp_wl_device_send_event_device(comp_wl, ec, dev, ev->timestamp);
_e_comp_wl_device_handle_axes(dev_name, dev_class, ec, ev->device, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
}
- _e_comp_wl_send_touch_move(ec, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
+ _e_comp_wl_send_touch_move(comp_wl, ec, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
}
}
static Eina_Bool
_e_comp_wl_cb_touch_frame(void *data, int type, void *event)
{
- E_Client *ec = e_comp_wl_touch_frame_send_ec_get();
- _e_comp_wl_send_touch_frame(ec);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ E_Client *ec = e_comp_wl_touch_frame_send_ec_get(comp_wl);
+ _e_comp_wl_send_touch_frame(comp_wl, ec);
return ECORE_CALLBACK_PASS_ON;
}
}
static void
-_e_comp_wl_input_thread_send_keys()
+_e_comp_wl_input_thread_send_keys(E_Comp_Wl_Data *comp_wl)
{
uint32_t serial;
E_Comp_Wl_Key_Data *k;
return;
}
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
t = ecore_time_unix_get();
EINA_LIST_FOREACH(e_comp_input_key->kbd.focused, l, res)
ec->comp_data->on_focus_timer = NULL;
- _e_comp_wl_input_thread_send_keys(NULL);
+ _e_comp_wl_input_thread_send_keys(e_comp_wl_get());
return EINA_FALSE;
}
ecore_timer_add(((e_config->xkb.delay_held_key_input_to_focus)/1000.0),
(Ecore_Task_Cb)_e_comp_wl_evas_cb_focus_in_timer, ec);
int rotation = ec->e.state.rot.ang.curr;
- e_pointer_rotation_set(e_comp->pointer, rotation);
+ e_pointer_rotation_set(e_comp_pointer_get(), rotation);
}
static void
}
/* send keyboard_leave to all keyboard resources */
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
t = ecore_time_unix_get();
EINA_LIST_FOREACH_SAFE(e_comp_input_key->kbd.focused, l, ll, res)
static Eina_Bool
_e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
{
- e_comp_wl->ptr.x = wl_fixed_from_int(ev->x);
- e_comp_wl->ptr.y = wl_fixed_from_int(ev->y);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ comp_wl->ptr.x = wl_fixed_from_int(ev->x);
+ comp_wl->ptr.y = wl_fixed_from_int(ev->y);
return ECORE_CALLBACK_RENEW;
}
static void
-_e_comp_wl_send_mouse_relative_move(E_Client *ec, int dx, int dy,
- int dx_unaccel, int dy_unaccel,
+_e_comp_wl_send_mouse_relative_move(E_Comp_Wl_Data *comp_wl, E_Client *ec,
+ int dx, int dy, int dx_unaccel, int dy_unaccel,
unsigned int timestamp)
{
struct wl_resource *surface;
wc = wl_resource_get_client(surface);
comp_conf = e_comp_config_get();
- EINA_LIST_FOREACH(e_comp_wl->relative_ptr.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->relative_ptr.resources, l, res)
{
if (!e_comp_wl_input_relative_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
_e_comp_wl_cb_mouse_relative_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Relative_Move *ev)
{
E_Client *ec;
+ E_Comp_Wl_Data *comp_wl;
- ec = e_comp_wl->ptr_constraints.ec;
+ comp_wl = e_comp_wl_get();
+ ec = comp_wl->ptr_constraints.ec;
if (!ec)
{
for (int i = 1; i < E_DEVICEMGR_BOUNDARY_MAX + 1; i++)
if (ec)
{
ELOGF("Mouse", "Relative Move. Clamped boundary:%d", ec, i);
- _e_comp_wl_send_mouse_relative_move(ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
+ _e_comp_wl_send_mouse_relative_move(comp_wl, ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
}
}
else if ((e_devicemgr->relative_motion_grab.prev_boundaries & (1 << i)))
if (ec)
{
ELOGF("Mouse", "Relative Move. Prev Clamped boundary:%d", ec, i);
- _e_comp_wl_send_mouse_relative_move(ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
+ _e_comp_wl_send_mouse_relative_move(comp_wl, ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
e_devicemgr->relative_motion_grab.prev_boundaries &= ~(1 << i);
}
}
else
{
- _e_comp_wl_send_mouse_relative_move(ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
+ _e_comp_wl_send_mouse_relative_move(comp_wl, ec, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ev->timestamp);
}
return ECORE_CALLBACK_DONE;
static Eina_Bool
_e_comp_wl_cb_mouse_button_cancel(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev)
{
- _e_comp_wl_touch_cancel();
+ _e_comp_wl_touch_cancel(e_comp_wl_get());
return ECORE_CALLBACK_PASS_ON;
}
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, ECORE_CALLBACK_PASS_ON);
if (!e_zone_is_displaying(zone))
- _e_comp_wl_touch_cancel();
+ _e_comp_wl_touch_cancel(e_comp_wl_get());
return ECORE_CALLBACK_PASS_ON;
}
if (!focused_ec) return ECORE_CALLBACK_PASS_ON;
rotation = focused_ec->e.state.rot.ang.curr;
- e_pointer_rotation_set(e_comp->pointer, rotation);
+ e_pointer_rotation_set(e_comp_pointer_get(), rotation);
return ECORE_CALLBACK_PASS_ON;
}
E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport;
E_Surface *surface = e_surface_from_ec(ec);
+ E_Comp_Wl_Data *comp_wl;
if (ec->ignored)
{
if ((ec->internal) ||
(cdata->shell.surface && state->new_attach))
{
+ E_Comp *comp = e_comp_get();
+
EC_CHANGED(ec);
ec->new_client = 1;
- e_comp->new_clients++;
+ comp->new_clients++;
ELOGF("COMP", "Unignore", ec);
e_client_unignore(ec);
}
if ((state->new_attach) ||
(state->buffer_viewport.changed))
{
- if ((e_comp_wl->drag) &&
- (e_comp_wl->drag_client) &&
- (e_comp_wl->drag_client == ec))
+ comp_wl = e_comp_wl_get();
+ if ((comp_wl->drag) &&
+ (comp_wl->drag_client) &&
+ (comp_wl->drag_client == ec))
{
- e_drag_reference_point_set(e_comp_wl->drag, state->sx, state->sy);
+ e_drag_reference_point_set(comp_wl->drag, state->sx, state->sy);
- e_drag_move(e_comp_wl->drag,
- e_comp_wl->drag->x,
- e_comp_wl->drag->y);
+ e_drag_move(comp_wl->drag,
+ comp_wl->drag->x,
+ comp_wl->drag->y);
- e_drag_resize(e_comp_wl->drag,
+ e_drag_resize(comp_wl->drag,
state->bw, state->bh);
}
else if ((cdata->shell.surface) &&
EINA_LIST_FREE(state->damages, dmg)
damages = eina_list_append(damages, dmg);
+ comp_wl = e_comp_wl_get();
EINA_LIST_FREE(damages, dmg)
{
/* not creating damage for ec that shows a underlay video */
if (state->buffer_viewport.changed ||
- !e_comp->wl_comp_data->available_hw_accel.underlay ||
- !buffer || buffer->type != E_COMP_WL_BUFFER_TYPE_VIDEO)
- e_view_client_damage(e_client_view_get(ec), dmg->x, dmg->y, dmg->w, dmg->h);
+ (!comp_wl->available_hw_accel.underlay) ||
+ !buffer || buffer->type != E_COMP_WL_BUFFER_TYPE_VIDEO)
+ e_view_client_damage(e_client_view_get(ec), dmg->x, dmg->y, dmg->w, dmg->h);
eina_rectangle_free(dmg);
}
e_comp_wl_subsurface_check_alpha_mask_rect(ec);
+ comp_wl = e_comp_wl_get();
if ((cdata->video_client) &&
- ((buffer) &&
- (buffer->type == E_COMP_WL_BUFFER_TYPE_VIDEO)) &&
- (e_comp->wl_comp_data->available_hw_accel.underlay))
+ (buffer && (buffer->type == E_COMP_WL_BUFFER_TYPE_VIDEO)) &&
+ (comp_wl->available_hw_accel.underlay))
{
e_pixmap_image_clear(ec->pixmap, 1);
}
struct wl_client *client = data;
E_Comp_Connected_Client_Info *cinfo;
E_Appinfo *eai;
+ E_Comp *comp;
cinfo = wl_container_of(listener, cinfo, destroy);
if (e_appinfo_owner_get(eai) == E_APPINFO_OWNER_SERVER)
e_appinfo_del(eai);
- e_comp->connected_clients = eina_list_remove(e_comp->connected_clients, cinfo);
+ comp = e_comp_get();
+ comp->connected_clients = eina_list_remove(comp->connected_clients, cinfo);
wl_list_remove(&cinfo->destroy.link);
eina_stringshare_del(cinfo->name);
_e_comp_wl_connected_client_create(struct wl_client *client, char *name, pid_t pid, uid_t uid, gid_t gid)
{
E_Comp_Connected_Client_Info *cinfo;
+ E_Comp *comp;
cinfo = E_NEW(E_Comp_Connected_Client_Info, 1);
EINA_SAFETY_ON_NULL_RETURN(cinfo);
cinfo->gid = gid;
cinfo->destroy.notify = _e_comp_wl_connected_client_cb_destroy;
wl_client_add_destroy_listener(client, &cinfo->destroy);
- e_comp->connected_clients = eina_list_append(e_comp->connected_clients, cinfo);
+
+ comp = e_comp_get();
+ comp->connected_clients = eina_list_append(comp->connected_clients, cinfo);
_e_comp_wl_pid_hook_call(E_COMP_WL_PID_HOOK_CONNECTED_CLIENT_CREATE, pid);
}
static void
_e_comp_wl_client_cb_resize_end(void *data EINA_UNUSED, E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
+
if (e_object_is_del(E_OBJECT(ec))) return;
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
- e_comp_wl->resize.edges = 0;
- e_comp_wl->resize.resource = NULL;
+ comp_wl = e_comp_wl_get();
+ comp_wl->resize.edges = 0;
+ comp_wl->resize.resource = NULL;
}
static void
}
static void
-_e_comp_wl_gl_init(void *data EINA_UNUSED)
+_e_comp_wl_gl_init(E_Comp_Wl_Data *comp_wl)
{
Evas *evas = NULL;
Evas_GL *evasgl = NULL;
Evas_GL_Config *cfg = NULL;
Eina_Bool res;
E_Comp_Wl_Evas_Gl *evas_gl = NULL;
+ E_Comp *comp;
if (!e_comp_gl_get()) return;
/* if wl_drm module doesn't call e_comp_canvas_init yet,
* then we should get evas from ecore_evas.
*/
- if (e_comp->evas)
- evas = e_comp->evas;
+ comp = e_comp_get();
+ if (comp->evas)
+ evas = comp->evas;
else
- evas = ecore_evas_get(e_comp->ee);
+ evas = ecore_evas_get(comp->ee);
evasgl = evas_gl_new(evas);
EINA_SAFETY_ON_NULL_GOTO(evasgl, err);
{
evas_gl_free(evasgl);
free(evas_gl);
- e_comp->gl = 1;
+ comp->gl = 1;
e_main_ts_end("\tE_Comp_Wl_GL Init Done");
return;
}
res = evas_gl_make_current(evasgl, sfc, ctx);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
- res = glapi->evasglBindWaylandDisplay(evasgl, e_comp_wl->wl.disp);
+ res = glapi->evasglBindWaylandDisplay(evasgl, comp_wl->wl.disp);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
evas_gl_config_free(cfg);
evas_gl->glsfc = sfc;
evas_gl->glctx = ctx;
- e_comp_wl->evas_gl = evas_gl;
+ comp_wl->evas_gl = evas_gl;
/* for native surface */
- e_comp->gl = 1;
+ comp->gl = 1;
e_main_ts_end("\tE_Comp_Wl_GL Init Done");
static E_Comp_Wl_Data *
_e_comp_wl_display_create(void)
{
- E_Comp_Data *comp;
+ E_Comp *comp;
+ E_Comp_Data *comp_data;
E_Comp_Wl_Data *comp_wl;
const char *name;
int fd = 0;
Eina_Bool res;
/* create new compositor data */
- if (!(comp = E_NEW(E_Comp_Data, 1)))
+ if (!(comp_data = E_NEW(E_Comp_Data, 1)))
{
ERR("Could not create compositor data: %m");
return NULL;
}
- comp_wl = &comp->base;
+ comp_wl = &comp_data->base;
/* set compositor wayland data */
- e_comp_wl = e_comp->wl_comp_data = comp_wl;
+ comp = e_comp_get();
+ e_comp_wl = comp->wl_comp_data = comp_wl;
g_mutex_init(&connection_mutex);
/* get the file descriptor of the wayland event loop */
fd = wl_event_loop_get_fd(comp_wl->wl.loop);
- comp->client_created.notify = _e_comp_wl_cb_client_created;
- wl_display_add_client_created_listener(comp->base.wl.disp, &comp->client_created);
+ comp_data->client_created.notify = _e_comp_wl_cb_client_created;
+ wl_display_add_client_created_listener(comp_data->base.wl.disp, &comp_data->client_created);
// TODO: this function has to move to compmgr module
if (e_comp_gl_get())
_e_comp_wl_cb_prepare, comp_wl);
/* add awake handler */
- ecore_main_awake_handler_add(_e_comp_wl_cb_awake, comp_wl);
+ ecore_main_awake_handler_add(_e_comp_wl_cb_awake, NULL);
return comp_wl;
disp_err:
g_mutex_clear(&connection_mutex);
e_comp_wl = NULL;
- e_comp->wl_comp_data = NULL;
- free(comp);
+ comp->wl_comp_data = NULL;
+ free(comp_data);
return NULL;
}
static void
-_e_comp_wl_gl_shutdown(void)
+_e_comp_wl_gl_shutdown(E_Comp_Wl_Data *comp_wl)
{
- if (!e_comp_wl->evas_gl) return;
+ if (!comp_wl->evas_gl) return;
- if (e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay)
- e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_wl->evas_gl->gl, e_comp_wl->wl.disp);
+ if (comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay)
+ comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(comp_wl->evas_gl->gl, comp_wl->wl.disp);
- evas_gl_make_current(e_comp_wl->evas_gl->gl, NULL, NULL);
- evas_gl_context_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glctx);
- evas_gl_surface_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glsfc);
- evas_gl_free(e_comp_wl->evas_gl->gl);
+ evas_gl_make_current(comp_wl->evas_gl->gl, NULL, NULL);
+ evas_gl_context_destroy(comp_wl->evas_gl->gl, comp_wl->evas_gl->glctx);
+ evas_gl_surface_destroy(comp_wl->evas_gl->gl, comp_wl->evas_gl->glsfc);
+ evas_gl_free(comp_wl->evas_gl->gl);
- E_FREE(e_comp_wl->evas_gl);
+ E_FREE(comp_wl->evas_gl);
}
static void
*
* @returns true on success, false if initialization failed.
*/
-EINTERN Eina_Bool
+EINTERN E_Comp_Wl_Data *
e_comp_wl_init(void)
{
E_Comp_Wl_Data *comp_wl;
{
e_error_message_show(_("Enlightenment cannot create a Wayland Compositor!\n"));
TRACE_DS_END();
- return EINA_FALSE;
+ return NULL;
}
//TODO: this is not to crate subsurface resource.
ERR("Failed to init_subsurfaces");
e_comp_wl_subsurfaces_shutdown();
TRACE_DS_END();
- return EINA_FALSE;
+ return NULL;
}
// TODO: this does not belong to server mdoule
TRACE_DS_END();
- return EINA_TRUE;
+ return comp_wl;
}
EINTERN void
EINTERN void
e_comp_wl_shutdown(void)
{
- E_Comp_Data *comp = (E_Comp_Data *)e_comp_wl;
+ E_Comp* comp = e_comp_get();
+ E_Comp_Data *comp_data = (E_Comp_Data *)e_comp_wl;
e_comp_wl_subsurfaces_shutdown();
/* free handlers */
e_input_hook_del(input_hook);
e_comp_wl_input_thread_remove_e_input_handlers();
- _e_comp_wl_gl_shutdown();
+ _e_comp_wl_gl_shutdown(e_comp_wl);
e_comp_wl_capture_shutdown();
- wl_list_remove(&comp->client_created.link);
+ wl_list_remove(&comp_data->client_created.link);
/* delete awake handler */
ecore_main_awake_handler_del(_e_comp_wl_cb_awake);
- wl_display_destroy(comp->base.wl.disp);
+ wl_display_destroy(comp_data->base.wl.disp);
e_comp_wl = NULL;
- e_comp->wl_comp_data = NULL;
- free(comp);
+ comp->wl_comp_data = NULL;
+ free(comp_data);
}
EINTERN E_Comp_Wl_Data *
/* ignore cursor changes during resize/move I guess */
if (!e_client_action_get())
{
- if (e_comp->pointer)
+ E_Pointer *comp_pointer = e_comp_pointer_get();
+ if (comp_pointer)
{
- x = e_comp->pointer->hot.x;
- y = e_comp->pointer->hot.y;
+ x = comp_pointer->hot.x;
+ y = comp_pointer->hot.y;
}
- e_pointer_view_set(e_comp->pointer, e_client_view_get(ec), x, y);
+ e_pointer_view_set(comp_pointer, e_client_view_get(ec), x, y);
}
}
return EINA_TRUE;
unsigned int transform)
{
E_Comp_Wl_Output *output;
+ E_Comp_Wl_Data *comp_wl;
Eina_List *l2;
struct wl_resource *resource;
/* retrieve named output; or create it if it doesn't exist */
- output = _e_comp_wl_output_get(e_comp_wl->outputs, id);
+ comp_wl = e_comp_wl_get();
+ output = _e_comp_wl_output_get(comp_wl->outputs, id);
if (!output)
{
if (!(output = E_NEW(E_Comp_Wl_Output, 1))) return EINA_FALSE;
else
output->model = eina_stringshare_add("unknown");
- e_comp_wl->outputs = eina_list_append(e_comp_wl->outputs, output);
+ comp_wl->outputs = eina_list_append(comp_wl->outputs, output);
output->global =
- wl_global_create(e_comp_wl->wl.disp, &wl_output_interface,
+ wl_global_create(comp_wl->wl.disp, &wl_output_interface,
2, output, _e_comp_wl_cb_output_bind);
output->resources = NULL;
e_comp_wl_output_remove(const char *id)
{
E_Comp_Wl_Output *output;
+ E_Comp_Wl_Data *comp_wl;
- output = _e_comp_wl_output_get(e_comp_wl->outputs, id);
+ comp_wl = e_comp_wl_get();
+ output = _e_comp_wl_output_get(comp_wl->outputs, id);
if (output)
{
- e_comp_wl->outputs = eina_list_remove(e_comp_wl->outputs, output);
+ comp_wl->outputs = eina_list_remove(comp_wl->outputs, output);
/* wl_global_destroy(output->global); */
struct wl_client *wc = NULL;
E_Comp_Config *comp_conf = NULL;
const char *device_name = NULL;
+ E_Comp_Wl_Data *comp_wl;
keycode = (ev->keycode - 8);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ serial = wl_display_next_serial(comp_wl->wl.disp);
comp_conf = e_comp_config_get();
EINTERN Eina_Bool
e_comp_wl_key_down(Ecore_Event_Key *ev, E_Device *dev)
{
+ E_Comp *comp;
E_Client *ec = NULL;
uint32_t keycode;
E_Comp_Wl_Key_Data *end, *k;
- if (ev->window != e_comp->ee_win)
+ if (ev->window != e_comp_ee_win_get())
{
return EINA_FALSE;
}
keycode = (ev->keycode - 8);
- if (!(e_comp_wl = e_comp->wl_comp_data))
- {
- return EINA_FALSE;
- }
+ if (!e_comp_wl_get()) return EINA_FALSE;
#ifndef E_RELEASE_BUILD
if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
}
}
- if ((!e_client_action_get()) && (!e_comp->input_key_grabs))
+ comp = e_comp_get();
+ if ((!e_client_action_get()) && (!comp->input_key_grabs))
{
ec = e_client_focused_get();
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
E_Client *ec = NULL;
uint32_t keycode, delivered_key;
E_Comp_Wl_Key_Data *end, *k;
+ E_Comp *comp;
- if (ev->window != e_comp->ee_win)
+ if (ev->window != e_comp_ee_win_get())
{
return EINA_FALSE;
}
keycode = (ev->keycode - 8);
delivered_key = 0;
- if (!(e_comp_wl = e_comp->wl_comp_data))
- {
- return EINA_FALSE;
- }
+ if (!(e_comp_wl_get())) return EINA_FALSE;
end = (E_Comp_Wl_Key_Data *)e_comp_input_key->kbd.keys.data + (e_comp_input_key->kbd.keys.size / sizeof(*k));
for (k = e_comp_input_key->kbd.keys.data; k < end; k++)
(const char *)end - (const char *)e_comp_input_key->kbd.keys.data;
/* If a key down event have been sent to clients, send a key up event to client for garantee key event sequence pair. (down/up) */
+ comp = e_comp_get();
if ((delivered_key) ||
- ((!e_client_action_get()) && (!e_comp->input_key_grabs)))
+ ((!e_client_action_get()) && (!comp->input_key_grabs)))
{
ec = e_client_focused_get();
}
EINTERN void
-e_comp_wl_surface_mouse_button_send(struct wl_resource *surface, uint32_t timestamp, uint32_t button_id, uint32_t state)
+e_comp_wl_surface_mouse_button_send(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, uint32_t timestamp, uint32_t button_id, uint32_t state)
{
Eina_List *l;
struct wl_client *wc;
default: btn = button_id; break;
}
- e_comp_wl->ptr.button = btn;
+ comp_wl = e_comp_wl_get();
+ comp_wl->ptr.button = btn;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_pointer_check(res)) continue;
}
EINTERN Eina_Bool
-e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state)
+e_comp_wl_evas_handle_mouse_button(E_Comp_Wl_Data *comp_wl, E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state)
{
if (ec->cur_mouse_action) return EINA_FALSE;
- if (e_comp_wl->drag)
+ if (comp_wl->drag)
{
ELOGF("Mouse", "Button %s ignored. dragging. (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), button_id, timestamp);
return EINA_FALSE;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return EINA_FALSE;
- if (!eina_list_count(e_comp_wl->ptr.resources))
+ if (!eina_list_count(comp_wl->ptr.resources))
return EINA_TRUE;
ELOGF("Mouse", "Button %s (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), button_id, timestamp);
- e_comp_wl_surface_mouse_button_send(surface, timestamp, button_id, state);
+ e_comp_wl_surface_mouse_button_send(comp_wl, surface, timestamp, button_id, state);
return EINA_TRUE;
}
E_API void
e_comp_wl_touch_cancel(void)
{
- _e_comp_wl_touch_cancel();
+ _e_comp_wl_touch_cancel(e_comp_wl_get());
}
///////////////////////////////////////////////////////////
E_API void
e_comp_wl_input_cursor_timer_enable_set(Eina_Bool enabled)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
e_config->use_cursor_timer = !!enabled;
if (e_config->use_cursor_timer)
{
- if (!e_pointer_is_hidden(e_comp->pointer))
+ if (!e_pointer_is_hidden(e_comp_pointer_get()))
{
- _e_comp_wl_cursor_move_timer_control(e_comp_wl->ptr.ec);
+ _e_comp_wl_cursor_move_timer_control(comp_wl, comp_wl->ptr.ec);
}
}
else
{
- if (e_comp_wl->ptr.hide_tmr)
+ if (comp_wl->ptr.hide_tmr)
{
- ecore_timer_del(e_comp_wl->ptr.hide_tmr);
- e_comp_wl->ptr.hide_tmr = NULL;
+ ecore_timer_del(comp_wl->ptr.hide_tmr);
+ comp_wl->ptr.hide_tmr = NULL;
}
cursor_timer_ec = NULL;
- if (e_comp_wl->ptr.ec && e_comp_wl->ptr.ec->has_cursor_unset)
+ if (comp_wl->ptr.ec && comp_wl->ptr.ec->has_cursor_unset)
return;
- if (e_pointer_is_hidden(e_comp->pointer))
+ if (e_pointer_is_hidden(e_comp_pointer_get()))
{
- _e_comp_wl_cursor_reload(e_comp_wl->ptr.ec);
+ _e_comp_wl_cursor_reload(comp_wl, comp_wl->ptr.ec);
}
}
}
enum wl_keyboard_key_state state;
E_Comp_Config *comp_conf = NULL;
const char *dev_name = NULL;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(wl_keycode <= 0, EINA_FALSE);
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (!time) time = e_util_timestamp_get();
if (pressed) state = WL_KEYBOARD_KEY_STATE_PRESSED;
else state = WL_KEYBOARD_KEY_STATE_RELEASED;
}
else
{
- _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+ _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
}
}
else
uint32_t serial, wl_keycode, cancel_keycode;
E_Comp_Config *comp_conf = NULL;
struct xkb_keymap *keymap = NULL;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
g_rec_mutex_lock(&e_comp_input_key->xkb.keymap_mutex);
keymap = e_comp_input_key->xkb.keymap;
EINA_SAFETY_ON_TRUE_RETURN_VAL(wl_keycode <= 0, EINA_FALSE);
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (!time) time = e_util_timestamp_get();
comp_conf = e_comp_config_get();
{
if (wl_resource_get_client(res) != wc) continue;
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Key", "Send Key Cancel (time: %d)", ec, time);
}
EINTERN E_Client*
-e_comp_wl_touch_frame_send_ec_get(void)
+e_comp_wl_touch_frame_send_ec_get(E_Comp_Wl_Data *comp_wl)
{
- return e_comp_wl->touch.frame_ec;
+ return comp_wl->touch.frame_ec;
}
EINTERN void
-e_comp_wl_touch_frame_send_ec_set(E_Client *ec)
+e_comp_wl_touch_frame_send_ec_set(E_Comp_Wl_Data *comp_wl, E_Client *ec)
{
- e_comp_wl->touch.frame_ec = ec;
+ comp_wl->touch.frame_ec = ec;
}
EINTERN Eina_Bool
struct wl_client *wc;
uint32_t serial;
E_Devicemgr_Input_Device *device = NULL;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
if (!time) time = e_util_timestamp_get();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev)
{
}
else if (device)
{
- _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_TOUCH, time);
+ _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_TOUCH, time);
_e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle);
}
x = x + ec->client.x;
y = y + ec->client.y;
- _e_comp_wl_send_touch(ec, idx, x, y, time, pressed);
+ _e_comp_wl_send_touch(comp_wl, ec, idx, x, y, time, pressed);
return EINA_TRUE;
}
E_Devicemgr_Input_Device *device;
uint32_t serial;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
if (!time) time = e_util_timestamp_get();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev)
{
}
else if (device)
{
- _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_TOUCH, time);
+ _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_TOUCH, time);
_e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle);
}
x = x + ec->client.x;
y = y + ec->client.y;
- _e_comp_wl_send_touch_move(ec, idx, x, y, time);
+ _e_comp_wl_send_touch_move(comp_wl, ec, idx, x, y, time);
return EINA_TRUE;
}
{
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl_get(), EINA_FALSE);
_e_comp_wl_send_touch_cancel(ec);
{
uint32_t serial;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
if (!time) time = e_util_timestamp_get();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
if (pressed)
- e_comp_wl_evas_handle_mouse_button(ec, time, buttons,
+ e_comp_wl_evas_handle_mouse_button(comp_wl, ec, time, buttons,
WL_POINTER_BUTTON_STATE_PRESSED);
else
- e_comp_wl_evas_handle_mouse_button(ec, time, buttons,
+ e_comp_wl_evas_handle_mouse_button(comp_wl, ec, time, buttons,
WL_POINTER_BUTTON_STATE_RELEASED);
return EINA_TRUE;
{
uint32_t serial;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
if (!time) time = e_util_timestamp_get();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
x = x + ec->client.x;
y = y + ec->client.y;
- _e_comp_wl_send_mouse_move(ec, x, y, time);
+ _e_comp_wl_send_mouse_move(comp_wl, ec, x, y, time);
return EINA_TRUE;
}
{
uint32_t serial;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
if (!time) time = e_util_timestamp_get();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
- if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec))
+ if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, comp_wl, ec))
return EINA_TRUE;
}
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
- _e_comp_wl_mouse_wheel_send(ec, direction, z, time);
+ _e_comp_wl_mouse_wheel_send(comp_wl, ec, direction, z, time);
if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed
{
if (_e_comp_wl_check_cursor_timer_needed(ec))
- _e_comp_wl_cursor_move_timer_control(ec);
+ _e_comp_wl_cursor_move_timer_control(comp_wl, ec);
}
return EINA_TRUE;
struct wl_client *wc;
struct wl_resource *res;
Eina_List *l;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE);
- if (!eina_list_count(e_comp_wl->ptr.resources)) return EINA_FALSE;
+ if (!eina_list_count(comp_wl->ptr.resources)) return EINA_FALSE;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
wl_pointer_send_enter(res, serial, surface,
wl_fixed_from_int(x),
wl_fixed_from_int(y));
ec->pointer_enter_sent = EINA_TRUE;
}
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_mousein_signal, ec);
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
return EINA_TRUE;
}
struct wl_client *wc;
struct wl_resource *res;
Eina_List *l;
+ E_Comp_Wl_Data *comp_wl;
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE);
- if (!eina_list_count(e_comp_wl->ptr.resources)) return EINA_FALSE;
+ if (!eina_list_count(comp_wl->ptr.resources)) return EINA_FALSE;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+ else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
wl_pointer_send_leave(res, serial, surface);
ec->pointer_enter_sent = EINA_FALSE;
}
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_mouseout_signal, ec);
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_mouseout_signal, ec);
return EINA_TRUE;
}
struct wl_client *wc;
Eina_List *l;
uint32_t serial;
+ E_Comp_Wl_Data *comp_wl;
- e_pointer_view_set(e_comp->pointer, NULL, 0, 0);
+ e_pointer_view_set(e_comp_pointer_get(), NULL, 0, 0);
- if (e_comp_wl->ptr.hide_tmr)
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->ptr.hide_tmr)
{
- ecore_timer_del(e_comp_wl->ptr.hide_tmr);
- e_comp_wl->ptr.hide_tmr = NULL;
+ ecore_timer_del(comp_wl->ptr.hide_tmr);
+ comp_wl->ptr.hide_tmr = NULL;
}
cursor_timer_ec = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
{
Eina_List *l;
E_Comp_Wl_Output *output;
+ E_Comp_Wl_Data *comp_wl;
if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return NULL;
- EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->outputs, l, output)
{
if (output->transform % 2)
{
EINTERN Eina_Array *
e_comp_wl_output_find_all(E_Client *ec)
{
+ E_Comp_Wl_Data* comp_wl;
E_Comp_Wl_Output *output;
Eina_Array *outputs;
Eina_List *l;
if (!outputs)
return NULL;
- EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->outputs, l, output)
{
if (E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
output->x, output->y, output->w, output->h))
EINTERN Eina_Bool
e_comp_wl_move_resize_init(void)
{
- if (!e_comp_wl) return EINA_FALSE;
- if (!e_comp_wl->wl.disp) return EINA_FALSE;
+ E_Comp_Wl_Data *comp_wl;
+
+ if (!(comp_wl = e_comp_wl_get())) return EINA_FALSE;
+ if (!comp_wl->wl.disp) return EINA_FALSE;
- if (!wl_global_create(e_comp_wl->wl.disp,
+ if (!wl_global_create(comp_wl->wl.disp,
&tizen_move_resize_interface,
1,
NULL,
EINTERN Eina_Bool
e_comp_wl_pid_output_configured_resolution_send(pid_t pid, int w, int h)
{
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Output *output;
pid_t output_pid = 0;
Eina_List *l = NULL, *l2 = NULL;
EINA_SAFETY_ON_TRUE_RETURN_VAL(w < 0, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(h < 0, EINA_FALSE);
- EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->outputs, l, output)
{
/* if we have bound resources, send updates */
EINA_LIST_FOREACH(output->resources, l2, resource)
E_API struct wl_display *
e_comp_wl_display_get(void)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, NULL);
+ E_Comp_Wl_Data *comp_wl;
+
+ if (!(comp_wl = e_comp_wl_get())) return NULL;
- return e_comp_wl->wl.disp;
+ return comp_wl->wl.disp;
}
E_API E_Client *
e_comp_wl_ptr_ec_get(void)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, NULL);
+ E_Comp_Wl_Data *comp_wl;
+
+ if (!(comp_wl = e_comp_wl_get())) return NULL;
- return e_comp_wl->ptr.ec;
+ return comp_wl->ptr.ec;
}
{
E_Capture_Client *ecc;
Capture_Data *capture_data;
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Buffer *buffer = NULL;
struct wl_shm_buffer *shm_buffer;
case E_COMP_WL_BUFFER_TYPE_NATIVE:
case E_COMP_WL_BUFFER_TYPE_VIDEO:
- tbm_surface = wayland_tbm_server_get_surface(e_comp_wl->tbm.server, buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tbm_surface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
if (!tbm_surface) goto end;
capture_data->tbm_surface = e_comp_wl_tbm_capturable_buffer_get(tbm_surface);
Eina_Bool skip_child)
{
E_Client *ec;
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Buffer *buffer = NULL;
Thread_Data *td;
struct wl_shm_buffer *shm_buffer;
break;
case E_COMP_WL_BUFFER_TYPE_NATIVE:
case E_COMP_WL_BUFFER_TYPE_VIDEO:
- tbm_surface = wayland_tbm_server_get_surface(e_comp_wl->tbm.server, buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tbm_surface = wayland_tbm_server_get_surface(comp_wl->tbm.server, buffer->resource);
if (!tbm_surface) goto end;
if (!_e_capture_client_tbm_surface_valid_check(tbm_surface)) goto end;
_e_comp_wl_data_offer_cb_accept(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t serial, const char *mime_type)
{
E_Comp_Wl_Data_Offer *offer;
+ E_Comp_Wl_Data *comp_wl;
DBG("Data Offer Accept");
if (!(offer = wl_resource_get_user_data(resource)))
return;
- if (offer->source && e_comp_wl->drag_offer == offer)
+ comp_wl = e_comp_wl_get();
+ if (offer->source && comp_wl->drag_offer == offer)
{
offer->source->target(offer->source, serial, mime_type);
offer->source->accepted = !!mime_type;
_e_comp_wl_data_source_notify_finish(E_Comp_Wl_Data_Source *source)
{
E_Comp_Wl_Data_Offer *drag_offer;
+ E_Comp_Wl_Data *comp_wl;
if (!source->actions_set)
return;
- drag_offer = e_comp_wl->drag_offer;
+ comp_wl = e_comp_wl_get();
+ drag_offer = comp_wl->drag_offer;
if (drag_offer && drag_offer->in_ask &&
wl_resource_get_version(source->resource) >= WL_DATA_SOURCE_ACTION_SINCE_VERSION)
wl_data_source_send_dnd_finished(source->resource);
}
- e_comp_wl->drag_offer = NULL;
+ comp_wl->drag_offer = NULL;
}
static uint32_t
_e_comp_wl_data_offer_cb_resource_destroy(struct wl_resource *resource)
{
E_Comp_Wl_Data_Offer *offer;
+ E_Comp_Wl_Data *comp_wl;
if (!(offer = wl_resource_get_user_data(resource)))
return;
if (offer->drag_enter)
wl_list_remove(&offer->ec_destroy_listener.link);
+ comp_wl = e_comp_wl_get();
if (offer->source)
{
wl_list_remove(&offer->source_destroy_listener.link);
if (wl_resource_get_version(offer->resource) < WL_DATA_OFFER_ACTION_SINCE_VERSION)
_e_comp_wl_data_source_notify_finish(offer->source);
- else if (offer->dropped && offer->source != e_comp_wl->drag_source)
+ else if (offer->dropped && offer->source != comp_wl->drag_source)
_e_comp_wl_data_source_cancelled_send(offer->source);
}
- if (offer == e_comp_wl->drag_offer)
- e_comp_wl->drag_offer = NULL;
+ if (offer == comp_wl->drag_offer)
+ comp_wl->drag_offer = NULL;
if ((offer->th != NULL) && !ecore_thread_check(offer->th))
{
_e_comp_wl_data_source_cb_resource_destroy(struct wl_resource *resource)
{
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
if (!(source = wl_resource_get_user_data(resource)))
return;
wl_signal_emit(&source->destroy_signal, source);
- if (e_comp_wl->drag_source == source)
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->drag_source == source)
{
- e_comp_wl->drag_source = NULL;
+ comp_wl->drag_source = NULL;
e_comp_override_del();
- e_drag_end(e_comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED);
+ e_drag_end(comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED);
}
_mime_types_free(source);
E_Comp_Wl_Data_Source *source;
struct wl_resource *data_device_res = NULL, *focus = NULL;
struct wl_client *source_client, *cbhm_client = NULL;
+ E_Comp_Wl_Data *comp_wl;
DBG("Data Device Destroy Selection Source");
if (!(source = (E_Comp_Wl_Data_Source*)data))
return;
- e_comp_wl->selection.data_source = NULL;
+ comp_wl = e_comp_wl_get();
+ comp_wl->selection.data_source = NULL;
source_client = wl_resource_get_client(source->resource);
- if (e_comp_wl->selection.cbhm)
- cbhm_client = wl_resource_get_client(e_comp_wl->selection.cbhm);
+ if (comp_wl->selection.cbhm)
+ cbhm_client = wl_resource_get_client(comp_wl->selection.cbhm);
if ((cbhm_client) && (source_client != cbhm_client))
{
data_device_res =
- e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.cbhm));
+ e_comp_wl_data_find_for_client(wl_resource_get_client(comp_wl->selection.cbhm));
if (data_device_res)
wl_data_device_send_selection(data_device_res, NULL);
wl_data_device_send_selection(data_device_res, NULL);
}
- if (e_comp_wl->selection.data_only_list)
+ if (comp_wl->selection.data_only_list)
{
struct wl_resource *data_only;
Eina_List *l;
- EINA_LIST_FOREACH(e_comp_wl->selection.data_only_list, l, data_only)
+ EINA_LIST_FOREACH(comp_wl->selection.data_only_list, l, data_only)
wl_data_device_send_selection(data_only, NULL);
}
- wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
+ wl_signal_emit(&comp_wl->selection.signal, comp_wl);
}
static struct wl_resource*
}
static Eina_Bool
-_e_comp_wl_data_secondary_res_check(struct wl_resource *resource)
+_e_comp_wl_data_secondary_res_check(E_Comp_Wl_Data *comp_wl, struct wl_resource *resource)
{
struct wl_resource *surface;
E_Client *ec;
if (resource == NULL)
return EINA_FALSE;
- if (e_comp_wl->selection.secondary_list == NULL)
+ if (comp_wl->selection.secondary_list == NULL)
return EINA_FALSE;
- EINA_LIST_FOREACH(e_comp_wl->selection.secondary_list, l, ec)
+ EINA_LIST_FOREACH(comp_wl->selection.secondary_list, l, ec)
{
surface = e_comp_wl_client_surface_get(ec);
if (!surface) continue;
}
static void
-_e_comp_wl_data_secondary_send(E_Comp_Wl_Data_Source *source)
+_e_comp_wl_data_secondary_send(E_Comp_Wl_Data *comp_wl, E_Comp_Wl_Data_Source *source)
{
struct wl_client *secondary_client;
struct wl_resource *surface, *offer_res, *data_device_res;
E_Client *ec;
Eina_List *l;
- EINA_LIST_FOREACH(e_comp_wl->selection.secondary_list, l, ec)
+ EINA_LIST_FOREACH(comp_wl->selection.secondary_list, l, ec)
{
surface = e_comp_wl_client_surface_get(ec);
if (!surface) continue;
- if ((e_comp_wl->selection.secondary_sent != NULL) &&
- (wl_resource_get_client(surface) == wl_resource_get_client(e_comp_wl->selection.secondary_sent)))
+ if ((comp_wl->selection.secondary_sent != NULL) &&
+ (wl_resource_get_client(surface) == wl_resource_get_client(comp_wl->selection.secondary_sent)))
continue;
secondary_client = wl_resource_get_client(surface);
wl_data_device_send_selection(data_device_res, NULL);
}
- e_comp_wl->selection.secondary_sent = NULL;
+ comp_wl->selection.secondary_sent = NULL;
}
static void
-_e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Source *source, uint32_t serial)
+_e_comp_wl_data_device_selection_set(E_Comp_Wl_Data *comp_wl, E_Comp_Wl_Data_Source *source, uint32_t serial)
{
E_Comp_Wl_Data_Source *sel_source;
struct wl_resource *offer_res, *data_device_res, *focus = NULL;
struct wl_client *source_client = NULL, *sel_client = NULL, *cbhm_client = NULL;
- sel_source = (E_Comp_Wl_Data_Source*)e_comp_wl->selection.data_source;
+ sel_source = (E_Comp_Wl_Data_Source*)comp_wl->selection.data_source;
if ((source) && (source->resource))
source_client = wl_resource_get_client(source->resource);
if ((sel_source) && (sel_source->resource))
sel_client = wl_resource_get_client(sel_source->resource);
- if (e_comp_wl->selection.cbhm)
- cbhm_client = wl_resource_get_client(e_comp_wl->selection.cbhm);
+ if (comp_wl->selection.cbhm)
+ cbhm_client = wl_resource_get_client(comp_wl->selection.cbhm);
if ((sel_source) &&
(sel_client == source_client) &&
(sel_client != cbhm_client) &&
- (e_comp_wl->selection.serial - serial < UINT32_MAX / 2))
+ (comp_wl->selection.serial - serial < UINT32_MAX / 2))
{
/* TODO: elm_entry is sending too many request on now,
* for those requests, selection.signal is being emitted also a lot.
* when it completes to optimize the entry, it should be checked more.
*/
- if (e_comp_wl->clipboard.source)
- wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
+ if (comp_wl->clipboard.source)
+ wl_signal_emit(&comp_wl->selection.signal, comp_wl);
return;
}
if (sel_source)
{
- if (!e_comp_wl->clipboard.xwl_owner)
- wl_list_remove(&e_comp_wl->selection.data_source_listener.link);
+ if (!comp_wl->clipboard.xwl_owner)
+ wl_list_remove(&comp_wl->selection.data_source_listener.link);
if (sel_source->cancelled)
sel_source->cancelled(sel_source);
- e_comp_wl->selection.data_source = NULL;
+ comp_wl->selection.data_source = NULL;
}
- e_comp_wl->selection.data_source = sel_source = source;
- e_comp_wl->clipboard.xwl_owner = NULL;
- e_comp_wl->selection.serial = serial;
+ comp_wl->selection.data_source = sel_source = source;
+ comp_wl->clipboard.xwl_owner = NULL;
+ comp_wl->selection.serial = serial;
if (e_comp_input_key->kbd.enabled)
focus = e_comp_input_key->kbd.focus;
offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res);
wl_data_device_send_selection(data_device_res, offer_res);
- if (_e_comp_wl_data_secondary_res_check(source->resource) == EINA_TRUE)
- e_comp_wl->selection.secondary_sent = source->resource;
+ if (_e_comp_wl_data_secondary_res_check(comp_wl, source->resource) == EINA_TRUE)
+ comp_wl->selection.secondary_sent = source->resource;
}
}
else
{
/* send wl_data_device@selection to secondary selection client */
- if (e_comp_wl->selection.secondary_list != NULL)
- _e_comp_wl_data_secondary_send(source);
+ if (comp_wl->selection.secondary_list != NULL)
+ _e_comp_wl_data_secondary_send(comp_wl, source);
/* send wl_data_device@selection to focused client */
if (focus)
/* send wl_data_device@selection to data only clients
* because they won't be focused at all
*/
- if (e_comp_wl->selection.data_only_list)
+ if (comp_wl->selection.data_only_list)
{
struct wl_resource *data_only;
Eina_List *l;
- EINA_LIST_FOREACH(e_comp_wl->selection.data_only_list, l, data_only)
+ EINA_LIST_FOREACH(comp_wl->selection.data_only_list, l, data_only)
{
if (source)
{
}
}
- wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
+ wl_signal_emit(&comp_wl->selection.signal, comp_wl);
if (source)
{
- e_comp_wl->selection.data_source_listener.notify =
+ comp_wl->selection.data_source_listener.notify =
_e_comp_wl_data_device_destroy_selection_data_source;
wl_signal_add(&source->destroy_signal,
- &e_comp_wl->selection.data_source_listener);
+ &comp_wl->selection.data_source_listener);
}
}
static void
_e_comp_wl_data_device_drag_finished(E_Drag *drag, E_Dnd_Drop_Type type)
{
- E_View *view = e_view_edje_part_swallow_get(drag->comp_edje, "e.swallow.content");
+ E_View *view;
+ E_Comp_Wl_Data *comp_wl;
+
+ view = e_view_edje_part_swallow_get(drag->comp_edje, "e.swallow.content");
if (eina_streq(evas_object_type_get(view->eo), "e_comp_object")) //TO DO : use view for type get
e_view_edje_part_unswallow(drag->comp_edje, view);
e_view_hide(view);
e_view_pass_events_set(view, 1);
- if (e_comp_wl->drag != drag) return;
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->drag != drag) return;
- e_comp_wl->drag = NULL;
+ comp_wl->drag = NULL;
- if (e_comp_wl->drag_client->visible)
+ if (comp_wl->drag_client->visible)
{
- e_comp_wl->drag_client->changes.visible = 1;
- e_comp_wl->drag_client->visible = 0;
- EC_CHANGED(e_comp_wl->drag_client);
+ comp_wl->drag_client->changes.visible = 1;
+ comp_wl->drag_client->visible = 0;
+ EC_CHANGED(comp_wl->drag_client);
}
- e_comp_wl->drag_client = NULL;
+ comp_wl->drag_client = NULL;
e_comp_override_del();
- if (e_comp_wl->selection.target)
+ if (comp_wl->selection.target)
{
struct wl_resource *res = NULL;
E_Comp_Wl_Data_Source *drag_source;
- struct wl_resource *surface = e_comp_wl_client_surface_get(e_comp_wl->selection.target);
+ struct wl_resource *surface = e_comp_wl_client_surface_get(comp_wl->selection.target);
if (surface)
res = e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
if (res)
{
- drag_source = e_comp_wl->drag_source;
+ drag_source = comp_wl->drag_source;
if (drag_source)
{
wl_data_device_send_drop(res);
if (wl_resource_get_version(drag_source->resource) >= WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION)
wl_data_source_send_dnd_drop_performed(drag_source->resource);
- ((E_Comp_Wl_Data_Offer*)e_comp_wl->drag_offer)->in_ask = drag_source->current_dnd_action ==
+ ((E_Comp_Wl_Data_Offer*)comp_wl->drag_offer)->in_ask = drag_source->current_dnd_action ==
WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK;
}
else if(wl_resource_get_version(drag_source->resource) >= WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION)
}
wl_data_device_send_leave(res);
}
- e_comp_wl->selection.target = NULL;
- e_comp_wl->drag_source = NULL;
+ comp_wl->selection.target = NULL;
+ comp_wl->drag_source = NULL;
- if (e_comp_wl->drag_offer)
- ((E_Comp_Wl_Data_Offer*)e_comp_wl->drag_offer)->dropped = EINA_TRUE;
+ if (comp_wl->drag_offer)
+ ((E_Comp_Wl_Data_Offer*)comp_wl->drag_offer)->dropped = EINA_TRUE;
}
e_comp_wl_data_current_device_id_set(-1);
static void
_e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, struct wl_resource *source_resource, struct wl_resource *origin_resource, struct wl_resource *icon_resource, uint32_t serial)
{
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Data_Source *source;
Eina_List *l;
struct wl_resource *res;
DBG("Data Device Drag Start");
- if (e_comp_wl->drag)
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->drag)
{
ERR("Drag already in progress");
return;
if (!(source = wl_resource_get_user_data(source_resource)))
return;
- e_comp_wl->drag_source = source;
+ comp_wl->drag_source = source;
if (icon_resource)
{
EC_CHANGED(drag_icon_ec);
e_comp_override_add();
}
- e_comp_wl->drag_client = drag_icon_ec;
+ comp_wl->drag_client = drag_icon_ec;
}
ec = e_client_from_surface_resource(origin_resource);
if (ec && ec->pointer_enter_sent)
{
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != client) continue;
ec->pointer_enter_sent = EINA_FALSE;
}
- evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
- e_comp_wl->drag = e_drag_new(x, y, _e_comp_wl_data_device_drag_finished);
- e_comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
+ evas_pointer_canvas_xy_get(e_comp_evas_get(), &x, &y);
+ comp_wl->drag = e_drag_new(x, y, _e_comp_wl_data_device_drag_finished);
+ comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp_evas_get());
if (drag_icon_ec)
{
- e_drag_view_set(e_comp_wl->drag, e_view_client_view_get(e_client_view_get(drag_icon_ec)));
- e_drag_reference_point_set(e_comp_wl->drag, drag_icon_ec->x, drag_icon_ec->y);
- e_drag_resize(e_comp_wl->drag, drag_icon_ec->w, drag_icon_ec->h);
+ e_drag_view_set(comp_wl->drag, e_view_client_view_get(e_client_view_get(drag_icon_ec)));
+ e_drag_reference_point_set(comp_wl->drag, drag_icon_ec->x, drag_icon_ec->y);
+ e_drag_resize(comp_wl->drag, drag_icon_ec->w, drag_icon_ec->h);
}
- e_drag_start(e_comp_wl->drag, x, y);
+ e_drag_start(comp_wl->drag, x, y);
desk = e_desk_current_get(e_comp_zone_find_by_ec(ec));
ec_under_pointer = e_client_under_position_input_get(desk, x, y);
_e_comp_wl_data_device_cb_selection_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, struct wl_resource *source_resource, uint32_t serial)
{
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
DBG("Data Device Selection Set");
if (!source_resource) return;
if (!(source = wl_resource_get_user_data(source_resource))) return;
- _e_comp_wl_data_device_selection_set(e_comp->wl_comp_data, source, serial);
+ _e_comp_wl_data_device_selection_set(comp_wl, source, serial);
}
static void
_e_comp_wl_data_device_cb_unbind(struct wl_resource *resource)
{
struct wl_client *wc = wl_resource_get_client(resource);
- e_comp_wl->selection.data_only_list =
- eina_list_remove(e_comp_wl->selection.data_only_list,
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ comp_wl->selection.data_only_list =
+ eina_list_remove(comp_wl->selection.data_only_list,
resource);
- eina_hash_del_by_key(e_comp_wl->mgr.data_resources, &wc);
+ eina_hash_del_by_key(comp_wl->mgr.data_resources, &wc);
}
static void
_e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resource *manager_resource, uint32_t id, struct wl_resource *seat_resource EINA_UNUSED)
{
struct wl_resource *res;
-
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
DBG("Data Manager Device Get");
return;
}
- eina_hash_add(e_comp_wl->mgr.data_resources, &client, res);
- wl_resource_set_implementation(res, &_e_data_device_interface, e_comp->wl_comp_data,
+ eina_hash_add(comp_wl->mgr.data_resources, &client, res);
+ wl_resource_set_implementation(res, &_e_data_device_interface, comp_wl,
_e_comp_wl_data_device_cb_unbind);
}
_e_comp_wl_data_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED, uint32_t version EINA_UNUSED, uint32_t id)
{
struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* try to create data manager resource */
- e_comp_wl->mgr.resource = res = wl_resource_create(client, &wl_data_device_manager_interface, 3, id);
+ comp_wl->mgr.resource = res = wl_resource_create(client, &wl_data_device_manager_interface, 3, id);
if (!res)
{
ERR("Could not create data device manager: %m");
return;
}
- wl_resource_set_implementation(res, &_e_manager_interface,
- e_comp->wl_comp_data, NULL);
+ wl_resource_set_implementation(res, &_e_manager_interface, comp_wl, NULL);
}
static Eina_Bool
ecore_main_fd_handler_del(handler);
if (!e_comp_wl_clipboard_source_unref(offer->source))
{
- if (e_comp_wl->clipboard.source == offer->source)
- e_comp_wl->clipboard.source = NULL;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (comp_wl->clipboard.source == offer->source)
+ comp_wl->clipboard.source = NULL;
}
free(offer);
}
E_Comp_Wl_Clipboard_Source *source;
char *p;
int len, size;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
-
- if (!(source = (E_Comp_Wl_Clipboard_Source*)e_comp_wl->clipboard.source))
+ if (!(source = (E_Comp_Wl_Clipboard_Source*)comp_wl->clipboard.source))
return ECORE_CALLBACK_CANCEL;
/* allocate contents of array */
{
ERR("Could not read fd(%d): %m", source->fd[0]);
if (!(e_comp_wl_clipboard_source_unref(source)))
- e_comp_wl->clipboard.source = NULL;
+ comp_wl->clipboard.source = NULL;
}
return ECORE_CALLBACK_RENEW;
E_Comp_Wl_Clipboard_Source *clip_source;
int p[2];
char *mime_type;
+ E_Comp_Wl_Data *comp_wl;
- sel_source = (E_Comp_Wl_Data_Source*) e_comp_wl->selection.data_source;
- clip_source = (E_Comp_Wl_Clipboard_Source*) e_comp_wl->clipboard.source;
+ comp_wl = e_comp_wl_get();
+ sel_source = (E_Comp_Wl_Data_Source*) comp_wl->selection.data_source;
+ clip_source = (E_Comp_Wl_Clipboard_Source*) comp_wl->clipboard.source;
if (!sel_source)
{
if (clip_source)
- _e_comp_wl_data_device_selection_set(e_comp->wl_comp_data,
+ _e_comp_wl_data_device_selection_set(comp_wl,
&clip_source->data_source,
clip_source->serial);
return;
sel_source->send(sel_source, mime_type, p[1]);
- e_comp_wl->clipboard.source =
+ comp_wl->clipboard.source =
e_comp_wl_clipboard_source_create(mime_type,
- e_comp_wl->selection.serial, p);
- if (!e_comp_wl->clipboard.source)
+ comp_wl->selection.serial, p);
+ if (!comp_wl->clipboard.source)
{
close(p[0]);
close(p[1]);
}
static void
-_e_comp_wl_clipboard_create(void)
+_e_comp_wl_clipboard_create(E_Comp_Wl_Data *comp_wl)
{
- e_comp_wl->clipboard.listener.notify = _e_comp_wl_clipboard_selection_set;
- wl_signal_add(&e_comp_wl->selection.signal, &e_comp_wl->clipboard.listener);
+ comp_wl->clipboard.listener.notify = _e_comp_wl_clipboard_selection_set;
+ wl_signal_add(&comp_wl->selection.signal, &comp_wl->clipboard.listener);
}
static void
_e_comp_wl_data_device_target_del(struct wl_listener *listener, void *data)
{
E_Client *ec = data;
+ E_Comp_Wl_Data *comp_wl;
- if (e_comp_wl->selection.target == ec)
- e_comp_wl->selection.target = NULL;
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->selection.target == ec)
+ comp_wl->selection.target = NULL;
}
EINTERN void
int x, y;
E_Comp_Config *comp_conf;
E_Comp_Wl_Data_Offer *offer;
+ E_Comp_Wl_Data *comp_wl;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
if (!data_device_res) return;
offer_res = e_comp_wl_data_device_send_offer(ec);
- if (e_comp_wl->drag_source)
+
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->drag_source)
{
- E_Comp_Wl_Data_Source *drag_source = e_comp_wl->drag_source;
+ E_Comp_Wl_Data_Source *drag_source = comp_wl->drag_source;
E_Comp_Wl_Data_Offer *new_offer;
- E_Comp_Wl_Data_Offer *old_offer = e_comp_wl->drag_offer;
+ E_Comp_Wl_Data_Offer *old_offer = comp_wl->drag_offer;
if (!offer_res) return;
drag_source->accepted = EINA_FALSE;
new_offer = wl_resource_get_user_data(offer_res);
- e_comp_wl->drag_offer = new_offer;
+ comp_wl->drag_offer = new_offer;
if (new_offer)
{
_e_comp_wl_data_offer_update_action(new_offer);
}
}
- e_comp_wl->selection.target = ec;
+ comp_wl->selection.target = ec;
offer = wl_resource_get_user_data(offer_res);
offer->ec_destroy_listener.notify = _e_comp_wl_data_device_target_del;
e_view_event_listener_add(e_view_client_view_get(e_client_view_get(ec)), E_VIEW_DESTROY, &offer->ec_destroy_listener);
if (e_client_transform_core_enable_get(ec))
{
int trans_x, trans_y;
- e_client_transform_core_input_transform(ec, wl_fixed_to_int(e_comp_wl->ptr.x), wl_fixed_to_int(e_comp_wl->ptr.y), &trans_x, &trans_y);
+ e_client_transform_core_input_transform(ec, wl_fixed_to_int(comp_wl->ptr.x), wl_fixed_to_int(comp_wl->ptr.y), &trans_x, &trans_y);
x = trans_x - ec->client.x;
y = trans_y - ec->client.y;
}
{
int ec_x, ec_y;
e_client_geometry_get(ec, &ec_x, &ec_y, NULL, NULL);
- x = wl_fixed_to_int(e_comp_wl->ptr.x) - ec_x;
- y = wl_fixed_to_int(e_comp_wl->ptr.y) - ec_y;
+ x = wl_fixed_to_int(comp_wl->ptr.x) - ec_x;
+ y = wl_fixed_to_int(comp_wl->ptr.y) - ec_y;
}
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
ELOGF("DnD", "Data device send enter to ec(%p): %s, ptr:%d,%d", ec, ec, e_client_icccm_name_get(ec), wl_fixed_from_int(x), wl_fixed_from_int(y));
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wl_data_device_send_enter(data_device_res, serial, surface,
wl_fixed_from_int(x), wl_fixed_from_int(y), offer_res);
}
{
E_Comp_Config *comp_conf;
struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl;
- if (e_comp_wl->selection.target == ec)
- e_comp_wl->selection.target = NULL;
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->selection.target == ec)
+ comp_wl->selection.target = NULL;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
{
struct wl_resource *data_device_res, *offer_res = NULL;
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return NULL;
data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
if (!data_device_res) return NULL;
- source = e_comp_wl->drag_source;
+
+ comp_wl = e_comp_wl_get();
+ source = comp_wl->drag_source;
if (source)
offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res);
return offer_res;
{
struct wl_resource *data_device_res, *offer_res = NULL, *focus;
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
if (!e_comp_input_key->kbd.enabled)
{
ERR("No focused resource");
return;
}
- source = (E_Comp_Wl_Data_Source*)e_comp_wl->selection.data_source;
+
+ comp_wl = e_comp_wl_get();
+ source = (E_Comp_Wl_Data_Source*)comp_wl->selection.data_source;
data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(focus));
if (!data_device_res) return;
/* to remove from data_only_list if it is on the list */
- e_comp_wl->selection.data_only_list =
- eina_list_remove(e_comp_wl->selection.data_only_list,
+ comp_wl->selection.data_only_list =
+ eina_list_remove(comp_wl->selection.data_only_list,
data_device_res);
if (source && !source->is_manual)
EINTERN Eina_Bool
e_comp_wl_data_manager_init(void)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* try to create global data manager */
- e_comp_wl->mgr.global =
- wl_global_create(e_comp_wl->wl.disp, &wl_data_device_manager_interface, 3,
- e_comp->wl_comp_data, _e_comp_wl_data_cb_bind_manager);
- if (!e_comp_wl->mgr.global)
+ comp_wl->mgr.global =
+ wl_global_create(comp_wl->wl.disp, &wl_data_device_manager_interface, 3,
+ comp_wl, _e_comp_wl_data_cb_bind_manager);
+ if (!comp_wl->mgr.global)
{
ERR("Could not create global for data device manager: %m");
return EINA_FALSE;
}
- wl_signal_init(&e_comp_wl->selection.signal);
+ wl_signal_init(&comp_wl->selection.signal);
/* create clipboard */
- _e_comp_wl_clipboard_create();
- e_comp_wl->mgr.data_resources = eina_hash_pointer_new(NULL);
+ _e_comp_wl_clipboard_create(comp_wl);
+ comp_wl->mgr.data_resources = eina_hash_pointer_new(NULL);
return EINA_TRUE;
}
EINTERN void
e_comp_wl_data_manager_shutdown(void)
{
+ E_Comp_Wl_Data *comp_wl;
+
/* destroy the global manager resource */
/* if (e_comp_wl->mgr.global) wl_global_destroy(e_comp_wl->mgr.global); */
- wl_list_remove(&e_comp_wl->clipboard.listener.link);
- E_FREE_FUNC(e_comp_wl->mgr.data_resources, eina_hash_free);
+ comp_wl = e_comp_wl_get();
+ wl_list_remove(&comp_wl->clipboard.listener.link);
+ E_FREE_FUNC(comp_wl->mgr.data_resources, eina_hash_free);
}
EINTERN struct wl_resource *
e_comp_wl_data_find_for_client(struct wl_client *client)
{
- return eina_hash_find(e_comp_wl->mgr.data_resources, &client);
+ E_Comp_Wl_Data *comp_wl;
+
+ comp_wl = e_comp_wl_get();
+ return eina_hash_find(comp_wl->mgr.data_resources, &client);
}
EINTERN E_Comp_Wl_Data_Source *
source->fd_handler =
ecore_main_fd_handler_add(fd[0], ECORE_FD_READ,
_e_comp_wl_clipboard_source_save,
- e_comp->wl_comp_data, NULL, NULL);
+ e_comp_wl_get(), NULL, NULL);
if (!source->fd_handler)
{
E_FREE(source);
{
struct wl_resource *offer_res = NULL, *focus;
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN(data_device_res);
+ comp_wl = e_comp_wl_get();
if (set)
{
- if (eina_list_data_find(e_comp_wl->selection.data_only_list, data_device_res))
+ if (eina_list_data_find(comp_wl->selection.data_only_list, data_device_res))
return;
- e_comp_wl->selection.data_only_list =
- eina_list_append(e_comp_wl->selection.data_only_list, data_device_res);
+ comp_wl->selection.data_only_list =
+ eina_list_append(comp_wl->selection.data_only_list, data_device_res);
- source = (E_Comp_Wl_Data_Source *)e_comp_wl->selection.data_source;
+ source = (E_Comp_Wl_Data_Source *)comp_wl->selection.data_source;
if (source && !source->is_manual)
{
offer_res =
}
else
{
- e_comp_wl->selection.data_only_list =
- eina_list_remove(e_comp_wl->selection.data_only_list, data_device_res);
+ comp_wl->selection.data_only_list =
+ eina_list_remove(comp_wl->selection.data_only_list, data_device_res);
focus = e_comp_input_key->kbd.focus;
if ((!focus) ||
{
struct wl_resource *data_device_res = NULL;
struct wl_client *cbhm_client = NULL;
+ E_Comp_Wl_Data *comp_wl;
- e_comp_wl->selection.data_source = NULL;
+ comp_wl = e_comp_wl_get();
+ comp_wl->selection.data_source = NULL;
- if (e_comp_wl->selection.cbhm)
- cbhm_client = wl_resource_get_client(e_comp_wl->selection.cbhm);
+ if (comp_wl->selection.cbhm)
+ cbhm_client = wl_resource_get_client(comp_wl->selection.cbhm);
if (cbhm_client)
{
E_Comp_Wl_Data_Source *sel_source;
struct wl_resource *offer_res, *data_device_res;
struct wl_client *cbhm_client = NULL;
+ E_Comp_Wl_Data *comp_wl;
- sel_source = (E_Comp_Wl_Data_Source*)e_comp_wl->selection.data_source;
+ comp_wl = e_comp_wl_get();
+ sel_source = (E_Comp_Wl_Data_Source*)comp_wl->selection.data_source;
- if (e_comp_wl->selection.cbhm)
- cbhm_client = wl_resource_get_client(e_comp_wl->selection.cbhm);
+ if (comp_wl->selection.cbhm)
+ cbhm_client = wl_resource_get_client(comp_wl->selection.cbhm);
if (sel_source)
{
- if (!e_comp_wl->clipboard.xwl_owner)
- wl_list_remove(&e_comp_wl->selection.data_source_listener.link);
+ if (!comp_wl->clipboard.xwl_owner)
+ wl_list_remove(&comp_wl->selection.data_source_listener.link);
if (sel_source->cancelled)
sel_source->cancelled(sel_source);
- e_comp_wl->selection.data_source = NULL;
+ comp_wl->selection.data_source = NULL;
}
- e_comp_wl->selection.data_source = sel_source = source;
- e_comp_wl->clipboard.xwl_owner = NULL;
- e_comp_wl->selection.serial = serial;
+ comp_wl->selection.data_source = sel_source = source;
+ comp_wl->clipboard.xwl_owner = NULL;
+ comp_wl->selection.serial = serial;
if (cbhm_client)
{
}
//do not notify to internal clipboard
- //wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
+ //wl_signal_emit(&e_comp_wl->selection.signal, e_comp_wl);
if (source)
{
- e_comp_wl->selection.data_source_listener.notify =
+ comp_wl->selection.data_source_listener.notify =
_e_comp_wl_data_device_destroy_manual_source;
wl_signal_add(&source->destroy_signal,
- &e_comp_wl->selection.data_source_listener);
+ &comp_wl->selection.data_source_listener);
}
}
e_comp_wl_data_device_manual_selection_set(void *data, size_t size, Eina_List *mime_list)
{
E_Comp_Wl_Manual_Data_Source *man_source;
+ E_Comp_Wl_Data *comp_wl;
Eina_List *l;
const char *t;
wl_array_init(&man_source->contents);
wl_signal_init(&man_source->data_source.destroy_signal);
- man_source->serial = e_comp_wl->selection.serial;
+ comp_wl = e_comp_wl_get();
+ man_source->serial = comp_wl->selection.serial;
if (!man_source->data_source.mime_types)
man_source->data_source.mime_types = eina_array_new(64);
EINTERN void
e_comp_wl_data_current_device_id_set(int id)
{
- e_comp_wl->drag_device_id = id;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ comp_wl->drag_device_id = id;
}
EINTERN int
e_comp_wl_data_current_device_id_get(void)
{
- return e_comp_wl->drag_device_id;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ return comp_wl->drag_device_id;
}
EINTERN void
}
static Eina_Bool
-_e_comp_wl_data_secondary_list_check(E_Client *ec)
+_e_comp_wl_data_secondary_list_check(E_Comp_Wl_Data *comp_wl, E_Client *ec)
{
E_Client *tmp;
Eina_List *l;
- if (e_comp_wl->selection.secondary_list == NULL)
+ if (comp_wl->selection.secondary_list == NULL)
return EINA_FALSE;
- EINA_LIST_FOREACH(e_comp_wl->selection.secondary_list, l, tmp)
+ EINA_LIST_FOREACH(comp_wl->selection.secondary_list, l, tmp)
{
if (tmp == ec)
return EINA_TRUE;
EINTERN void
e_comp_wl_data_secondary_add(E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN(ec);
- if (_e_comp_wl_data_secondary_list_check(ec) == EINA_TRUE)
+ comp_wl = e_comp_wl_get();
+ if (_e_comp_wl_data_secondary_list_check(comp_wl, ec) == EINA_TRUE)
return;
- e_comp_wl->selection.secondary_list = eina_list_append(e_comp_wl->selection.secondary_list, ec);
+ comp_wl->selection.secondary_list = eina_list_append(comp_wl->selection.secondary_list, ec);
DBG("add secondary %s(%p). listcount(%d)",
- e_client_util_name_get(ec), ec, eina_list_count(e_comp_wl->selection.secondary_list));
+ e_client_util_name_get(ec), ec, eina_list_count(comp_wl->selection.secondary_list));
}
EINTERN void
e_comp_wl_data_secondary_remove(E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
+
EINA_SAFETY_ON_NULL_RETURN(ec);
- if (_e_comp_wl_data_secondary_list_check(ec) == EINA_FALSE)
+ comp_wl = e_comp_wl_get();
+ if (_e_comp_wl_data_secondary_list_check(comp_wl, ec) == EINA_FALSE)
return;
- e_comp_wl->selection.secondary_list = eina_list_remove(e_comp_wl->selection.secondary_list, ec);
+ comp_wl->selection.secondary_list = eina_list_remove(comp_wl->selection.secondary_list, ec);
DBG("remove secondary %s(%p). listcount(%d)",
- e_client_util_name_get(ec), ec, eina_list_count(e_comp_wl->selection.secondary_list));
+ e_client_util_name_get(ec), ec, eina_list_count(comp_wl->selection.secondary_list));
- if (eina_list_count(e_comp_wl->selection.secondary_list) == 0)
+ if (eina_list_count(comp_wl->selection.secondary_list) == 0)
{
- eina_list_free(e_comp_wl->selection.secondary_list);
- e_comp_wl->selection.secondary_list = NULL;
- e_comp_wl->selection.secondary_sent = NULL;
+ eina_list_free(comp_wl->selection.secondary_list);
+ comp_wl->selection.secondary_list = NULL;
+ comp_wl->selection.secondary_sent = NULL;
}
}
wl_fixed_t fy);
static void
-_e_comp_wl_input_update_seat_caps(struct wl_client *wc)
+_e_comp_wl_input_update_seat_caps(E_Comp_Wl_Data *comp_wl, struct wl_client *wc)
{
Eina_List *l;
struct wl_resource *res;
enum wl_seat_capability caps = 0;
- if (e_comp_wl->ptr.enabled)
+ if (comp_wl->ptr.enabled)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (e_comp_input_key->kbd.enabled)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
- if (e_comp_wl->touch.enabled)
+ if (comp_wl->touch.enabled)
caps |= WL_SEAT_CAPABILITY_TOUCH;
- EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, res)
+ EINA_LIST_FOREACH(comp_wl->seat.resources, l, res)
{
/* if a wc is null, send seat capability to all wl_seat resources */
if (wc && (wl_resource_get_client(res) != wc)) continue;
E_Client *ec;
E_Pointer *ptr;
struct wl_client *wc;
+ E_Comp_Wl_Data *comp_wl;
if (!(ec = e_client_from_surface_resource(resource))) return;
if (e_object_is_del(E_OBJECT(ec))) return;
//if cursor ec have external content
e_comp_object_content_unset(ec->frame);
- if (!e_comp_wl->ptr.ec || !e_comp_wl->ptr.ec->comp_data) return;
- struct wl_resource *surface = e_comp_wl_client_surface_get(e_comp_wl->ptr.ec);
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->ptr.ec || !comp_wl->ptr.ec->comp_data) return;
+ struct wl_resource *surface = e_comp_wl_client_surface_get(comp_wl->ptr.ec);
if (!surface) return;
wc = wl_resource_get_client(resource);
if (wc != wl_resource_get_client(surface)) return;
- if (!e_comp_wl->ptr.ec->pointer_enter_sent) return;
+ if (!comp_wl->ptr.ec->pointer_enter_sent) return;
- if ((ptr = e_comp->pointer))
+ if ((ptr = e_comp_pointer_get()))
e_pointer_view_set(ptr, e_client_view_get(ec), ptr->hot.x, ptr->hot.y);
}
E_Client *ec;
Eina_Bool got_mouse = EINA_FALSE;
struct wl_resource *surface;
+ E_Pointer *comp_pointer = e_comp_pointer_get();
E_Input_Thread_Request_EClient_Data ec_data;
memset(&ec_data, 0, sizeof(E_Input_Thread_Request_EClient_Data));
}
if (!surface_resource || e_policy_client_is_waydroid(ec))
{
- if (e_policy_client_is_waydroid(ec) && e_comp_wl->drag)
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (e_policy_client_is_waydroid(ec) && comp_wl->drag)
{
ELOGF("COMP", "Cursor Set ignored. dragging on Waydroid", ec);
return;
}
- e_pointer_view_set(e_comp->pointer, NULL, x, y);
+ e_pointer_view_set(comp_pointer, NULL, x, y);
ec->has_cursor_unset = EINA_TRUE;
ELOGF("COMP", "Cursor Set. has_cursor_unset:TRUE", ec);
return;
#if 0
/* ignore cursor changes during resize/move I guess */
if (e_client_action_get()) return;
- e_pointer_view_set(e_comp->pointer, e_client_view_get(ec), x, y);
+ e_pointer_view_set(comp_pointer, e_client_view_get(ec), x, y);
#endif
- if (e_comp->pointer)
+ if (comp_pointer)
{
- e_comp->pointer->hot.x = x;
- e_comp->pointer->hot.y = y;
+ comp_pointer->hot.x = x;
+ comp_pointer->hot.y = y;
if (e_config->show_cursor)
ec->visible = EINA_TRUE;
}
static void
_e_comp_wl_input_cb_pointer_unbind(struct wl_resource *resource)
{
- e_comp_wl->ptr.resources =
- eina_list_remove(e_comp_wl->ptr.resources, resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- wl_signal_emit(&e_comp_wl->ptr_constraints.pointer_destroy_signal, resource);
+ comp_wl->ptr.resources =
+ eina_list_remove(comp_wl->ptr.resources, resource);
+
+ wl_signal_emit(&comp_wl->ptr_constraints.pointer_destroy_signal, resource);
}
static void
struct wl_resource *res;
struct wl_client *ptr_client = NULL;
E_Comp_Wl_Client_Data *cdata = NULL;
+ E_Comp_Wl_Data *comp_wl;
+
+ comp_wl = e_comp_wl_get();
/* try to create pointer resource */
res = wl_resource_create(client, &wl_pointer_interface,
if (!res)
{
ERR("Could not create pointer on seat %s: %m",
- e_comp_wl->seat.name);
+ comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
- e_comp_wl->ptr.resources =
- eina_list_append(e_comp_wl->ptr.resources, res);
+ comp_wl->ptr.resources =
+ eina_list_append(comp_wl->ptr.resources, res);
wl_resource_set_implementation(res, &_e_pointer_interface,
- e_comp->wl_comp_data,
+ comp_wl,
_e_comp_wl_input_cb_pointer_unbind);
- if ((e_comp_wl->ptr.num_devices == 1) && e_comp_wl->ptr.ec && !e_comp_wl->ptr.ec->pointer_enter_sent && !e_config->use_cursor_timer)
+ if ((comp_wl->ptr.num_devices == 1) && comp_wl->ptr.ec && !comp_wl->ptr.ec->pointer_enter_sent && !e_config->use_cursor_timer)
{
- cdata = (E_Comp_Wl_Client_Data*)e_comp_wl->ptr.ec->comp_data;
+ cdata = (E_Comp_Wl_Client_Data*)comp_wl->ptr.ec->comp_data;
if (cdata && cdata->wl_surface)
ptr_client = wl_resource_get_client(cdata->wl_surface);
Eina_List *list, *l;
const char *name, *desc;
- list = (Eina_List *)evas_device_list(evas_object_evas_get(e_comp_wl->ptr.ec->frame), NULL);
+ list = (Eina_List *)evas_device_list(evas_object_evas_get(comp_wl->ptr.ec->frame), NULL);
EINA_LIST_FOREACH(list, l, dev)
{
name = evas_device_name_get(dev);
}
}
if (last_ptr)
- e_comp_wl_mouse_in_renew(e_comp_wl->ptr.ec, 0, wl_fixed_to_int(e_comp_wl->ptr.x), wl_fixed_to_int(e_comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
+ e_comp_wl_mouse_in_renew(comp_wl->ptr.ec, 0, wl_fixed_to_int(comp_wl->ptr.x), wl_fixed_to_int(comp_wl->ptr.y), NULL, NULL, NULL, ecore_time_get(), EVAS_EVENT_FLAG_NONE, last_ptr, NULL);
}
}
}
uint32_t serial;
xkb_mod_mask_t mod_depressed, mod_latched, mod_locked;
xkb_layout_index_t mod_group;
+ E_Comp_Wl_Data *comp_wl;
- if (!e_comp_input_key->kbd.focused)
- {
- return;
- }
+ if (!e_comp_input_key->kbd.focused) return;
e_comp_wl_input_keyboard_modifiers_serialize();
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ serial = wl_display_next_serial(comp_wl->wl.disp);
mod_depressed = atomic_load(&e_comp_input_key->kbd.mod_depressed);
mod_latched = atomic_load(&e_comp_input_key->kbd.mod_latched);
{
struct wl_resource *res;
E_Input_Thread_Request_Keyboard_Get_Data keyboard_get_data;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* try to create keyboard resource */
res = wl_resource_create(client, &wl_keyboard_interface,
if (!res)
{
ERR("Could not create keyboard on seat %s: %m",
- e_comp_wl->seat.name);
+ comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
wl_resource_set_implementation(res, &_e_keyboard_interface,
- e_comp->wl_comp_data,
+ comp_wl,
_e_comp_wl_input_cb_keyboard_unbind);
/* send current keymap */
static void
_e_comp_wl_input_cb_touch_unbind(struct wl_resource *resource)
{
- e_comp_wl->touch.resources =
- eina_list_remove(e_comp_wl->touch.resources, resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->touch.resources =
+ eina_list_remove(comp_wl->touch.resources, resource);
}
static void
_e_comp_wl_input_cb_touch_get(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t id EINA_UNUSED)
{
struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* try to create pointer resource */
res = wl_resource_create(client, &wl_touch_interface,
if (!res)
{
ERR("Could not create touch on seat %s: %m",
- e_comp_wl->seat.name);
+ comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
- e_comp_wl->touch.resources =
- eina_list_append(e_comp_wl->touch.resources, res);
+ comp_wl->touch.resources =
+ eina_list_append(comp_wl->touch.resources, res);
wl_resource_set_implementation(res, &_e_touch_interface,
- e_comp->wl_comp_data,
+ comp_wl,
_e_comp_wl_input_cb_touch_unbind);
}
_e_comp_wl_input_cb_unbind_seat(struct wl_resource *resource)
{
E_Comp_Wl_Seat *seat = wl_resource_get_user_data(resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
INF("Unbind seat: %u (client: %p)", wl_resource_get_id(resource), wl_resource_get_client(resource));
- e_comp_wl->seat.resources =
- eina_list_remove(e_comp_wl->seat.resources, resource);
+ comp_wl->seat.resources =
+ eina_list_remove(comp_wl->seat.resources, resource);
E_FREE(seat);
}
Eina_List *l;
struct wl_resource *tmp_res;
E_Comp_Wl_Seat *seat;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
seat = E_NEW(E_Comp_Wl_Seat, 1);
if (!seat)
}
seat->is_first_resource = 1;
- EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, tmp_res)
+ EINA_LIST_FOREACH(comp_wl->seat.resources, l, tmp_res)
{
if (wl_resource_get_client(tmp_res) != client) continue;
DBG("wl_seat (res: %d) is already bound to client (%p)",
INF("Bind seat: %u (client: %p)", wl_resource_get_id(res), client);
/* store version of seat interface for reuse in updating capabilities */
- e_comp_wl->seat.version = version;
- e_comp_wl->seat.resources =
- eina_list_append(e_comp_wl->seat.resources, res);
+ comp_wl->seat.version = version;
+ comp_wl->seat.resources =
+ eina_list_append(comp_wl->seat.resources, res);
wl_resource_set_implementation(res, &_e_seat_interface,
seat,
_e_comp_wl_input_cb_unbind_seat);
- _e_comp_wl_input_update_seat_caps(client);
- if (e_comp_wl->seat.version >= WL_SEAT_NAME_SINCE_VERSION)
- wl_seat_send_name(res, e_comp_wl->seat.name);
+ _e_comp_wl_input_update_seat_caps(comp_wl, client);
+ if (comp_wl->seat.version >= WL_SEAT_NAME_SINCE_VERSION)
+ wl_seat_send_name(res, comp_wl->seat.name);
}
static void
static void
_e_comp_wl_input_cb_unbind_relative_pointer(struct wl_resource *resource)
{
- e_comp_wl->relative_ptr.resources =
- eina_list_remove(e_comp_wl->relative_ptr.resources, resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->relative_ptr.resources =
+ eina_list_remove(comp_wl->relative_ptr.resources, resource);
}
static void
struct wl_resource *pointer_resource)
{
struct wl_resource *res = NULL;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
res = wl_resource_create(client, &zwp_relative_pointer_v1_interface, 1, id);
return;
}
- e_comp_wl->relative_ptr.resources =
- eina_list_append(e_comp_wl->relative_ptr.resources, res);
+ comp_wl->relative_ptr.resources =
+ eina_list_append(comp_wl->relative_ptr.resources, res);
/* FIXME: must consider destroying relative pointer together
when the wl_pointer is destroyed */
static void
_e_comp_wl_input_cb_unbind_relative_pointer_manager(struct wl_resource *resource)
{
- e_comp_wl->relative_ptr.manager_resources =
- eina_list_remove(e_comp_wl->relative_ptr.manager_resources, resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->relative_ptr.manager_resources =
+ eina_list_remove(comp_wl->relative_ptr.manager_resources, resource);
}
static void
uint32_t id)
{
struct wl_resource *resource = NULL;
-
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
resource = wl_resource_create(client, &zwp_relative_pointer_manager_v1_interface, 1, id);
if (!resource)
return;
}
- e_comp_wl->relative_ptr.manager_resources =
- eina_list_append(e_comp_wl->relative_ptr.manager_resources, resource);
+ comp_wl->relative_ptr.manager_resources =
+ eina_list_append(comp_wl->relative_ptr.manager_resources, resource);
wl_resource_set_implementation(resource, &_e_relative_pointer_manager_interface,
NULL, _e_comp_wl_input_cb_unbind_relative_pointer_manager);
}
static void
_e_comp_wl_input_pointer_constraint_deactivate(E_Comp_Wl_Pointer_Constraint *constraint)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
constraint->active = EINA_FALSE;
- e_comp_wl->ptr_constraints.activated = EINA_FALSE;
- e_comp_wl->ptr_constraints.ec = NULL;
- e_comp_wl->relative_ptr.activated = EINA_FALSE;
- e_comp_wl->relative_ptr.ec = NULL;
+ comp_wl->ptr_constraints.activated = EINA_FALSE;
+ comp_wl->ptr_constraints.ec = NULL;
+ comp_wl->relative_ptr.activated = EINA_FALSE;
+ comp_wl->relative_ptr.ec = NULL;
e_input_relative_motion_handler_set(NULL);
_e_comp_wl_input_pointer_constraint_notify_deactivated(constraint);
wl_list_remove(&constraint->surface_unmap_listener.link);
}
static void
-_e_comp_wl_input_pointer_constraint_enable(E_Comp_Wl_Pointer_Constraint *constraint)
+_e_comp_wl_input_pointer_constraint_enable(E_Comp_Wl_Data *comp_wl, E_Comp_Wl_Pointer_Constraint *constraint)
{
if (constraint->active)
{
constraint->active = EINA_TRUE;
E_Client *ec = constraint->ec;
- e_comp_wl->ptr_constraints.activated = EINA_TRUE;
- e_comp_wl->ptr_constraints.ec = ec;
- e_comp_wl->relative_ptr.activated = EINA_TRUE;
- e_comp_wl->relative_ptr.ec = ec;
+ comp_wl->ptr_constraints.activated = EINA_TRUE;
+ comp_wl->ptr_constraints.ec = ec;
+ comp_wl->relative_ptr.activated = EINA_TRUE;
+ comp_wl->relative_ptr.ec = ec;
_e_comp_wl_input_pointer_constraint_notify_activated(constraint);
- wl_signal_add(&e_comp_wl->ptr_constraints.surface_unmap_signal,
+ wl_signal_add(&comp_wl->ptr_constraints.surface_unmap_signal,
&constraint->surface_unmap_listener);
if (!e_input_relative_motion_handler_set(_e_comp_wl_input_relative_motion_handler))
ERR("ERROR! Could not set relative motion handler !");
- E_FREE_FUNC(e_comp_wl->ptr.hide_tmr, ecore_timer_del);
+ E_FREE_FUNC(comp_wl->ptr.hide_tmr, ecore_timer_del);
}
static void
_e_comp_wl_input_pointer_constraints_check_enable(E_Comp_Wl_Pointer_Constraint *constraint)
{
int px, py, cx, cy;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
if (!constraint || !constraint->ec)
{
}
E_Client *ec = constraint->ec;
- px = wl_fixed_to_int(e_comp_wl->ptr.x);
- py = wl_fixed_to_int(e_comp_wl->ptr.y);
+ px = wl_fixed_to_int(comp_wl->ptr.x);
+ py = wl_fixed_to_int(comp_wl->ptr.y);
if (e_client_transform_core_enable_get(ec))
{
cy = py - ec->client.y;
INF("Constraint check. ptr(%d, %d) cx/cy(%d, %d) ec(%p)", px, py, cx, cy, ec);
- if ((!e_comp_wl->ptr.ec) || (e_comp_wl->ptr.ec != ec)
+ if ((!comp_wl->ptr.ec) || (comp_wl->ptr.ec != ec)
|| (!ec->pointer_enter_sent))
return;
cy))
return;
- _e_comp_wl_input_pointer_constraint_enable(constraint);
+ _e_comp_wl_input_pointer_constraint_enable(comp_wl, constraint);
}
static void
E_Comp_Wl_Pointer_Constraint_Type type)
{
E_Comp_Wl_Pointer_Constraint *constraint;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
constraint = E_NEW(E_Comp_Wl_Pointer_Constraint, 1);
constraint->surface_mouseout_listener.notify =
_e_comp_wl_input_cb_pointer_constraints_surface_mouseout;
- wl_signal_add(&e_comp_wl->ptr_constraints.pointer_destroy_signal,
+ wl_signal_add(&comp_wl->ptr_constraints.pointer_destroy_signal,
&constraint->pointer_destroy_listener);
- wl_signal_add(&e_comp_wl->ptr_constraints.surface_commit_signal,
+ wl_signal_add(&comp_wl->ptr_constraints.surface_commit_signal,
&constraint->surface_commit_listener);
- wl_signal_add(&e_comp_wl->ptr_constraints.surface_mousein_signal,
+ wl_signal_add(&comp_wl->ptr_constraints.surface_mousein_signal,
&constraint->surface_mousein_listener);
- wl_signal_add(&e_comp_wl->ptr_constraints.surface_mouseout_signal,
+ wl_signal_add(&comp_wl->ptr_constraints.surface_mouseout_signal,
&constraint->surface_mouseout_listener);
wl_list_init(&constraint->surface_unmap_listener.link);
static void
_e_comp_wl_input_cb_unbind_pointer_constraints(struct wl_resource *resource)
{
- e_comp_wl->ptr_constraints.resources =
- eina_list_remove(e_comp_wl->ptr_constraints.resources, resource);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->ptr_constraints.resources =
+ eina_list_remove(comp_wl->ptr_constraints.resources, resource);
}
static void
_e_comp_wl_input_cb_bind_pointer_constraints(struct wl_client *client, void *data EINA_UNUSED, uint32_t version, uint32_t id)
{
struct wl_resource *resource;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
resource = wl_resource_create(client, &zwp_pointer_constraints_v1_interface, version, id);
return;
}
- e_comp_wl->ptr_constraints.resources =
- eina_list_append(e_comp_wl->ptr_constraints.resources, resource);
+ comp_wl->ptr_constraints.resources =
+ eina_list_append(comp_wl->ptr_constraints.resources, resource);
wl_resource_set_implementation(resource, &_e_pointer_constraints_interface,
NULL, _e_comp_wl_input_cb_unbind_pointer_constraints);
}
static void
_e_comp_wl_input_cb_surface_commit(void *data EINA_UNUSED, E_Client *ec)
{
- wl_signal_emit(&e_comp_wl->ptr_constraints.surface_commit_signal, ec);
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ wl_signal_emit(&comp_wl->ptr_constraints.surface_commit_signal, ec);
}
static void
/* FIXME: will be deprecated after migration */
char *tmp;
xkb_mod_mask_t latched = 0, locked = 0, group = 0;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* unreference any existing keymap */
- if (e_comp_wl->xkb.keymap)
- xkb_map_unref(e_comp_wl->xkb.keymap);
+ if (comp_wl->xkb.keymap)
+ xkb_map_unref(comp_wl->xkb.keymap);
/* unmap any existing keyboard area */
- if (e_comp_wl->xkb.area)
- munmap(e_comp_wl->xkb.area, e_comp_wl->xkb.size);
- if (e_comp_wl->xkb.fd >= 0) close(e_comp_wl->xkb.fd);
+ if (comp_wl->xkb.area)
+ munmap(comp_wl->xkb.area, comp_wl->xkb.size);
+ if (comp_wl->xkb.fd >= 0) close(comp_wl->xkb.fd);
/* unreference any existing keyboard state */
- if (e_comp_wl->xkb.state)
+ if (comp_wl->xkb.state)
{
latched =
- xkb_state_serialize_mods(e_comp_wl->xkb.state,
+ xkb_state_serialize_mods(comp_wl->xkb.state,
XKB_STATE_MODS_LATCHED);
locked =
- xkb_state_serialize_mods(e_comp_wl->xkb.state,
+ xkb_state_serialize_mods(comp_wl->xkb.state,
XKB_STATE_MODS_LOCKED);
group =
- xkb_state_serialize_layout(e_comp_wl->xkb.state,
+ xkb_state_serialize_layout(comp_wl->xkb.state,
XKB_STATE_LAYOUT_EFFECTIVE);
- xkb_state_unref(e_comp_wl->xkb.state);
+ xkb_state_unref(comp_wl->xkb.state);
}
/* create a new xkb state */
- e_comp_wl->xkb.state = xkb_state_new(keymap);
+ comp_wl->xkb.state = xkb_state_new(keymap);
- if (!e_comp_wl->xkb.state)
+ if (!comp_wl->xkb.state)
{
return;
}
if ((latched) || (locked) || (group))
- xkb_state_update_mask(e_comp_wl->xkb.state, 0,
+ xkb_state_update_mask(comp_wl->xkb.state, 0,
latched, locked, 0, 0, group);
/* increment keymap reference */
- e_comp_wl->xkb.keymap = keymap;
+ comp_wl->xkb.keymap = keymap;
/* fetch updated modifiers */
- e_comp_wl->kbd.mod_shift =
+ comp_wl->kbd.mod_shift =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_SHIFT);
- e_comp_wl->kbd.mod_caps =
+ comp_wl->kbd.mod_caps =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
- e_comp_wl->kbd.mod_ctrl =
+ comp_wl->kbd.mod_ctrl =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_CTRL);
- e_comp_wl->kbd.mod_alt =
+ comp_wl->kbd.mod_alt =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_ALT);
- e_comp_wl->kbd.mod_super =
+ comp_wl->kbd.mod_super =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_LOGO);
if (!(tmp = xkb_map_get_as_string(keymap)))
return;
}
- e_comp_wl->xkb.size = strlen(tmp) + 1;
- e_comp_wl->xkb.fd =
- _e_comp_wl_input_keymap_fd_get(e_comp_wl->xkb.size);
- if (e_comp_wl->xkb.fd < 0)
+ comp_wl->xkb.size = strlen(tmp) + 1;
+ comp_wl->xkb.fd =
+ _e_comp_wl_input_keymap_fd_get(comp_wl->xkb.size);
+ if (comp_wl->xkb.fd < 0)
{
ERR("Could not create keymap file");
free(tmp);
return;
}
- e_comp_wl->xkb.area =
- mmap(NULL, e_comp_wl->xkb.size, (PROT_READ | PROT_WRITE),
- MAP_SHARED, e_comp_wl->xkb.fd, 0);
- if (e_comp_wl->xkb.area == MAP_FAILED)
+ comp_wl->xkb.area =
+ mmap(NULL, comp_wl->xkb.size, (PROT_READ | PROT_WRITE),
+ MAP_SHARED, comp_wl->xkb.fd, 0);
+ if (comp_wl->xkb.area == MAP_FAILED)
{
ERR("Failed to mmap keymap area: %m");
free(tmp);
return;
}
- strncpy(e_comp_wl->xkb.area, tmp, e_comp_wl->xkb.size);
+ strncpy(comp_wl->xkb.area, tmp, comp_wl->xkb.size);
free(tmp);
}
EINTERN Eina_Bool
e_comp_wl_input_init(void)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
/* set default seat name */
- if (!e_comp_wl->seat.name)
- e_comp_wl->seat.name = "default";
+ if (!comp_wl->seat.name)
+ comp_wl->seat.name = "default";
dont_set_e_input_keymap = getenv("NO_E_INPUT_KEYMAP_CACHE") ? EINA_TRUE : EINA_FALSE;
dont_use_xkb_cache = getenv("NO_KEYMAP_CACHE") ? EINA_TRUE : EINA_FALSE;
- g_mutex_init(&e_comp_wl->kbd.resource_mutex);
- g_mutex_init(&e_comp_wl->kbd.repeat_delay_mutex);
- g_mutex_init(&e_comp_wl->kbd.repeat_rate_mutex);
+ g_mutex_init(&comp_wl->kbd.resource_mutex);
+ g_mutex_init(&comp_wl->kbd.repeat_delay_mutex);
+ g_mutex_init(&comp_wl->kbd.repeat_rate_mutex);
- g_mutex_init(&e_comp_wl->xkb.keymap_mutex);
+ g_mutex_init(&comp_wl->xkb.keymap_mutex);
/* get default keyboard repeat delay from configuration */
atomic_store(&e_comp_input_key->kbd.repeat_delay, e_config->keyboard.repeat_delay);
atomic_store(&e_comp_input_key->kbd.repeat_rate, 25);
/* create the global resource for input seat */
- e_comp_wl->seat.global =
- wl_global_create(e_comp_wl->wl.disp, &wl_seat_interface, 4,
- e_comp->wl_comp_data, _e_comp_wl_input_cb_bind_seat);
- if (!e_comp_wl->seat.global)
+ comp_wl->seat.global =
+ wl_global_create(comp_wl->wl.disp, &wl_seat_interface, 4,
+ comp_wl, _e_comp_wl_input_cb_bind_seat);
+ if (!comp_wl->seat.global)
{
ERR("Could not create global for seat: %m");
return EINA_FALSE;
}
/* create the global resource for relative pointer */
- e_comp_wl->relative_ptr.global =
- wl_global_create(e_comp_wl->wl.disp,
+ comp_wl->relative_ptr.global =
+ wl_global_create(comp_wl->wl.disp,
&zwp_relative_pointer_manager_v1_interface, 1,
- e_comp->wl_comp_data,
+ comp_wl,
_e_comp_wl_input_cb_bind_relative_pointer_manager);
- if (!e_comp_wl->relative_ptr.global)
+ if (!comp_wl->relative_ptr.global)
{
ERR("Could not create global for relative pointer: %m");
return EINA_FALSE;
}
/* create the global resource for pointer-constraints */
- e_comp_wl->ptr_constraints.global =
- wl_global_create(e_comp_wl->wl.disp,
+ comp_wl->ptr_constraints.global =
+ wl_global_create(comp_wl->wl.disp,
&zwp_pointer_constraints_v1_interface, 1,
- e_comp->wl_comp_data,
+ comp_wl,
_e_comp_wl_input_cb_bind_pointer_constraints);
- if (!e_comp_wl->ptr_constraints.global)
+ if (!comp_wl->ptr_constraints.global)
{
ERR("Could not create global for pointer constraints: %m");
return EINA_FALSE;
}
- e_comp_wl->ptr_constraints.ec = NULL;
- e_comp_wl->ptr_constraints.activated = EINA_FALSE;
- wl_signal_init(&e_comp_wl->ptr_constraints.pointer_destroy_signal);
- wl_signal_init(&e_comp_wl->ptr_constraints.surface_unmap_signal);
- wl_signal_init(&e_comp_wl->ptr_constraints.surface_commit_signal);
- wl_signal_init(&e_comp_wl->ptr_constraints.surface_mousein_signal);
- wl_signal_init(&e_comp_wl->ptr_constraints.surface_mouseout_signal);
+ comp_wl->ptr_constraints.ec = NULL;
+ comp_wl->ptr_constraints.activated = EINA_FALSE;
+ wl_signal_init(&comp_wl->ptr_constraints.pointer_destroy_signal);
+ wl_signal_init(&comp_wl->ptr_constraints.surface_unmap_signal);
+ wl_signal_init(&comp_wl->ptr_constraints.surface_commit_signal);
+ wl_signal_init(&comp_wl->ptr_constraints.surface_mousein_signal);
+ wl_signal_init(&comp_wl->ptr_constraints.surface_mouseout_signal);
_surface_commit_hook = e_comp_wl_hook_add(E_COMP_WL_HOOK_CLIENT_SURFACE_COMMIT,
_e_comp_wl_input_cb_surface_commit,
e_comp_wl_input_shutdown(void)
{
struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* free environment variable string */
E_FREE(_env_e_default_xkb_rules );
}
/* destroy pointer resources */
- EINA_LIST_FREE(e_comp_wl->ptr.resources, res)
+ EINA_LIST_FREE(comp_wl->ptr.resources, res)
wl_resource_destroy(res);
/* destroy relative pointer resources */
- EINA_LIST_FREE(e_comp_wl->relative_ptr.resources, res)
+ EINA_LIST_FREE(comp_wl->relative_ptr.resources, res)
wl_resource_destroy(res);
/* destroy relative pointer manager resources */
- EINA_LIST_FREE(e_comp_wl->relative_ptr.manager_resources, res)
+ EINA_LIST_FREE(comp_wl->relative_ptr.manager_resources, res)
wl_resource_destroy(res);
/* destroy pointer constraints resources */
- EINA_LIST_FREE(e_comp_wl->ptr_constraints.resources, res)
+ EINA_LIST_FREE(comp_wl->ptr_constraints.resources, res)
wl_resource_destroy(res);
/* destroy keyboard resources */
wl_resource_destroy(res);
e_comp_input_key->kbd.resources = eina_list_free(e_comp_input_key->kbd.resources);
- g_mutex_clear(&e_comp_wl->kbd.resource_mutex);
+ g_mutex_clear(&comp_wl->kbd.resource_mutex);
/* destroy touch resources */
- EINA_LIST_FREE(e_comp_wl->touch.resources, res)
+ EINA_LIST_FREE(comp_wl->touch.resources, res)
wl_resource_destroy(res);
/* destroy e_comp_input_key->kbd.keys array */
- wl_array_release(&e_comp_wl->kbd.keys);
+ wl_array_release(&comp_wl->kbd.keys);
wl_array_release(&e_comp_input_key->kbd.routed_keys);
/* unmap any existing keyboard area */
- if (e_comp_wl->xkb.area)
- munmap(e_comp_wl->xkb.area, e_comp_wl->xkb.size);
- if (e_comp_wl->xkb.fd >= 0) close(e_comp_wl->xkb.fd);
+ if (comp_wl->xkb.area)
+ munmap(comp_wl->xkb.area, comp_wl->xkb.size);
+ if (comp_wl->xkb.fd >= 0) close(comp_wl->xkb.fd);
/* unreference any existing keyboard state */
- if (e_comp_wl->xkb.state)
- xkb_state_unref(e_comp_wl->xkb.state);
+ if (comp_wl->xkb.state)
+ xkb_state_unref(comp_wl->xkb.state);
/* unreference any existing keymap */
- if (e_comp_wl->xkb.keymap)
- xkb_map_unref(e_comp_wl->xkb.keymap);
+ if (comp_wl->xkb.keymap)
+ xkb_map_unref(comp_wl->xkb.keymap);
/* unreference any existing context */
- if (e_comp_wl->xkb.context)
- xkb_context_unref(e_comp_wl->xkb.context);
+ if (comp_wl->xkb.context)
+ xkb_context_unref(comp_wl->xkb.context);
/* destroy the global relative pointer resource */
- if (e_comp_wl->relative_ptr.global)
- wl_global_destroy(e_comp_wl->relative_ptr.global);
- e_comp_wl->relative_ptr.global = NULL;
+ if (comp_wl->relative_ptr.global)
+ wl_global_destroy(comp_wl->relative_ptr.global);
+ comp_wl->relative_ptr.global = NULL;
/* destroy the global pointer constraints resource */
- if (e_comp_wl->ptr_constraints.global)
- wl_global_destroy(e_comp_wl->ptr_constraints.global);
- e_comp_wl->ptr_constraints.global = NULL;
+ if (comp_wl->ptr_constraints.global)
+ wl_global_destroy(comp_wl->ptr_constraints.global);
+ comp_wl->ptr_constraints.global = NULL;
/* destroy the global seat resource */
- if (e_comp_wl->seat.global)
- wl_global_destroy(e_comp_wl->seat.global);
- e_comp_wl->seat.global = NULL;
+ if (comp_wl->seat.global)
+ wl_global_destroy(comp_wl->seat.global);
+ comp_wl->seat.global = NULL;
dont_set_e_input_keymap = EINA_FALSE;
dont_use_xkb_cache = EINA_FALSE;
- g_mutex_clear(&e_comp_wl->xkb.keymap_mutex);
+ g_mutex_clear(&comp_wl->xkb.keymap_mutex);
- g_mutex_clear(&e_comp_wl->kbd.repeat_delay_mutex);
- g_mutex_clear(&e_comp_wl->kbd.repeat_rate_mutex);
+ g_mutex_clear(&comp_wl->kbd.repeat_delay_mutex);
+ g_mutex_clear(&comp_wl->kbd.repeat_rate_mutex);
}
EINTERN Eina_Bool
uint32_t serial;
struct wl_resource *res;
Eina_List *l;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
if (!e_comp_wl_input_keyboard_modifiers_serialize()) return;
if (!e_comp_input_key->kbd.focused)
return;
}
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
EINA_LIST_FOREACH(e_comp_input_key->kbd.focused, l, res)
wl_keyboard_send_modifiers(res, serial,
e_comp_input_key->kbd.mod_depressed,
EINTERN void
e_comp_wl_input_pointer_enabled_set(Eina_Bool enabled)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* check for valid compositor data */
- if (!e_comp->wl_comp_data)
+ if (!comp_wl)
{
ERR("No compositor data");
return;
}
- e_comp_wl->ptr.enabled = !!enabled;
- _e_comp_wl_input_update_seat_caps(NULL);
+ comp_wl->ptr.enabled = !!enabled;
+ _e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}
static void
EINTERN void
e_comp_wl_input_keyboard_enabled_set(Eina_Bool enabled)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* check for valid compositor data */
- if (!e_comp->wl_comp_data)
+ if (!comp_wl)
{
ERR("No compositor data");
return;
}
e_input_backend_thread_safe_call(_e_comp_wl_input_thread_cb_keyboard_enabled_set, &enabled, sizeof(Eina_Bool));
- _e_comp_wl_input_update_seat_caps(NULL);
+ _e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}
E_API Eina_Bool
EINTERN void
e_comp_wl_input_touch_enabled_set(Eina_Bool enabled)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* check for valid compositor data */
- if (!e_comp->wl_comp_data)
+ if (!comp_wl)
{
ERR("No compositor data");
return;
}
- e_comp_wl->touch.enabled = !!enabled;
- _e_comp_wl_input_update_seat_caps(NULL);
+ comp_wl->touch.enabled = !!enabled;
+ _e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}
EINTERN void
e_comp_wl_input_seat_caps_set(unsigned int caps)
{
Eina_Bool need_update = EINA_FALSE;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
/* check for valid compositor data */
- if (!e_comp->wl_comp_data)
+ if (!comp_wl)
{
ERR("No compositor data");
return;
}
if (caps & E_INPUT_SEAT_POINTER)
- e_comp_wl->ptr.enabled = need_update = EINA_TRUE;
+ comp_wl->ptr.enabled = need_update = EINA_TRUE;
if (caps & E_INPUT_SEAT_KEYBOARD)
e_comp_input_key->kbd.enabled = need_update = EINA_TRUE;
if (caps & E_INPUT_SEAT_TOUCH)
- e_comp_wl->touch.enabled = need_update = EINA_TRUE;
+ comp_wl->touch.enabled = need_update = EINA_TRUE;
if (need_update)
- _e_comp_wl_input_update_seat_caps(NULL);
+ _e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}
EINTERN Eina_Bool
struct wl_resource *res;
Eina_List *l;
- EINA_SAFETY_ON_NULL_RETURN(e_comp_wl);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp_wl_get());
atomic_store(&e_comp_input_key->kbd.repeat_delay, delay);
atomic_store(&e_comp_input_key->kbd.repeat_rate, rate);
char *name_tmp;
EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl_get(), 0);
g_rec_mutex_lock(&e_comp_input_key->xkb.keymap_mutex);
keymap = e_comp_input_key->xkb.keymap;
char name[256] = {0, };
EINA_SAFETY_ON_FALSE_RETURN_VAL(8 <= keycode, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl_get(), NULL);
g_rec_mutex_lock(&e_comp_input_key->xkb.keymap_mutex);
if (!e_comp_input_key->xkb.state)
{
E_API Eina_Bool
e_comp_wl_input_pointer_constraint_activated_get(void)
{
- return e_comp_wl->ptr_constraints.activated;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ return comp_wl->ptr_constraints.activated;
}
EINTERN void
EINA_SAFETY_ON_NULL_RETURN(dev);
if (!iec) return;
- // if (ec->cur_mouse_action || e_comp_wl->drag)
+ // E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ // if (ec->cur_mouse_action || comp_wl->drag)
// return;
// if (e_object_is_del(E_OBJECT(ec))) return;
// if ((ec->ignored) && (!ec->remote_surface.provider)) return;
ELOGF("Mouse", "dev name(%s), identifier(%s), class(%d), last device(%p)", NULL, dev_name, dev_identifier, dev_class, last_device);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
wc = wl_resource_get_client(surface);
g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
struct wl_client *wc;
Eina_List *l;
uint32_t serial;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- e_comp_wl->ptr.x = wl_fixed_from_int(x);
- e_comp_wl->ptr.y = wl_fixed_from_int(y);
+ comp_wl->ptr.x = wl_fixed_from_int(x);
+ comp_wl->ptr.y = wl_fixed_from_int(y);
if (!iec) return;
NULL, timestamp, x, y, x, y,
e_input_thread_client_util_name_get(iec));
- if (!eina_list_count(e_comp_wl->ptr.resources)) return;
+ if (!eina_list_count(comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
struct wl_client *wc;
Eina_List *l;
uint32_t serial;
+ E_Comp_Wl_Data *comp_wl;
if (!iec) return;
NULL, timestamp,
e_input_thread_client_util_name_get(iec));
- if (!eina_list_count(e_comp_wl->ptr.resources)) return;
+ comp_wl = e_comp_wl_get();
+ if (!eina_list_count(comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(surface);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+ EINA_LIST_FOREACH(comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
const char *dev_name;
Ecore_Device_Class dev_class;
int client_x = 0, client_y = 0;
+ E_Comp_Wl_Data *comp_wl;
- e_comp_wl->ptr.x = wl_fixed_from_int(ev->x);
- e_comp_wl->ptr.y = wl_fixed_from_int(ev->y);
+ comp_wl = e_comp_wl_get();
+ comp_wl->ptr.x = wl_fixed_from_int(ev->x);
+ comp_wl->ptr.y = wl_fixed_from_int(ev->y);
ELOGF("Mouse", "E Event Mouse Move (time: %d, x:%d y:%d)", NULL, ev->timestamp, ev->x, ev->y);
}
// send mouse move event
- e_comp_wl_surface_send_mouse_move(surface, ev->x, ev->y, client_x, client_y, ev->timestamp);
+ e_comp_wl_surface_send_mouse_move(comp_wl, surface, ev->x, ev->y, client_x, client_y, ev->timestamp);
e_input_thread_client_geometry_get(iec, &client_x, &client_y, NULL, NULL);
if (dev && (dev_class == ECORE_DEVICE_CLASS_TOUCH))
{
- if (!e_comp_wl->drag_client)
+ if (!comp_wl->drag_client)
{
- if (e_comp_wl->touch.pressed & (1 << 0))
+ if (comp_wl->touch.pressed & (1 << 0))
{
_e_comp_wl_device_input_thread_send_event_device(iec, dev, ev->timestamp);
- e_comp_wl_surface_send_touch_move(surface, 0, ev->x, ev->y, client_x, client_y, ev->timestamp);
+ e_comp_wl_surface_send_touch_move(comp_wl, surface, 0, ev->x, ev->y, client_x, client_y, ev->timestamp);
}
}
- e_pointer_touch_move(e_comp->pointer, ev->x, ev->y);
+ e_pointer_touch_move(e_comp_pointer_get(), ev->x, ev->y);
}
else
{
- if (!e_comp_wl->drag_client)
+ if (!comp_wl->drag_client)
{
_e_comp_wl_device_input_thread_send_event_device(iec, dev, ev->timestamp);
- e_comp_wl_surface_send_mouse_move(surface, ev->x, ev->y, client_x, client_y, ev->timestamp);
+ e_comp_wl_surface_send_mouse_move(comp_wl, surface, ev->x, ev->y, client_x, client_y, ev->timestamp);
}
- e_pointer_mouse_move(e_comp->pointer, ev->x, ev->y);
+ e_pointer_mouse_move(e_comp_pointer_get(), ev->x, ev->y);
}
err:
E_Input_Thread_Client *iec = NULL;
int client_x = 0, client_y = 0;
struct wl_resource *surface = NULL;
+ E_Comp_Wl_Data *comp_wl;
ELOGF("Mouse", "E Event Mouse Down (time: %d, x:%d y:%d), fixed(%d, %d)", NULL, ev->timestamp, ev->x, ev->y, wl_fixed_from_int(ev->x), wl_fixed_from_int(ev->y));
_e_comp_wl_device_input_thread_send_event_device(iec, dev, ev->timestamp);
+ comp_wl = e_comp_wl_get();
if (dev && device_class == ECORE_DEVICE_CLASS_TOUCH)
{
if (dev_name)
e_comp_wl_surface_device_renew_axis(dev_name, device_class,
surface, 0, ev->x, ev->y, ev->multi.pressure, ev->multi.angle);
- e_comp_wl_surface_handle_mouse_button_to_touch(surface, ev->timestamp, ev->x, ev->y, client_x, client_y, EINA_TRUE);
+ e_comp_wl_surface_handle_mouse_button_to_touch(comp_wl, surface, ev->timestamp, ev->x, ev->y, client_x, client_y, EINA_TRUE);
- e_pointer_touch_move(e_comp->pointer, ev->x, ev->y);
+ e_pointer_touch_move(e_comp_pointer_get(), ev->x, ev->y);
- e_comp_wl->touch.pressed |= (1 << 0);
+ comp_wl->touch.pressed |= (1 << 0);
}
else
{
ELOGF("Mouse", "button(%d)", NULL, ev->buttons);
- e_comp_wl_surface_mouse_button_send(surface, ev->timestamp, ev->buttons, WL_POINTER_BUTTON_STATE_PRESSED);
+ e_comp_wl_surface_mouse_button_send(comp_wl, surface, ev->timestamp, ev->buttons, WL_POINTER_BUTTON_STATE_PRESSED);
- e_pointer_mouse_move(e_comp->pointer, ev->x, ev->y);
+ e_pointer_mouse_move(e_comp_pointer_get(), ev->x, ev->y);
}
need_send_released = EINA_TRUE;
E_Input_Thread_Client *iec = NULL;
struct wl_resource *surface;
int client_x = 0, client_y = 0;
+ E_Comp_Wl_Data *comp_wl;
if (!need_send_released)
{
ELOGF("Mouse", "Up (button: %d, time: %d, x:%d, y:%d) (dev:%s)",
NULL, ev->buttons, ev->timestamp, ev->x, ev->y, dev_name);
+ comp_wl = e_comp_wl_get();
if (dev && (device_class == EVAS_DEVICE_CLASS_TOUCH))
{
- e_comp_wl->touch.pressed &= ~(1 << 0);
+ comp_wl->touch.pressed &= ~(1 << 0);
- if (!e_comp_wl->touch.pressed && e_comp_wl->touch.faked_ec)
- e_comp_wl->touch.faked_ec = NULL;
+ if (!comp_wl->touch.pressed && comp_wl->touch.faked_ec)
+ comp_wl->touch.faked_ec = NULL;
}
iec = _e_comp_wl_input_thread_client_under_pointer(ev->x, ev->y);
if (dev_name)
e_comp_wl_surface_device_handle_axes(dev_name, device_class,
surface, 0, ev->x, ev->y, ev->multi.pressure, ev->multi.angle);
- e_comp_wl_surface_handle_mouse_button_to_touch(surface, ev->timestamp, ev->x, ev->y, client_x, client_y, EINA_FALSE);
+ e_comp_wl_surface_handle_mouse_button_to_touch(comp_wl, surface, ev->timestamp, ev->x, ev->y, client_x, client_y, EINA_FALSE);
}
else
{
- e_comp_wl_surface_mouse_button_send(surface, ev->timestamp, ev->buttons,
+ e_comp_wl_surface_mouse_button_send(comp_wl, surface, ev->timestamp, ev->buttons,
WL_POINTER_BUTTON_STATE_RELEASED);
}
Ecore_Event_Mouse_Wheel *ev = event;
E_Input_Thread_Client *iec = NULL;
struct wl_resource *surface = NULL;
+ E_Comp_Wl_Data *comp_wl;
iec = _e_comp_wl_input_thread_client_under_pointer(ev->x, ev->y);
if (!iec)
goto err;
}
- if (!eina_list_count(e_comp_wl->ptr.resources))
+ comp_wl = e_comp_wl_get();
+ if (!eina_list_count(comp_wl->ptr.resources))
return ECORE_CALLBACK_RENEW;
_e_comp_wl_device_input_thread_send_event_device(iec, (E_Device *)ev->dev, ev->timestamp);
- e_comp_wl_surface_mouse_wheel_send(surface, ev->direction, ev->z, ev->timestamp);
+ e_comp_wl_surface_mouse_wheel_send(comp_wl, surface, ev->direction, ev->z, ev->timestamp);
err:
return ECORE_CALLBACK_RENEW;
#include "e_policy_wl.h"
#include "e_device_intern.h"
-EINTERN Eina_Bool e_comp_wl_init(void);
+EINTERN E_Comp_Wl_Data *e_comp_wl_init(void);
EINTERN void e_comp_wl_shutdown(void);
EINTERN E_Comp_Wl_Data *e_comp_wl_get(void);
EINTERN Eina_Bool e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time);
EINTERN Eina_Bool e_comp_wl_key_process(Ecore_Event_Key *ev, E_Device *dev, int type);
-EINTERN E_Client* e_comp_wl_touch_frame_send_ec_get(void);
-EINTERN void e_comp_wl_touch_frame_send_ec_set(E_Client *ec);
+EINTERN E_Client* e_comp_wl_touch_frame_send_ec_get(E_Comp_Wl_Data *comp_wl);
+EINTERN void e_comp_wl_touch_frame_send_ec_set(E_Comp_Wl_Data *comp_wl, E_Client *ec);
EINTERN Eina_Bool e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time);
EINTERN Eina_Bool e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time);
EINTERN void e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Device *dev, uint32_t serial);
EINTERN void e_comp_wl_send_event_e_device(struct wl_client *wc, uint32_t timestamp, E_Device *dev, uint32_t serial);
-EINTERN Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
+EINTERN Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Comp_Wl_Data *comp_wl, E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
EINTERN void e_comp_wl_shell_surface_ready(E_Client *ec);
EINTERN void e_comp_wl_trace_serial_debug(Eina_Bool on);
-EINTERN void e_comp_wl_surface_send_mouse_move(struct wl_resource *surface, int x, int y, int client_x, int client_y, unsigned int timestamp);
-EINTERN void e_comp_wl_surface_mouse_button_send(struct wl_resource *surface, uint32_t timestamp, uint32_t button_id, uint32_t state);
-EINTERN void e_comp_wl_surface_mouse_wheel_send(struct wl_resource *surface, int direction, int z, int timestamp);
+EINTERN void e_comp_wl_surface_send_mouse_move(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int x, int y, int client_x, int client_y, unsigned int timestamp);
+EINTERN void e_comp_wl_surface_mouse_button_send(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, uint32_t timestamp, uint32_t button_id, uint32_t state);
+EINTERN void e_comp_wl_surface_mouse_wheel_send(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int direction, int z, int timestamp);
EINTERN void e_comp_wl_surface_device_renew_axis(const char *dev_name, Evas_Device_Class dev_class, struct wl_resource *surface, unsigned int idx, double radius_x, double radius_y, double pressure, double angle);
EINTERN void e_comp_wl_surface_device_handle_axes(const char *dev_name, Ecore_Device_Class dev_class, struct wl_resource *surface, unsigned int idx, double radius_x, double radius_y, double pressure, double angle);
-EINTERN void e_comp_wl_surface_handle_mouse_button_to_touch(struct wl_resource *surface, uint32_t timestamp, int canvas_x, int canvas_y, int client_x, int client_y, Eina_Bool flag);
-EINTERN void e_comp_wl_surface_send_touch_move(struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp);
+EINTERN void e_comp_wl_surface_handle_mouse_button_to_touch(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, uint32_t timestamp, int canvas_x, int canvas_y, int client_x, int client_y, Eina_Bool flag);
+EINTERN void e_comp_wl_surface_send_touch_move(E_Comp_Wl_Data *comp_wl, struct wl_resource *surface, int idx, int canvas_x, int canvas_y, int client_x, int client_y, uint32_t timestamp);
EINTERN E_Devicemgr_Input_Device *e_comp_wl_device_last_device_get(Ecore_Device_Class dev_class);
EINTERN void e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Devicemgr_Input_Device *device);
#include "e_comp_wl_renderer_intern.h"
+#include "e_comp_wl_intern.h"
#include <tizen-extension-server-protocol.h>
e_comp_wl_renderer_init(void)
{
E_Comp_Wl_Renderer_Manager *renderer_mgr;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
if (_renderer_mgr) return EINA_TRUE;
renderer_mgr = E_NEW(E_Comp_Wl_Renderer_Manager, 1);
EINA_SAFETY_ON_NULL_GOTO(renderer_mgr, fail);
- renderer_mgr->global = wl_global_create(e_comp_wl->wl.disp,
+ renderer_mgr->global = wl_global_create(comp_wl->wl.disp,
&tizen_renderer_interface,
1,
NULL,
if (!zone) return;
if (!provider->common.surfaces) return;
- o = evas_object_top_get(e_comp->evas);
+ o = evas_object_top_get(e_comp_evas_get());
for (; o; o = evas_object_below_get(o))
{
_ec = evas_object_data_get(o, "E_Client");
e_comp_wl_remote_surface_init(void)
{
E_Comp_Wl_Remote_Manager *rs_manager = NULL;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->wl_comp_data->tbm.server, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->tbm.server, EINA_FALSE);
rs_manager = E_NEW(E_Comp_Wl_Remote_Manager, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(rs_manager, EINA_FALSE);
- rs_manager->global = wl_global_create(e_comp_wl->wl.disp,
+ rs_manager->global = wl_global_create(comp_wl->wl.disp,
&tizen_remote_surface_manager_interface,
6,
NULL,
#include "e_privilege_intern.h"
#include "e_output_intern.h"
#include "e_comp_wl_video_buffer_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_util_video_intern.h"
#include "e_security_intern.h"
static Eina_Bool
_e_tz_screenmirror_buffer_check(struct wl_resource *resource)
{
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
if (wl_shm_buffer_get(resource) ||
- wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, resource))
+ wayland_tbm_server_get_surface(comp_wl->tbm.server, resource))
return EINA_TRUE;
ERR("unrecognized buffer");
EINTERN int
e_comp_wl_screenshooter_init(void)
{
- if (!e_comp_wl) return 0;
- if (!e_comp_wl->wl.disp) return 0;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (!comp_wl) return 0;
+ if (!comp_wl->wl.disp) return 0;
/* try to add screenshooter to wayland globals */
- if (!wl_global_create(e_comp_wl->wl.disp, &screenshooter_interface, 2,
+ if (!wl_global_create(comp_wl->wl.disp, &screenshooter_interface, 2,
NULL, _e_screenshooter_cb_bind))
{
ERR("Could not add screenshooter to wayland globals");
}
/* try to add tizen_screenshooter to wayland globals */
- if (!wl_global_create(e_comp_wl->wl.disp, &tizen_screenshooter_interface, 3,
+ if (!wl_global_create(comp_wl->wl.disp, &tizen_screenshooter_interface, 3,
NULL, _e_tz_screenshooter_cb_bind))
{
ERR("Could not add tizen_screenshooter to wayland globals");
#include "e_bindings_intern.h"
#include "e_xdg_shell_v6_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_rsm_intern.h"
#include "e_comp_wl_shell_intern.h"
#include "e_comp_wl_subsurface_intern.h"
EINTERN void
e_shell_e_client_popup_set(E_Client *ec)
{
+ E_Comp *comp;
EINA_SAFETY_ON_NULL_RETURN(ec);
ELOGF("SHELL", "Set popup", ec);
EC_CHANGED(ec);
ec->new_client = ec->override = 1;
e_client_unignore(ec);
- e_comp->new_clients++;
+ comp = e_comp_get();
+ comp->new_clients++;
if (!ec->internal)
ec->borderless = 1;
ec->lock_border = EINA_TRUE;
struct wl_resource *seat EINA_UNUSED)
{
E_Binding_Event_Mouse_Button ev;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
e_client_layout_apply(ec, EINA_FALSE);
- switch (e_comp_wl->ptr.button)
+ comp_wl = e_comp_wl_get();
+ switch (comp_wl->ptr.button)
{
case BTN_LEFT: ev.button = 1; break;
case BTN_MIDDLE: ev.button = 2; break;
case BTN_RIGHT: ev.button = 3; break;
- default: ev.button = e_comp_wl->ptr.button; break;
+ default: ev.button = comp_wl->ptr.button; break;
}
e_view_client_frame_xy_unadjust(e_client_view_get(ec),
- wl_fixed_to_int(e_comp_wl->ptr.x),
- wl_fixed_to_int(e_comp_wl->ptr.y),
+ wl_fixed_to_int(comp_wl->ptr.x),
+ wl_fixed_to_int(comp_wl->ptr.y),
&ev.canvas.x,
&ev.canvas.y);
uint32_t edges)
{
E_Binding_Event_Mouse_Button ev;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
e_client_layout_apply(ec, EINA_FALSE);
- e_comp_wl->resize.resource = resource;
- e_comp_wl->resize.edges = edges;
- e_comp_wl->ptr.grab_x = e_comp_wl->ptr.x - wl_fixed_from_int(ec->client.x);
- e_comp_wl->ptr.grab_y = e_comp_wl->ptr.y - wl_fixed_from_int(ec->client.y);
+ comp_wl = e_comp_wl_get();
+ comp_wl->resize.resource = resource;
+ comp_wl->resize.edges = edges;
+ comp_wl->ptr.grab_x = comp_wl->ptr.x - wl_fixed_from_int(ec->client.x);
+ comp_wl->ptr.grab_y = comp_wl->ptr.y - wl_fixed_from_int(ec->client.y);
- switch (e_comp_wl->ptr.button)
+ switch (comp_wl->ptr.button)
{
case BTN_LEFT: ev.button = 1; break;
case BTN_MIDDLE: ev.button = 2; break;
case BTN_RIGHT: ev.button = 3; break;
- default: ev.button = e_comp_wl->ptr.button; break;
+ default: ev.button = comp_wl->ptr.button; break;
}
e_view_client_frame_xy_unadjust(e_client_view_get(ec),
- wl_fixed_to_int(e_comp_wl->ptr.x),
- wl_fixed_to_int(e_comp_wl->ptr.y),
+ wl_fixed_to_int(comp_wl->ptr.x),
+ wl_fixed_to_int(comp_wl->ptr.y),
&ev.canvas.x,
&ev.canvas.y);
{
E_Client *ec;
uint32_t serial;
+ E_Comp_Wl_Data *comp_wl;
if (!resource)
return;
return;
}
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wl_shell_surface_send_ping(ec->comp_data->shell.surface, serial);
}
if (ec->netwm.type != E_WINDOW_TYPE_POPUP_MENU)
{
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
xdg_surface_send_configure(resource, width, height, &states, serial);
}
if (!eina_list_data_find(esh->ping_ecs, ec))
esh->ping_ecs = eina_list_append(esh->ping_ecs, ec);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
xdg_shell_send_ping(esh->res, serial);
}
wl_resource_set_implementation(res,
&_e_shell_interface,
- e_comp->wl_comp_data,
+ e_comp_wl_get(),
_e_shell_cb_unbind);
}
wl_resource_set_dispatcher(res,
_e_xdg_shell_cb_dispatch,
NULL,
- e_comp->wl_comp_data,
+ e_comp_wl_get(),
NULL);
return;
wl_resource_set_implementation(res,
&_e_tz_surf_interface,
- e_comp->wl_comp_data,
+ e_comp_wl_get(),
NULL);
}
EINTERN Eina_Bool
e_comp_wl_shell_init(void)
{
- if (!wl_global_create(e_comp_wl->wl.disp,
+ E_Comp_Wl_Data *comp_wl;
+
+ comp_wl = e_comp_wl_get();
+ if (!wl_global_create(comp_wl->wl.disp,
&wl_shell_interface,
1,
- e_comp->wl_comp_data,
+ comp_wl,
_e_shell_cb_bind))
{
ERR("Could not create shell global: %m");
return EINA_FALSE;
}
- if (!wl_global_create(e_comp_wl->wl.disp,
+ if (!wl_global_create(comp_wl->wl.disp,
&xdg_shell_interface,
1,
- e_comp->wl_comp_data,
+ comp_wl,
_e_xdg_shell_cb_bind))
{
ERR("Could not create xdg_shell global: %m");
return EINA_FALSE;
}
- if (!e_xdg_shell_v6_init())
+ if (!e_xdg_shell_v6_init(comp_wl->wl.disp))
{
ERR("Could not init xdg_shell_v6");
return EINA_FALSE;
}
- if (!wl_global_create(e_comp_wl->wl.disp,
+ if (!wl_global_create(comp_wl->wl.disp,
&tizen_surface_interface,
1,
- e_comp->wl_comp_data,
+ comp_wl,
_e_tz_surf_cb_bind))
{
ERR("Could not create tizen_surface to wayland globals: %m");
#include "e_comp_wl_subsurface_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_viewport_intern.h"
#include "e_pixmap_intern.h"
#include "e_client_video_intern.h"
static void _e_comp_wl_subsurface_stack_update(E_Client *ec);
static void
-_e_comp_wl_client_subsurface_set(E_Client *ec, E_Comp_Wl_Subsurf_Data *sdata)
+_e_comp_wl_client_subsurface_set(E_Comp* comp, E_Client *ec, E_Comp_Wl_Subsurf_Data *sdata)
{
e_comp_wl_client_surface_set(ec, ec->comp_data->wl_surface);
ec->comp_data->sub.data = sdata;
EC_CHANGED(ec);
ec->new_client = ec->netwm.ping = EINA_TRUE;
- e_comp->new_clients++;
+ comp->new_clients++;
e_client_unignore(ec);
}
EINTERN void
e_comp_wl_subsurface_data_init(E_Comp_Wl_Subsurf_Data *sdata, E_Client *ec, E_Client *parent, E_Client *offscreen_parent)
{
+ E_Comp *comp;
+
sdata->cached_buffer_ref.buffer = NULL;
sdata->synchronized = EINA_TRUE;
sdata->parent = parent;
e_comp_wl_surface_state_init(&sdata->cached, ec->w, ec->h);
- _e_comp_wl_client_subsurface_set(ec, sdata);
+ comp = e_comp_get();
+ _e_comp_wl_client_subsurface_set(comp, ec, sdata);
_e_comp_wl_client_subsurface_parent_set(ec, parent);
e_comp_wl_hook_call(E_COMP_WL_HOOK_SUBSURFACE_CREATE, ec);
#include "e_comp_wl_tbm_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_tbm_gbm_server_intern.h"
#include "e_utils_intern.h"
#include "e_comp_screen_intern.h"
EINTERN Eina_Bool
e_comp_wl_tbm_init(void)
{
- if (!e_comp)
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (!comp_wl)
{
e_error_message_show(_("Enlightenment cannot has no e_comp at Wayland TBM!\n"));
return EINA_FALSE;
}
- EINA_SAFETY_ON_FALSE_RETURN_VAL(e_comp->wl_comp_data->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
- if (e_comp->wl_comp_data->tbm.server)
+ if (comp_wl->tbm.server)
return EINA_TRUE;
- if (!e_tbm_gbm_server_init(e_comp->wl_comp_data->wl.disp))
+ if (!e_tbm_gbm_server_init(comp_wl->wl.disp))
{
e_error_message_show(_("Enlightenment cannot initialize E_Tbm_Gbm_Server!!\n"));
return EINA_FALSE;
{
struct wl_resource *remote_buffer;
tbm_surface_h tbm_surface;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_tbm, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer, NULL);
- tbm_surface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server,
+ tbm_surface = wayland_tbm_server_get_surface(comp_wl->tbm.server,
wl_buffer);
- remote_buffer = wayland_tbm_server_export_buffer(e_comp->wl_comp_data->tbm.server,
+ remote_buffer = wayland_tbm_server_export_buffer(comp_wl->tbm.server,
wl_tbm, tbm_surface);
return remote_buffer;
e_comp_wl_tbm_remote_buffer_get_with_tbm(struct wl_resource *wl_tbm, tbm_surface_h tbm_surface)
{
struct wl_resource *remote_buffer;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_tbm, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(tbm_surface, NULL);
- remote_buffer = wayland_tbm_server_export_buffer(e_comp->wl_comp_data->tbm.server,
+ remote_buffer = wayland_tbm_server_export_buffer(comp_wl->tbm.server,
wl_tbm, tbm_surface);
return remote_buffer;
tbm_bo tbo = NULL;
int fd = -1;
Eina_Bool need_close = EINA_FALSE;
- E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+ E_Comp_Screen *comp_screen = e_comp_screen_get();
int i;
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen->bufmgr, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_get(), NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_screen, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_screen->bufmgr, NULL);
info.width = gbm_bo_get_width(gbo);
info.height = gbm_bo_get_height(gbo);
fd = _e_comp_wl_tbm_gbm_bo_fd_get(gbo, &need_close);
EINA_SAFETY_ON_FALSE_GOTO(fd >= 0, end);
- tbo = tbm_bo_import_fd(e_comp_screen->bufmgr, fd);
+ tbo = tbm_bo_import_fd(comp_screen->bufmgr, fd);
EINA_SAFETY_ON_NULL_GOTO(tbo, end);
tsurface = tbm_surface_internal_create_with_bos(&info, &tbo, 1);
e_comp_wl_tbm_client_queue_get(E_Client *ec)
{
struct wayland_tbm_client_queue * cqueue;
- E_Comp_Wl_Data *wl_cdata = (E_Comp_Wl_Data *)e_comp->wl_comp_data;
E_Comp_Wl_Client_Data *cdata;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(wl_cdata, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
cdata = e_pixmap_cdata_get(ec->pixmap);
if (!cdata) return NULL;
if (!cdata->wl_surface) return NULL;
- cqueue = wayland_tbm_server_client_queue_get(wl_cdata->tbm.server, cdata->wl_surface);
+ cqueue = wayland_tbm_server_client_queue_get(comp_wl->tbm.server, cdata->wl_surface);
return cqueue;
}
#include "e_comp_wl_tizen_hwc_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_utils_intern.h"
#include "e_error_intern.h"
#include "e_hwc_window_intern.h"
EINTERN Eina_Bool
e_comp_wl_tizen_hwc_init(void)
{
- if (!e_comp_wl)
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ if (!comp_wl)
{
- e_error_message_show(_("Enlightenment cannot has no e_comp_wl at Wayland Tizen HWC!\n"));
+ e_error_message_show(_("Enlightenment cannot has no comp_wl at Wayland Tizen HWC!\n"));
return EINA_FALSE;
}
- EINA_SAFETY_ON_FALSE_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
- if (e_comp_wl->tizen_hwc.global)
+ if (comp_wl->tizen_hwc.global)
return EINA_TRUE;
/* create the global resource for tizen_hwc */
- e_comp_wl->tizen_hwc.global = wl_global_create(e_comp_wl->wl.disp, &tizen_hwc_interface, 1,
+ comp_wl->tizen_hwc.global = wl_global_create(comp_wl->wl.disp, &tizen_hwc_interface, 1,
NULL, _e_comp_wl_tizen_hwc_cb_bind);
- if (!e_comp_wl->tizen_hwc.global)
+ if (!comp_wl->tizen_hwc.global)
{
ERR("Could not create global for tizen_hwc: %m");
return EINA_FALSE;
E_Comp_Wl_Tizen_Hwc *tizen_hwc;
E_Comp_Wl_Tizen_Hwc_Commit_Feedback *hwc_commit_feedback;
const Eina_List *l, *ll, *lll, *llll;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
ELOGF("TIZEN-HWC", "Shutdown Tizen HWC.", NULL);
- if (!e_comp_wl) return;
- if (!e_comp_wl->tizen_hwc.global) return;
+ if (!comp_wl) return;
+ if (!comp_wl->tizen_hwc.global) return;
EINA_LIST_FOREACH_SAFE(_e_comp_wl_tizen_hwc_list, l, ll, tizen_hwc)
{
}
_e_comp_wl_tizen_hwc_list = NULL;
- wl_global_destroy(e_comp_wl->tizen_hwc.global);
- e_comp_wl->tizen_hwc.global = NULL;
+ wl_global_destroy(comp_wl->tizen_hwc.global);
+ comp_wl->tizen_hwc.global = NULL;
}
EINTERN void
#include "e_comp_wl_intern.h"
#include "e_comp_wl_video_buffer_intern.h"
#include "e_zone_video_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_comp_wl_viewport_intern.h"
#include "e_utils_intern.h"
#include "e_client_intern.h"
e_comp_wl_video_init(void)
{
struct wl_global *global;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- if (!e_comp_wl) return EINA_FALSE;
- if (!e_comp_wl->wl.disp) return EINA_FALSE;
- if (e_comp->wl_comp_data->video.global) return EINA_TRUE;
+ if (!comp_wl) return EINA_FALSE;
+ if (!comp_wl->wl.disp) return EINA_FALSE;
+ if (comp_wl->video.global) return EINA_TRUE;
/* try to add tizen_video to wayland globals */
- global = wl_global_create(e_comp_wl->wl.disp, &tizen_video_interface,
+ global = wl_global_create(comp_wl->wl.disp, &tizen_video_interface,
1, NULL, _e_comp_wl_tizen_video_bind);
if (!global)
{
return EINA_FALSE;
}
- e_comp->wl_comp_data->video.global = global;
+ comp_wl->video.global = global;
- e_comp->wl_comp_data->available_hw_accel.underlay = EINA_TRUE;
+ comp_wl->available_hw_accel.underlay = EINA_TRUE;
DBG("enable HW underlay");
- e_comp->wl_comp_data->available_hw_accel.scaler = EINA_TRUE;
+ comp_wl->available_hw_accel.scaler = EINA_TRUE;
DBG("enable HW scaler");
e_info_server_hook_set("vbuf", _e_comp_wl_video_info_cb_vbuf_print, NULL);
EINTERN void
e_comp_wl_video_shutdown(void)
{
- e_comp->wl_comp_data->available_hw_accel.underlay = EINA_FALSE;
- e_comp->wl_comp_data->available_hw_accel.scaler = EINA_FALSE;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->available_hw_accel.underlay = EINA_FALSE;
+ comp_wl->available_hw_accel.scaler = EINA_FALSE;
- E_FREE_FUNC(e_comp->wl_comp_data->video.global, wl_global_destroy);
+ E_FREE_FUNC(comp_wl->video.global, wl_global_destroy);
e_info_server_hook_set("vbuf", NULL, NULL);
e_info_server_hook_set("video-to-primary", NULL, NULL);
#include "e_comp_wl_video_buffer_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_compositor_intern.h"
#include "e_util_video_intern.h"
static E_Comp_Wl_Video_Buf*
_e_comp_wl_video_buffer_create_res(struct wl_resource *resource)
{
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Video_Buf *vbuf = NULL;
struct wl_shm_buffer *shm_buffer;
tbm_surface_h tbm_surface;
vbuf->resource = resource;
+ comp_wl = e_comp_wl_get();
if ((shm_buffer = wl_shm_buffer_get(resource)))
{
uint32_t tbmfmt = wl_shm_buffer_get_format(shm_buffer);
vbuf->width_from_pitch = vbuf->width;
vbuf->height_from_size = vbuf->height;;
}
- else if ((tbm_surface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, resource)))
+ else if ((tbm_surface = wayland_tbm_server_get_surface(comp_wl->tbm.server, resource)))
{
int i;
setvbuf(log_fl, NULL, _IOLBF, 512);
// append clients.
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ for (o = evas_object_top_get(e_comp_evas_get()); o; o = evas_object_below_get(o))
{
E_Client *ec;
E_Viewport *viewport;
EINTERN int
e_comp_wl_viewport_init(void)
{
- if (!e_comp_wl) return 0;
- if (!e_comp_wl->wl.disp) return 0;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- if (!ds_tizen_scaler_create(e_comp_wl->wl.disp))
+ if (!comp_wl) return 0;
+ if (!comp_wl->wl.disp) return 0;
+
+ if (!ds_tizen_scaler_create(comp_wl->wl.disp))
{
ERR("Could not create ds_tizen_scaler");
return 0;
if (!ec->netwm.pid)
ec->netwm.pid = pid;
if (ec->new_client)
- e_comp->new_clients--;
+ {
+ E_Comp *comp = e_comp_get();
+ comp->new_clients--;
+ }
ec->new_client = 0;
if ((!ec->client.w) && (ec->client.h))
ec->client.w = ec->client.h = 1;
_e_surface_destroy(E_Surface *surface)
{
struct wl_resource *cb;
+ E_Comp_Wl_Data *comp_wl;
ELOGF("COMPOSITOR", "Desroy E_Surface %p", surface->ec, surface);
}
}
- if (e_comp_wl->ptr.ec == surface->ec)
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->ptr.ec == surface->ec)
{
- e_comp_wl->ptr.ec = NULL;
- E_FREE_FUNC(e_comp_wl->ptr.hide_tmr, ecore_timer_del);
+ comp_wl->ptr.ec = NULL;
+ E_FREE_FUNC(comp_wl->ptr.hide_tmr, ecore_timer_del);
}
- if (e_comp_wl->touch.faked_ec == surface->ec)
- e_comp_wl->touch.faked_ec = NULL;
+ if (comp_wl->touch.faked_ec == surface->ec)
+ comp_wl->touch.faked_ec = NULL;
- if (e_comp_wl->selection.cbhm == surface->base.surface)
- e_comp_wl->selection.cbhm = NULL;
+ if (comp_wl->selection.cbhm == surface->base.surface)
+ comp_wl->selection.cbhm = NULL;
e_comp_wl_data_secondary_remove(surface->ec);
pixman_box32_t *rects;
int32_t x, y, w, h;
int nrects, i;
+ int comp_w = 0, comp_h = 0;
- tiler = eina_tiler_new(e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ tiler = eina_tiler_new(comp_w, comp_h);
if (!tiler)
return NULL;
if (surface->base.shell.surface && surface->base.pending.new_attach &&
!ec->internal && !e_comp_wl_subsurface_check(ec) && !ec->remote_surface.provider)
{
+ E_Comp *comp;
ELOGF("COMP", "Current unmapped. COMMIT. pixmap_usable:%d", ec, e_pixmap_usable_get(ec->pixmap));
// no canvas update before client's commit request, begin rendering after 1st commit
comp_conf = e_comp_config_get();
- if (comp_conf && comp_conf->canvas_render_delay_after_boot && e_comp->canvas_render_delayed)
+ comp = e_comp_get();
+ if (comp_conf && comp_conf->canvas_render_delay_after_boot && comp->canvas_render_delayed)
{
ELOGF("COMP", "Begin canvas update for the first time after boot", ec);
- e_comp->canvas_render_delayed = EINA_FALSE;
+ comp->canvas_render_delayed = EINA_FALSE;
}
}
}
struct wl_array axes;
E_Tizen_Devicemgr_Mgr_Data *mgr_data;
E_Comp_Wl_Seat *seat_data;
+ E_Comp_Wl_Data *comp_wl;
/* TODO: find the seat corresponding to event */
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wl_array_init(&axes);
- EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, seat_res)
+ EINA_LIST_FOREACH(comp_wl->seat.resources, l, seat_res)
{
seat_data = wl_resource_get_user_data(seat_res);
if (!seat_data) continue;
uint32_t serial;
E_Tizen_Devicemgr_User_Data *device_user_data;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
EINA_LIST_FREE(dev->resources, res)
{
uint32_t serial;
struct wl_client *wc;
E_Tizen_Devicemgr_Mgr_Data *mgr_data;
+ E_Comp_Wl_Data *comp_wl;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (res && seat_res)
{
}
else
{
- EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, seat_resource)
+ EINA_LIST_FOREACH(comp_wl->seat.resources, l, seat_resource)
{
wc = wl_resource_get_client(seat_resource);
DMINF("Relative Move. Event Boundary: %d", boundary);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
tizen_input_device_manager_send_event_boundary(resource, serial, boundary);
}
E_Tizen_Devicemgr_Mgr_Data *mgr_data;
E_Tizen_Devicemgr_User_Data *device_user_data;
- if(!e_comp_wl) return;
+ if(!e_comp_wl_get()) return;
mgr_data = wl_resource_get_user_data(resource);
if (!mgr_data) return;
struct wl_array axes;
E_Tizen_Devicemgr_User_Data *device_user_data;
E_Tizen_Devicemgr_Mgr_Data *mgr_data, *tmp_data;
+ E_Comp_Wl_Data *comp_wl;
mgr_data = E_NEW(E_Tizen_Devicemgr_Mgr_Data, 1);
if (!mgr_data)
wl_resource_set_implementation(res, &_e_devicemgr_wl_implementation, mgr_data,
_e_devicemgr_wl_cb_unbind);
- EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, seat_res)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->seat.resources, l, seat_res)
{
if (wl_resource_get_client(seat_res) != client) continue;
wl_array_init(&axes);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(comp_wl->wl.disp);
if (e_devicemgr->max_touch_count > 0)
{
#include "e_dpms_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_output_intern.h"
#include "e_dbus_conn_intern.h"
{
dbus_init_done_handler = NULL;
dpms_binded = EINA_FALSE;
+ E_Comp_Wl_Data *comp_wl;
if (e_dbus_conn_init() > 0)
{
e_dbus_conn_dbus_init(edbus_conn_type);
}
- if (!e_comp_wl || !e_comp_wl->wl.disp)
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl || !comp_wl->wl.disp)
{
- ERR("no e_comp_wl resource. cannot create dpms interface");
+ ERR("no comp_wl resource. cannot create dpms interface");
return 1;
}
/* try to add dpms_manager to wayland globals */
- dpms_global = wl_global_create(e_comp_wl->wl.disp,
+ dpms_global = wl_global_create(comp_wl->wl.disp,
&tizen_dpms_manager_interface, 1, NULL,
_e_dpms_cb_bind);
if (!dpms_global)
E_Client *ec = NULL;
E_Comp_Wl_Buffer *wl_buffer = NULL;
tbm_surface_h tbm_buffer = NULL;
+ E_Comp_Wl_Data *comp_wl;
Eina_List *l;
E_Output_Display_Mode display_mode, display_mode_prev;
int width, height;
EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer->resource, ECORE_CALLBACK_PASS_ON);
/* TODO: support different SHMEM buffers etc. */
- tbm_buffer = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, wl_buffer->resource);
+ comp_wl = e_comp_wl_get();
+ tbm_buffer = wayland_tbm_server_get_surface(comp_wl->tbm.server, wl_buffer->resource);
EINA_SAFETY_ON_NULL_RETURN_VAL(tbm_buffer, ECORE_CALLBACK_PASS_ON);
width = tbm_surface_get_width(tbm_buffer);
EINTERN Eina_Bool
e_eom_init(void)
{
- E_Comp_Screen *e_comp_screen;
- EINA_SAFETY_ON_NULL_GOTO(e_comp_wl, err);
+ E_Comp_Screen *comp_screen;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- e_comp_screen = e_comp_screen_get();
- if (!e_comp || e_comp_screen->num_outputs < 1)
+ EINA_SAFETY_ON_NULL_GOTO(comp_wl, err);
+
+ comp_screen = e_comp_screen_get();
+ if (!comp_screen || comp_screen->num_outputs < 1)
return EINA_FALSE;
g_eom = E_NEW(E_Eom, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(g_eom, EINA_FALSE);
- g_eom->global = wl_global_create(e_comp_wl->wl.disp, &wl_eom_interface, 1, g_eom, _e_eom_cb_wl_bind);
+ g_eom->global = wl_global_create(comp_wl->wl.disp, &wl_eom_interface, 1, g_eom, _e_eom_cb_wl_bind);
EINA_SAFETY_ON_NULL_GOTO(g_eom->global, err);
if (!_e_eom_output_init())
E_Output *output;
Eina_Bool ret = EINA_FALSE;
Eina_List *l;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_get(), EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen_get(), EINA_FALSE);
if (_explicit_sync) return EINA_TRUE;
explicit_sync = E_NEW(E_Explicit_Sync, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(explicit_sync, EINA_FALSE);
- explicit_sync->global = wl_global_create(e_comp_wl->wl.disp,
+ explicit_sync->global = wl_global_create(comp_wl->wl.disp,
&zwp_linux_explicit_synchronization_v1_interface,
2,
explicit_sync,
#include "e_foreign_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_comp_wl_subsurface_intern.h"
#include "e_pixmap_intern.h"
#include "e_view_intern.h"
* or internal client. */
if (fs->ec->ignored)
{
+ E_Comp *comp = e_comp_get();
+
EC_CHANGED(fs->ec);
fs->ec->new_client = 1;
- e_comp->new_clients++;
+ comp->new_clients++;
e_client_unignore(fs->ec);
}
#include "e_input_backend_intern.h"
#include "e_comp_wl_input_intern.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_client_intern.h"
#include "e_config_intern.h"
#include "e_comp_input_intern.h"
uint32_t serial, keycode;
struct wl_client *wc;
E_Comp_Config *comp_conf = NULL;
+ E_Comp_Wl_Data *comp_wl;
keycode = (ev->keycode - 8);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ serial = wl_display_next_serial(comp_wl->wl.disp);
comp_conf = e_comp_config_get();
Eina_Bool
e_keyrouter_wl_key_send(Ecore_Event_Key *ev, E_Device *dev, Eina_Bool pressed, struct wl_client *client, struct wl_resource *surface, Eina_Bool focused)
{
+ E_Comp *comp;
E_Client *ec = NULL;
struct wl_client *wc = NULL;
uint32_t keycode;
enum wl_keyboard_key_state state;
- if (ev->window != e_comp->ee_win)
+ if (ev->window != e_comp_ee_win_get())
{
return EINA_FALSE;
}
keycode = (ev->keycode - 8);
- if (!(e_comp_wl = e_comp->wl_comp_data))
- {
- return EINA_FALSE;
- }
+ if (!e_comp_wl_get()) return EINA_FALSE;
#ifndef E_RELEASE_BUILD
if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
return EINA_FALSE;
}
- if ((!e_client_action_get()) && (!e_comp->input_key_grabs))
+ comp = e_comp_get();
+ if ((!e_client_action_get()) && (comp && !comp->input_key_grabs))
{
ec = e_client_focused_get();
E_Comp_Screen *e_comp_screen = e_comp_screen_get();
int i = 0;
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_get(), NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen->bufmgr, NULL);
_e_policy_wl_e_client_is_valid(E_Client *ec)
{
E_Client *ec2;
- Eina_List *l;
+ Eina_List *l, *comp_ec_list;
Eina_Bool del = EINA_FALSE;
Eina_Bool found = EINA_FALSE;
- EINA_LIST_FOREACH(e_comp->clients, l, ec2)
+ comp_ec_list = e_comp_ec_list_get();
+ EINA_LIST_FOREACH(comp_ec_list, l, ec2)
{
if (ec2 == ec)
{
_e_policy_wl_e_clients_find_by_pid(pid_t pid)
{
E_Client *ec;
- Eina_List *clients = NULL, *l;
+ Eina_List *clients = NULL, *l, *comp_ec_list;
- EINA_LIST_FOREACH(e_comp->clients, l, ec)
+ comp_ec_list = e_comp_ec_list_get();
+ EINA_LIST_FOREACH(comp_ec_list, l, ec)
{
if (e_object_is_del(E_OBJECT(ec))) continue;
if (ec->netwm.pid != pid) continue;
}
else if (!e_util_strcmp("cbhm", role))
{
+ E_Comp_Wl_Data *comp_wl;
cdata = e_client_cdata_get(ec);
if (!cdata) return;
- e_comp_wl->selection.cbhm = cdata->surface;
+
+ comp_wl = e_comp_wl_get();
+ comp_wl->selection.cbhm = cdata->surface;
}
else if (!e_util_strcmp("wl_pointer-cursor", role))
{
_tzsh_srv_kvm_cb_perform_drop(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_cancel_drag(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_perform_drag_enter(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_perform_drag_leave(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_secondary_selection_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_secondary_selection_unset(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
_tzsh_srv_kvm_cb_perform_drop_target(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t drop_target)
{
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
E_Client *ec;
- if (!e_comp_wl->drag) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag) return;
tzsh_srv = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
Evas_Object *o;
int ex, ey, ew, eh;
- o = evas_object_top_get(e_comp->evas);
+ o = evas_object_top_get(e_comp_evas_get());
for (; o; o = evas_object_below_get(o))
{
ec = evas_object_data_get(o, "E_Client");
if (ec->visibility.skip) continue;
if ((e_client_visibility_get(ec) != E_VISIBILITY_UNOBSCURED) &&
(e_client_visibility_get(ec) != E_VISIBILITY_PARTIALLY_OBSCURED) &&
- (!eina_list_data_find(e_comp->launchscrns, ec)))
+ (!eina_list_data_find(e_comp_launchscrn_list_get(), ec)))
continue;
if (e_comp_wl_subsurface_check(ec)) continue;
ec->ignored = EINA_TRUE;
}
- e_comp->launchscrns = eina_list_remove(e_comp->launchscrns, ec);
+ e_comp_launchscrn_ec_remove(ec);
e_pixmap_win_id_del(tzlaunch_splash->ep);
e_object_del(E_OBJECT(ec));
}
}
- e_comp->launchscrns = eina_list_remove(e_comp->launchscrns, ec);
+ e_comp_launchscrn_ec_remove(ec);
}
if (obj)
}
else //Do original setup process
{
+ int comp_w = 0, comp_h = 0;
if (splash->type == LAUNCH_IMG_FILE_TYPE_IMAGE)
{
Evas_Load_Error err;
content_type = E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE;
- splash->obj = evas_object_image_add(e_comp->evas);
+ splash->obj = evas_object_image_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_RETURN_VAL(splash->obj, EINA_FALSE);
evas_object_image_file_set(splash->obj, splash->path, NULL);
return EINA_FALSE;
}
- evas_object_image_fill_set(splash->obj, 0, 0, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_object_image_fill_set(splash->obj, 0, 0, comp_w, comp_h);
evas_object_image_filled_set(splash->obj, EINA_TRUE);
}
else
{
content_type = E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE;
- splash->obj = edje_object_add(e_comp->evas);
+ splash->obj = edje_object_add(e_comp_evas_get());
EINA_SAFETY_ON_NULL_RETURN_VAL(splash->obj, EINA_FALSE);
if (!edje_object_file_set(splash->obj, splash->path, SPLASH_GROUP_NAME))
}
evas_object_move(splash->obj, 0, 0);
- evas_object_resize(splash->obj, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ evas_object_resize(splash->obj, comp_w, comp_h);
}
if (depth == 32) ec->argb = EINA_TRUE;
E_Client *pre_ec = NULL, *new_ec = NULL, *old_ec;
Eina_List *clients, *l;
int tw, th;
+ int comp_w = 0, comp_h = 0;
+ E_Comp *comp = e_comp_get();
tzlaunch_splash = wl_resource_get_user_data(res_tzlaunch_splash);
EINA_SAFETY_ON_NULL_RETURN(tzlaunch_splash);
EINA_SAFETY_ON_FALSE_RETURN(tzlaunch_splash->valid);
/* use ec was already created */
+ e_comp_size_get(&comp_w, &comp_h);
clients = _e_policy_wl_e_clients_find_by_pid(pid);
EINA_LIST_FOREACH(clients, l, pre_ec)
{
new_ec = pre_ec;
e_client_geometry_get(new_ec, NULL, NULL, &tw, &th);
if (tw <= 1 || th <= 1)
- e_view_client_size_set(e_client_view_get(new_ec), e_comp->w, e_comp->h);
+ e_view_client_size_set(e_client_view_get(new_ec), comp_w, comp_h);
break;
}
eina_list_free(clients);
e_client_unignore(new_ec);
new_ec->visible = EINA_TRUE;
if (new_ec->new_client)
- e_comp->new_clients--;
+ comp->new_clients--;
new_ec->new_client = EINA_FALSE;
new_ec->argb = old_ec->argb;
ELOGF("COMP", "Set argb:%d", new_ec, new_ec->argb);
new_ec->use_splash = EINA_TRUE;
e_client_icccm_title_set(new_ec, "launchscreen");
- e_comp->launchscrns = eina_list_append(e_comp->launchscrns, new_ec);
+ e_comp_launchscrn_ec_add(new_ec);
if (tzlaunch_splash->custom_effect_callee)
{
}
/* delete ec was created for launchscreen */
- e_comp->launchscrns = eina_list_remove(e_comp->launchscrns, old_ec);
+ e_comp_launchscrn_ec_remove(old_ec);
e_pixmap_win_id_del(tzlaunch_splash->ep);
e_object_del(E_OBJECT(old_ec));
old_ec->ignored = EINA_FALSE;
old_ec->visible = EINA_TRUE;
if (old_ec->new_client)
- e_comp->new_clients--;
+ comp->new_clients--;
old_ec->new_client = EINA_FALSE;
old_ec->icccm.accepts_focus = EINA_TRUE;
e_client_icccm_name_set(tzlaunch_splash->ec, "Launchscreen");
tzlaunch_splash->ec->ignored = EINA_TRUE;
- e_comp->launchscrns = eina_list_append(e_comp->launchscrns, tzlaunch_splash->ec);
+ e_comp_launchscrn_ec_add(tzlaunch_splash->ec);
return tzlaunch_splash;
error:
e_policy_wl_defer_job(void)
{
struct wl_global *global = NULL;
+ E_Comp_Wl_Data *comp_wl;
+
EINA_SAFETY_ON_NULL_GOTO(polwl, err);
+ comp_wl = e_comp_wl_get();
if (!e_config->global_object_not_provide.launch_effect)
{
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_launch_effect_interface,
1,
NULL,
polwl->globals = eina_list_append(polwl->globals, global);
}
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_launch_appinfo_interface,
2,
NULL,
e_policy_wl_init(void)
{
struct wl_global *global;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
polwl = E_NEW(E_Policy_Wl, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(polwl, EINA_FALSE);
/* create globals */
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_policy_interface,
13,
NULL,
EINA_SAFETY_ON_NULL_GOTO(global, err);
polwl->globals = eina_list_append(polwl->globals, global);
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_display_policy_interface,
1,
NULL,
EINA_SAFETY_ON_NULL_GOTO(global, err);
polwl->globals = eina_list_append(polwl->globals, global);
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_ws_shell_interface,
4,
NULL,
EINA_SAFETY_ON_NULL_GOTO(global, err);
polwl->globals = eina_list_append(polwl->globals, global);
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_indicator_interface,
1,
NULL,
EINA_SAFETY_ON_NULL_GOTO(global, err);
polwl->globals = eina_list_append(polwl->globals, global);
- global = wl_global_create(e_comp_wl->wl.disp,
+ global = wl_global_create(comp_wl->wl.disp,
&tizen_clipboard_interface,
2,
NULL,
#include "e_presentation_time_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_client_intern.h"
#include "e_comp_wl_intern.h"
#include "e_utils_intern.h"
e_presentation_time_init(void)
{
E_Presentation_Time *presentation;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
if (_presentation) return EINA_TRUE;
presentation = E_NEW(E_Presentation_Time, 1);
EINA_SAFETY_ON_NULL_GOTO(presentation, fail);
- presentation->global = wl_global_create(e_comp_wl->wl.disp,
+ presentation->global = wl_global_create(comp_wl->wl.disp,
&wp_presentation_interface,
1,
NULL,
static struct wl_resource *
_presentation_feedback_output_find(E_Presentation_Time_Feedback *feedback, const char *id)
{
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Output *wl_output;
struct wl_resource *wl_output_resource;
Eina_Bool found = EINA_FALSE;
struct wl_client *wl_client;
Eina_List *l;
- if (!e_comp_wl) return NULL;
+ if (!(comp_wl = e_comp_wl_get())) return NULL;
wl_client = wl_resource_get_client(feedback->resource);
if (!wl_client) return NULL;
- EINA_LIST_FOREACH(e_comp_wl->outputs, l, wl_output)
+ EINA_LIST_FOREACH(comp_wl->outputs, l, wl_output)
{
if(!e_util_strcmp(wl_output->id, id))
{
#include "e_screen_rotation_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_client_intern.h"
#include <libds-tizen/screen_rotation.h>
EINTERN Eina_Bool
e_screen_rotation_init()
{
+ E_Comp_Wl_Data *comp_wl;
+
if (g_screen_rotation)
return EINA_TRUE;
- g_screen_rotation = ds_tizen_screen_rotation_create(e_comp_wl->wl.disp);
+ comp_wl = e_comp_wl_get();
+ g_screen_rotation = ds_tizen_screen_rotation_create(comp_wl->wl.disp);
if (!g_screen_rotation)
{
ERR("Could not add tizen_screen_rotation to wayland globals");
EINTERN Eina_Bool
e_server_init(void)
{
+ E_Comp_Wl_Data *comp_wl;
if (g_server) return EINA_TRUE;
g_server = E_NEW(E_Server, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(g_server, EINA_FALSE);
- if (!e_comp_wl_init())
+ if (!(comp_wl = e_comp_wl_init()))
{
E_FREE(g_server);
return EINA_FALSE;
e_server_feature_register(E_SERVER_FEATURE_INPUT, &dummy_handle);
if (e_comp_wl_shell_init())
e_server_feature_register(E_SERVER_FEATURE_SHELL, &dummy_handle);
- if (e_wtz_shell_init())
+ if (e_wtz_shell_init(comp_wl->wl.disp))
e_server_feature_register(E_SERVER_FEATURE_WTZ_SHELL, &dummy_handle);
if (e_comp_wl_tbm_init())
e_server_feature_register(E_SERVER_FEATURE_WL_TBM, &dummy_handle);
e_server_feature_register(E_SERVER_FEATURE_TIZEN_BLENDER, &dummy_handle);
if (e_blur_manager_init())
e_server_feature_register(E_SERVER_FEATURE_TIZEN_BLUR_MANAGER, &dummy_handle);
- if (e_foreign_global_init(e_comp_wl->wl.disp))
+ if (e_foreign_global_init(comp_wl->wl.disp))
e_server_feature_register(E_SERVER_FEATURE_TIZEN_FOREIGN, &dummy_handle);
if (e_egl_sync_init())
e_server_feature_register(E_SERVER_FEATURE_EGL_SYNC, &dummy_handle);
if (e_explicit_sync_init())
e_server_feature_register(E_SERVER_FEATURE_EXPLICIT_SYNC, &dummy_handle);
- if (e_video_shell_create(e_comp_wl->wl.disp))
+ if (e_video_shell_create(comp_wl->wl.disp))
e_server_feature_register(E_SERVER_FEATURE_TIZEN_VIDEO_SHELL, &dummy_handle);
e_server_feature_register(E_SERVER_FEATURE_TIZEN_SRCREEN_MANAGER, e_tizen_screen_manager_init());
- if (e_linux_dmabuf_init(e_comp_wl->wl.disp))
+ if (e_linux_dmabuf_init(comp_wl->wl.disp))
e_server_feature_register(E_SERVER_FEATURE_LINUX_DMABUF, &dummy_handle);
if (e_screen_rotation_init())
e_server_feature_register(E_SERVER_FEATURE_TIZEN_SCREEN_ROTATION, &dummy_handle);
if (e_comp_wl_tizen_hwc_init())
e_server_feature_register(E_SERVER_FEATURE_TIZEN_HWC, &dummy_handle);
- e_server_feature_register(E_SERVER_FEATURE_TIZEN_SURFACE_SHM, e_tizen_surface_shm_init(e_comp_wl->wl.disp));
- e_server_feature_register(E_SERVER_FEATURE_TIZEN_DEVICEMGR, e_devicemgr_wl_init(e_comp_wl->wl.disp));
- e_server_feature_register(E_SERVER_FEATURE_TIZEN_KEYROUTER, e_keyrouter_wl_init(e_comp_wl->wl.disp));
+ e_server_feature_register(E_SERVER_FEATURE_TIZEN_SURFACE_SHM, e_tizen_surface_shm_init(comp_wl->wl.disp));
+ e_server_feature_register(E_SERVER_FEATURE_TIZEN_DEVICEMGR, e_devicemgr_wl_init(comp_wl->wl.disp));
+ e_server_feature_register(E_SERVER_FEATURE_TIZEN_KEYROUTER, e_keyrouter_wl_init(comp_wl->wl.disp));
return EINA_TRUE;
}
#include "e_tbm_gbm_server_intern.h"
#include "e_display_intern.h"
#include "e_comp_wl_tbm_intern.h"
+#include "e_comp_wl_intern.h"
#include <assert.h>
#include <stdbool.h>
static void
_e_comp_tbm_server_set(struct wayland_tbm_server *wl_tbm_server)
{
- e_comp->wl_comp_data->tbm.server = (void *)wl_tbm_server;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ comp_wl->tbm.server = (void *)wl_tbm_server;
}
static void
tizen_screen->zone_destroy.notify = _e_tizen_screen_cb_zone_destroy;
e_zone_destroy_listener_add(zone, &tizen_screen->zone_destroy);
- tizen_screen->tizen_screen = ds_tizen_screen_create(e_comp_wl->wl.disp);
+ tizen_screen->tizen_screen = ds_tizen_screen_create(e_comp_wl_display_get());
EINA_SAFETY_ON_NULL_RETURN_VAL(tizen_screen->tizen_screen, NULL);
tizen_screen->ds_screen_destroy.notify = _e_tizen_screen_cb_ds_screen_destroy;
g_tizen_surface_shm = E_NEW(E_Tizen_Surface_Shm, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(g_tizen_surface_shm, NULL);
- g_tizen_surface_shm->global = wl_global_create(e_comp_wl->wl.disp, &tizen_surface_shm_interface,
+ g_tizen_surface_shm->global = wl_global_create(display, &tizen_surface_shm_interface,
2, g_tizen_surface_shm, _e_tizen_surface_shm_cb_bind);
if (!g_tizen_surface_shm->global)
{
#include "e_log.h"
#include "e_comp_wl.h"
#include "e_comp_wl_intern.h"
+#include "e_comp_intern.h"
#include "e_client_intern.h"
#include "e_compositor_intern.h"
#include "e_comp_wl_shell_intern.h"
static void
_source_map(E_Video_Viewport_Source *source)
{
+ E_Comp *comp = e_comp_get();
E_Client *ec = e_surface_ec_get(source->surface->surface);
if (e_surface_is_mapped(source->surface->surface))
{
EC_CHANGED(ec);
ec->new_client = 1;
- e_comp->new_clients++;
+ comp->new_clients++;
e_client_unignore(ec);
}
#include "e_wtz_shell_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_client_intern.h"
#include "e_zone_intern.h"
#include "e_comp_wl_intern.h"
/* End of Wtz_shell */
EINTERN Eina_Bool
-e_wtz_shell_init(void)
+e_wtz_shell_init(struct wl_display *display)
{
- global_resource = wl_global_create(e_comp_wl->wl.disp, &wtz_shell_interface,
- 1, e_comp->wl_comp_data, _e_wtz_shell_cb_bind);
+ global_resource = wl_global_create(display, &wtz_shell_interface,
+ 1, e_comp_wl_get(), _e_wtz_shell_cb_bind);
EINA_SAFETY_ON_NULL_RETURN_VAL(global_resource, EINA_FALSE);
return EINA_TRUE;
#include "e_intern.h"
-EINTERN Eina_Bool e_wtz_shell_init(void);
+EINTERN Eina_Bool e_wtz_shell_init(struct wl_display *display);
EINTERN void e_wtz_shell_shutdown(void);
#endif
static E_Xdg_Toplevel_V6 *_e_xdg_toplevel_v6_from_shell_surface_resource(struct wl_resource *shsurface_resource);
EINTERN Eina_Bool
-e_xdg_shell_v6_init(void)
+e_xdg_shell_v6_init(struct wl_display *display)
{
static E_Xdg_Shell_V6 shell = { .ds_xdg_shell = NULL };
}
- shell.ds_xdg_shell = ds_xdg_shell_v6_create(e_comp_wl->wl.disp);
+ shell.ds_xdg_shell = ds_xdg_shell_v6_create(display);
if (!shell.ds_xdg_shell)
{
ERR("Could not create ds_xdg_shell_v6", NULL);
#include "e_intern.h"
-EINTERN Eina_Bool e_xdg_shell_v6_init(void);
+EINTERN Eina_Bool e_xdg_shell_v6_init(struct wl_display *display);
EINTERN E_Client *e_xdg_shell_v6_xdg_surface_ec_get(struct wl_resource *resource);
#endif
_e_drag_finalize(E_Drag *drag, int x, int y)
{
E_View_Rect *rect;
+ E_Pointer* comp_pointer;
const int color[4] = {0, 0, 0, 0};
if (_drag_win) return 0;
- _drag_win = e_comp->ee_win;
+ _drag_win = e_comp_ee_win_get();
if (!e_comp_grab_input(1, 1))
{
_drag_win = 0;
e_drag_view_set(drag, e_view_rect_view_get(rect));
}
- drag->angle = e_comp->pointer->rotation;
+ comp_pointer = e_comp_pointer_get();
+ drag->angle = comp_pointer->rotation;
e_drag_move(drag, x, y);
e_drag_resize(drag, drag->w, drag->h);
drag->visible = 1;
{
if (!_event_handlers)
{
-
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
E_LIST_HANDLER_PREPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL);
}
int angle, drag_client_w, drag_client_h;
E_Map *map = NULL, *new_map = NULL;
Eina_Bool need_map_enable;
+ E_Comp_Wl_Data *comp_wl;
E_View *view;
angle = drag->angle;
else if (angle == 270)
angle = 90;
- view = e_view_client_view_get(e_client_view_get(e_comp_wl->drag_client));
+ comp_wl = e_comp_wl_get();
+ view = e_view_client_view_get(e_client_view_get(comp_wl->drag_client));
need_map_enable = e_view_map_enable_get(view) || (angle != 0);
if (!need_map_enable) return;
- map = e_client_map_get(e_comp_wl->drag_client);
+ map = e_client_map_get(comp_wl->drag_client);
if (map)
new_map = e_map_dup(map);
new_map = e_map_new();
if (!new_map) goto fin;
- e_client_geometry_get(e_comp_wl->drag_client, NULL, NULL, &drag_client_w, &drag_client_h);
+ e_client_geometry_get(comp_wl->drag_client, NULL, NULL, &drag_client_w, &drag_client_h);
e_map_util_points_populate_from_geometry(new_map, drag->x, drag->y, drag_client_w, drag_client_h, 0);
e_map_util_rotate(new_map, angle, drag->x, drag->y);
e_map_util_object_move_sync_set(new_map, EINA_TRUE);
{
int x, y;
Ecore_Event_Mouse_Move *ev = event;
+ E_Comp_Wl_Data *comp_wl;
- if (e_comp_wl->selection.target &&
- e_comp_wl->drag)
+ comp_wl = e_comp_wl_get();
+ if (comp_wl->selection.target && comp_wl->drag)
{
struct wl_resource *res;
E_Client *ec = NULL;
- E_Client *legacy_target = e_comp_wl->selection.target;
+ E_Client *legacy_target = comp_wl->selection.target;
int device_id = e_comp_wl_data_current_device_id_get();
x = ev->x;
res = e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
EINA_SAFETY_ON_NULL_RETURN_VAL(res, ECORE_CALLBACK_RENEW);
- if ((e_comp_wl->drag_offer != wl_resource_get_user_data(res)) &&
+ if ((comp_wl->drag_offer != wl_resource_get_user_data(res)) &&
(ec != legacy_target))
{
e_comp_wl_data_device_send_leave(legacy_target);
e_comp_wl_data_device_send_enter(ec);
}
- if (e_comp_wl->drag)
- e_drag_move(e_comp_wl->drag, x, y);
+ if (comp_wl->drag)
+ e_drag_move(comp_wl->drag, x, y);
e_comp_wl_data_device_send_motion(ec, x, y, ev->timestamp);
}
_e_dnd_cb_zone_display_rotation_change_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
if (!_drag_current) return ECORE_CALLBACK_PASS_ON;
- if (!e_comp_wl->drag_source) return ECORE_CALLBACK_PASS_ON;
- source = e_comp_wl->drag_source;
+ comp_wl = e_comp_wl_get();
+ if (!(comp_wl->drag_source)) return ECORE_CALLBACK_PASS_ON;
+
+ source = comp_wl->drag_source;
source->accepted = EINA_FALSE;
_e_drag_end(_drag_current, E_DND_DRAG_TYPE_DROPPED);
- E_FREE(e_comp_wl->drag);
+ E_FREE(comp_wl->drag);
return ECORE_CALLBACK_PASS_ON;
}
E_Zone *zone;
E_Desk *desk;
E_Client *ec;
+ E_Comp *comp;
const Eina_List *l;
+ comp = e_comp_get();
+
history_policy = wl_container_of(listener, history_policy, zone_focus_reset);
E_FOCUS_HISTORY_TRACE(history_policy, NULL);
if (!desk) continue;
if (desk->visible && (!ec->iconic))
{
- if (e_comp->input_key_grabs || e_comp->input_mouse_grabs)
+ if (comp->input_key_grabs || comp->input_mouse_grabs)
{
break;
}
#include "e_hints_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_scale_intern.h"
#include "e_utils_intern.h"
#include "e_comp_wl_intern.h"
{
Eina_List *l;
E_Comp_Wl_Output *output;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
+ EINA_LIST_FOREACH(comp_wl->outputs, l, output)
output->scale = e_scale;
}
zone = e_zone_current_get();
EINA_SAFETY_ON_NULL_RETURN_VAL(zone, EINA_FALSE);
- _e_magnifier_mgr = evas_object_smart_add(e_comp->evas, _e_magnifier_smart_class_new());
+ _e_magnifier_mgr = evas_object_smart_add(e_comp_evas_get(), _e_magnifier_smart_class_new());
E_MAGNIFIER_SMART_DATA_GET_OR_RETURN(_e_magnifier_mgr, sd) EINA_FALSE;
ELOGF("MAGNIFIER", "INIT Magnifier (%p)", NULL, _e_magnifier_mgr);
return EINA_FALSE;
}
- ec->magnifier_proxy = evas_object_image_filled_add(e_comp->evas);
+ ec->magnifier_proxy = evas_object_image_filled_add(e_comp_evas_get());
if (!ec->magnifier_proxy)
{
ELOGF("MAGNIFIER", "CAN NOT make PROXY object..", ec);
#include "e_pointer_intern.h"
#include "e_input_device_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_client_intern.h"
#include "e_comp_canvas.h"
#include "e_comp_wl_intern.h"
/* hide cursor object */
if (e_view_client_visible_get(view_client))
{
+ int comp_w = 0, comp_h = 0;
res = EINA_TRUE;
e_view_client_hide(view_client);
- e_canvas_damage_rectangle_add(e_comp_canvas_get(), 0, 0, e_comp->w, e_comp->h);
+ e_comp_size_get(&comp_w, &comp_h);
+ e_canvas_damage_rectangle_add(e_comp_canvas_get(), 0, 0, comp_w, comp_h);
}
_e_pointer_view_set(ptr, NULL);
e_pointer_view_set(E_Pointer *ptr, E_View_Client *view_client, int x, int y)
{
Eina_Bool need_call_hide = EINA_FALSE;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
EINA_SAFETY_ON_NULL_RETURN(ptr);
/* don't show cursor if in hidden mode */
- if ((!e_config->show_cursor) || (!e_comp_wl->ptr.enabled))
+ if ((!e_config->show_cursor) || (!comp_wl->ptr.enabled))
{
if (ptr->view_client && _e_pointer_view_hide(ptr, ptr->view_client))
_e_pointer_hook_call(E_POINTER_HOOK_HIDE, ptr);
#else
E_Zone *zone;
E_Config_Policy_Desk *d;
- const Eina_List *l;
+ const Eina_List *l, *comp_zone_list;
int i, n;
#endif
pol = E_NEW(E_Policy, 1);
#ifdef CONTAINER_POLICY
#else
- EINA_LIST_FOREACH(e_comp->zones, l, zone)
+ comp_zone_list = e_comp_zone_list_get();
+ EINA_LIST_FOREACH(comp_zone_list, l, zone)
{
n = zone->desk_y_count * zone->desk_x_count;
for (i = 0; i < n; i++)
else
{
uint32_t serial;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
tizen_policy_send_conformant_region
(cres->res,
if (!g_conf->part[type].state.visible)
return EINA_TRUE;
- pre_serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ pre_serial = wl_display_next_serial(e_comp_wl_display_get());
DBG("PART %s win(%zx) ec(%p) Intercept Hide", _conf_type_to_str(type), e_client_util_win_get(g_conf->part[type].ec), g_conf->part[type].ec);
_conf_state_update(type,
{
E_Policy_Cbhm *cbhm;
E_Comp_Wl_Client_Data *cdata;
+ E_Comp_Wl_Data *comp_wl;
E_View_Client *view_client;
if (EINA_UNLIKELY(!ec))
ec->exp_iconify.skip_iconify = 1;
cdata = e_client_cdata_get(ec);
- e_comp_wl->selection.cbhm = cdata->surface;
+ comp_wl = e_comp_wl_get();
+ comp_wl->selection.cbhm = cdata->surface;
e_client_window_role_set(ec, "cbhm");
e_policy_conformant_part_add(ec);
_kvm_hook_drag_start(void *d EINA_UNUSED, E_Drag *drag)
{
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
E_Service_Kvm *esk;
Eina_Iterator *it;
struct wl_client *source_client, *kvm_client;
if (!drag) return;
if (!_kvm_service_hash) return;
+ comp_wl = e_comp_wl_get();
it = eina_hash_iterator_data_new(_kvm_service_hash);
EINA_ITERATOR_FOREACH(it, esk)
// Workaround: Feed mouse out/in to make sure that the mouse in to correct client.
// The event mouse in/out is not emit during dragging(mouse move with mouse button pressed).
// It makes the pointer still locked after mouse out from kvm window When the drag started.
- source = e_comp_wl->drag_source;
+ source = comp_wl->drag_source;
source_client = wl_resource_get_client(source->resource);
kvm_client = wl_resource_get_client(esk->srv_kvm_res);
if (source_client == kvm_client)
e_service_kvm_drop_perform(E_Service_Kvm *esk, E_Service_Kvm_Drop_Target drop_target)
{
E_Client *ec, *legacy_target_ec;
+ E_Comp_Wl_Data *comp_wl;
EINA_SAFETY_ON_NULL_RETURN_VAL(esk, EINA_FALSE);
esk->perform_requested = EINA_TRUE;
+ comp_wl = e_comp_wl_get();
if (drop_target == E_SERVICE_KVM_DROP_TARGET_KVM_SERVICE)
{
- legacy_target_ec = e_comp_wl->selection.target;
+ legacy_target_ec = comp_wl->selection.target;
if (legacy_target_ec != ec)
{
e_comp_wl_data_device_send_leave(legacy_target_ec);
e_comp_wl_data_device_send_enter(ec);
- e_comp_wl_data_offer_mimetype_action_accept(e_comp_wl->drag_offer);
+ e_comp_wl_data_offer_mimetype_action_accept(comp_wl->drag_offer);
}
}
- e_drag_end(e_comp_wl->drag, E_DND_DRAG_TYPE_DROPPED);
+ e_drag_end(comp_wl->drag, E_DND_DRAG_TYPE_DROPPED);
return EINA_TRUE;
}
EINTERN Eina_Bool
e_service_kvm_drag_cancel(E_Service_Kvm *esk)
{
+ E_Comp_Wl_Data *comp_wl;
+
EINA_SAFETY_ON_NULL_RETURN_VAL(esk, EINA_FALSE);
ELOGF("KVM", "Cancel drag by kvm_service request! service:%p", esk->ec, esk);
- e_drag_end(e_comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED_BY_KVM);
+ comp_wl = e_comp_wl_get();
+ e_drag_end(comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED_BY_KVM);
return EINA_TRUE;
}
e_service_kvm_send_source_mimetypes(E_Service_Kvm *esk)
{
E_Comp_Wl_Data_Source *source;
+ E_Comp_Wl_Data *comp_wl;
Eina_Iterator *it;
char *mimetype;
EINA_SAFETY_ON_NULL_RETURN_VAL(esk, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(esk->ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(esk->srv_kvm_res, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->drag_source, EINA_FALSE);
+
+ comp_wl = e_comp_wl_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->drag_source, EINA_FALSE);
ELOGF("KVM", "Source mimes send!", esk->ec);
- source = (E_Comp_Wl_Data_Source *) e_comp_wl->drag_source;
+ source = (E_Comp_Wl_Data_Source *) comp_wl->drag_source;
tws_service_kvm_send_source_mimes(esk->srv_kvm_res, NULL);
it = eina_array_iterator_new(source->mime_types);
static void
_e_service_kvm_send_client_enter(E_Client *ec)
{
+ E_Comp_Wl_Data *comp_wl;
struct wl_resource *data_device_res, *offer_res;
struct wl_resource *surface;
uint32_t serial;
int x, y;
- if (!e_comp_wl->drag_source) return;
- if (e_comp_wl->selection.target == ec) return;
+ comp_wl = e_comp_wl_get();
+ if (!comp_wl->drag_source) return;
+ if (comp_wl->selection.target == ec) return;
surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
offer_res = e_comp_wl_data_device_send_offer(ec);
if (!offer_res) return;
- x = wl_fixed_to_int(e_comp_wl->ptr.x) - ec->client.x;
- y = wl_fixed_to_int(e_comp_wl->ptr.y) - ec->client.y;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ x = wl_fixed_to_int(comp_wl->ptr.x) - ec->client.x;
+ y = wl_fixed_to_int(comp_wl->ptr.y) - ec->client.y;
+ serial = wl_display_next_serial(comp_wl->wl.disp);
wl_data_device_send_enter(data_device_res, serial, surface,
wl_fixed_from_int(x), wl_fixed_from_int(y), offer_res);
}
#include "e_comp_wl_intern.h"
#include "e_comp_wl_rsm_intern.h"
#include "e_comp_wl_tbm_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_devicemgr_intern.h"
#include "e_policy_intern.h"
#include "e_policy_wl_intern.h"
_launcher_clients_find_by_pid(pid_t pid)
{
E_Client *ec;
- Eina_List *clients = NULL, *l;
+ Eina_List *clients = NULL, *l, *comp_ec_list;
- EINA_LIST_FOREACH(e_comp->clients, l, ec)
+ comp_ec_list = e_comp_ec_list_get();
+ EINA_LIST_FOREACH(comp_ec_list, l, ec)
{
if (e_object_is_del(E_OBJECT(ec))) continue;
if (ec->netwm.pid != pid) continue;
_launcher_target_ec_set(lc, target_ec);
lc->direction = TWS_SERVICE_LAUNCHER_DIRECTION_BACKWARD;
- lc->serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ lc->serial = wl_display_next_serial(e_comp_wl_display_get());
sent = e_tzsh_shared_widget_launch_prepare_send(target_ec,
TWS_SHARED_WIDGET_LAUNCH_PREPARE_STATE_WIDGET_HIDE,
_launcher_launched_ec_set(lc, NULL);
_launcher_target_ec_set(lc, target_ec);
- lc->serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ lc->serial = wl_display_next_serial(e_comp_wl_display_get());
lc->direction = TWS_SERVICE_LAUNCHER_DIRECTION_BACKWARD;
e_client_pos_get(target_ec, &x, &y);
{
struct wayland_tbm_client_queue *cqueue;
- if (!e_comp_wl) return;
+ if (!e_comp_wl_get()) return;
if (!lc) return;
if (!lc->target.ec) return;
if (e_object_is_del(E_OBJECT(lc->target.ec))) return;
if (e_config->qp_use_bg_rect)
{
Evas_Object *o;
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(e_comp_evas_get());
qp->bg_rect = o;
evas_object_layer_set(o, E_POLICY_QUICKPANEL_LAYER);
if (!region)
return NULL;
- o = evas_object_rectangle_add(e_comp->evas);
+ o = evas_object_rectangle_add(e_comp_evas_get());
evas_object_color_set(o, 0, 0, 0, 0);
evas_object_repeat_events_set(o, EINA_TRUE);
region->obj = o;
#include "e_comp_wl_intern.h"
#include "e_view_intern.h"
#include "e_view_client_intern.h"
+#include "e_comp_wl_intern.h"
#include <wayland-server.h>
#include <tzsh_server.h>
uint32_t serial;
E_Comp_Wl_Client_Data *volume_cdata = e_client_cdata_get(_volume_ec);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
wl_touch_send_down(_volume_wl_touch, serial, e->timestamp,
volume_cdata->surface, 0,
wl_fixed_from_int(e->canvas.x - _volume_ec->client.x),
Evas_Event_Mouse_Up *e = event;
uint32_t serial;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
wl_touch_send_up(_volume_wl_touch, serial, e->timestamp, 0);
}
uint32_t serial;
E_Comp_Wl_Client_Data *volume_cdata = e_client_cdata_get(_volume_ec);
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
wl_touch_send_down(_volume_wl_touch, serial, e->timestamp,
volume_cdata->surface, e->device,
wl_fixed_from_int(e->canvas.x - _volume_ec->client.x),
Evas_Event_Multi_Up *e = event;
uint32_t serial;
- serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl_display_get());
wl_touch_send_up(_volume_wl_touch, serial, e->timestamp, e->device);
}
Eina_List *l;
struct wl_client *wc;
struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl;
E_Comp_Wl_Client_Data *volume_cdata = e_client_cdata_get(_volume_ec);
if (_volume_wl_touch) goto end;
wc = wl_resource_get_client(volume_cdata->surface);
- EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
+ comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
static E_Bq_Mgr *
_e_bq_mgr_new(char *sock_name)
{
- E_Comp *comp;
E_Bq_Mgr *bq_mgr;
int fd;
static char *default_sock_name = "e_bq_mgr_daemon";
if (!bq_mgr)
return NULL;
- /* try to get the current compositor */
- if (!(comp = e_comp))
+ /* check the current compositor is exist or not*/
+ if (!(e_comp_screen_get()))
{
free(bq_mgr);
return NULL;
else
{
/* try to get the compositor data */
- bq_mgr->wdpy = e_comp_wl->wl.disp;
+ bq_mgr->wdpy = e_comp_wl_display_get();
bq_mgr->loop = wl_display_get_event_loop(bq_mgr->wdpy);
bq_mgr->self_dpy = 0;
}